Topologic  0.8.9
Face.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 <Topology.h>
20 
21 #include <TopologicCore/include/Face.h>
22 
23 #ifndef TOPOLOGIC_DYNAMO
24 #include <Geom_BSplineSurface.hxx>
25 #include <Geom_Plane.hxx>
26 #endif
27 
28 namespace Topologic {
29  ref class Vertex;
30  ref class Edge;
31  ref class Wire;
32  ref class Shell;
33  ref class Cell;
34 
35 #ifndef TOPOLOGIC_DYNAMO
36  ref class NurbsSurface;
37  ref class PlanarSurface;
38 #endif
39 
43  public ref class Face : Topology
44  {
45  public:
50  property List<Face^>^ AdjacentFaces
51  {
52  List<Face^>^ get();
53  }
54 
59  property List<Cell^>^ Cells
60  {
61  List<Cell^>^ get();
62  }
63 
68  property List<Shell^>^ Shells
69  {
70  List<Shell^>^ get();
71  }
72 
77  property List<Vertex^>^ Vertices
78  {
79  List<Vertex^>^ get();
80  }
81 
86  property List<Edge^>^ Edges
87  {
88  List<Edge^>^ get();
89  }
90 
95  property List<Wire^>^ Wires
96  {
97  List<Wire^>^ get();
98  }
99 
106  static Face^ ByWire(Wire^ wire);
107 
114  static Face^ ByExternalInternalBoundaries(Wire^ externalBoundary, System::Collections::Generic::IEnumerable<Wire^>^ internalBoundaries);
115 
116 #ifdef TOPOLOGIC_DYNAMO
117  [IsVisibleInDynamoLibrary(false)]
118 #endif
119  static Face^ ByNurbsParameters(List<List<Vertex^>^>^ controlPoints, List<List<double>^>^ weights, List<double>^ uKnots, List<double>^ vKnots, bool isRational, bool isUPeriodic, bool isVPeriodic, int uDegree, int vDegree);
120 
127  static Face^ ByEdges(System::Collections::Generic::IEnumerable<Edge^>^ edges);
128 
134  List<Edge^>^ SharedEdges(Face^ face);
135 
141  List<Vertex^>^ SharedVertices(Face^ face);
142 
148  {
149  Wire^ get();
150  }
151 
156  property List<Wire^>^ InternalBoundaries
157  {
158  List<Wire^>^ get();
159  }
160 
166  Face^ AddInternalBoundaries(List<Wire^>^ internalBoundaries);
167 
174  Face^ AddApertureDesign(Face^ apertureDesign, int numEdgeSamples);
175 
180  property Object^ BasicGeometry
181  {
182  virtual Object^ get() override;
183  }
184 
189  static int Type();
190 
191  public protected:
192  Face();
193 
198  Face(const std::shared_ptr<TopologicCore::Face>& kpCoreFace);
199 
204  virtual std::shared_ptr<TopologicCore::TopologicalQuery> GetCoreTopologicalQuery() override;
205 
206 #ifdef TOPOLOGIC_DYNAMO
207  Autodesk::DesignScript::Geometry::Surface^ Surface();
212 
217  Autodesk::DesignScript::Geometry::Mesh^ TriangulatedMesh();
218 
224  static Face^ BySurface(Autodesk::DesignScript::Geometry::Surface^ surface);
225 
231  static Face^ BySurface(Autodesk::DesignScript::Geometry::NurbsSurface^ pDynamoNurbsSurface,
232  array<Autodesk::DesignScript::Geometry::Curve^>^ pDynamoPerimeterCurves);
233 #else
234  Object^ Surface();
239 
244  NurbsSurface^ Surface(Handle(Geom_BSplineSurface) pOcctBSplineSurface);
245 
251  PlanarSurface^ Surface(Handle(Geom_Plane) pOcctPlane);
252 #endif
253 
254  protected:
255  virtual ~Face();
256 
260  std::shared_ptr<TopologicCore::Face>* m_pCoreFace;
261  };
262 }
Definition: PlanarSurface.h:33
static Face ^ ByExternalInternalBoundaries(Wire^ externalBoundary, System::Collections::Generic::IEnumerable< Wire^>^ internalBoundaries)
Creates a Face by an external boundary (Wire) and internal boundaries (Wires).
Definition: Face.cpp:127
List< Edge^>^ Edges
Returns the Edges constituent to the Face.
Definition: Face.h:86
A Topology is an abstract superclass that includes constructors, properties and methods used by other...
Definition: Topology.h:53
Definition: NurbsSurface.h:33
List< Cell^>^ Cells
Returns the Cells incident to the Face.
Definition: Face.h:59
Object ^ Surface()
Definition: Face.cpp:1134
A Face is a two-dimensional region defined by a collection of closed Wires. The geometry of a face ca...
Definition: Face.h:43
std::shared_ptr< TopologicCore::Face > * m_pCoreFace
Definition: Face.h:260
List< Vertex^>^ Vertices
Returns the Vertices constituent to the Face.
Definition: Face.h:77
static Face ^ ByEdges(System::Collections::Generic::IEnumerable< Edge^>^ edges)
Creates a Face by a list of Edges.
Definition: Face.cpp:271
Face ^ AddApertureDesign(Face^ apertureDesign, int numEdgeSamples)
Adds an Aperture design to a Face.
Definition: Face.cpp:1403
Face ^ AddInternalBoundaries(List< Wire^>^ internalBoundaries)
Adds internal boundaries (Wires) to a Face.
Definition: Face.cpp:1282
List< Wire^>^ Wires
Returns the Wires constituent to the Face.
Definition: Face.h:95
List< Shell^>^ Shells
Returns the Shells incident to the Face.
Definition: Face.h:68
List< Edge^> ^ SharedEdges(Face^ face)
Returns the shared Edges between two Faces.
Definition: Face.cpp:1216
Wire^ ExternalBoundary
Returns the external boundary (Wire) of the Face.
Definition: Face.h:147
virtual std::shared_ptr< TopologicCore::TopologicalQuery > GetCoreTopologicalQuery() override
Definition: Face.cpp:1368
List< Wire^>^ InternalBoundaries
Returns the internal boundaries (Wires) of the Face.
Definition: Face.h:156
static int Type()
Returns the type associated to Face.
Definition: Face.cpp:1379
List< Face^>^ AdjacentFaces
Returns the Faces adjacent to the Face.
Definition: Face.h:50
Object^ BasicGeometry
Creates a geometry from Face.
Definition: Face.h:180
Topologic is an open-source software modelling library enabling hierarchical and topological represen...
Definition: About.h:23
List< Vertex^> ^ SharedVertices(Face^ face)
Returns the shared Vertices between two Faces.
Definition: Face.cpp:1237
static Face ^ ByWire(Wire^ wire)
Creates a Face by a closed planar Wire.
Definition: Face.cpp:119
A Wire is a contiguous collection of Edges, where adjacent Edges are connected by shared Vertices...
Definition: Wire.h:32