Topologic  0.8.9
Cell.h
1 // This file is part of Topologic software library.
2 // Copyright(C) 2019, Cardiff University and University College London
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
13 //
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <https://www.gnu.org/licenses/>.
16 
17 #pragma once
18 
19 #include <TopologicCore/include/Cell.h>
20 
21 #include "Topology.h"
22 
23 namespace Topologic
24 {
25  ref class Vertex;
26  ref class Edge;
27  ref class Wire;
28  ref class Face;
29  ref class Shell;
30  ref class CellComplex;
31 
35  public ref class Cell : Topology
36  {
37  public:
44 #ifdef TOPOLOGIC_DYNAMO
45  static Cell^ ByFaces(System::Collections::Generic::IEnumerable<Face^>^ faces, [DefaultArgument("0.0001")] double tolerance);
46 #else
47  static Cell^ ByFaces(System::Collections::Generic::IEnumerable<Face^>^ faces, double tolerance);
48 #endif
49 
55  static Cell^ ByShell(Shell^ shell);
56 
61  property List<CellComplex^>^ CellComplexes
62  {
63  List<CellComplex^>^ get();
64  }
65 
70  property List<Shell^>^ Shells
71  {
72  List<Shell^>^ get();
73  }
74 
79  property List<Face^>^ Faces
80  {
81  List<Face^>^ get();
82  }
83 
88  property List<Wire^>^ Wires
89  {
90  List<Wire^>^ get();
91  }
92 
97  property List<Edge^>^ Edges
98  {
99  List<Edge^>^ get();
100  }
101 
106  property List<Vertex^>^ Vertices
107  {
108  List<Vertex^>^ get();
109  }
110 
116  property List<Cell^>^ AdjacentCells
117  {
118  List<Cell^>^ get();
119  }
120 
126  List<Face^>^ SharedFaces(Cell^ cell);
127 
133  List<Edge^>^ SharedEdges(Cell^ cell);
134 
140  List<Vertex^>^ SharedVertices(Cell^ cell);
141 
147  {
148  Shell^ get();
149  }
150 
155  property List<Shell^>^ InternalBoundaries
156  {
157  List<Shell^>^ get();
158  }
159 
164  property Object^ BasicGeometry
165  {
166  virtual Object^ get() override;
167  }
168 
173  static int Type();
174 
175  public protected:
176  Cell();
181  Cell(const std::shared_ptr<TopologicCore::Cell>& kpCoreCell);
182 
183 #ifdef TOPOLOGIC_DYNAMO
184  static Cell^ BySolid(Autodesk::DesignScript::Geometry::Solid^ solid, [DefaultArgument("0.0001")] double tolerance);
191 
197  static Cell^ BySphere(Autodesk::DesignScript::Geometry::Sphere^ sphere);
198 
204  static Cell^ ByCylinder(Autodesk::DesignScript::Geometry::Cylinder^ cylinder);
205 
211  static Cell^ ByCone(Autodesk::DesignScript::Geometry::Cone^ cone);
212 
218  static Cell^ ByCuboid(Autodesk::DesignScript::Geometry::Cuboid^ cuboid);
219 #endif
220 
225  virtual std::shared_ptr<TopologicCore::TopologicalQuery> GetCoreTopologicalQuery() override;
226 
227  protected:
228  virtual ~Cell();
229 
233  std::shared_ptr<TopologicCore::Cell>* m_pCoreCell;
234  };
235 }
List< Face^>^ Faces
Returns the Faces constituent to the Cell.
Definition: Cell.h:79
A Topology is an abstract superclass that includes constructors, properties and methods used by other...
Definition: Topology.h:53
List< Vertex^>^ Vertices
Returns the Vertices constituent to the Cell.
Definition: Cell.h:106
A Shell is a contiguous collection of Faces, where adjacent Faces are connected by shared Edges...
Definition: Shell.h:35
List< Vertex^> ^ SharedVertices(Cell^ cell)
Returns the shared Vertices between two Cells.
Definition: Cell.cpp:243
Object^ BasicGeometry
Creates a geometry from Cell.
Definition: Cell.h:164
static Cell ^ ByFaces(System::Collections::Generic::IEnumerable< Face^>^ faces, double tolerance)
Creates a Cell by a set of Faces.
Definition: Cell.cpp:34
List< Shell^>^ InternalBoundaries
Returns the internal boundaries (Shells) of the Cell.
Definition: Cell.h:155
List< Edge^> ^ SharedEdges(Cell^ cell)
Returns the shared Edges between two Cells.
Definition: Cell.cpp:223
List< Edge^>^ Edges
Returns the Edges constituent to the Cell.
Definition: Cell.h:97
List< Face^> ^ SharedFaces(Cell^ cell)
Returns the shared Faces between two Cells.
Definition: Cell.cpp:203
Shell^ ExternalBoundary
Returns the external boundary (Shell) of the Cell.
Definition: Cell.h:146
static int Type()
Returns the type associated to Cell.
Definition: Cell.cpp:508
List< CellComplex^>^ CellComplexes
Returns the CellComplexes which contain the Cell.
Definition: Cell.h:61
Topologic is an open-source software modelling library enabling hierarchical and topological represen...
Definition: About.h:23
List< Wire^>^ Wires
Returns the Wires constituent to the Cell.
Definition: Cell.h:88
List< Cell^>^ AdjacentCells
Returns the Cells adjacent to the Cell.
Definition: Cell.h:116
List< Shell^>^ Shells
Returns the Shells constituent to the Cell.
Definition: Cell.h:70
A Cell is a three-dimensional region defined by a collection of closed Shells. It may be manifold or ...
Definition: Cell.h:35
virtual std::shared_ptr< TopologicCore::TopologicalQuery > GetCoreTopologicalQuery() override
Definition: Cell.cpp:497
static Cell ^ ByShell(Shell^ shell)
Creates a Cell from a Shell. The Shell must be closed, otherwise an exception is thrown.
Definition: Cell.cpp:54
std::shared_ptr< TopologicCore::Cell > * m_pCoreCell
Definition: Cell.h:233