Topologic  0.8.9
CellUtility.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 "Cell.h"
20 
21 namespace Topologic {
25  namespace Utilities {
26 
27 
31  public ref class CellUtility
32  {
33  public:
39  static Cell^ ByLoft(System::Collections::Generic::IEnumerable<Wire^>^ wires);
40 
57 #ifdef TOPOLOGIC_DYNAMO
58  [IsVisibleInDynamoLibrary(false)]
59 #endif
60  static Cell^ ByCuboid(double xCentroid, double yCentroid, double zCentroid,
61  double xDimension, double yDimension, double zDimension,
62  double xNormal, double yNormal, double zNormal,
63  double xAxisX, double yAxisX, double ZAxisX,
64  double xAxisY, double yAxisY, double ZAxisY);
65 
74 #ifdef TOPOLOGIC_DYNAMO
75  [IsVisibleInDynamoLibrary(false)]
76 #endif
77  static Cell^ BySphere(double xCentroid, double yCentroid, double zCentroid, double radius);
78 
85 #ifdef TOPOLOGIC_DYNAMO
86  [IsVisibleInDynamoLibrary(false)]
87 #endif
88  static Cell ^ ByTwoCorners(Vertex ^ minVertex, Vertex ^ maxVertex);
89 
95  static double Volume(Cell^ cell);
96 
105  static bool Contains(
106  Cell^ cell,
107  Vertex^ vertex,
108  bool allowOnBoundary,
109 #ifdef TOPOLOGIC_DYNAMO
110  [Autodesk::DesignScript::Runtime::DefaultArgument("0.0001")]
111 #endif
112  double tolerance
113  );
114 
120 #ifdef TOPOLOGIC_DYNAMO
121  [IsVisibleInDynamoLibrary(false)]
122 #endif
123  static List<double>^ GetMinMax(Cell^ cell);
124 
131  static Vertex^ InternalVertex(
132  Cell^ cell,
133 #ifdef TOPOLOGIC_DYNAMO
134  [DefaultArgument("0.0001")]
135 #endif
136  double tolerance);
137 
138  public protected:
139  CellUtility() {}
140  };
141  }
142 }
A Vertex is a zero-dimensional entity equivalent to a geometry point.
Definition: Vertex.h:31
static Cell ^ ByTwoCorners(Vertex ^ minVertex, Vertex ^ maxVertex)
Creates an Axis-Aligned Bounding Box Cell by two Vertices at the minimum and maximum corners...
Definition: CellUtility.cpp:78
static List< double > ^ GetMinMax(Cell^ cell)
Returns six values associated to the x, y, z coordinates of the bounding box of the Cell...
Definition: CellUtility.cpp:129
static Cell ^ BySphere(double xCentroid, double yCentroid, double zCentroid, double radius)
Creates a Cell by a Sphere.
Definition: CellUtility.cpp:65
static double Volume(Cell^ cell)
Returns the volume of a Cell.
Definition: CellUtility.cpp:93
static Cell ^ ByCuboid(double xCentroid, double yCentroid, double zCentroid, double xDimension, double yDimension, double zDimension, double xNormal, double yNormal, double zNormal, double xAxisX, double yAxisX, double ZAxisX, double xAxisY, double yAxisY, double ZAxisY)
Creates a Cell by a Cuboid.
Definition: CellUtility.cpp:44
CellUtility includes geometric methods relevant to a Cell.
Definition: CellUtility.h:31
static bool Contains(Cell^ cell, Vertex^ vertex, bool allowOnBoundary, double tolerance)
Checks if a Vertex is contained in a Cell or not.
Definition: CellUtility.cpp:99
Topologic is an open-source software modelling library enabling hierarchical and topological represen...
Definition: About.h:23
static Cell ^ ByLoft(System::Collections::Generic::IEnumerable< Wire^>^ wires)
Creates a Cell by lofting through a set of Wires.
Definition: CellUtility.cpp:25
A Cell is a three-dimensional region defined by a collection of closed Shells. It may be manifold or ...
Definition: Cell.h:35
static Vertex ^ InternalVertex(Cell^ cell, double tolerance)
Returns a Vertex inside the Cell.
Definition: CellUtility.cpp:144