FadeExport is a simple struct to export triangulation data.
More...
#include <FadeExport.h>
|
double * | aCoords |
| Cartesian coordinates (dim*numPoints)
|
|
int * | aCustomIndices |
| Custom indices of the points (only when exported)
|
|
int * | aTriangles |
| 3 counterclockwise oriented vertex-indices per triangle (3*numTriangles)
|
|
int | dim |
| Dimension.
|
|
int | numCustomIndices |
| number of custom indices (same as numPoints when exported, otherwise 0)
|
|
int | numPoints |
| number of points
|
|
int | numTriangles |
| number of triangles
|
|
This data structure is designed to get data out of Fade easily and memory efficiently using only basic data types.
- Note
- The important source code for this struct is implemented in the
FadeExport.h
file, allowing users to adapt the code for their own needs.
- See also
- https://www.geom.at/triangulation-export/ This article describes exporting triangulations.
◆ copy()
void GEOM_FADE2D::FadeExport::copy |
( |
const FadeExport & |
other | ) |
|
|
inline |
Copies the other
FadeExport struct to the current one.
- Parameters
-
◆ extractTriangleNeighborships()
void GEOM_FADE2D::FadeExport::extractTriangleNeighborships |
( |
std::vector< std::pair< int, int > > & |
vNeigs | ) |
const |
|
inline |
This method extracts the adjacency relationships between triangles by identifying which triangles share an edge. It populates the provided vector with pairs of adjacent triangle indices.
- Parameters
-
vNeigs | A vector that will be populated with pairs of adjacent triangle indices. |
◆ getCoordinates()
void GEOM_FADE2D::FadeExport::getCoordinates |
( |
int |
vtxIdx, |
|
|
double & |
x, |
|
|
double & |
y |
|
) |
| const |
|
inline |
- Parameters
-
vtxIdx | [in] vertex index |
x,y | [out] coordinates |
◆ getCornerIndices()
void GEOM_FADE2D::FadeExport::getCornerIndices |
( |
int |
triIdx, |
|
|
int & |
vtxIdx0, |
|
|
int & |
vtxIdx1, |
|
|
int & |
vtxIdx2 |
|
) |
| const |
|
inline |
- Parameters
-
triIdx | [in] triangle index |
vtxIdx0,vtxIdx1,vtxIdx2 | [out] corner indices |
◆ getCustomIndex()
int GEOM_FADE2D::FadeExport::getCustomIndex |
( |
int |
vtxIdx | ) |
const |
|
inline |
- Returns
- the (optional) custom index of the vertex with the index
vtxIdx
or -1 if the vertex indices have not been exported.
◆ lexiSort()
void GEOM_FADE2D::FadeExport::lexiSort |
( |
| ) |
|
This method sorts the points in lexicographical order for better reproducibility. It is mainly used for consistent output in tests or exports.
◆ print()
void GEOM_FADE2D::FadeExport::print |
( |
| ) |
const |
|
inline |
Prints the points, triangles, and their adjacency relationships for inspection.
◆ reset()
void GEOM_FADE2D::FadeExport::reset |
( |
| ) |
|
|
inline |
Deletes all dynamically allocated data and resets the number of points, triangles, and custom indices to 0.
◆ writeObj()
bool GEOM_FADE2D::FadeExport::writeObj |
( |
const char * |
filename | ) |
const |
|
inline |
This method exports the triangulation to the popular .obj
file format, which is supported by most 3D viewers.
- Parameters
-
filename | The name of the file to write to. |
- Returns
true
if the file was successfully written, false
otherwise.
The documentation for this struct was generated from the following file: