39 #ifndef vtkSVGContextDevice2D_h 40 #define vtkSVGContextDevice2D_h 42 #include "vtkIOExportModule.h" 61 void PrintSelf(ostream &os,
vtkIndent indent) override;
79 vtkGetMacro(EmbedFonts,
bool)
99 vtkGetMacro(TextAsPath,
bool)
119 vtkGetMacro(SubdivisionThreshold,
float)
126 void GenerateDefinitions();
131 void DrawPoly(
float *
points,
int n,
unsigned char *colors =
nullptr,
132 int nc_comps = 0) override;
133 void DrawLines(
float *f,
int n,
unsigned char *colors =
nullptr,
134 int nc_comps = 0) override;
135 void DrawPoints(
float *points,
int n,
unsigned char* colors =
nullptr,
136 int nc_comps = 0) override;
137 void DrawPointSprites(
vtkImageData *sprite,
float *points,
int n,
138 unsigned char *colors =
nullptr,
139 int nc_comps = 0) override;
140 void DrawMarkers(
int shape,
bool highlight,
float *points,
int n,
141 unsigned char *colors =
nullptr,
int nc_comps = 0) override;
142 void DrawQuad(
float *,
int) override;
143 void DrawQuadStrip(
float *,
int) override;
144 void DrawPolygon(
float *,
int) override;
145 void DrawColoredPolygon(
float *points,
int numPoints,
146 unsigned char *colors =
nullptr,
147 int nc_comps = 0) override;
148 void DrawEllipseWedge(
float x,
float y,
float outRx,
float outRy,
150 float stopAngle) override;
151 void DrawEllipticArc(
float x,
float y,
float rX,
float rY,
152 float startAngle,
float stopAngle) override;
155 float bounds[4]) override;
158 float bounds[4]) override;
159 void ComputeJustifiedStringBounds(const
char*
string,
160 float bounds[4]) override;
161 void DrawMathTextString(
float *point, const
vtkStdString &str) override;
164 void SetColor4(
unsigned char color[4]) override;
166 void SetPointSize(
float size) override;
167 void SetLineWidth(
float width) override;
169 void SetLineType(
int type) override;
173 void PushMatrix() override;
174 void PopMatrix() override;
175 void SetClipping(
int *x) override;
176 void EnableClipping(
bool enable) override;
180 ~vtkSVGContextDevice2D() override;
184 void PushGraphicsState();
185 void PopGraphicsState();
188 void SetupClippingAndTransform();
212 void ApplyTransform();
215 std::
string AddCrossSymbol(
bool highlight);
216 std::
string AddPlusSymbol(
bool highlight);
217 std::
string AddSquareSymbol(
bool highlight);
218 std::
string AddCircleSymbol(
bool highlight);
219 std::
string AddDiamondSymbol(
bool highlight);
221 void DrawPath(
vtkPath *path, std::ostream &out);
236 bool LengthLessThanTolerance(const
vtkVector2f &p1,
246 void WritePatterns();
247 void WriteClipRects();
249 void AdjustMatrixForSVG(const
double in[9],
double out[9]);
250 void GetSVGMatrix(
double svg[9]);
251 static
bool Transform2DEqual(const
double mat3[9], const
double mat4[16]);
252 static
void Matrix3ToMatrix4(const
double mat3[9],
double mat4[16]);
253 static
void Matrix4ToMatrix3(const
double mat4[16],
double mat3[9]);
255 float GetScaledPenWidth();
256 void GetScaledPenWidth(
float &x,
float &y);
257 void TransformSize(
float &x,
float &y);
264 vtkViewport *Viewport;
271 std::array<
double, 9> ActiveNodeTransform;
273 std::array<
int, 4> ClipRect;
274 std::array<
int, 4> ActiveNodeClipRect;
277 float SubdivisionThreshold;
279 bool ActiveNodeIsClipping;
284 vtkSVGContextDevice2D(const vtkSVGContextDevice2D&) = delete;
285 void operator=(const vtkSVGContextDevice2D&) = delete;
288 #endif // vtkSVGContextDevice2D_h
Wrapper around std::string to keep symbols short.
Represents an XML element and those nested inside.
concrete dataset representing a path defined by Bezier curves.
abstract specification for Viewports
vtkContextDevice2D implementation for use with vtkSVGExporter.
abstract specification for renderers
static vtkContextDevice2D * New()
Some derived classes for the different colors commonly used.
a simple class to control print indentation
topologically and geometrically regular array of data
Abstract class for drawing 2D primitives.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
Allocate and hold a VTK object.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
represent and manipulate 3x3 transformation matrices
String class that stores Unicode text.