Visualizer3 is a 3D scene writer for the Geomview viewer. More...
#include <Visualizer3.h>
Public Member Functions | |
Visualizer3 (const char *name) | |
Constructor. More... | |
~Visualizer3 () | |
Destructor. | |
void | closeFile () |
Closes the output file. More... | |
void | setBackfaces (bool bWithBackfaces) |
Set whether to show backfaces in a different color. More... | |
void | writeBall (const Point2 &p, double radius) |
Write a ball (point with radius) to the output file. More... | |
void | writeCubes (const std::vector< Point2 > &vPoints, const char *color) |
Write cubes to the output file. More... | |
void | writeNormals (const std::vector< Triangle2 * > &vT, double scale) |
Write normals to the output file. More... | |
void | writePoint (const Point2 &p, unsigned linewidth, const char *color) |
Write a single point to the output file. More... | |
void | writePoints (const std::vector< Point2 * > &vPoints, unsigned linewidth, const char *color) |
Write points to the output file. More... | |
void | writePoints (const std::vector< Point2 > &vPoints, unsigned linewidth, const char *color) |
Write points to the output file (overloaded) More... | |
void | writeSegment (const Point2 &src, const Point2 &trg, const char *color, bool bWithEndPoints=false) |
Write a segment to the output file. More... | |
void | writeSegments (const std::vector< Edge2 > &vEdge2, const char *color, bool bWithEndPoints=false) |
Write multiple edge segments to the output file. More... | |
void | writeSegments (const std::vector< Segment2 > &vSegments, const char *color, bool bWithEndPoints=false) |
Write multiple segments to the output file. More... | |
void | writeTriangle (const Point2 &p0, const Point2 &p1, const Point2 &p2, const char *color) |
Write a triangle to the output file using 3 points. More... | |
void | writeTriangle (const Triangle2 &t, const char *color) |
Write a single triangle to the output file. More... | |
void | writeTriangles (const std::vector< Point2 > &vTriangleCorners, const char *color, bool bWithNNV) |
Write triangles using corner points to the output file. More... | |
void | writeTriangles (const std::vector< Triangle2 * > &vT, const char *color, bool bWithNormals=false) |
Write triangles to the output file. More... | |
void | writeVertexPairs (const std::vector< VertexPair2 > &vVertexPairs, const char *color) |
Write vertex pairs to the output file. More... | |
Static Public Member Functions | |
static const char * | getColor (int i) |
Returns a color by index. More... | |
static const char * | getNextColor () |
Returns the next color in the sequence. More... | |
static const char * | getNextColorAndName (const char *&colorName) |
Returns the next color and its name. More... | |
static int | getNextColorNum () |
Returns the color index for the next color. More... | |
|
explicit |
Initializes the Visualizer3 with the specified output file name. The file is used to write the visualization data in a format readable by the Geomview viewer.
name | The name of the output file. |
void GEOM_FADE25D::Visualizer3::closeFile | ( | ) |
This method finalizes the output and closes the file.
|
static |
i | The index of the color. |
|
static |
|
static |
colorName | A reference to the color name to be updated. |
|
static |
void GEOM_FADE25D::Visualizer3::setBackfaces | ( | bool | bWithBackfaces | ) |
This method allows setting whether backfaces be shown in a different color.
bWithBackfaces | Flag indicating whether to show backfaces in a different color. |
void GEOM_FADE25D::Visualizer3::writeBall | ( | const Point2 & | p, |
double | radius | ||
) |
Writes a ball defined by a point and radius to the output file.
p | The center point of the ball. |
radius | The radius of the ball. |
void GEOM_FADE25D::Visualizer3::writeCubes | ( | const std::vector< Point2 > & | vPoints, |
const char * | color | ||
) |
Writes a collection of cubes defined by points to the output file with the specified color.
vPoints | The points that define the cubes. |
color | The color of the cubes. |
void GEOM_FADE25D::Visualizer3::writeNormals | ( | const std::vector< Triangle2 * > & | vT, |
double | scale | ||
) |
Writes normals of the specified triangles to the output file. Normals are scaled by the specified factor.
vT | The triangles whose normals are written. |
scale | The scaling factor for the normals. |
void GEOM_FADE25D::Visualizer3::writePoint | ( | const Point2 & | p, |
unsigned | linewidth, | ||
const char * | color | ||
) |
Writes the specified point to the output file with the given line width and color.
p | The point to be written. |
linewidth | The width of the line used to represent the point. |
color | The color of the point. |
void GEOM_FADE25D::Visualizer3::writePoints | ( | const std::vector< Point2 * > & | vPoints, |
unsigned | linewidth, | ||
const char * | color | ||
) |
Writes the specified points to the output file with the given line width and color.
vPoints | The points to be written. |
linewidth | The width of the lines used to represent points. |
color | The color of the points. |
void GEOM_FADE25D::Visualizer3::writePoints | ( | const std::vector< Point2 > & | vPoints, |
unsigned | linewidth, | ||
const char * | color | ||
) |
Writes the specified points to the output file with the given line width and color. This version uses a vector of Point2 objects directly.
vPoints | The points to be written. |
linewidth | The width of the lines used to represent points. |
color | The color of the points. |
void GEOM_FADE25D::Visualizer3::writeSegment | ( | const Point2 & | src, |
const Point2 & | trg, | ||
const char * | color, | ||
bool | bWithEndPoints = false |
||
) |
Writes a segment defined by two endpoints to the output file, with the given color and optional endpoint visibility.
src | The source point. |
trg | The target point. |
color | The color of the segment. |
bWithEndPoints | Flag indicating whether to show endpoints. |
void GEOM_FADE25D::Visualizer3::writeSegments | ( | const std::vector< Edge2 > & | vEdge2, |
const char * | color, | ||
bool | bWithEndPoints = false |
||
) |
Writes a collection of Edge2 objects to the output file with the specified color and optional endpoint visibility.
vEdge2 | The edges to be written. |
color | The color of the segments. |
bWithEndPoints | Flag indicating whether to show endpoints. |
void GEOM_FADE25D::Visualizer3::writeSegments | ( | const std::vector< Segment2 > & | vSegments, |
const char * | color, | ||
bool | bWithEndPoints = false |
||
) |
Writes a collection of segments to the output file with the specified color and optional endpoint visibility.
vSegments | The segments to be written. |
color | The color of the segments. |
bWithEndPoints | Flag indicating whether to show endpoints. |
void GEOM_FADE25D::Visualizer3::writeTriangle | ( | const Point2 & | p0, |
const Point2 & | p1, | ||
const Point2 & | p2, | ||
const char * | color | ||
) |
Writes a triangle defined by 3 points to the output file with the specified color.
p0 | The first point of the triangle. |
p1 | The second point of the triangle. |
p2 | The third point of the triangle. |
color | The color of the triangle. |
void GEOM_FADE25D::Visualizer3::writeTriangle | ( | const Triangle2 & | t, |
const char * | color | ||
) |
Writes a single triangle to the output file with the specified color.
t | The triangle to be written. |
color | The color of the triangle. |
void GEOM_FADE25D::Visualizer3::writeTriangles | ( | const std::vector< Point2 > & | vTriangleCorners, |
const char * | color, | ||
bool | bWithNNV | ||
) |
Writes a collection of triangles defined by corner points to the output file with the specified color and optional normal visibility.
vTriangleCorners | The corner points of the triangles. |
color | The color of the triangles. |
bWithNNV | Flag indicating whether to include normals. |
void GEOM_FADE25D::Visualizer3::writeTriangles | ( | const std::vector< Triangle2 * > & | vT, |
const char * | color, | ||
bool | bWithNormals = false |
||
) |
Writes a collection of triangles to the output file with the specified color and optional normals.
vT | The triangles to be written. |
color | The color of the triangles. |
bWithNormals | Flag indicating whether to include normals. |
void GEOM_FADE25D::Visualizer3::writeVertexPairs | ( | const std::vector< VertexPair2 > & | vVertexPairs, |
const char * | color | ||
) |
Writes a collection of segments, defined by VertexPair2 objects to the output file with the specified color.
vVertexPairs | The segments to be written. |
color | The color of the segments. |