SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
10 #ifndef smtk_model_Tessellation_h
11 #define smtk_model_Tessellation_h
13 #include "smtk/common/UUID.h"
94 typedef int size_type;
99 std::vector<double>&
coords() {
return m_coords; }
101 std::vector<double>
const&
coords()
const {
return m_coords; }
104 std::vector<int>&
conn() {
return m_conn; }
106 std::vector<int>
const&
conn()
const {
return m_conn; }
108 int addCoords(
const double* a);
112 Tessellation& addLine(
const double* a,
const double* b);
113 Tessellation& addTriangle(
const double* a,
const double* b,
const double* c);
114 Tessellation& addQuad(
const double* a,
const double* b,
const double* c,
const double* d);
121 void setPoint(std::size_t
id,
const double* points);
125 size_type begin()
const;
126 size_type end()
const;
127 size_type nextCellOffset(size_type curOffset)
const;
128 size_type cellType(size_type offset)
const;
129 size_type numberOfCellVertices(size_type offset, size_type* cellTypeOut)
const;
130 size_type vertexIdsOfCell(size_type offset, std::vector<int>& cellConn)
const;
131 size_type materialIdOfCell(size_type offset)
const;
133 bool vertexIdsOfPolylineEndpoints(size_type offset,
int& first,
int& last)
const;
144 size_type insertNextCell(std::vector<int>& cellConn);
145 size_type insertNextCell(size_type connLen,
const int* cellConn);
147 bool insertCell(size_type offset, std::vector<int>& cellConn);
148 bool insertCell(size_type offset, size_type connLen,
const int* cellConn);
150 static size_type cellShapeFromType(size_type);
151 static int numCellPropsFromType(size_type cellType);
152 static int numVertexPropsFromType(size_type cellType);
154 static void invalidBoundingBox(
double bbox[6]);
155 bool getBoundingBox(
double bbox[6])
const;
158 std::vector<double> m_coords;
159 std::vector<int> m_conn;
162 typedef std::map<smtk::common::UUID, Tessellation> UUIDsToTessellations;
163 typedef std::map<smtk::common::UUID, Tessellation>::iterator UUIDWithTessellation;
168 #endif // smtk_model_Tessellation_h
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
@ TESS_POLYLINE
Cell is a polyline, with the number of vertices in the following connectivity entry.
Definition: Tessellation.h:42
@ TESS_FACE_NORMAL
Cell has an offset into the normal-vector storage following vertex UVs (part of Three....
Definition: Tessellation.h:60
@ TESS_FACE_VERTEX_COLOR
Cell has N offsets into the color storage following face color (part of Three.js).
Definition: Tessellation.h:66
@ TESS_INVALID_CELL
Something went wrong; an invalid cell.
Definition: Tessellation.h:48
@ TESS_VARYING_VERT_CELL
All cell types that have a varying number of vertices (and store it after cell type).
Definition: Tessellation.h:50
@ TESS_FACE_VERTEX_UV
Cell has N offsets into the UV coordinate storage following face UV (part of Three....
Definition: Tessellation.h:58
std::vector< int > & conn()
Direct access to the underlying connectivity storage.
Definition: Tessellation.h:104
TessellationCellType
Cell type information bit-vector constants.
Definition: Tessellation.h:35
@ TESS_VERTEX
Cell is a single vertex.
Definition: Tessellation.h:37
Store geometric information related to model entities.
Definition: Tessellation.h:91
@ TESS_FACE_VERTEX_NORMAL
Cell has N offsets into the normal-vector storage following face normal (part of Three....
Definition: Tessellation.h:62
@ TESS_PROPERTY_MASK
All properties that can be stored with a cell.
Definition: Tessellation.h:69
@ TESS_TRIANGLE_STRIP
Cell is a triangle strip, with the number of vertices in the following connectivity entry.
Definition: Tessellation.h:46
@ TESS_QUAD
Cell is a quadrilateral (4 vertices, part of Three.JS).
Definition: Tessellation.h:39
std::vector< double > const & coords() const
Direct access to the underlying point-coordinate storage.
Definition: Tessellation.h:101
std::vector< int > const & conn() const
Direct access to the underlying connectivity storage.
Definition: Tessellation.h:106
@ TESS_POLYVERTEX
Cell is a polyvertex, with the number of vertices in the following connectivity entry.
Definition: Tessellation.h:40
@ TESS_FACE_COLOR
Cell has an offset into the color storage following vertex normals (part of Three....
Definition: Tessellation.h:64
@ TESS_FACE_MATERIAL
Cell has a material ID immediately following the list of vertices (part of Three.js).
Definition: Tessellation.h:54
@ TESS_FACE_UV
Cell has an offset into the UV coordinate storage following material ID (part of Three....
Definition: Tessellation.h:56
@ TESS_POLYGON
Cell is a polygon, with the number of vertices in the following connectivity entry.
Definition: Tessellation.h:44
std::vector< double > & coords()
Direct access to the underlying point-coordinate storage.
Definition: Tessellation.h:99
@ TESS_TRIANGLE
Cell is a triangle (3 vertices, part of Three.JS).
Definition: Tessellation.h:38
@ TESS_CELLTYPE_MASK
The union of all cell type bits.
Definition: Tessellation.h:52