Topologic  0.8.9
Wire.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/Wire.h>
22 
23 namespace Topologic {
24  ref class Vertex;
25  ref class Edge;
26  ref class Face;
27 
31 
32  public ref class Wire : Topology
33  {
34  public:
41  static Wire^ ByEdges(System::Collections::Generic::IEnumerable<Edge^>^ edges);
42 
47  property List<Edge^>^ Edges
48  {
49  List<Edge^>^ get();
50  }
51 
56  property List<Face^>^ Faces
57  {
58  List<Face^>^ get();
59  }
60 
65  property List<Vertex^>^ Vertices
66  {
67  List<Vertex^>^ get();
68  }
69 
74 #ifdef TOPOLOGIC_DYNAMO
75  [IsVisibleInDynamoLibrary(false)]
76 #endif
77  int GetNumberOfBranches();
78 
83  property bool IsClosed
84  {
85  bool get();
86  }
87 
92  property Object^ BasicGeometry
93  {
94  virtual Object^ get() override;
95  }
96 
101  static int Type();
102 
103  public protected:
104  Wire();
105 
110  Wire(const std::shared_ptr<TopologicCore::Wire>& kpCoreWire);
111 
112 #ifdef TOPOLOGIC_DYNAMO
113  static Wire^ ByPolyCurve(Autodesk::DesignScript::Geometry::PolyCurve^ polyCurve);
119 #endif
120 
125  virtual std::shared_ptr<TopologicCore::TopologicalQuery> GetCoreTopologicalQuery() override;
126 
127  protected:
128  virtual ~Wire();
129 
133  std::shared_ptr<TopologicCore::Wire>* m_pCoreWire;
134  };
135 }
bool IsClosed
Checks if the Wire is closed.
Definition: Wire.h:83
virtual std::shared_ptr< TopologicCore::TopologicalQuery > GetCoreTopologicalQuery() override
Definition: Wire.cpp:189
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 Wire. NOTE: This method will automatically identify its loop ...
Definition: Wire.h:65
static int Type()
Returns the type associated to Wire.
Definition: Wire.cpp:200
std::shared_ptr< TopologicCore::Wire > * m_pCoreWire
Definition: Wire.h:133
int GetNumberOfBranches()
Returns the number of branches of the Wire.
Definition: Wire.cpp:88
List< Edge^>^ Edges
Returns the Edges constituent to the Wire. NOTE: This method will automatically identify its loop ord...
Definition: Wire.h:47
List< Face^>^ Faces
Returns the Faces containing the Wire.
Definition: Wire.h:56
Topologic is an open-source software modelling library enabling hierarchical and topological represen...
Definition: About.h:23
Object^ BasicGeometry
Creates a geometry from Wire.
Definition: Wire.h:92
static Wire ^ ByEdges(System::Collections::Generic::IEnumerable< Edge^>^ edges)
Creates a Wire by a set of Edges.
Definition: Wire.cpp:94
A Wire is a contiguous collection of Edges, where adjacent Edges are connected by shared Vertices...
Definition: Wire.h:32