VTK
|
vtkContextDevice2D implementation for use with vtkSVGExporter. More...
#include <vtkSVGContextDevice2D.h>
Public Types | |
typedef vtkContextDevice2D | Superclass |
Public Types inherited from vtkContextDevice2D | |
enum | TextureProperty { Nearest = 0x01, Linear = 0x02, Stretch = 0x04, Repeat = 0x08 } |
typedef vtkObject | Superclass |
Public Member Functions | |
virtual vtkTypeBool | IsA (const char *type) |
Return 1 if this class is the same type of (or a subclass of) the named class. More... | |
vtkSVGContextDevice2D * | NewInstance () const |
void | PrintSelf (ostream &os, vtkIndent indent) override |
Methods invoked by print to print information about the object including superclasses. More... | |
void | SetSVGContext (vtkXMLDataElement *context, vtkXMLDataElement *defs) |
The svg container element to draw into, and the global definitions element. More... | |
void | GenerateDefinitions () |
Write any definition information (fonts, images, etc) that are accumulated between actors. More... | |
void | Begin (vtkViewport *) override |
Begin drawing, pass in the viewport to set up the view. More... | |
void | End () override |
End drawing, clean up the view. More... | |
void | DrawPoly (float *points, int n, unsigned char *colors=nullptr, int nc_comps=0) override |
Draw a poly line using the points - fastest code path due to memory layout of the coordinates. More... | |
void | DrawLines (float *f, int n, unsigned char *colors=nullptr, int nc_comps=0) override |
Draw lines using the points - memory layout is as follows: l1p1,l1p2,l2p1,l2p2... More... | |
void | DrawPoints (float *points, int n, unsigned char *colors=nullptr, int nc_comps=0) override |
Draw a series of points - fastest code path due to memory layout of the coordinates. More... | |
void | DrawPointSprites (vtkImageData *sprite, float *points, int n, unsigned char *colors=nullptr, int nc_comps=0) override |
Draw a series of point sprites, images centred at the points supplied. More... | |
void | DrawMarkers (int shape, bool highlight, float *points, int n, unsigned char *colors=nullptr, int nc_comps=0) override |
Draw a series of markers centered at the points supplied. More... | |
void | DrawQuad (float *, int) override |
Draw a quad using the specified number of points. More... | |
void | DrawQuadStrip (float *, int) override |
Draw a quad using the specified number of points. More... | |
void | DrawPolygon (float *, int) override |
Draw a polygon using the specified number of points. More... | |
void | DrawColoredPolygon (float *points, int numPoints, unsigned char *colors=nullptr, int nc_comps=0) override |
Draw a polygon using the specified number of points. More... | |
void | DrawEllipseWedge (float x, float y, float outRx, float outRy, float inRx, float inRy, float startAngle, float stopAngle) override |
Draw an elliptic wedge with center at x, y, outer radii outRx, outRy, inner radii inRx, inRy between angles startAngle and stopAngle (expressed in degrees). More... | |
void | DrawEllipticArc (float x, float y, float rX, float rY, float startAngle, float stopAngle) override |
Draw an elliptic arc with center at x,y with radii rX and rY between angles startAngle and stopAngle (expressed in degrees). More... | |
void | DrawString (float *point, const vtkStdString &string) override |
Draw some text to the screen. More... | |
void | ComputeStringBounds (const vtkStdString &string, float bounds[4]) override |
Compute the bounds of the supplied string. More... | |
void | DrawString (float *point, const vtkUnicodeString &string) override |
Draw some text to the screen. More... | |
void | ComputeStringBounds (const vtkUnicodeString &string, float bounds[4]) override |
Compute the bounds of the supplied string. More... | |
void | ComputeJustifiedStringBounds (const char *string, float bounds[4]) override |
Compute the bounds of the supplied string while taking into account the justification of the currently applied text property. More... | |
void | DrawMathTextString (float *point, const vtkStdString &str) override |
Draw text using MathText markup for mathematical equations. More... | |
void | DrawImage (float p[2], float scale, vtkImageData *image) override |
Draw the supplied image at the given x, y (p[0], p[1]) (bottom corner), scaled by scale (1.0 would match the image). More... | |
void | DrawImage (const vtkRectf &pos, vtkImageData *image) override |
Draw the supplied image at the given position. More... | |
void | SetColor4 (unsigned char color[4]) override |
Set the color for the device using unsigned char of length 4, RGBA. More... | |
void | SetTexture (vtkImageData *image, int properties) override |
Set the texture for the device, it is used to fill the polygons. More... | |
void | SetPointSize (float size) override |
Set the point size for glyphs/sprites. More... | |
void | SetLineWidth (float width) override |
Set the line width. More... | |
void | SetLineType (int type) override |
Set the line type type (using anonymous enum in vtkPen). More... | |
void | SetMatrix (vtkMatrix3x3 *m) override |
Set the model view matrix for the display. More... | |
void | GetMatrix (vtkMatrix3x3 *m) override |
Set the model view matrix for the display. More... | |
void | MultiplyMatrix (vtkMatrix3x3 *m) override |
Multiply the current model view matrix by the supplied one. More... | |
void | PushMatrix () override |
Push the current matrix onto the stack. More... | |
void | PopMatrix () override |
Pop the current matrix off of the stack. More... | |
void | SetClipping (int *x) override |
Supply an int array of length 4 with x1, y1, width, height specifying clipping region for the device in pixels. More... | |
void | EnableClipping (bool enable) override |
Enable or disable the clipping of the scene. More... | |
virtual void | SetEmbedFonts (bool) |
EXPERIMENTAL: If true, the font glyph information will be embedded in the output. More... | |
virtual bool | GetEmbedFonts () |
EXPERIMENTAL: If true, the font glyph information will be embedded in the output. More... | |
virtual void | EmbedFontsOn () |
EXPERIMENTAL: If true, the font glyph information will be embedded in the output. More... | |
virtual void | EmbedFontsOff () |
EXPERIMENTAL: If true, the font glyph information will be embedded in the output. More... | |
virtual void | SetTextAsPath (bool) |
If true, draw all text as path objects rather than text objects. More... | |
virtual bool | GetTextAsPath () |
If true, draw all text as path objects rather than text objects. More... | |
virtual void | TextAsPathOn () |
If true, draw all text as path objects rather than text objects. More... | |
virtual void | TextAsPathOff () |
If true, draw all text as path objects rather than text objects. More... | |
virtual void | SetSubdivisionThreshold (float) |
Set the threshold for subdividing gradient-shaded polygons/line. More... | |
virtual float | GetSubdivisionThreshold () |
Set the threshold for subdividing gradient-shaded polygons/line. More... | |
Public Member Functions inherited from vtkContextDevice2D | |
vtkContextDevice2D * | NewInstance () const |
void | PrintSelf (ostream &os, vtkIndent indent) override |
Methods invoked by print to print information about the object including superclasses. More... | |
virtual bool | MathTextIsSupported () |
Return true if MathText rendering available on this device. More... | |
virtual void | DrawPolyData (float p[2], float scale, vtkPolyData *polyData, vtkUnsignedCharArray *colors, int scalarMode) |
Draw the supplied PolyData at the given x, y (p[0], p[1]) (bottom corner), scaled by scale (1.0 would match the actual dataset). More... | |
virtual void | ApplyPen (vtkPen *pen) |
Apply the supplied pen which controls the outlines of shapes, as well as lines, points and related primitives. More... | |
virtual void | ApplyBrush (vtkBrush *brush) |
Apply the supplied brush which controls the outlines of shapes, as well as lines, points and related primitives. More... | |
virtual void | ApplyTextProp (vtkTextProperty *prop) |
Apply the supplied text property which controls how text is rendered. More... | |
virtual int | GetWidth () |
Get the width of the device in pixels. More... | |
virtual int | GetHeight () |
Get the width of the device in pixels. More... | |
virtual void | DisableClipping () |
Disable clipping of the display. More... | |
virtual bool | GetBufferIdMode () const |
Tell if the device context is in BufferId creation mode. More... | |
virtual void | BufferIdModeBegin (vtkAbstractContextBufferId *bufferId) |
Start BufferId creation Mode. More... | |
virtual void | BufferIdModeEnd () |
Finalize BufferId creation Mode. More... | |
virtual void | SetViewportSize (const vtkVector2i &size) |
virtual vtkVector2i | GetViewportSize () |
virtual void | SetViewportRect (const vtkRecti &rect) |
virtual vtkRecti | GetViewportRect () |
virtual vtkPen * | GetPen () |
Get the pen which controls the outlines of shapes, as well as lines, points and related primitives. More... | |
virtual vtkBrush * | GetBrush () |
Get the pen which controls the outlines of shapes as well as lines, points and related primitives. More... | |
virtual vtkTextProperty * | GetTextProp () |
Get the text properties object for the vtkContext2D. More... | |
Public Member Functions inherited from vtkObject | |
vtkBaseTypeMacro (vtkObject, vtkObjectBase) | |
virtual void | DebugOn () |
Turn debugging output on. More... | |
virtual void | DebugOff () |
Turn debugging output off. More... | |
bool | GetDebug () |
Get the value of the debug flag. More... | |
void | SetDebug (bool debugFlag) |
Set the value of the debug flag. More... | |
virtual void | Modified () |
Update the modification time for this object. More... | |
virtual vtkMTimeType | GetMTime () |
Return this object's modified time. More... | |
void | RemoveObserver (unsigned long tag) |
void | RemoveObservers (unsigned long event) |
void | RemoveObservers (const char *event) |
void | RemoveAllObservers () |
vtkTypeBool | HasObserver (unsigned long event) |
vtkTypeBool | HasObserver (const char *event) |
int | InvokeEvent (unsigned long event) |
int | InvokeEvent (const char *event) |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
vtkCommand * | GetCommand (unsigned long tag) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
void | RemoveObserver (vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
void | RemoveObservers (unsigned long event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
void | RemoveObservers (const char *event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
vtkTypeBool | HasObserver (unsigned long event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
vtkTypeBool | HasObserver (const char *event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More... | |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More... | |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
Allow user to set the AbortFlagOn() with the return value of the callback method. More... | |
int | InvokeEvent (unsigned long event, void *callData) |
This method invokes an event and return whether the event was aborted or not. More... | |
int | InvokeEvent (const char *event, void *callData) |
This method invokes an event and return whether the event was aborted or not. More... | |
Public Member Functions inherited from vtkObjectBase | |
const char * | GetClassName () const |
Return the class name as a string. More... | |
virtual void | Delete () |
Delete a VTK object. More... | |
virtual void | FastDelete () |
Delete a reference to this object. More... | |
void | InitializeObjectBase () |
void | Print (ostream &os) |
Print an object to an ostream. More... | |
virtual void | Register (vtkObjectBase *o) |
Increase the reference count (mark as used by another object). More... | |
virtual void | UnRegister (vtkObjectBase *o) |
Decrease the reference count (release by another object). More... | |
int | GetReferenceCount () |
Return the current reference count of this object. More... | |
void | SetReferenceCount (int) |
Sets the reference count. More... | |
void | PrintRevisions (ostream &) |
Legacy. More... | |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
Methods invoked by print to print information about the object including superclasses. More... | |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
Methods invoked by print to print information about the object including superclasses. More... | |
Static Public Member Functions | |
static vtkSVGContextDevice2D * | New () |
static vtkTypeBool | IsTypeOf (const char *type) |
static vtkSVGContextDevice2D * | SafeDownCast (vtkObjectBase *o) |
Static Public Member Functions inherited from vtkContextDevice2D | |
static vtkTypeBool | IsTypeOf (const char *type) |
static vtkContextDevice2D * | SafeDownCast (vtkObjectBase *o) |
static vtkContextDevice2D * | New () |
Static Public Member Functions inherited from vtkObject | |
static vtkObject * | New () |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More... | |
static void | BreakOnError () |
This method is called when vtkErrorMacro executes. More... | |
static void | SetGlobalWarningDisplay (int val) |
This is a global flag that controls whether any debug, warning or error messages are displayed. More... | |
static void | GlobalWarningDisplayOn () |
This is a global flag that controls whether any debug, warning or error messages are displayed. More... | |
static void | GlobalWarningDisplayOff () |
This is a global flag that controls whether any debug, warning or error messages are displayed. More... | |
static int | GetGlobalWarningDisplay () |
This is a global flag that controls whether any debug, warning or error messages are displayed. More... | |
Static Public Member Functions inherited from vtkObjectBase | |
static vtkTypeBool | IsTypeOf (const char *name) |
Return 1 if this class type is the same type of (or a subclass of) the named class. More... | |
static vtkObjectBase * | New () |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More... | |
Static Protected Member Functions | |
static bool | Transform2DEqual (const double mat3[9], const double mat4[16]) |
static void | Matrix3ToMatrix4 (const double mat3[9], double mat4[16]) |
static void | Matrix4ToMatrix3 (const double mat4[16], double mat3[9]) |
vtkContextDevice2D implementation for use with vtkSVGExporter.
Limitations:
Definition at line 56 of file vtkSVGContextDevice2D.h.
Definition at line 60 of file vtkSVGContextDevice2D.h.
|
protected |
|
overrideprotected |
|
static |
|
static |
|
virtual |
Return 1 if this class is the same type of (or a subclass of) the named class.
Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkContextDevice2D.
|
static |
|
protectedvirtual |
Reimplemented from vtkContextDevice2D.
vtkSVGContextDevice2D* vtkSVGContextDevice2D::NewInstance | ( | ) | const |
|
overridevirtual |
void vtkSVGContextDevice2D::SetSVGContext | ( | vtkXMLDataElement * | context, |
vtkXMLDataElement * | defs | ||
) |
The svg container element to draw into, and the global definitions element.
|
virtual |
EXPERIMENTAL: If true, the font glyph information will be embedded in the output.
Default is false.
|
virtual |
EXPERIMENTAL: If true, the font glyph information will be embedded in the output.
Default is false.
|
virtual |
EXPERIMENTAL: If true, the font glyph information will be embedded in the output.
Default is false.
|
virtual |
EXPERIMENTAL: If true, the font glyph information will be embedded in the output.
Default is false.
|
virtual |
If true, draw all text as path objects rather than text objects.
Enabling this option will:
Note that some text (e.g. MathText) is always rendered as a path.
The default is true, as many browsers and SVG viewers render text objects inconsistently.
|
virtual |
If true, draw all text as path objects rather than text objects.
Enabling this option will:
Note that some text (e.g. MathText) is always rendered as a path.
The default is true, as many browsers and SVG viewers render text objects inconsistently.
|
virtual |
If true, draw all text as path objects rather than text objects.
Enabling this option will:
Note that some text (e.g. MathText) is always rendered as a path.
The default is true, as many browsers and SVG viewers render text objects inconsistently.
|
virtual |
If true, draw all text as path objects rather than text objects.
Enabling this option will:
Note that some text (e.g. MathText) is always rendered as a path.
The default is true, as many browsers and SVG viewers render text objects inconsistently.
|
virtual |
Set the threshold for subdividing gradient-shaded polygons/line.
Default value is 1, and lower values yield higher quality and larger files. Larger values will reduce the number of primitives, but will decrease quality.
A triangle / line will not be subdivided further if all of it's vertices satisfy the equation:
|v1 - v2|^2 < thresh
e.g. the squared norm of the vector between any verts must be greater than the threshold for subdivision to occur.
|
virtual |
Set the threshold for subdividing gradient-shaded polygons/line.
Default value is 1, and lower values yield higher quality and larger files. Larger values will reduce the number of primitives, but will decrease quality.
A triangle / line will not be subdivided further if all of it's vertices satisfy the equation:
|v1 - v2|^2 < thresh
e.g. the squared norm of the vector between any verts must be greater than the threshold for subdivision to occur.
void vtkSVGContextDevice2D::GenerateDefinitions | ( | ) |
Write any definition information (fonts, images, etc) that are accumulated between actors.
|
overridevirtual |
Begin drawing, pass in the viewport to set up the view.
Reimplemented from vtkContextDevice2D.
|
overridevirtual |
End drawing, clean up the view.
Reimplemented from vtkContextDevice2D.
|
overridevirtual |
Draw a poly line using the points - fastest code path due to memory layout of the coordinates.
The line will be colored by the colors array, which must be have nc_comps components (defining a single color).
Implements vtkContextDevice2D.
|
overridevirtual |
Draw lines using the points - memory layout is as follows: l1p1,l1p2,l2p1,l2p2...
The lines will be colored by colors array which has nc_comps components (defining a single color).
Implements vtkContextDevice2D.
|
overridevirtual |
Draw a series of points - fastest code path due to memory layout of the coordinates.
The colors and nc_comps are optional - color array.
Implements vtkContextDevice2D.
|
overridevirtual |
Draw a series of point sprites, images centred at the points supplied.
The supplied vtkImageData is the sprite to be drawn, only squares will be drawn and the size is set using SetPointSize.
colors | is an optional array of colors. |
nc_comps | is the number of components for the color. |
Implements vtkContextDevice2D.
|
overridevirtual |
Draw a series of markers centered at the points supplied.
The shape argument controls the marker shape, and can be one of
colors | is an optional array of colors. |
nc_comps | is the number of components for the color. |
Reimplemented from vtkContextDevice2D.
Draw a quad using the specified number of points.
Reimplemented from vtkContextDevice2D.
Draw a quad using the specified number of points.
Reimplemented from vtkContextDevice2D.
Draw a polygon using the specified number of points.
Reimplemented from vtkContextDevice2D.
|
overridevirtual |
Draw a polygon using the specified number of points.
Reimplemented from vtkContextDevice2D.
|
overridevirtual |
Draw an elliptic wedge with center at x, y, outer radii outRx, outRy, inner radii inRx, inRy between angles startAngle and stopAngle (expressed in degrees).
Implements vtkContextDevice2D.
|
overridevirtual |
Draw an elliptic arc with center at x,y with radii rX and rY between angles startAngle and stopAngle (expressed in degrees).
Implements vtkContextDevice2D.
|
overridevirtual |
Draw some text to the screen.
Implements vtkContextDevice2D.
|
overridevirtual |
Compute the bounds of the supplied string.
The bounds will be copied to the supplied bounds variable, the first two elements are the bottom corner of the string, and the second two elements are the width and height of the bounding box. NOTE: This function does not take account of the text rotation or justification.
Implements vtkContextDevice2D.
|
overridevirtual |
Draw some text to the screen.
Implements vtkContextDevice2D.
|
overridevirtual |
Compute the bounds of the supplied string.
The bounds will be copied to the supplied bounds variable, the first two elements are the bottom corner of the string, and the second two elements are the width and height of the bounding box. NOTE: This function does not take account of the text rotation or justification.
Implements vtkContextDevice2D.
|
overridevirtual |
Compute the bounds of the supplied string while taking into account the justification of the currently applied text property.
Simple rotations (0, 90, 180, 270) are also correctly taken into account.
Implements vtkContextDevice2D.
|
overridevirtual |
Draw text using MathText markup for mathematical equations.
See http://matplotlib.sourceforge.net/users/mathtext.html for more information.
Implements vtkContextDevice2D.
|
overridevirtual |
Draw the supplied image at the given x, y (p[0], p[1]) (bottom corner), scaled by scale (1.0 would match the image).
Implements vtkContextDevice2D.
|
overridevirtual |
Draw the supplied image at the given position.
The origin, width, and height are specified by the supplied vtkRectf variable pos. The image will be drawn scaled to that size.
Implements vtkContextDevice2D.
|
overridevirtual |
Set the color for the device using unsigned char of length 4, RGBA.
Implements vtkContextDevice2D.
|
overridevirtual |
Set the texture for the device, it is used to fill the polygons.
Implements vtkContextDevice2D.
|
overridevirtual |
Set the point size for glyphs/sprites.
Implements vtkContextDevice2D.
|
overridevirtual |
Set the line width.
Implements vtkContextDevice2D.
|
overridevirtual |
Set the line type type (using anonymous enum in vtkPen).
Implements vtkContextDevice2D.
|
overridevirtual |
Set the model view matrix for the display.
Implements vtkContextDevice2D.
|
overridevirtual |
Set the model view matrix for the display.
Implements vtkContextDevice2D.
|
overridevirtual |
Multiply the current model view matrix by the supplied one.
Implements vtkContextDevice2D.
|
overridevirtual |
Push the current matrix onto the stack.
Implements vtkContextDevice2D.
|
overridevirtual |
Pop the current matrix off of the stack.
Implements vtkContextDevice2D.
|
overridevirtual |
Supply an int array of length 4 with x1, y1, width, height specifying clipping region for the device in pixels.
Implements vtkContextDevice2D.
|
overridevirtual |
Enable or disable the clipping of the scene.
Implements vtkContextDevice2D.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
Definition at line 261 of file vtkSVGContextDevice2D.h.
|
protected |
Definition at line 264 of file vtkSVGContextDevice2D.h.
|
protected |
Definition at line 265 of file vtkSVGContextDevice2D.h.
|
protected |
Definition at line 266 of file vtkSVGContextDevice2D.h.
|
protected |
Definition at line 267 of file vtkSVGContextDevice2D.h.
|
protected |
Definition at line 270 of file vtkSVGContextDevice2D.h.
|
protected |
Definition at line 271 of file vtkSVGContextDevice2D.h.
|
protected |
Definition at line 273 of file vtkSVGContextDevice2D.h.
|
protected |
Definition at line 274 of file vtkSVGContextDevice2D.h.
|
protected |
Definition at line 276 of file vtkSVGContextDevice2D.h.
|
protected |
Definition at line 277 of file vtkSVGContextDevice2D.h.
|
protected |
Definition at line 278 of file vtkSVGContextDevice2D.h.
|
protected |
Definition at line 279 of file vtkSVGContextDevice2D.h.
|
protected |
Definition at line 280 of file vtkSVGContextDevice2D.h.
|
protected |
Definition at line 281 of file vtkSVGContextDevice2D.h.