A class for writing data to the VTK file format for visualization purposes. More...
#include <VtkWriter.h>
Public Member Functions | |
VtkWriter (const char *name) | |
Constructor for the VtkWriter class. More... | |
~VtkWriter () | |
Destructor for the VtkWriter class. | |
void | addPoint (const Point2 &p, VtkColor color) |
Add a single point. More... | |
void | addPoints (const std::vector< Point2 * > &vPoints, VtkColor color) |
Add multiple points. More... | |
void | addPoints (const std::vector< Point2 > &vPoints, VtkColor color) |
Add multiple points. More... | |
void | addSegment (const Point2 &source, const Point2 &target, VtkColor color, bool bWithEndPoints=false) |
Add a segment. More... | |
void | addSegment (const Segment2 &segment, VtkColor color, bool bWithEndPoints=false) |
Add a segment. More... | |
void | addSegments (const std::vector< Edge2 > &vEdges, VtkColor color, bool bWithEndPoints=false) |
Add multiple Edge2 objects. More... | |
void | addSegments (const std::vector< Point2 > &vSegmentEndPoints, VtkColor color, bool bWithEndPoints=false) |
Add multiple segments. More... | |
void | addSegments (const std::vector< Segment2 > &vSegments, VtkColor color, bool bWithEndPoints=false) |
Add multiple segments. More... | |
void | addTriangle (const Point2 &p0, const Point2 &p1, const Point2 &p2, VtkColor color) |
Add a triangle defined by three points. More... | |
void | addTriangle (const Triangle2 &t, VtkColor color) |
Add a single triangle. More... | |
void | addTriangles (const std::vector< Point2 > &vTriangleCorners, VtkColor color) |
Add multiple triangles. More... | |
void | addTriangles (const std::vector< Triangle2 * > &vT, VtkColor color) |
Add multiple triangles. More... | |
VtkColor | getNextColor () |
Get the next color in the predefined sequence of colors. More... | |
void | writeFile () |
Finalize the visualization. More... | |
This class visualizes 3D scenes by outputting various geometric objects (such as points, segments, and triangles) to a VTK file. VTK files are compatible with many viewers, and if you're new to this format, you may want to try Paraview for visualization.
You can use this class to create custom 2D and 3D scenes, or use pre-made VTK visualizations available in classes like Fade_2D and Zone2.
|
explicit |
name | The name of the output VTK file. |
Adds a single point to the VTK file with a specified color.
p | The point to add. |
color | The color of the point. |
Adds multiple points with a specified color to the VTK file.
vPoints | A vector of points to add. |
color | The color of the points. |
Adds multiple points with a specified color to the VTK file.
vPoints | A vector of points to add. |
color | The color of the points. |
void GEOM_FADE2D::VtkWriter::addSegment | ( | const Point2 & | source, |
const Point2 & | target, | ||
VtkColor | color, | ||
bool | bWithEndPoints = false |
||
) |
Adds a segment defined by source and target points with a specified color to the VTK file.
source | The source point of the segment. |
target | The target point of the segment. |
color | The color of the segment. |
bWithEndPoints | Whether to include the end points in the visualization. |
void GEOM_FADE2D::VtkWriter::addSegment | ( | const Segment2 & | segment, |
VtkColor | color, | ||
bool | bWithEndPoints = false |
||
) |
Adds a segment with a specified color to the VTK file.
segment | The segment to add. |
color | The color of the segment. |
bWithEndPoints | Whether to include the end points in the visualization. |
void GEOM_FADE2D::VtkWriter::addSegments | ( | const std::vector< Point2 > & | vSegmentEndPoints, |
VtkColor | color, | ||
bool | bWithEndPoints = false |
||
) |
Adds multiple segments defined by pairs of endpoints with a specified color to the VTK file.
vSegmentEndPoints | A vector of point pairs defining the endpoints of the segments. |
color | The color of the segments. |
bWithEndPoints | Whether to include the end points in the visualization. |
void GEOM_FADE2D::VtkWriter::addSegments | ( | const std::vector< Segment2 > & | vSegments, |
VtkColor | color, | ||
bool | bWithEndPoints = false |
||
) |
Adds multiple segments with a specified color to the VTK file.
vSegments | A vector of segments to add. |
color | The color of the segments. |
bWithEndPoints | Whether to include the end points in the visualization. |
void GEOM_FADE2D::VtkWriter::addTriangle | ( | const Point2 & | p0, |
const Point2 & | p1, | ||
const Point2 & | p2, | ||
VtkColor | color | ||
) |
Adds a triangle defined by three points with a specified color to the VTK file.
p0 | The first point defining the triangle. |
p1 | The second point defining the triangle. |
p2 | The third point defining the triangle. |
color | The color of the triangle. |
Adds a single triangle with a specified color to the VTK file.
t | The triangle to add. |
color | The color of the triangle. |
void GEOM_FADE2D::VtkWriter::addTriangles | ( | const std::vector< Point2 > & | vTriangleCorners, |
VtkColor | color | ||
) |
Adds multiple triangles defined by their corner points with a specified color to the VTK file.
vTriangleCorners | A vector of points defining the corners of the triangles. |
color | The color of the triangles. |
Adds multiple triangles with a specified color to the VTK file.
vT | A vector of triangle pointers to add. |
color | The color of the triangles. |
VtkColor GEOM_FADE2D::VtkWriter::getNextColor | ( | ) |
void GEOM_FADE2D::VtkWriter::writeFile | ( | ) |
Writes all accumulated data to the specified VTK file.