32 class GISMO_EXPORT
gsSolid :
public gsSolidElement<T>
35 typedef memory::shared_ptr<gsSolid> Ptr;
36 typedef memory::unique_ptr<gsSolid> uPtr;
38 typedef gsSolidElement<T> SolidElement;
39 typedef typename gsSolidElement<T>::scalar_t scalar_t;
40 typedef typename gsSolidElement<T>::gsSolidHeVertexHandle gsSolidHeVertexHandle;
41 typedef typename gsSolidElement<T>::gsSolidHalfEdgeHandle gsSolidHalfEdgeHandle;
42 typedef typename gsSolidElement<T>::gsSolidHalfFaceHandle gsSolidHalfFaceHandle;
43 typedef typename gsSolidElement<T>::gsVolumeHandle gsVolumeHandle;
47 typedef typename std::vector<gsSolidHalfFaceHandle*>::iterator
face_iterator;
48 typedef typename std::vector<gsGeometry<T> *>::const_iterator const_face_iterator;
50 typedef typename std::vector<gsSolidHalfEdgeHandle*>::iterator edge_iterator;
51 typedef typename std::vector<gsSolidHalfEdgeHandle*>::const_iterator const_edge_iterator;
53 typedef typename std::vector<gsSolidHeVertexHandle*>::iterator vertex_iterator;
54 typedef typename std::vector<gsSolidHeVertexHandle*>::const_iterator const_vertex_iterator;
56 typedef typename std::vector<gsVolumeHandle*>::iterator volume_iterator;
57 typedef typename std::vector<gsVolumeHandle*>::const_iterator const_volume_iterator;
62 unsigned numHalfEdges;
63 unsigned numHalfFaces;
66 std::vector<gsSolidHeVertexHandle > vertex;
67 std::vector<gsSolidHalfEdgeHandle > edge;
68 std::vector<gsSolidHalfFaceHandle > face;
69 std::vector<gsVolumeHandle > volume;
82 gsSolid(
int const & i = 0) : SolidElement(i), initialized(false)
101 inline int nVolumes()
const {
return volume.size();}
103 inline int nHalfFaces()
const {
return face.size();}
105 inline int nVertices()
const {
return vertex.size();}
107 inline size_t nHalfEdges()
const {
return edge.size();}
109 inline bool isFaceCCW()
const {
return FaceCCW;}
111 inline gsSolidHeVertexHandle getVertexFromID(
int const & _id)
const
112 {
return *(vertex.begin()+_id);}
114 inline gsSolidHalfEdgeHandle getHalfEdgeFromID(
int const & _id)
const
115 {
return *(edge.begin()+_id);}
117 inline gsSolidHalfFaceHandle getHalfFaceFromID(
int const & _id)
const
118 {
return *(face.begin()+_id);}
120 gsBoundingBox<T> getBoundingBox()
const {
return bb;}
126 void addHeVertex(scalar_t
const& x, scalar_t
const& y, scalar_t
const& z=0);
131 gsSolidHalfFaceHandle addFace(std::vector<gsSolidHeVertexHandle> V);
133 gsSolidHalfFaceHandle addFace(std::vector<gsSolidHeVertexHandle> V,
134 gsTrimSurface<T> * tsurf);
140 gsSolidHalfFaceHandle addFace(std::vector< std::vector<gsSolidHeVertexHandle> > loopV,
141 gsTrimSurface<T> * tsurf);
143 gsSolidHalfFaceHandle addFace_PlanarPolygon(std::vector<gsSolidHeVertexHandle> V);
147 gsSolidHeVertexHandle v1,
148 gsSolidHeVertexHandle v2,
149 gsSolidHeVertexHandle v3)
151 std::vector<gsSolidHeVertexHandle> V(4);
152 V[0] = v0; V[1] = v1; V[2] = v2; V[3] = v3;
161 gsSolidHalfFaceHandle splitFace(gsSolidHalfFaceHandle f,
162 gsSolidHeVertexHandle startVertex,
163 gsSolidHeVertexHandle endVertex,
169 volume.push_back(vol);
170 vol->setId(numVolumes++);
174 void addVolume(std::vector<gsSolidHalfFaceHandle> hfaces)
176 gsVolumeHandle vol = this->makeVolume(hfaces);
184 std::vector<gsSolidHalfEdgeHandle> detectNonConvexEdges(std::vector<int>
const & ncEdgeV1, std::vector<int>
const & ncEdgeV2);
188 gsVolumeBlock<T> *newVolume(gsSolidHalfFaceHandle startingFace);
191 void checkStructure(
bool checkVerts =
false)
const;
195 gsSolidHalfFace<T> *addFaceWithMate(
const std::vector<gsSolidHeVertexHandle> &Verts,
gsTrimSurface<T> *surf);
200 void insertNewVertex(gsSolidHalfEdgeHandle he);
204 void handleImpedingEdges(gsSolidHalfEdgeHandle he);
214 std::vector<gsSolidHalfEdgeHandle> impedingEdges(gsSolidHalfEdgeHandle he)
const;
220 virtual std::ostream &print(std::ostream &os)
const;
225 #ifndef GISMO_BUILD_LIB
226 #include GISMO_HPP_HEADER(gsSolid.hpp)
Class for a trim surface.
Definition: gsTrimSurface.h:33
Provides gsVolumeBlock class.
Provides gsSolidHeVertex - a vertex of a gsSolid.
gsSolidHalfFaceHandle addFace_4Vertices(gsSolidHeVertexHandle v0, gsSolidHeVertexHandle v1, gsSolidHeVertexHandle v2, gsSolidHeVertexHandle v3)
add one face as a trimmed surface, the order of the vertices in V must be either CCW or CW when viewi...
Definition: gsSolid.h:146
A B-spline function of one argument, with arbitrary target dimension.
Definition: gsBSpline.h:50
void addVolume(std::vector< gsSolidHalfFaceHandle > hfaces)
add a volume using handles of its half faces
Definition: gsSolid.h:174
std::vector< gsSolidHalfFaceHandle * >::iterator face_iterator
Iterators.
Definition: gsSolid.h:47
Provides gsSolidElement class - interface for an element (vertex, edge or face) of a solid...
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition: gsMultiPatch.h:33
void addVolume(gsVolumeHandle vol)
add a volume using its handle
Definition: gsSolid.h:167
Class for representing a solid made up of vertices, edges, faces, and volumes.
Definition: gsSolid.h:32
This is the main header file that collects wrappers of Eigen for linear algebra.
Provides gsSolidHalfEdge - a half-edge of a gsSolid.
Provides gsSolidHalfFace - a (half-)face of a gsSolid.
Provides gsBoundingBox class.