Fade2.5D Documentation pages v2.16.7
Delaunay Features
GEOM_FADE25D::Visualizer3 Class Reference

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...
 

Static Public Attributes

static const char *const CBLACK
 
static const char *const CCYAN
 
static const char *const CDARKBLUE
 
static const char *const CDARKBROWN
 
static const char *const CDARKORANGE
 
static const char *const CGOLDENROD
 
static const char *const CGRAY
 
static const char *const CGREEN
 
static const char *const CGREENYELLOW
 
static const char *const CLAWNGREEN
 
static const char *const CLIGHTBLUE
 
static const char *const CLIGHTBROWN
 
static const char *const CLIGHTGRAY
 
static const char *const CLIGHTSEAGREAN
 
static const char *const CMEDSPRINGGREEN
 
static const char *const COLIVE
 
static const char *const CORANGE
 
static const char *const CPALEGREEN
 
static const char *const CPINK
 
static const char *const CPURPLE
 
static const char *const CRED
 
static const char *const CRIMSON
 
static const char *const CSTEELBLUE
 
static const char *const CWHEAT
 
static const char *const CWHITE
 
static const char *const CYELLOW
 
static const char *const MIDNIGHTBLUE
 

Detailed Description

Deprecated:
This class enables the visualization of 3D scenes by outputting various geometric objects (such as points, segments, and triangles) to a file, which can then be displayed using the Geomview viewer. This viewer is reliable, fast, and minimal. However, despite these advantages, Geomview is outdated and only available on Linux. Therefore, it is recommended to use the VtkWriter class instead, for creating visualizations in the widely supported VTK file format. VTK files are compatible with many viewers, and if you're new to this format, try using Paraview.
See also
VtkWriter A class for creating VTK visualization files.

Constructor & Destructor Documentation

◆ Visualizer3()

GEOM_FADE25D::Visualizer3::Visualizer3 ( const char *  name)
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.

Parameters
nameThe name of the output file.

Member Function Documentation

◆ closeFile()

void GEOM_FADE25D::Visualizer3::closeFile ( )

This method finalizes the output and closes the file.

◆ getColor()

static const char* GEOM_FADE25D::Visualizer3::getColor ( int  i)
static
Parameters
iThe index of the color.
Returns
The corresponding color as a string.

◆ getNextColor()

static const char* GEOM_FADE25D::Visualizer3::getNextColor ( )
static
Returns
The next color as a string.

◆ getNextColorAndName()

static const char* GEOM_FADE25D::Visualizer3::getNextColorAndName ( const char *&  colorName)
static
Parameters
colorNameA reference to the color name to be updated.
Returns
The next color as a string.

◆ getNextColorNum()

static int GEOM_FADE25D::Visualizer3::getNextColorNum ( )
static
Returns
The next color index.

◆ setBackfaces()

void GEOM_FADE25D::Visualizer3::setBackfaces ( bool  bWithBackfaces)

This method allows setting whether backfaces be shown in a different color.

Parameters
bWithBackfacesFlag indicating whether to show backfaces in a different color.

◆ writeBall()

void GEOM_FADE25D::Visualizer3::writeBall ( const Point2 p,
double  radius 
)

Writes a ball defined by a point and radius to the output file.

Parameters
pThe center point of the ball.
radiusThe radius of the ball.

◆ writeCubes()

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.

Parameters
vPointsThe points that define the cubes.
colorThe color of the cubes.

◆ writeNormals()

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.

Parameters
vTThe triangles whose normals are written.
scaleThe scaling factor for the normals.

◆ writePoint()

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.

Parameters
pThe point to be written.
linewidthThe width of the line used to represent the point.
colorThe color of the point.

◆ writePoints() [1/2]

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.

Parameters
vPointsThe points to be written.
linewidthThe width of the lines used to represent points.
colorThe color of the points.

◆ writePoints() [2/2]

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.

Parameters
vPointsThe points to be written.
linewidthThe width of the lines used to represent points.
colorThe color of the points.

◆ writeSegment()

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.

Parameters
srcThe source point.
trgThe target point.
colorThe color of the segment.
bWithEndPointsFlag indicating whether to show endpoints.

◆ writeSegments() [1/2]

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.

Parameters
vEdge2The edges to be written.
colorThe color of the segments.
bWithEndPointsFlag indicating whether to show endpoints.

◆ writeSegments() [2/2]

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.

Parameters
vSegmentsThe segments to be written.
colorThe color of the segments.
bWithEndPointsFlag indicating whether to show endpoints.

◆ writeTriangle() [1/2]

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.

Parameters
p0The first point of the triangle.
p1The second point of the triangle.
p2The third point of the triangle.
colorThe color of the triangle.

◆ writeTriangle() [2/2]

void GEOM_FADE25D::Visualizer3::writeTriangle ( const Triangle2 t,
const char *  color 
)

Writes a single triangle to the output file with the specified color.

Parameters
tThe triangle to be written.
colorThe color of the triangle.

◆ writeTriangles() [1/2]

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.

Parameters
vTriangleCornersThe corner points of the triangles.
colorThe color of the triangles.
bWithNNVFlag indicating whether to include normals.

◆ writeTriangles() [2/2]

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.

Parameters
vTThe triangles to be written.
colorThe color of the triangles.
bWithNormalsFlag indicating whether to include normals.

◆ writeVertexPairs()

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.

Parameters
vVertexPairsThe segments to be written.
colorThe color of the segments.

The documentation for this class was generated from the following file: