VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Friends | List of all members
vtkGL2PSUtilities Class Reference

Helper functions for using GL2PS within VTK. More...

#include <vtkGL2PSUtilities.h>

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

Public Types

typedef vtkObject Superclass
 

Public Member Functions

virtual int IsA (const char *type)
 Return 1 if this class is the same type of (or a subclass of) the named class. More...
 
vtkGL2PSUtilitiesNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. 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 ()
 
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...
 
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...
 
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...
 
- 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 vtkGL2PSUtilitiesNew ()
 
static int IsTypeOf (const char *type)
 
static vtkGL2PSUtilitiesSafeDownCast (vtkObjectBase *o)
 
static void DrawString (const char *str, vtkTextProperty *tprop, double pos[3], double backgroundDepth)
 Format the text in str according to tprop and instruct GL2PS to draw it at world coordinate pos. More...
 
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 vtkRenderWindowGetRenderWindow ()
 Get the current RenderWindow that is being exported. More...
 
static void Draw3DPath (vtkPath *path, vtkMatrix4x4 *actorMatrix, double rasterPos[3], unsigned char actorColor[4], const char *label=NULL)
 Transform the path using the actor's matrix and current GL state, then draw it to GL2PS. More...
 
static 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)
 Generate PS, EPS, or SVG markup from a vtkPath object, and then inject it into the output using the gl2psSpecial command. More...
 
static bool GetTextAsPath ()
 Get whether all text will be exported as paths. More...
 
static float GetPointSizeFactor ()
 Get a scaling factor for the point size or line width used by GL2PS. More...
 
static float GetLineWidthFactor ()
 
- 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 ()
 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 vtkObjectBaseNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkGL2PSUtilities ()
 
 ~vtkGL2PSUtilities ()
 
- 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=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...
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Static Protected Member Functions

static void StartExport ()
 
static void FinishExport ()
 
static void SetPointSizeFactor (float f)
 
static void SetLineWidthFactor (float f)
 
static void SetTextAsPath (bool b)
 
static void SetRenderWindow (vtkRenderWindow *renWin)
 
static void DrawPathPS (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)
 
static void DrawPathPDF (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)
 
static void DrawPathSVG (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)
 

Friends

class vtkOpenGLGL2PSExporter
 

Additional Inherited Members

- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

Helper functions for using GL2PS within VTK.

vtkGL2PSUtilities implements some static helper function that simplify calling GL2PS routines on VTK objects. This class is meant for internal use only and is subject to change.

Definition at line 37 of file vtkGL2PSUtilities.h.

Member Typedef Documentation

Definition at line 41 of file vtkGL2PSUtilities.h.

Constructor & Destructor Documentation

vtkGL2PSUtilities::vtkGL2PSUtilities ( )
inlineprotected

Definition at line 148 of file vtkGL2PSUtilities.h.

vtkGL2PSUtilities::~vtkGL2PSUtilities ( )
inlineprotected

Definition at line 149 of file vtkGL2PSUtilities.h.

Member Function Documentation

static vtkGL2PSUtilities* vtkGL2PSUtilities::New ( )
static
static int vtkGL2PSUtilities::IsTypeOf ( const char *  type)
static
virtual int vtkGL2PSUtilities::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.

static vtkGL2PSUtilities* vtkGL2PSUtilities::SafeDownCast ( vtkObjectBase o)
static
virtual vtkObjectBase* vtkGL2PSUtilities::NewInstanceInternal ( ) const
protectedvirtual
vtkGL2PSUtilities* vtkGL2PSUtilities::NewInstance ( ) const
void vtkGL2PSUtilities::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
inlinevirtual

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.

Definition at line 42 of file vtkGL2PSUtilities.h.

static void vtkGL2PSUtilities::DrawString ( const char *  str,
vtkTextProperty tprop,
double  pos[3],
double  backgroundDepth 
)
static

Format the text in str according to tprop and instruct GL2PS to draw it at world coordinate pos.

Background depth is no longer used.

static const char* vtkGL2PSUtilities::TextPropertyToPSFontName ( vtkTextProperty tprop)
static

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

static int vtkGL2PSUtilities::TextPropertyToGL2PSAlignment ( vtkTextProperty tprop)
static

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

static vtkRenderWindow* vtkGL2PSUtilities::GetRenderWindow ( void  )
inlinestatic

Get the current RenderWindow that is being exported.

Definition at line 67 of file vtkGL2PSUtilities.h.

static void vtkGL2PSUtilities::Draw3DPath ( vtkPath path,
vtkMatrix4x4 actorMatrix,
double  rasterPos[3],
unsigned char  actorColor[4],
const char *  label = NULL 
)
static

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.

static void vtkGL2PSUtilities::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 
)
static

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.

static bool vtkGL2PSUtilities::GetTextAsPath ( )
inlinestatic

Get whether all text will be exported as paths.

Definition at line 99 of file vtkGL2PSUtilities.h.

static float vtkGL2PSUtilities::GetPointSizeFactor ( )
inlinestatic

Get a scaling factor for the point size or line width used by GL2PS.

Default value: 5/7.

Definition at line 108 of file vtkGL2PSUtilities.h.

static float vtkGL2PSUtilities::GetLineWidthFactor ( )
inlinestatic

Definition at line 110 of file vtkGL2PSUtilities.h.

static void vtkGL2PSUtilities::StartExport ( )
staticprotected
static void vtkGL2PSUtilities::FinishExport ( )
staticprotected
static void vtkGL2PSUtilities::SetPointSizeFactor ( float  f)
inlinestaticprotected

Definition at line 119 of file vtkGL2PSUtilities.h.

static void vtkGL2PSUtilities::SetLineWidthFactor ( float  f)
inlinestaticprotected

Definition at line 122 of file vtkGL2PSUtilities.h.

static void vtkGL2PSUtilities::SetTextAsPath ( bool  b)
inlinestaticprotected

Definition at line 125 of file vtkGL2PSUtilities.h.

static void vtkGL2PSUtilities::SetRenderWindow ( vtkRenderWindow renWin)
inlinestaticprotected

Definition at line 130 of file vtkGL2PSUtilities.h.

static void vtkGL2PSUtilities::DrawPathPS ( 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 
)
staticprotected
static void vtkGL2PSUtilities::DrawPathPDF ( 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 
)
staticprotected
static void vtkGL2PSUtilities::DrawPathSVG ( 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 
)
staticprotected

Friends And Related Function Documentation

friend class vtkOpenGLGL2PSExporter
friend

Definition at line 114 of file vtkGL2PSUtilities.h.


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