VTK
|
Helper functionality for GL2PS exporting. More...
#include <vtkOpenGLGL2PSHelper.h>
Public Types | |
enum | State { Inactive = 0, Background, Capture } |
Public Member Functions | |
vtkAbstractTypeMacro (vtkOpenGLGL2PSHelper, vtkObject) virtual void PrintSelf(ostream &os | |
virtual void | DrawString (const std::string &str, vtkTextProperty *tprop, double pos[3], double backgroundDepth, vtkRenderer *ren)=0 |
Format the text in str according to tprop and instruct GL2PS to draw it at pixel coordinate pos. More... | |
virtual void | DrawPath (vtkPath *path, double rasterPos[3], double windowPos[2], unsigned char rgba[4], double scale[2]=NULL, double rotateAngle=0.0, float strokeWidth=-1, const char *label=NULL)=0 |
Generate PS, EPS, or SVG markup from a vtkPath object, and then inject it into the output using the gl2psSpecial command. More... | |
virtual void | Draw3DPath (vtkPath *path, vtkMatrix4x4 *actorMatrix, double rasterPos[3], unsigned char actorColor[4], vtkRenderer *ren, const char *label=NULL)=0 |
Transform the path using the actor's matrix and current GL state, then draw it to GL2PS. More... | |
virtual void | DrawImage (vtkImageData *image, double pos[3])=0 |
Draw the image at pos. More... | |
virtual vtkRenderWindow * | GetRenderWindow () |
Get the renderwindow that's being exported. More... | |
virtual State | GetActiveState () |
Get the current export state. More... | |
virtual void | SetPointSize (float) |
Set/Get the current point size. More... | |
virtual float | GetPointSize () |
Set/Get the current point size. More... | |
virtual void | SetLineWidth (float) |
Set/Get the current line width. More... | |
virtual float | GetLineWidth () |
Set/Get the current line width. More... | |
virtual void | SetLineStipple (unsigned short) |
Set/Get the current line stipple pattern per OpenGL convention. More... | |
virtual unsigned short | GetLineStipple () |
Set/Get the current line stipple pattern per OpenGL convention. More... | |
virtual void | ProcessTransformFeedback (vtkTransformFeedback *tfc, vtkRenderer *ren, vtkActor *act)=0 |
Parse the vertex information in tfc and inject primitives into GL2PS. More... | |
virtual void | ProcessTransformFeedback (vtkTransformFeedback *tfc, vtkRenderer *ren, unsigned char col[4])=0 |
Parse the vertex information in tfc and inject primitives into GL2PS. More... | |
virtual void | ProcessTransformFeedback (vtkTransformFeedback *tfc, vtkRenderer *ren, float col[4])=0 |
Parse the vertex information in tfc and inject primitives into GL2PS. More... | |
![]() | |
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 | PrintSelf (ostream &os, vtkIndent indent) override |
Methods invoked by print to print information about the object including superclasses. More... | |
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) |
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... | |
int | HasObserver (unsigned long event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
int | 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... | |
![]() | |
const char * | GetClassName () const |
Return the class name as a string. More... | |
virtual vtkTypeBool | IsA (const char *name) |
Return 1 if this class is the same type of (or a subclass of) the named class. 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 void | DisableStipple () |
Call alongside glDisable(GL_LINE_STIPPLE) to inform GL2PS of the change. More... | |
static vtkOpenGLGL2PSHelper * | New () |
static void | SetLineWidth (float lineWidth) |
Call alongside glLineWidth(lineWidth) to inform GL2PS of the change. More... | |
static void | SetPointSize (float pointSize) |
Call alongside glPointSize(pointSize) to inform GL2PS of the change. More... | |
static void | EnableStipple () |
Call alongside glEnable(GL_LINE_STIPPLE) to inform GL2PS of the change. More... | |
static vtkOpenGLGL2PSHelper * | GetInstance () |
The global instance. More... | |
static void | SetInstance (vtkOpenGLGL2PSHelper *) |
The global instance. More... | |
![]() | |
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 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... | |
Public Attributes | |
vtkIndent | indent |
Protected Member Functions | |
vtkOpenGLGL2PSHelper () | |
~vtkOpenGLGL2PSHelper () | |
virtual void | SetActiveState (State) |
virtual void | SetTextAsPath (bool) |
virtual void | SetRenderWindow (vtkRenderWindow *) |
virtual void | SetPointSizeFactor (float) |
virtual void | SetLineWidthFactor (float) |
![]() | |
vtkObject () | |
~vtkObject () override | |
void | RegisterInternal (vtkObjectBase *, vtkTypeBool check) override |
void | UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) override |
void | InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL) |
These methods allow a command to exclusively grab all events. More... | |
void | InternalReleaseFocus () |
These methods allow a command to exclusively grab all events. More... | |
![]() | |
vtkObjectBase () | |
virtual | ~vtkObjectBase () |
virtual void | CollectRevisions (ostream &) |
virtual void | ReportReferences (vtkGarbageCollector *) |
vtkObjectBase (const vtkObjectBase &) | |
void | operator= (const vtkObjectBase &) |
Protected Attributes | |
vtkRenderWindow * | RenderWindow |
State | ActiveState |
bool | TextAsPath |
float | PointSize |
float | LineWidth |
float | PointSizeFactor |
float | LineWidthFactor |
unsigned short | LineStipple |
![]() | |
bool | Debug |
vtkTimeStamp | MTime |
vtkSubjectHelper * | SubjectHelper |
![]() | |
vtkAtomicInt32 | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
Static Protected Attributes | |
static bool | InGL2PSRender |
static GLfloat | PointSizeFactor |
static GLfloat | LineWidthFactor |
static GLfloat | PointSizeToken |
static GLfloat | LineWidthToken |
static GLfloat | StippleBeginToken |
static GLfloat | StippleEndToken |
static vtkOpenGLGL2PSHelper * | Instance |
Friends | |
class | vtkGL2PSUtilities |
class | vtkOpenGLGL2PSExporter |
Helper functionality for GL2PS exporting.
Access GL2PS functionality.
vtkOpenGLGL2PSHelper provides a number of static variables and methods that are used during GL2PS exporting. The rational behind this class is that GL does not include all of the information that GL2PS needs into its feedback buffer, and in certain situations GL2PS function calls need to be made alongside their GL equivalents, notably glLineWidth and glPointSize.
The static variables in this class are set by vtkGL2PSUtilities at the beginning of a GL2PS export render. This class fakes GL2PS calls like gl2psLineWidth in order to keep GL2PS from being a module dependency for vtkRenderingOpenGL.
This class provides convenience functions that can be used to draw into a GL2PS context. Link to vtkRenderingGL2PSOpenGL2 to bring in the vtkOpenGLGL2PSHelperImpl class, the object factory override that implements this interface.
Definition at line 39 of file vtkOpenGLGL2PSHelper.h.
Enumerator | |
---|---|
Inactive | |
Background |
No export active. |
Capture |
Rendering rasterized props for the background. Capturing vectorized objects. |
Definition at line 64 of file vtkOpenGLGL2PSHelper.h.
|
protected |
|
protected |
|
inlinestatic |
Call alongside glLineWidth(lineWidth) to inform GL2PS of the change.
Definition at line 47 of file vtkOpenGLGL2PSHelper.h.
|
inlinestatic |
Call alongside glPointSize(pointSize) to inform GL2PS of the change.
Definition at line 61 of file vtkOpenGLGL2PSHelper.h.
|
inlinestatic |
Call alongside glEnable(GL_LINE_STIPPLE) to inform GL2PS of the change.
This must be called after calling glLineStipple(factor, pattern).
Definition at line 76 of file vtkOpenGLGL2PSHelper.h.
|
inlinestatic |
Call alongside glDisable(GL_LINE_STIPPLE) to inform GL2PS of the change.
Definition at line 93 of file vtkOpenGLGL2PSHelper.h.
|
static |
vtkOpenGLGL2PSHelper::vtkAbstractTypeMacro | ( | vtkOpenGLGL2PSHelper | , |
vtkObject | |||
) |
|
static |
The global instance.
Only set during export.
|
static |
The global instance.
Only set during export.
|
virtual |
Get the renderwindow that's being exported.
|
virtual |
Get the current export state.
Vector images are rendered in two passes: First, all non-vectorizable props are rendered, and the resulting image is inserted as a raster image into the background of the exported file (ActiveState == Background). Next, all vectorizable props are drawn and captured into GL2PS, where they are drawn over the background image. Vectorizable props should not draw themselves during the background pass, and use the vtkOpenGLGL2PSHelper API to draw themselves during the capture pass.
|
virtual |
Set/Get the current point size.
|
virtual |
Set/Get the current point size.
|
virtual |
Set/Get the current line width.
|
virtual |
Set/Get the current line width.
|
virtual |
Set/Get the current line stipple pattern per OpenGL convention.
Default is 0xffff.
|
virtual |
Set/Get the current line stipple pattern per OpenGL convention.
Default is 0xffff.
|
pure virtual |
Parse the vertex information in tfc and inject primitives into GL2PS.
ren is used to obtain viewport information to complete the vertex tranformation into pixel coordinates, and act/col are used to color the vertices when tfc does not contain color information.
Implemented in vtkOpenGLGL2PSHelperImpl.
|
pure virtual |
Parse the vertex information in tfc and inject primitives into GL2PS.
ren is used to obtain viewport information to complete the vertex tranformation into pixel coordinates, and act/col are used to color the vertices when tfc does not contain color information.
Implemented in vtkOpenGLGL2PSHelperImpl.
|
pure virtual |
Parse the vertex information in tfc and inject primitives into GL2PS.
ren is used to obtain viewport information to complete the vertex tranformation into pixel coordinates, and act/col are used to color the vertices when tfc does not contain color information.
Implemented in vtkOpenGLGL2PSHelperImpl.
|
pure virtual |
Format the text in str according to tprop and instruct GL2PS to draw it at pixel coordinate pos.
Background depth is the z value for the background quad, and should be in NDC space. The drawing is always done in the overlay plane.
Implemented in vtkOpenGLGL2PSHelperImpl.
|
pure virtual |
Generate PS, EPS, or SVG markup from a vtkPath object, and then inject it into the output using the gl2psSpecial command.
The path is translated uniformly in the scene by windowPos. It is scaled by scale and rotated counter-clockwise by rotateAngle. The rasterPos is in world coordinates and determines clipping and depth. If scale is NULL, no scaling is done. If strokeWidth is positive, the path will be stroked with the indicated width. If zero or negative, the path will be filled (default). The label string is inserted into the GL2PS output at the beginning of the path specification as a comment on supported backends.
Implemented in vtkOpenGLGL2PSHelperImpl.
|
pure virtual |
Transform the path using the actor's matrix and current GL state, then draw it to GL2PS.
The label string is inserted into the GL2PS output at the beginning of the path specification as a comment on supported backends.
Implemented in vtkOpenGLGL2PSHelperImpl.
|
pure virtual |
Draw the image at pos.
Image must be RGB or RGBA with float scalars.
Implemented in vtkOpenGLGL2PSHelperImpl.
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
friend |
Definition at line 103 of file vtkOpenGLGL2PSHelper.h.
|
friend |
Definition at line 170 of file vtkOpenGLGL2PSHelper.h.
|
staticprotected |
Definition at line 105 of file vtkOpenGLGL2PSHelper.h.
|
staticprotected |
Definition at line 106 of file vtkOpenGLGL2PSHelper.h.
|
staticprotected |
Definition at line 107 of file vtkOpenGLGL2PSHelper.h.
|
staticprotected |
Definition at line 108 of file vtkOpenGLGL2PSHelper.h.
|
staticprotected |
Definition at line 109 of file vtkOpenGLGL2PSHelper.h.
|
staticprotected |
Definition at line 110 of file vtkOpenGLGL2PSHelper.h.
|
staticprotected |
Definition at line 111 of file vtkOpenGLGL2PSHelper.h.
vtkIndent vtkOpenGLGL2PSHelper::indent |
Definition at line 47 of file vtkOpenGLGL2PSHelper.h.
|
staticprotected |
Definition at line 181 of file vtkOpenGLGL2PSHelper.h.
|
protected |
Definition at line 183 of file vtkOpenGLGL2PSHelper.h.
|
protected |
Definition at line 184 of file vtkOpenGLGL2PSHelper.h.
|
protected |
Definition at line 185 of file vtkOpenGLGL2PSHelper.h.
|
protected |
Definition at line 186 of file vtkOpenGLGL2PSHelper.h.
|
protected |
Definition at line 187 of file vtkOpenGLGL2PSHelper.h.
|
protected |
Definition at line 188 of file vtkOpenGLGL2PSHelper.h.
|
protected |
Definition at line 189 of file vtkOpenGLGL2PSHelper.h.
|
protected |
Definition at line 190 of file vtkOpenGLGL2PSHelper.h.