VTK
|
Abstract class for drawing 2D primitives. More...
#include <vtkContextDevice2D.h>
Public Types | |
enum | TextureProperty { Nearest = 0x01, Linear = 0x02, Stretch = 0x04, Repeat = 0x08 } |
typedef vtkObject | Superclass |
Public Types inherited from vtkObject | |
typedef vtkObjectBase | Superclass |
Public Member Functions | |
virtual int | IsA (const char *type) |
vtkContextDevice2D * | NewInstance () const |
virtual void | PrintSelf (ostream &os, vtkIndent indent) |
virtual void | DrawQuad (float *, int) |
virtual void | DrawQuadStrip (float *, int) |
virtual void | DrawPolygon (float *, int) |
virtual void | DrawString (float *point, const vtkStdString &string)=0 |
virtual void | DrawString (float *point, const vtkUnicodeString &string)=0 |
virtual void | DrawMathTextString (float *point, const vtkStdString &string)=0 |
virtual bool | MathTextIsSupported () |
virtual void | DrawImage (float p[2], float scale, vtkImageData *image)=0 |
virtual void | DrawImage (const vtkRectf &pos, vtkImageData *image)=0 |
void | ApplyPen (vtkPen *pen) |
void | ApplyBrush (vtkBrush *brush) |
void | ApplyTextProp (vtkTextProperty *prop) |
virtual void | SetColor4 (unsigned char color[4])=0 |
virtual void | SetTexture (vtkImageData *image, int properties)=0 |
virtual void | SetPointSize (float size)=0 |
virtual void | SetLineWidth (float width)=0 |
virtual void | SetLineType (int type)=0 |
virtual int | GetWidth () |
virtual int | GetHeight () |
virtual void | SetMatrix (vtkMatrix3x3 *m)=0 |
virtual void | GetMatrix (vtkMatrix3x3 *m)=0 |
virtual void | MultiplyMatrix (vtkMatrix3x3 *m)=0 |
virtual void | PushMatrix ()=0 |
virtual void | PopMatrix ()=0 |
virtual void | SetClipping (int *x)=0 |
virtual void | DisableClipping () |
virtual void | EnableClipping (bool enable)=0 |
virtual void | Begin (vtkViewport *) |
virtual void | End () |
virtual bool | GetBufferIdMode () const |
virtual void | BufferIdModeEnd () |
virtual void | SetViewportSize (const vtkVector2i &size) |
virtual void | SetViewportRect (const vtkRecti &rect) |
virtual void | DrawPoly (float *points, int n, unsigned char *colors=0, int nc_comps=0)=0 |
virtual void | DrawLines (float *f, int n, unsigned char *colors=0, int nc_comps=0)=0 |
virtual void | DrawPoints (float *points, int n, unsigned char *colors=0, int nc_comps=0)=0 |
virtual void | DrawPointSprites (vtkImageData *sprite, float *points, int n, unsigned char *colors=0, int nc_comps=0)=0 |
virtual void | DrawMarkers (int shape, bool highlight, float *points, int n, unsigned char *colors=0, int nc_comps=0) |
virtual void | DrawEllipseWedge (float x, float y, float outRx, float outRy, float inRx, float inRy, float startAngle, float stopAngle)=0 |
virtual void | DrawEllipticArc (float x, float y, float rX, float rY, float startAngle, float stopAngle)=0 |
virtual void | ComputeStringBounds (const vtkStdString &string, float bounds[4])=0 |
virtual void | ComputeStringBounds (const vtkUnicodeString &string, float bounds[4])=0 |
virtual vtkPen * | GetPen () |
virtual vtkBrush * | GetBrush () |
virtual vtkTextProperty * | GetTextProp () |
virtual void | BufferIdModeBegin (vtkAbstractContextBufferId *bufferId) |
Public Member Functions inherited from vtkObject | |
vtkObject * | NewInstance () const |
virtual void | DebugOn () |
virtual void | DebugOff () |
bool | GetDebug () |
void | SetDebug (bool debugFlag) |
virtual void | Modified () |
virtual unsigned long | GetMTime () |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
vtkCommand * | GetCommand (unsigned long tag) |
void | RemoveObserver (vtkCommand *) |
void | RemoveObservers (unsigned long event, vtkCommand *) |
void | RemoveObservers (const char *event, vtkCommand *) |
int | HasObserver (unsigned long event, vtkCommand *) |
int | HasObserver (const char *event, vtkCommand *) |
void | RemoveObserver (unsigned long tag) |
void | RemoveObservers (unsigned long event) |
void | RemoveObservers (const char *event) |
void | RemoveAllObservers () |
int | HasObserver (unsigned long event) |
int | HasObserver (const char *event) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
int | InvokeEvent (unsigned long event, void *callData) |
int | InvokeEvent (const char *event, void *callData) |
int | InvokeEvent (unsigned long event) |
int | InvokeEvent (const char *event) |
Public Member Functions inherited from vtkObjectBase | |
const char * | GetClassName () const |
virtual void | Delete () |
virtual void | FastDelete () |
void | Print (ostream &os) |
virtual void | Register (vtkObjectBase *o) |
virtual void | UnRegister (vtkObjectBase *o) |
void | SetReferenceCount (int) |
void | PrintRevisions (ostream &) |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
int | GetReferenceCount () |
Static Public Member Functions | |
static int | IsTypeOf (const char *type) |
static vtkContextDevice2D * | SafeDownCast (vtkObjectBase *o) |
static vtkContextDevice2D * | New () |
Static Public Member Functions inherited from vtkObject | |
static int | IsTypeOf (const char *type) |
static vtkObject * | SafeDownCast (vtkObjectBase *o) |
static vtkObject * | New () |
static void | BreakOnError () |
static void | SetGlobalWarningDisplay (int val) |
static void | GlobalWarningDisplayOn () |
static void | GlobalWarningDisplayOff () |
static int | GetGlobalWarningDisplay () |
Static Public Member Functions inherited from vtkObjectBase | |
static int | IsTypeOf (const char *name) |
static vtkObjectBase * | New () |
Protected Member Functions | |
virtual vtkObjectBase * | NewInstanceInternal () const |
vtkContextDevice2D () | |
~vtkContextDevice2D () | |
Protected Member Functions inherited from vtkObject | |
vtkObject () | |
virtual | ~vtkObject () |
virtual void | RegisterInternal (vtkObjectBase *, int check) |
virtual void | UnRegisterInternal (vtkObjectBase *, int check) |
void | InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL) |
void | InternalReleaseFocus () |
Protected Member Functions inherited from vtkObjectBase | |
vtkObjectBase () | |
virtual | ~vtkObjectBase () |
virtual void | CollectRevisions (ostream &) |
virtual void | ReportReferences (vtkGarbageCollector *) |
vtkObjectBase (const vtkObjectBase &) | |
void | operator= (const vtkObjectBase &) |
Protected Attributes | |
int | Geometry [2] |
vtkVector2i | ViewportSize |
vtkRecti | ViewportRect |
vtkAbstractContextBufferId * | BufferId |
vtkPen * | Pen |
vtkBrush * | Brush |
vtkTextProperty * | TextProp |
Protected Attributes inherited from vtkObject | |
bool | Debug |
vtkTimeStamp | MTime |
vtkSubjectHelper * | SubjectHelper |
Protected Attributes inherited from vtkObjectBase | |
vtkAtomicInt32 | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
Abstract class for drawing 2D primitives.
This defines the interface for a vtkContextDevice2D. In this sense a ContextDevice is a class used to paint 2D primitives onto a device, such as an OpenGL context or a QGraphicsView.
Definition at line 47 of file vtkContextDevice2D.h.
Definition at line 50 of file vtkContextDevice2D.h.
Enumerator | |
---|---|
Nearest | |
Linear | |
Stretch | |
Repeat |
Definition at line 211 of file vtkContextDevice2D.h.
|
protected |
|
protected |
|
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 vtkObject.
Reimplemented in vtkOpenGLContextDevice2D, vtkOpenGLContextDevice2D, vtkOpenGL2ContextDevice2D, and vtkGL2PSContextDevice2D.
|
static |
|
protectedvirtual |
Reimplemented from vtkObject.
Reimplemented in vtkOpenGLContextDevice2D, vtkOpenGLContextDevice2D, vtkOpenGL2ContextDevice2D, and vtkGL2PSContextDevice2D.
vtkContextDevice2D* vtkContextDevice2D::NewInstance | ( | ) | const |
|
virtual |
Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from vtkObject.
Reimplemented in vtkOpenGLContextDevice2D, vtkOpenGLContextDevice2D, vtkOpenGL2ContextDevice2D, and vtkGL2PSContextDevice2D.
|
static |
|
pure virtual |
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).
Implemented in vtkOpenGLContextDevice2D, vtkOpenGLContextDevice2D, and vtkGL2PSContextDevice2D.
|
pure virtual |
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).
Implemented in vtkOpenGLContextDevice2D, and vtkOpenGLContextDevice2D.
|
pure virtual |
Draw a series of points - fastest code path due to memory layout of the coordinates. The colors and nc_comps are optional - color array.
Implemented in vtkOpenGLContextDevice2D, vtkOpenGLContextDevice2D, and vtkGL2PSContextDevice2D.
|
pure virtual |
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. |
Implemented in vtkOpenGLContextDevice2D, vtkOpenGLContextDevice2D, vtkGL2PSContextDevice2D, and vtkOpenGL2ContextDevice2D.
|
virtual |
Draw a series of markers centered at the points supplied. The shape argument controls the marker shape, and can be one of - VTK_MARKER_CROSS - VTK_MARKER_PLUS - VTK_MARKER_SQUARE - VTK_MARKER_CIRCLE - VTK_MARKER_DIAMOND
colors | is an optional array of colors. |
nc_comps | is the number of components for the color. |
Reimplemented in vtkGL2PSContextDevice2D, vtkOpenGLContextDevice2D, and vtkOpenGLContextDevice2D.
Draw a quad using the specified number of points.
Reimplemented in vtkOpenGLContextDevice2D, vtkOpenGLContextDevice2D, and vtkGL2PSContextDevice2D.
Definition at line 102 of file vtkContextDevice2D.h.
Draw a quad using the specified number of points.
Reimplemented in vtkOpenGLContextDevice2D, vtkOpenGLContextDevice2D, and vtkGL2PSContextDevice2D.
Definition at line 105 of file vtkContextDevice2D.h.
Draw a polygon using the specified number of points.
Reimplemented in vtkOpenGLContextDevice2D, vtkOpenGLContextDevice2D, and vtkGL2PSContextDevice2D.
Definition at line 108 of file vtkContextDevice2D.h.
|
pure virtual |
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).
Implemented in vtkOpenGLContextDevice2D, vtkOpenGLContextDevice2D, and vtkGL2PSContextDevice2D.
|
pure virtual |
Draw an elliptic arc with center at x,y with radii rX and rY between angles startAngle and stopAngle (expressed in degrees).
Implemented in vtkOpenGLContextDevice2D, vtkOpenGLContextDevice2D, and vtkGL2PSContextDevice2D.
|
pure virtual |
Draw some text to the screen.
Implemented in vtkOpenGLContextDevice2D, vtkOpenGLContextDevice2D, and vtkGL2PSContextDevice2D.
|
pure virtual |
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.
Implemented in vtkOpenGLContextDevice2D, and vtkOpenGLContextDevice2D.
|
pure virtual |
Draw some text to the screen.
Implemented in vtkOpenGLContextDevice2D, vtkOpenGLContextDevice2D, and vtkGL2PSContextDevice2D.
|
pure virtual |
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.
Implemented in vtkOpenGLContextDevice2D, and vtkOpenGLContextDevice2D.
|
pure virtual |
Draw text using MathText markup for mathematical equations. See http://matplotlib.sourceforge.net/users/mathtext.html for more information.
|
virtual |
Return true if MathText rendering available on this device.
|
pure virtual |
Draw the supplied image at the given x, y (p[0], p[1]) (bottom corner), scaled by scale (1.0 would match the image).
Implemented in vtkOpenGLContextDevice2D, vtkOpenGLContextDevice2D, and vtkOpenGL2ContextDevice2D.
|
pure virtual |
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.
Implemented in vtkOpenGLContextDevice2D, vtkOpenGLContextDevice2D, and vtkOpenGL2ContextDevice2D.
void vtkContextDevice2D::ApplyPen | ( | vtkPen * | pen | ) |
Apply the supplied pen which controls the outlines of shapes, as well as lines, points and related primitives. This makes a deep copy of the vtkPen object in the vtkContext2D, it does not hold a pointer to the supplied object.
|
virtual |
Get the pen which controls the outlines of shapes, as well as lines, points and related primitives. This object can be modified and the changes will be reflected in subsequent drawing operations.
void vtkContextDevice2D::ApplyBrush | ( | vtkBrush * | brush | ) |
Apply the supplied brush which controls the outlines of shapes, as well as lines, points and related primitives. This makes a deep copy of the vtkBrush object in the vtkContext2D, it does not hold a pointer to the supplied object.
|
virtual |
Get the pen which controls the outlines of shapes as well as lines, points and related primitives.
void vtkContextDevice2D::ApplyTextProp | ( | vtkTextProperty * | prop | ) |
Apply the supplied text property which controls how text is rendered. This makes a deep copy of the vtkTextProperty object in the vtkContext2D, it does not hold a pointer to the supplied object.
|
virtual |
Get the text properties object for the vtkContext2D.
|
pure virtual |
Set the color for the device using unsigned char of length 4, RGBA.
Implemented in vtkOpenGLContextDevice2D, and vtkOpenGLContextDevice2D.
|
pure virtual |
Set the texture for the device, it is used to fill the polygons
Implemented in vtkOpenGLContextDevice2D, and vtkOpenGLContextDevice2D.
|
pure virtual |
Set the point size for glyphs/sprites.
Implemented in vtkOpenGLContextDevice2D, vtkOpenGLContextDevice2D, and vtkGL2PSContextDevice2D.
|
pure virtual |
Set the line width.
Implemented in vtkOpenGLContextDevice2D, vtkOpenGLContextDevice2D, and vtkGL2PSContextDevice2D.
|
pure virtual |
Set the line type type (using anonymous enum in vtkPen).
Implemented in vtkOpenGLContextDevice2D, vtkOpenGLContextDevice2D, and vtkGL2PSContextDevice2D.
|
inlinevirtual |
Get the width of the device in pixels.
Definition at line 230 of file vtkContextDevice2D.h.
|
inlinevirtual |
Get the width of the device in pixels.
Definition at line 233 of file vtkContextDevice2D.h.
|
pure virtual |
Set the model view matrix for the display
Implemented in vtkOpenGLContextDevice2D, and vtkOpenGLContextDevice2D.
|
pure virtual |
Set the model view matrix for the display
Implemented in vtkOpenGLContextDevice2D, and vtkOpenGLContextDevice2D.
|
pure virtual |
Multiply the current model view matrix by the supplied one
Implemented in vtkOpenGLContextDevice2D, and vtkOpenGLContextDevice2D.
|
pure virtual |
Push the current matrix onto the stack.
Implemented in vtkOpenGLContextDevice2D, and vtkOpenGLContextDevice2D.
|
pure virtual |
Pop the current matrix off of the stack.
Implemented in vtkOpenGLContextDevice2D, and vtkOpenGLContextDevice2D.
|
pure virtual |
Supply a float array of length 4 with x1, y1, width, height specifying clipping region for the device in pixels.
Implemented in vtkOpenGLContextDevice2D, and vtkOpenGLContextDevice2D.
|
inlinevirtual |
Disable clipping of the display. Remove in a future release - retained for API compatibility.
Definition at line 256 of file vtkContextDevice2D.h.
|
pure virtual |
Enable or disable the clipping of the scene.
Implemented in vtkOpenGLContextDevice2D, and vtkOpenGLContextDevice2D.
|
inlinevirtual |
Begin drawing, pass in the viewport to set up the view.
Reimplemented in vtkOpenGLContextDevice2D, and vtkOpenGLContextDevice2D.
Definition at line 262 of file vtkContextDevice2D.h.
|
inlinevirtual |
End drawing, clean up the view.
Reimplemented in vtkOpenGLContextDevice2D, and vtkOpenGLContextDevice2D.
Definition at line 265 of file vtkContextDevice2D.h.
|
virtual |
Tell if the device context is in BufferId creation mode. Initial value is false.
|
virtual |
Start BufferId creation Mode. The default implementation is empty.
Reimplemented in vtkOpenGLContextDevice2D, and vtkOpenGLContextDevice2D.
|
virtual |
Finalize BufferId creation Mode. It makes sure that the content of the bufferId passed in argument of BufferIdModeBegin() is correctly set. The default implementation is empty.
Reimplemented in vtkOpenGLContextDevice2D, and vtkOpenGLContextDevice2D.
|
inlinevirtual |
Definition at line 285 of file vtkContextDevice2D.h.
|
inlinevirtual |
Definition at line 290 of file vtkContextDevice2D.h.
|
protected |
Store the width and height of the device in pixels.
Definition at line 301 of file vtkContextDevice2D.h.
|
protected |
Store the size of the total viewport.
Definition at line 304 of file vtkContextDevice2D.h.
|
protected |
Store our origin and size in the total viewport.
Definition at line 307 of file vtkContextDevice2D.h.
|
protected |
Definition at line 309 of file vtkContextDevice2D.h.
|
protected |
Definition at line 311 of file vtkContextDevice2D.h.
|
protected |
Definition at line 312 of file vtkContextDevice2D.h.
|
protected |
Definition at line 313 of file vtkContextDevice2D.h.