VTK  9.0.20201023
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
vtkOpenGLGL2PSHelper Class Referenceabstract

Access GL2PS functionality. More...

#include <vtkOpenGLGL2PSHelper.h>

Inheritance diagram for vtkOpenGLGL2PSHelper:
[legend]
Collaboration diagram for vtkOpenGLGL2PSHelper:
[legend]

Public Types

enum  State { Inactive = 0, Background, Capture }
 

Public Member Functions

 vtkAbstractTypeMacro (vtkOpenGLGL2PSHelper, vtkObject)
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses. More...
 
virtual vtkRenderWindowGetRenderWindow ()
 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 ()
 
virtual void SetLineWidth (float)
 Set/Get the current line width. More...
 
virtual float GetLineWidth ()
 
virtual void SetLineStipple (unsigned short)
 Set/Get the current line stipple pattern per OpenGL convention. More...
 
virtual unsigned short GetLineStipple ()
 
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
 
virtual void ProcessTransformFeedback (vtkTransformFeedback *tfc, vtkRenderer *ren, float col[4])=0
 
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]=nullptr, double rotateAngle=0.0, float strokeWidth=-1, const char *label=nullptr)=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=nullptr)=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...
 
- 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...
 
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)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
vtkTypeBool HasObserver (unsigned long event, vtkCommand *)
 
vtkTypeBool HasObserver (const char *event, vtkCommand *)
 
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)
 
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)
 
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)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
- Public Member Functions inherited from vtkObjectBase
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 vtkIdType GetNumberOfGenerationsFromBase (const char *name)
 Given the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and 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 PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
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...
 
bool GetIsInMemkind () const
 A local state flag that remembers whether this object lives in the normal or extended memory space. More...
 

Static Public Member Functions

static vtkOpenGLGL2PSHelperNew ()
 
static vtkOpenGLGL2PSHelperGetInstance ()
 The global instance. More...
 
static void SetInstance (vtkOpenGLGL2PSHelper *)
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 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 ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- 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 vtkIdType GetNumberOfGenerationsFromBaseType (const char *name)
 Given a the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class). More...
 
static vtkObjectBaseNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 
static void SetMemkindDirectory (const char *directoryname)
 The name of a directory, ideally mounted -o dax, to memory map an extended memory space within. More...
 
static bool GetUsingMemkind ()
 A global state flag that controls whether vtkObjects are constructed in the usual way (the default) or within the extended memory space. More...
 

Protected Member Functions

 vtkOpenGLGL2PSHelper ()
 
 ~vtkOpenGLGL2PSHelper () override
 
virtual void SetActiveState (State)
 
virtual void SetTextAsPath (bool)
 
virtual void SetRenderWindow (vtkRenderWindow *)
 
virtual void SetPointSizeFactor (float)
 
virtual void SetLineWidthFactor (float)
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
 ~vtkObject () override
 
void RegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr)
 These methods allow a command to exclusively grab all events. More...
 
void InternalReleaseFocus ()
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

vtkRenderWindowRenderWindow
 
State ActiveState
 
bool TextAsPath
 
float PointSize
 
float LineWidth
 
float PointSizeFactor
 
float LineWidthFactor
 
unsigned short LineStipple
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
std::atomic< int32_t > ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Static Protected Attributes

static vtkOpenGLGL2PSHelperInstance
 

Friends

class vtkOpenGLGL2PSExporter
 

Additional Inherited Members

- Static Protected Member Functions inherited from vtkObjectBase
static vtkMallocingFunction GetCurrentMallocFunction ()
 
static vtkReallocingFunction GetCurrentReallocFunction ()
 
static vtkFreeingFunction GetCurrentFreeFunction ()
 
static vtkFreeingFunction GetAlternateFreeFunction ()
 

Detailed Description

Access GL2PS functionality.

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 43 of file vtkOpenGLGL2PSHelper.h.

Member Enumeration Documentation

◆ State

Enumerator
Inactive 
Background 

No export active.

Capture 

Rendering rasterized props for the background.

Capturing vectorized objects.

Definition at line 65 of file vtkOpenGLGL2PSHelper.h.

Constructor & Destructor Documentation

◆ vtkOpenGLGL2PSHelper()

vtkOpenGLGL2PSHelper::vtkOpenGLGL2PSHelper ( )
protected

◆ ~vtkOpenGLGL2PSHelper()

vtkOpenGLGL2PSHelper::~vtkOpenGLGL2PSHelper ( )
overrideprotected

Member Function Documentation

◆ New()

static vtkOpenGLGL2PSHelper* vtkOpenGLGL2PSHelper::New ( )
static

◆ vtkAbstractTypeMacro()

vtkOpenGLGL2PSHelper::vtkAbstractTypeMacro ( vtkOpenGLGL2PSHelper  ,
vtkObject   
)

◆ PrintSelf()

void vtkOpenGLGL2PSHelper::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
overridevirtual

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.

◆ GetInstance()

static vtkOpenGLGL2PSHelper* vtkOpenGLGL2PSHelper::GetInstance ( )
static

The global instance.

Only set during export.

◆ SetInstance()

static void vtkOpenGLGL2PSHelper::SetInstance ( vtkOpenGLGL2PSHelper )
static

◆ GetRenderWindow()

virtual vtkRenderWindow* vtkOpenGLGL2PSHelper::GetRenderWindow ( )
virtual

Get the renderwindow that's being exported.

◆ GetActiveState()

virtual State vtkOpenGLGL2PSHelper::GetActiveState ( )
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.

◆ SetPointSize()

virtual void vtkOpenGLGL2PSHelper::SetPointSize ( float  )
virtual

Set/Get the current point size.

◆ GetPointSize()

virtual float vtkOpenGLGL2PSHelper::GetPointSize ( )
virtual

◆ SetLineWidth()

virtual void vtkOpenGLGL2PSHelper::SetLineWidth ( float  )
virtual

Set/Get the current line width.

◆ GetLineWidth()

virtual float vtkOpenGLGL2PSHelper::GetLineWidth ( )
virtual

◆ SetLineStipple()

virtual void vtkOpenGLGL2PSHelper::SetLineStipple ( unsigned short  )
virtual

Set/Get the current line stipple pattern per OpenGL convention.

Default is 0xffff.

◆ GetLineStipple()

virtual unsigned short vtkOpenGLGL2PSHelper::GetLineStipple ( )
virtual

◆ ProcessTransformFeedback() [1/3]

virtual void vtkOpenGLGL2PSHelper::ProcessTransformFeedback ( vtkTransformFeedback tfc,
vtkRenderer ren,
vtkActor act 
)
pure virtual

Parse the vertex information in tfc and inject primitives into GL2PS.

ren is used to obtain viewport information to complete the vertex transformation into pixel coordinates, and act/col are used to color the vertices when tfc does not contain color information.

Implemented in vtkOpenGLGL2PSHelperImpl.

◆ ProcessTransformFeedback() [2/3]

virtual void vtkOpenGLGL2PSHelper::ProcessTransformFeedback ( vtkTransformFeedback tfc,
vtkRenderer ren,
unsigned char  col[4] 
)
pure virtual

Implemented in vtkOpenGLGL2PSHelperImpl.

◆ ProcessTransformFeedback() [3/3]

virtual void vtkOpenGLGL2PSHelper::ProcessTransformFeedback ( vtkTransformFeedback tfc,
vtkRenderer ren,
float  col[4] 
)
pure virtual

Implemented in vtkOpenGLGL2PSHelperImpl.

◆ DrawString()

virtual void vtkOpenGLGL2PSHelper::DrawString ( const std::string &  str,
vtkTextProperty tprop,
double  pos[3],
double  backgroundDepth,
vtkRenderer ren 
)
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.

See also
TextAsPath

Implemented in vtkOpenGLGL2PSHelperImpl.

◆ DrawPath()

virtual void vtkOpenGLGL2PSHelper::DrawPath ( vtkPath path,
double  rasterPos[3],
double  windowPos[2],
unsigned char  rgba[4],
double  scale[2] = nullptr,
double  rotateAngle = 0.0,
float  strokeWidth = -1,
const char *  label = nullptr 
)
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.

◆ Draw3DPath()

virtual void vtkOpenGLGL2PSHelper::Draw3DPath ( vtkPath path,
vtkMatrix4x4 actorMatrix,
double  rasterPos[3],
unsigned char  actorColor[4],
vtkRenderer ren,
const char *  label = nullptr 
)
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.

◆ DrawImage()

virtual void vtkOpenGLGL2PSHelper::DrawImage ( vtkImageData image,
double  pos[3] 
)
pure virtual

Draw the image at pos.

Image must be RGB or RGBA with float scalars.

Implemented in vtkOpenGLGL2PSHelperImpl.

◆ SetActiveState()

virtual void vtkOpenGLGL2PSHelper::SetActiveState ( State  )
protectedvirtual

◆ SetTextAsPath()

virtual void vtkOpenGLGL2PSHelper::SetTextAsPath ( bool  )
protectedvirtual

◆ SetRenderWindow()

virtual void vtkOpenGLGL2PSHelper::SetRenderWindow ( vtkRenderWindow )
protectedvirtual

◆ SetPointSizeFactor()

virtual void vtkOpenGLGL2PSHelper::SetPointSizeFactor ( float  )
protectedvirtual

◆ SetLineWidthFactor()

virtual void vtkOpenGLGL2PSHelper::SetLineWidthFactor ( float  )
protectedvirtual

Friends And Related Function Documentation

◆ vtkOpenGLGL2PSExporter

friend class vtkOpenGLGL2PSExporter
friend

Definition at line 166 of file vtkOpenGLGL2PSHelper.h.

Member Data Documentation

◆ Instance

vtkOpenGLGL2PSHelper* vtkOpenGLGL2PSHelper::Instance
staticprotected

Definition at line 175 of file vtkOpenGLGL2PSHelper.h.

◆ RenderWindow

vtkRenderWindow* vtkOpenGLGL2PSHelper::RenderWindow
protected

Definition at line 179 of file vtkOpenGLGL2PSHelper.h.

◆ ActiveState

State vtkOpenGLGL2PSHelper::ActiveState
protected

Definition at line 180 of file vtkOpenGLGL2PSHelper.h.

◆ TextAsPath

bool vtkOpenGLGL2PSHelper::TextAsPath
protected

Definition at line 181 of file vtkOpenGLGL2PSHelper.h.

◆ PointSize

float vtkOpenGLGL2PSHelper::PointSize
protected

Definition at line 182 of file vtkOpenGLGL2PSHelper.h.

◆ LineWidth

float vtkOpenGLGL2PSHelper::LineWidth
protected

Definition at line 183 of file vtkOpenGLGL2PSHelper.h.

◆ PointSizeFactor

float vtkOpenGLGL2PSHelper::PointSizeFactor
protected

Definition at line 184 of file vtkOpenGLGL2PSHelper.h.

◆ LineWidthFactor

float vtkOpenGLGL2PSHelper::LineWidthFactor
protected

Definition at line 185 of file vtkOpenGLGL2PSHelper.h.

◆ LineStipple

unsigned short vtkOpenGLGL2PSHelper::LineStipple
protected

Definition at line 186 of file vtkOpenGLGL2PSHelper.h.


The documentation for this class was generated from the following file: