Fade2.5D Documentation pages v2.16.8
Delaunay Features
VtkWriter.h
Go to the documentation of this file.
1 // Copyright (C) Geom Software e.U, Bernhard Kornberger, Graz/Austria
2 //
3 // This file is part of the Fade2D library. The student license is free
4 // of charge and covers personal non-commercial research. Licensees
5 // holding a commercial license may use this file in accordance with
6 // the Commercial License Agreement.
7 //
8 // This software is provided AS IS with NO WARRANTY OF ANY KIND,
9 // INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS
10 // FOR A PARTICULAR PURPOSE.
11 //
12 // Please contact the author if any conditions of this licensing are
13 // not clear to you.
14 //
15 // Author: Bernhard Kornberger, bkorn (at) geom.at
16 // http://www.geom.at
17 
19 #pragma once
20 #include "common.h"
21 #include "Point2.h"
22 #include "Segment2.h"
23 #include "Edge2.h"
24 #include "Triangle2.h"
25 
26 #if GEOM_PSEUDO3D == GEOM_TRUE
27 namespace GEOM_FADE25D {
28 #elif GEOM_PSEUDO3D == GEOM_FALSE
29 namespace GEOM_FADE2D {
30 #else
31 #error GEOM_PSEUDO3D is not defined
32 #endif
33 
34 struct Dat3; // FWD
35 
39 {
57 };
58 
75 class CLASS_DECLSPEC VtkWriter
76 {
77 public:
78 
83  explicit VtkWriter(const char* name);
84 
89 
95 
104  void addPoint(const Point2& p, VtkColor color);
105 
114  void addPoints(const std::vector<Point2*>& vPoints, VtkColor color);
123  void addPoints(const std::vector<Point2>& vPoints, VtkColor color);
124 
134  void addSegment(const Segment2& segment, VtkColor color, bool bWithEndPoints = false);
135 
146  void addSegment(const Point2& source, const Point2& target, VtkColor color, bool bWithEndPoints = false);
147 
157  void addSegments(const std::vector<Segment2>& vSegments, VtkColor color, bool bWithEndPoints = false);
158 
168  void addSegments(const std::vector<Edge2>& vEdges, VtkColor color, bool bWithEndPoints = false);
169 
179  void addSegments(const std::vector<Point2>& vSegmentEndPoints, VtkColor color, bool bWithEndPoints = false);
180 
189  void addTriangles(const std::vector<Triangle2*>& vT, VtkColor color);
190 
199  void addTriangles(const std::vector<Point2>& vTriangleCorners, VtkColor color);
200 
209  void addTriangle(const Triangle2& t, VtkColor color);
210 
221  void addTriangle(const Point2& p0, const Point2& p1, const Point2& p2, VtkColor color);
222 
230  void writeFile();
231 
232 private:
234  VtkWriter(const VtkWriter&);
235 
237  VtkWriter& operator=(const VtkWriter&);
238 
239  Dat3* pDat;
240 };
241 
242 } // namespace GEOM_FADE25D or GEOM_FADE2D
243 
VtkColor
Enumeration of colors used by the VTKWriter class to represent various colors in the VTK file format.
Definition: VtkWriter.h:39
@ VTK_GRAY
Gray color.
Definition: VtkWriter.h:48
@ VTK_WHITE
White color.
Definition: VtkWriter.h:47
@ VTK_GREEN
Green color.
Definition: VtkWriter.h:41
@ VTK_BLUE
Blue color.
Definition: VtkWriter.h:42
@ VTK_BROWN
Brown color.
Definition: VtkWriter.h:54
@ VTK_YELLOW
Yellow color.
Definition: VtkWriter.h:43
@ VTK_ORANGE
Orange color.
Definition: VtkWriter.h:49
@ VTK_BLACK
Black color.
Definition: VtkWriter.h:46
@ VTK_RED
Red color.
Definition: VtkWriter.h:40
@ VTK_PURPLE
Purple color.
Definition: VtkWriter.h:55
@ VTK_DARKBLUE
Dark blue color.
Definition: VtkWriter.h:52
@ VTK_PINK
Pink color.
Definition: VtkWriter.h:50
@ VTK_LIGHTBLUE
Light blue color.
Definition: VtkWriter.h:51
@ VTK_MAGENTA
Magenta color.
Definition: VtkWriter.h:45
@ VTK_CYAN
Cyan color.
Definition: VtkWriter.h:44
@ VTK_TRANSPARENT
Transparent color, meaning: Don't draw.
Definition: VtkWriter.h:56
@ VTK_LIGHTGREEN
Light green color.
Definition: VtkWriter.h:53
Represents a 2.5D point.
Definition: Point2.h:76
Represents a line segment between two points.
Definition: Segment2.h:41
Represents a triangle in a triangulation.
Definition: Triangle2.h:59
A class for writing data to the VTK file format for visualization purposes.
Definition: VtkWriter.h:76
void addSegments(const std::vector< Point2 > &vSegmentEndPoints, VtkColor color, bool bWithEndPoints=false)
Add multiple segments.
void addTriangles(const std::vector< Triangle2 * > &vT, VtkColor color)
Add multiple triangles.
void addTriangle(const Point2 &p0, const Point2 &p1, const Point2 &p2, VtkColor color)
Add a triangle defined by three points.
void addPoint(const Point2 &p, VtkColor color)
Add a single point.
void addSegments(const std::vector< Edge2 > &vEdges, VtkColor color, bool bWithEndPoints=false)
Add multiple Edge2 objects.
void writeFile()
Finalize the visualization.
VtkColor getNextColor()
Get the next color in the predefined sequence of colors.
void addSegment(const Point2 &source, const Point2 &target, VtkColor color, bool bWithEndPoints=false)
Add a segment.
void addPoints(const std::vector< Point2 * > &vPoints, VtkColor color)
Add multiple points.
void addTriangles(const std::vector< Point2 > &vTriangleCorners, VtkColor color)
Add multiple triangles.
void addPoints(const std::vector< Point2 > &vPoints, VtkColor color)
Add multiple points.
void addTriangle(const Triangle2 &t, VtkColor color)
Add a single triangle.
~VtkWriter()
Destructor for the VtkWriter class.
VtkWriter(const char *name)
Constructor for the VtkWriter class.
void addSegment(const Segment2 &segment, VtkColor color, bool bWithEndPoints=false)
Add a segment.
void addSegments(const std::vector< Segment2 > &vSegments, VtkColor color, bool bWithEndPoints=false)
Add multiple segments.