Topologic  0.8.9
Edge.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/Edge.h>
22 
23 namespace Topologic {
24  ref class Vertex;
25  ref class Wire;
26  ref class Geometry;
27 
31  public ref class Edge : Topology
32  {
33  public:
40  static Edge^ ByStartVertexEndVertex(Vertex^ startVertex, Vertex^ endVertex);
41 
42 #ifdef TOPOLOGIC_DYNAMO
43  [IsVisibleInDynamoLibrary(false)]
44 #endif
45  static Edge^ ByNurbsParameters(List<Vertex^>^ controlPoints, List<double>^ weights, List<double>^ knots, bool isRational, bool isPeriodic, int degree);
46 
51  property List<Edge^>^ AdjacentEdges
52  {
53  List<Edge^>^ get();
54  }
55 
60  property Vertex^ StartVertex {
61  Vertex^ get();
62  }
63 
68  property Vertex^ EndVertex {
69  Vertex^ get();
70  }
71 
76  property List<Vertex^>^ Vertices {
77  List<Vertex^>^ get();
78  }
79 
84  property List<Wire^>^ Wires
85  {
86  List<Wire^>^ get();
87  }
88 
94  List<Vertex^>^ SharedVertices(Edge^ edge);
95 
100  property Object^ BasicGeometry
101  {
102  virtual Object^ get() override;
103  }
104 
109  static int Type();
110 
111  public protected:
112  Edge();
113 
118  Edge(const std::shared_ptr<TopologicCore::Edge>& kpCoreEdge);
119 
120 #ifdef TOPOLOGIC_DYNAMO
121  Autodesk::DesignScript::Geometry::Curve^ Curve();
126 
132  Autodesk::DesignScript::Geometry::Curve^ Curve(Handle(Geom_Curve) pOcctCurve, const double u0, const double u1);
133 
139  static Edge^ ByCurve(Autodesk::DesignScript::Geometry::Curve^ curve);
140 
146  static Edge^ ByCurve(Autodesk::DesignScript::Geometry::NurbsCurve^ pDynamoNurbsCurve);
147 
153  static Edge^ ByCurve(Autodesk::DesignScript::Geometry::Circle^ pDynamoCircle);
154 
160  static Edge^ ByCurve(Autodesk::DesignScript::Geometry::Line^ pDynamoLine);
161 #else
162  Topologic::Geometry^ Curve();
163 #endif
164 
169  virtual std::shared_ptr<TopologicCore::TopologicalQuery> GetCoreTopologicalQuery() override;
170 
171  protected:
172  virtual ~Edge();
173 
177  std::shared_ptr<TopologicCore::Edge>* m_pCoreEdge;
178  };
179 }
List< Vertex^> ^ SharedVertices(Edge^ edge)
Returns the shared Vertices between two Edges.
Definition: Edge.cpp:592
A Vertex is a zero-dimensional entity equivalent to a geometry point.
Definition: Vertex.h:31
A Topology is an abstract superclass that includes constructors, properties and methods used by other...
Definition: Topology.h:53
An Edge is a one-dimensional entity defined by two vertices. It is important to note that while a top...
Definition: Edge.h:31
Object^ BasicGeometry
Creates a geometry from Edge.
Definition: Edge.h:100
List< Edge^>^ AdjacentEdges
Returns the Edges adjacent to the Edge.
Definition: Edge.h:51
Vertex^ StartVertex
Returns the start Vertex of the Edge.
Definition: Edge.h:60
Definition: Geometry.h:30
Vertex^ EndVertex
Returns the end Vertex of the Edge.
Definition: Edge.h:68
List< Vertex^>^ Vertices
Returns the Vertices at the ends of the Edge.
Definition: Edge.h:76
Topologic is an open-source software modelling library enabling hierarchical and topological represen...
Definition: About.h:23
static Edge ^ ByStartVertexEndVertex(Vertex^ startVertex, Vertex^ endVertex)
Creates a straight Edge by the startVertex and endVertex.
Definition: Edge.cpp:577
std::shared_ptr< TopologicCore::Edge > * m_pCoreEdge
Definition: Edge.h:177
static int Type()
Returns the type associated to Edge.
Definition: Edge.cpp:629
List< Wire^>^ Wires
Returns the Wires incident to the Edge.
Definition: Edge.h:84
virtual std::shared_ptr< TopologicCore::TopologicalQuery > GetCoreTopologicalQuery() override
Definition: Edge.cpp:618