VTK  9.3.20240415
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
vtkOpenGLGL2PSHelperImpl Class Reference

vtkOpenGLGL2PSHelper override implementation. More...

#include <vtkOpenGLGL2PSHelperImpl.h>

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

Public Types

typedef vtkOpenGLGL2PSHelper Superclass
 
- Public Types inherited from vtkOpenGLGL2PSHelper
enum  State { Inactive = 0 , Background , Capture }
 

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...
 
vtkOpenGLGL2PSHelperImplNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses. More...
 
void ProcessTransformFeedback (vtkTransformFeedback *tfc, vtkRenderer *ren, vtkActor *act) override
 Parse the vertex information in tfc and inject primitives into GL2PS. More...
 
void ProcessTransformFeedback (vtkTransformFeedback *tfc, vtkRenderer *ren, unsigned char col[4]) override
 Parse the vertex information in tfc and inject primitives into GL2PS. More...
 
void ProcessTransformFeedback (vtkTransformFeedback *tfc, vtkRenderer *ren, float col[4]) override
 Parse the vertex information in tfc and inject primitives into GL2PS. More...
 
void DrawString (const std::string &str, vtkTextProperty *tprop, double pos[3], double backgroundDepth, vtkRenderer *ren) override
 Format the text in str according to tprop and instruct GL2PS to draw it at pixel coordinate pos. More...
 
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) override
 Generate PS, EPS, or SVG markup from a vtkPath object, and then inject it into the output using the gl2psSpecial command. More...
 
void Draw3DPath (vtkPath *path, vtkMatrix4x4 *actorMatrix, double rasterPos[3], unsigned char actorColor[4], vtkRenderer *ren, const char *label=nullptr) override
 Transform the path using the actor's matrix and current GL state, then draw it to GL2PS. More...
 
void DrawImage (vtkImageData *input, double pos[3]) override
 Draw the image at pos. More...
 
- Public Member Functions inherited from vtkOpenGLGL2PSHelper
 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 ()
 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...
 
- 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)
 
vtkTypeBool InvokeEvent (unsigned long event)
 
vtkTypeBool InvokeEvent (const char *event)
 
std::string GetObjectDescription () const override
 The object description printed in messages and PrintSelf output. 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)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
vtkCommandGetCommand (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...
 
vtkTypeBool InvokeEvent (unsigned long event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
vtkTypeBool InvokeEvent (const char *event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
virtual void SetObjectName (const std::string &objectName)
 Set/get the name of this object for reporting purposes. More...
 
virtual std::string GetObjectName () const
 Set/get the name of this object for reporting purposes. More...
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 Return the class name as a string. 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...
 
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...
 
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...
 
virtual bool UsesGarbageCollector () const
 Indicate whether the class uses vtkGarbageCollector or not. More...
 

Static Public Member Functions

static vtkOpenGLGL2PSHelperImplNew ()
 
static vtkTypeBool IsTypeOf (const char *type)
 
static vtkOpenGLGL2PSHelperImplSafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkOpenGLGL2PSHelper
static vtkOpenGLGL2PSHelperNew ()
 
static vtkOpenGLGL2PSHelperGetInstance ()
 The global instance. More...
 
static void SetInstance (vtkOpenGLGL2PSHelper *)
 The global instance. More...
 
- 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 (vtkTypeBool 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 vtkTypeBool 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 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

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkOpenGLGL2PSHelperImpl ()
 
 ~vtkOpenGLGL2PSHelperImpl () override
 
void DrawPathPS (vtkPath *path, double rasterPos[3], double windowPos[2], unsigned char rgba[4], double scale[2], double rotateAngle, float strokeWidth, const std::string &label)
 
void DrawPathPDF (vtkPath *path, double rasterPos[3], double windowPos[2], unsigned char rgba[4], double scale[2], double rotateAngle, float strokeWidth, const std::string &label)
 
void DrawPathSVG (vtkPath *path, double rasterPos[3], double windowPos[2], unsigned char rgba[4], double scale[2], double rotateAngle, float strokeWidth, const std::string &label)
 
- Protected Member Functions inherited from vtkOpenGLGL2PSHelper
 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 ()
 These methods allow a command to exclusively grab all events. More...
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Static Protected Member Functions

static const char * TextPropertyToPSFontName (vtkTextProperty *tprop)
 Translate the tprop's fontname into a Postscript font name. More...
 
static int TextPropertyToGL2PSAlignment (vtkTextProperty *tprop)
 Convert the alignment hint in tprop to a GL2PS text alignment constant. More...
 
static void GetTransformParameters (vtkRenderer *ren, vtkMatrix4x4 *actorMatrix, vtkMatrix4x4 *xform, double vpOrigin[2], double halfSize[2], double zfact[2])
 Extracts the information needed for transforming and projecting points from a renderer. More...
 
static void ProjectPoint (double point[3], vtkRenderer *ren, vtkMatrix4x4 *actorMatrix=nullptr)
 Project the point from world coordinates into device coordinates. More...
 
static void ProjectPoint (double point[4], vtkMatrix4x4 *transformMatrix, double viewportOrigin[2], double halfWidth, double halfHeight, double zfact1, double zfact2)
 Project the point from world coordinates into device coordinates. More...
 
static void ProjectPoints (vtkPoints *points, vtkRenderer *ren, vtkMatrix4x4 *actorMatrix=nullptr)
 Project the point from world coordinates into device coordinates. More...
 
static void UnprojectPoint (double point[4], vtkMatrix4x4 *invTransformMatrix, double viewportOrigin[2], double halfWidth, double halfHeight, double zfact1, double zfact2)
 Unproject the point from device coordinates into world coordinates. More...
 
static void UnprojectPoints (double *points3D, vtkIdType numPoints, vtkRenderer *ren, vtkMatrix4x4 *actorMatrix=nullptr)
 Unproject the point from device coordinates into world coordinates. More...
 
- Static Protected Member Functions inherited from vtkObjectBase
static vtkMallocingFunction GetCurrentMallocFunction ()
 
static vtkReallocingFunction GetCurrentReallocFunction ()
 
static vtkFreeingFunction GetCurrentFreeFunction ()
 
static vtkFreeingFunction GetAlternateFreeFunction ()
 

Additional Inherited Members

- Protected Attributes inherited from vtkOpenGLGL2PSHelper
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
 
std::string ObjectName
 
- Protected Attributes inherited from vtkObjectBase
std::atomic< int32_t > ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 
- Static Protected Attributes inherited from vtkOpenGLGL2PSHelper
static vtkOpenGLGL2PSHelperInstance
 

Detailed Description

vtkOpenGLGL2PSHelper override implementation.

Definition at line 20 of file vtkOpenGLGL2PSHelperImpl.h.

Member Typedef Documentation

◆ Superclass

Definition at line 24 of file vtkOpenGLGL2PSHelperImpl.h.

Constructor & Destructor Documentation

◆ vtkOpenGLGL2PSHelperImpl()

vtkOpenGLGL2PSHelperImpl::vtkOpenGLGL2PSHelperImpl ( )
protected

◆ ~vtkOpenGLGL2PSHelperImpl()

vtkOpenGLGL2PSHelperImpl::~vtkOpenGLGL2PSHelperImpl ( )
overrideprotected

Member Function Documentation

◆ New()

static vtkOpenGLGL2PSHelperImpl* vtkOpenGLGL2PSHelperImpl::New ( )
static

◆ IsTypeOf()

static vtkTypeBool vtkOpenGLGL2PSHelperImpl::IsTypeOf ( const char *  type)
static

◆ IsA()

virtual vtkTypeBool vtkOpenGLGL2PSHelperImpl::IsA ( const char *  name)
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 vtkObjectBase.

◆ SafeDownCast()

static vtkOpenGLGL2PSHelperImpl* vtkOpenGLGL2PSHelperImpl::SafeDownCast ( vtkObjectBase o)
static

◆ NewInstanceInternal()

virtual vtkObjectBase* vtkOpenGLGL2PSHelperImpl::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkOpenGLGL2PSHelperImpl* vtkOpenGLGL2PSHelperImpl::NewInstance ( ) const

◆ PrintSelf()

void vtkOpenGLGL2PSHelperImpl::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.

◆ ProcessTransformFeedback() [1/3]

void vtkOpenGLGL2PSHelperImpl::ProcessTransformFeedback ( vtkTransformFeedback tfc,
vtkRenderer ren,
vtkActor act 
)
overridevirtual

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.

Implements vtkOpenGLGL2PSHelper.

◆ ProcessTransformFeedback() [2/3]

void vtkOpenGLGL2PSHelperImpl::ProcessTransformFeedback ( vtkTransformFeedback tfc,
vtkRenderer ren,
unsigned char  col[4] 
)
overridevirtual

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.

Implements vtkOpenGLGL2PSHelper.

◆ ProcessTransformFeedback() [3/3]

void vtkOpenGLGL2PSHelperImpl::ProcessTransformFeedback ( vtkTransformFeedback tfc,
vtkRenderer ren,
float  col[4] 
)
overridevirtual

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.

Implements vtkOpenGLGL2PSHelper.

◆ DrawString()

void vtkOpenGLGL2PSHelperImpl::DrawString ( const std::string &  str,
vtkTextProperty tprop,
double  pos[3],
double  backgroundDepth,
vtkRenderer ren 
)
overridevirtual

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

Implements vtkOpenGLGL2PSHelper.

◆ DrawPath()

void vtkOpenGLGL2PSHelperImpl::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 
)
overridevirtual

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.

Implements vtkOpenGLGL2PSHelper.

◆ Draw3DPath()

void vtkOpenGLGL2PSHelperImpl::Draw3DPath ( vtkPath path,
vtkMatrix4x4 actorMatrix,
double  rasterPos[3],
unsigned char  actorColor[4],
vtkRenderer ren,
const char *  label = nullptr 
)
overridevirtual

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.

Implements vtkOpenGLGL2PSHelper.

◆ DrawImage()

void vtkOpenGLGL2PSHelperImpl::DrawImage ( vtkImageData image,
double  pos[3] 
)
overridevirtual

Draw the image at pos.

Image must be RGB or RGBA with float scalars.

Implements vtkOpenGLGL2PSHelper.

◆ TextPropertyToPSFontName()

static const char* vtkOpenGLGL2PSHelperImpl::TextPropertyToPSFontName ( vtkTextProperty tprop)
staticprotected

Translate the tprop's fontname into a Postscript font name.

◆ TextPropertyToGL2PSAlignment()

static int vtkOpenGLGL2PSHelperImpl::TextPropertyToGL2PSAlignment ( vtkTextProperty tprop)
staticprotected

Convert the alignment hint in tprop to a GL2PS text alignment constant.

◆ GetTransformParameters()

static void vtkOpenGLGL2PSHelperImpl::GetTransformParameters ( vtkRenderer ren,
vtkMatrix4x4 actorMatrix,
vtkMatrix4x4 xform,
double  vpOrigin[2],
double  halfSize[2],
double  zfact[2] 
)
staticprotected

Extracts the information needed for transforming and projecting points from a renderer.

◆ ProjectPoint() [1/2]

static void vtkOpenGLGL2PSHelperImpl::ProjectPoint ( double  point[3],
vtkRenderer ren,
vtkMatrix4x4 actorMatrix = nullptr 
)
staticprotected

Project the point from world coordinates into device coordinates.

◆ ProjectPoint() [2/2]

static void vtkOpenGLGL2PSHelperImpl::ProjectPoint ( double  point[4],
vtkMatrix4x4 transformMatrix,
double  viewportOrigin[2],
double  halfWidth,
double  halfHeight,
double  zfact1,
double  zfact2 
)
staticprotected

Project the point from world coordinates into device coordinates.

◆ ProjectPoints()

static void vtkOpenGLGL2PSHelperImpl::ProjectPoints ( vtkPoints points,
vtkRenderer ren,
vtkMatrix4x4 actorMatrix = nullptr 
)
staticprotected

Project the point from world coordinates into device coordinates.

◆ UnprojectPoint()

static void vtkOpenGLGL2PSHelperImpl::UnprojectPoint ( double  point[4],
vtkMatrix4x4 invTransformMatrix,
double  viewportOrigin[2],
double  halfWidth,
double  halfHeight,
double  zfact1,
double  zfact2 
)
staticprotected

Unproject the point from device coordinates into world coordinates.

Input Z coordinate should be in NDC space.

◆ UnprojectPoints()

static void vtkOpenGLGL2PSHelperImpl::UnprojectPoints ( double *  points3D,
vtkIdType  numPoints,
vtkRenderer ren,
vtkMatrix4x4 actorMatrix = nullptr 
)
staticprotected

Unproject the point from device coordinates into world coordinates.

Input Z coordinate should be in NDC space.

◆ DrawPathPS()

void vtkOpenGLGL2PSHelperImpl::DrawPathPS ( vtkPath path,
double  rasterPos[3],
double  windowPos[2],
unsigned char  rgba[4],
double  scale[2],
double  rotateAngle,
float  strokeWidth,
const std::string &  label 
)
protected

◆ DrawPathPDF()

void vtkOpenGLGL2PSHelperImpl::DrawPathPDF ( vtkPath path,
double  rasterPos[3],
double  windowPos[2],
unsigned char  rgba[4],
double  scale[2],
double  rotateAngle,
float  strokeWidth,
const std::string &  label 
)
protected

◆ DrawPathSVG()

void vtkOpenGLGL2PSHelperImpl::DrawPathSVG ( vtkPath path,
double  rasterPos[3],
double  windowPos[2],
unsigned char  rgba[4],
double  scale[2],
double  rotateAngle,
float  strokeWidth,
const std::string &  label 
)
protected

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