24#ifndef _GEMA_TRISURFACE_DISCONTINUITY_H_
25#define _GEMA_TRISURFACE_DISCONTINUITY_H_
35 enum class CellIntersectionType {
43 const char* ciTypeToStr(
const CellIntersectionType t)
const {
45 case CellIntersectionType::EMPTY:
47 case CellIntersectionType::COMPLETE:
49 case CellIntersectionType::PARTIAL:
51 case CellIntersectionType::EXTENDED:
53 case CellIntersectionType::AMBIGUOUS:
83 int numOriginalTriangles()
const {
return _originalNumTriangles; }
90 const QVector<bool>& validIntersectionPointList()
const {
return _validIntPoint; }
91 const QSet<int>& extendedCellSet()
const {
return _extendedCell; }
104 std::accumulate(_cellIntersection.begin(),
105 _cellIntersection.end(),
108 return v + c.size() * sizeof(EdgeId);
116 const BoolMat& getOrBuildEEMatrix(
const GmCellType type);
117 const BoolMat& getOrBuildFEMatrix(
const GmCellType type);
122 :
GmDiscontinuity(ds,
index,
id, groupIndex, psIndex),
_numPoints(0),
_numTriangles(0),
_pointCoord(NULL),
_triList(NULL), _invalidCellCount(0), _validCellCount(0), _originalNumTriangles(0) {}
130 assert(dvec && ivec);
147 int _originalNumTriangles;
159 int _invalidCellCount;
162 int markAmbiguousEdges();
189 bool checkConsistency();
191 void clearIntersections() {
192 _cellIntersection.
clear();
193 _cellIntersectionType.
clear();
195 _validIntPoint.
clear();
196 _ambiguousCells.
clear();
197 _extendedCell.
clear();
198 _invalidCellCount = 0;
207 void DebugCell(
int cellId,
GmMatrix& points, CellIntersection& ci);
209 bool checkCoherence();
Base interface class for CellMesh type plugins.
Definition gmCellMesh.h:40
The geometric representation for a single discontinuity from the Discontinuity set....
Definition gmDiscontinuity.h:38
int index() const
Returns this discontinuity index in the father set.
Definition gmDiscontinuity.h:44
QString id() const
Returns the discontinuity id (name)
Definition gmDiscontinuity.h:47
Base interface for providing discontinuity geometry information for spatial indices.
Definition gmDiscontinuitySet.h:59
Definition gmDiscontinuitySet.h:357
Class representing a category with multiple logging levels.
Definition gmLog.h:58
Surface 3D representation for a discontinuity.
Definition gmTriSurfaceDiscontinuity.h:33
virtual void printGeometry(const GmLogCategory &logger, GmLogLevel level) const
Prints the discontinuity geometry information.
Definition gmTriSurfaceDiscontinuity.cpp:65
virtual size_t usedGeometryMemory() const
Returns an estimative of the memory used by the discontinuity geometry in bytes.
Definition gmTriSurfaceDiscontinuity.h:99
int * _triList
The list with triangle incidences. Size == _numTriangles * 3.
Definition gmTriSurfaceDiscontinuity.h:144
CellIntersectionType reorderIntersections(CellIntersection &ci, const GmCellType type, bool removeInvalid=true)
For each cellIntersection[i] reorder its edges indexes to form a polygon with the intersection points...
Definition gmTriSurfaceDiscontinuity.cpp:542
virtual ~GmTriSurfaceDiscontinuity()
Destructor.
Definition gmTriSurfaceDiscontinuity.cpp:45
double * _pointCoord
The coordinate vector. Size == _numPoints * 3.
Definition gmTriSurfaceDiscontinuity.h:143
virtual void setGeometry(double *dvec, int nd, int *ivec, int ni)
Sets the geometry. dvec should be a vector with coordinates (size nd * 3), nd the number of coordinat...
Definition gmTriSurfaceDiscontinuity.h:128
virtual int numPoints() const
Returns the number of surface points.
Definition gmTriSurfaceDiscontinuity.h:75
const int * triangleIncidences() const
Returns the incidence vector, organized as p11, p12, p13, p21, p22, p23, .... Size equal to numTriang...
Definition gmTriSurfaceDiscontinuity.h:86
virtual void clearGeometry()
Clears the original discontinuity geometry information, releasing memory.
Definition gmTriSurfaceDiscontinuity.cpp:54
virtual int numElements() const
A generic interface to return the original discontinuity data number of geometric elements....
Definition gmTriSurfaceDiscontinuity.h:67
virtual int numIntersections() const
A generic interface to return the number of intersections between the mesh and the user given geometr...
Definition gmTriSurfaceDiscontinuity.h:70
const double * pointCoordinates() const
Returns the surface coordinates vector, organized as x1, y1, z1, x2, y2, z2, .... Size equal to numPo...
Definition gmTriSurfaceDiscontinuity.h:78
virtual bool extendGeometry(GmCellMesh *sMesh, double size, const GmLogCategory &logger)
Definition gmTriSurfaceDiscontinuity.cpp:772
virtual size_t usedIntersectionMemory() const
Returns an estimative of the memory used by the intersection data in bytes.
Definition gmTriSurfaceDiscontinuity.h:101
virtual void printIntersections(const GmLogCategory &logger, GmLogLevel level) const
Prints the discontinuity-mesh intersection information.
Definition gmTriSurfaceDiscontinuity.cpp:674
virtual bool findIntersections(const GmLogCategory &logger)
Builds the element intersection list for this discontinuity.
Definition gmTriSurfaceDiscontinuity.cpp:84
int _numTriangles
The number of triangles in the surface.
Definition gmTriSurfaceDiscontinuity.h:142
int _numPoints
The number of points in the surface.
Definition gmTriSurfaceDiscontinuity.h:141
GmTriSurfaceDiscontinuity(const GmDiscontinuitySet *ds, int index, QString id, int groupIndex, const QVector< int > &psIndex)
Constructor.
Definition gmTriSurfaceDiscontinuity.h:121
int numTriangles() const
Returns the number of surface triangles.
Definition gmTriSurfaceDiscontinuity.h:81
Declaration of the gmBVHAcceleration class using https://github.com/madmann91/bvh/ header-only implem...
Declaration of the GmCellMesh interface class.
GmCellType
Mesh Cell types. Don't change type orders or add types without reading comments below.
Definition gmCellType.h:31
Declaration of the GmDiscontinuity class.
GmLogLevel
Available log levels list.
Definition gmLog.h:36
arma::mat GmMatrix
The basic type for a GeMA matrix object. Currently based on an Armadillo matrix.
Definition gmMatrix.h:38
Definition gmBVHAcceleration.h:36