VTK  9.1.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkCoordinate Class Reference

perform coordinate transformation, and represent position, in a variety of vtk coordinate systems More...

#include <vtkCoordinate.h>

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

Public Types

typedef vtkObject Superclass
 

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.
 
vtkCoordinateNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses.
 
const char * GetCoordinateSystemAsString ()
 
double * GetComputedDoubleViewportValue (vtkViewport *)
 
double * GetComputedDoubleDisplayValue (vtkViewport *)
 
double * GetComputedValue (vtkViewport *)
 GetComputedValue() will return either World, Viewport or Display based on what has been set as the coordinate system.
 
virtual double * GetComputedUserDefinedValue (vtkViewport *)
 GetComputedUserDefinedValue() is to be used only when the coordinate system is VTK_USERDEFINED.
 
virtual void SetCoordinateSystem (int)
 Set/get the coordinate system which this coordinate is defined in.
 
virtual int GetCoordinateSystem ()
 Set/get the coordinate system which this coordinate is defined in.
 
void SetCoordinateSystemToDisplay ()
 Set/get the coordinate system which this coordinate is defined in.
 
void SetCoordinateSystemToNormalizedDisplay ()
 Set/get the coordinate system which this coordinate is defined in.
 
void SetCoordinateSystemToViewport ()
 Set/get the coordinate system which this coordinate is defined in.
 
void SetCoordinateSystemToNormalizedViewport ()
 Set/get the coordinate system which this coordinate is defined in.
 
void SetCoordinateSystemToView ()
 Set/get the coordinate system which this coordinate is defined in.
 
void SetCoordinateSystemToPose ()
 Set/get the coordinate system which this coordinate is defined in.
 
void SetCoordinateSystemToWorld ()
 Set/get the coordinate system which this coordinate is defined in.
 
virtual void SetValue (double, double, double)
 Set/get the value of this coordinate.
 
virtual void SetValue (double[3])
 Set/get the value of this coordinate.
 
virtual double * GetValue ()
 Set/get the value of this coordinate.
 
virtual void GetValue (double &, double &, double &)
 Set/get the value of this coordinate.
 
virtual void GetValue (double[3])
 Set/get the value of this coordinate.
 
void SetValue (double a, double b)
 Set/get the value of this coordinate.
 
virtual void SetReferenceCoordinate (vtkCoordinate *)
 If this coordinate is relative to another coordinate, then specify that coordinate as the ReferenceCoordinate.
 
virtual vtkCoordinateGetReferenceCoordinate ()
 If this coordinate is relative to another coordinate, then specify that coordinate as the ReferenceCoordinate.
 
void SetViewport (vtkViewport *viewport)
 If you want this coordinate to be relative to a specific vtkViewport (vtkRenderer) then you can specify that here.
 
virtual vtkViewportGetViewport ()
 If you want this coordinate to be relative to a specific vtkViewport (vtkRenderer) then you can specify that here.
 
double * GetComputedWorldValue (vtkViewport *)
 Return the computed value in a specified coordinate system.
 
int * GetComputedViewportValue (vtkViewport *)
 Return the computed value in a specified coordinate system.
 
int * GetComputedDisplayValue (vtkViewport *)
 Return the computed value in a specified coordinate system.
 
int * GetComputedLocalDisplayValue (vtkViewport *)
 Return the computed value in a specified coordinate system.
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 Turn debugging output on.
 
virtual void DebugOff ()
 Turn debugging output off.
 
bool GetDebug ()
 Get the value of the debug flag.
 
void SetDebug (bool debugFlag)
 Set the value of the debug flag.
 
virtual void Modified ()
 Update the modification time for this object.
 
virtual vtkMTimeType GetMTime ()
 Return this object's modified time.
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses.
 
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)
 
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.
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
vtkCommandGetCommand (unsigned long tag)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
void RemoveObserver (vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
void RemoveObservers (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
void RemoveObservers (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
vtkTypeBool HasObserver (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
vtkTypeBool HasObserver (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
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.
 
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.
 
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.
 
int InvokeEvent (unsigned long event, void *callData)
 This method invokes an event and return whether the event was aborted or not.
 
int InvokeEvent (const char *event, void *callData)
 This method invokes an event and return whether the event was aborted or not.
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 Return the class name as a string.
 
virtual vtkTypeBool IsA (const char *name)
 Return 1 if this class is the same type of (or a subclass of) the named class.
 
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).
 
virtual void Delete ()
 Delete a VTK object.
 
virtual void FastDelete ()
 Delete a reference to this object.
 
void InitializeObjectBase ()
 
void Print (ostream &os)
 Print an object to an ostream.
 
virtual void Register (vtkObjectBase *o)
 Increase the reference count (mark as used by another object).
 
virtual void UnRegister (vtkObjectBase *o)
 Decrease the reference count (release by another object).
 
int GetReferenceCount ()
 Return the current reference count of this object.
 
void SetReferenceCount (int)
 Sets the reference count.
 
bool GetIsInMemkind () const
 A local state flag that remembers whether this object lives in the normal or extended memory space.
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses.
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses.
 

Static Public Member Functions

static vtkTypeBool IsTypeOf (const char *type)
 
static vtkCoordinateSafeDownCast (vtkObjectBase *o)
 
static vtkCoordinateNew ()
 Creates an instance of this class with the following defaults: value of (0,0,0) in world coordinates.
 
- 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.
 
static void BreakOnError ()
 This method is called when vtkErrorMacro executes.
 
static void SetGlobalWarningDisplay (int val)
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
static void GlobalWarningDisplayOn ()
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
static void GlobalWarningDisplayOff ()
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
static int GetGlobalWarningDisplay ()
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
- 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.
 
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).
 
static vtkObjectBaseNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
 
static void SetMemkindDirectory (const char *directoryname)
 The name of a directory, ideally mounted -o dax, to memory map an extended memory space within.
 
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.
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkCoordinate ()
 
 ~vtkCoordinate () override
 
- 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.
 
void InternalReleaseFocus ()
 These methods allow a command to exclusively grab all events.
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void RegisterInternal (vtkObjectBase *, vtkTypeBool check)
 
virtual void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

double Value [3]
 
int CoordinateSystem
 
vtkCoordinateReferenceCoordinate
 
vtkViewportViewport
 
double ComputedWorldValue [3]
 
int ComputedDisplayValue [2]
 
int ComputedViewportValue [2]
 
int Computing
 
double ComputedDoubleDisplayValue [2]
 
double ComputedDoubleViewportValue [2]
 
double ComputedUserDefinedValue [3]
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
std::atomic< int32_t > ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Additional Inherited Members

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

Detailed Description

perform coordinate transformation, and represent position, in a variety of vtk coordinate systems

vtkCoordinate represents position in a variety of coordinate systems, and converts position to other coordinate systems. It also supports relative positioning, so you can create a cascade of vtkCoordinate objects (no loops please!) that refer to each other. The typical usage of this object is to set the coordinate system in which to represent a position (e.g., SetCoordinateSystemToNormalizedDisplay()), set the value of the coordinate (e.g., SetValue()), and then invoke the appropriate method to convert to another coordinate system (e.g., GetComputedWorldValue()).

The coordinate systems in vtk are as follows:

  DISPLAY -             x-y pixel values in window
     0, 0 is the lower left of the first pixel,
     size, size is the upper right of the last pixel
  NORMALIZED DISPLAY -  x-y (0,1) normalized values
     0, 0 is the lower left of the first pixel,
     1, 1 is the upper right of the last pixel
  VIEWPORT -            x-y pixel values in viewport
     0, 0 is the lower left of the first pixel,
     size, size is the upper right of the last pixel
  NORMALIZED VIEWPORT - x-y (0,1) normalized value in viewport
     0, 0 is the lower left of the first pixel,
     1, 1 is the upper right of the last pixel
  VIEW -                x-y-z (-1,1) values in pose coordinates. (z is depth)
  POSE -                world coords translated and rotated to the camera
                        position and view direction
  WORLD -               x-y-z global coordinate values
  USERDEFINED -         x-y-z in User defined space

If you cascade vtkCoordinate objects, you refer to another vtkCoordinate object which in turn can refer to others, and so on. This allows you to create composite groups of things like vtkActor2D that are positioned relative to one another. Note that in cascaded sequences, each vtkCoordinate object may be specified in different coordinate systems!

See also
vtkActor2D vtkScalarBarActor
Online Examples:

Definition at line 185 of file vtkCoordinate.h.

Member Typedef Documentation

◆ Superclass

Definition at line 188 of file vtkCoordinate.h.

Constructor & Destructor Documentation

◆ vtkCoordinate()

vtkCoordinate::vtkCoordinate ( )
protected

◆ ~vtkCoordinate()

vtkCoordinate::~vtkCoordinate ( )
overrideprotected

Member Function Documentation

◆ IsTypeOf()

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

◆ IsA()

virtual vtkTypeBool vtkCoordinate::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 vtkCoordinate * vtkCoordinate::SafeDownCast ( vtkObjectBase o)
static

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkCoordinate::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkCoordinate * vtkCoordinate::NewInstance ( ) const

◆ PrintSelf()

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

◆ New()

static vtkCoordinate * vtkCoordinate::New ( )
static

Creates an instance of this class with the following defaults: value of (0,0,0) in world coordinates.

◆ SetCoordinateSystem()

virtual void vtkCoordinate::SetCoordinateSystem ( int  )
virtual

Set/get the coordinate system which this coordinate is defined in.

The options are Display, Normalized Display, Viewport, Normalized Viewport, View, and World.

◆ GetCoordinateSystem()

virtual int vtkCoordinate::GetCoordinateSystem ( )
virtual

Set/get the coordinate system which this coordinate is defined in.

The options are Display, Normalized Display, Viewport, Normalized Viewport, View, and World.

◆ SetCoordinateSystemToDisplay()

void vtkCoordinate::SetCoordinateSystemToDisplay ( )
inline

Set/get the coordinate system which this coordinate is defined in.

The options are Display, Normalized Display, Viewport, Normalized Viewport, View, and World.

Definition at line 205 of file vtkCoordinate.h.

◆ SetCoordinateSystemToNormalizedDisplay()

void vtkCoordinate::SetCoordinateSystemToNormalizedDisplay ( )
inline

Set/get the coordinate system which this coordinate is defined in.

The options are Display, Normalized Display, Viewport, Normalized Viewport, View, and World.

Definition at line 206 of file vtkCoordinate.h.

◆ SetCoordinateSystemToViewport()

void vtkCoordinate::SetCoordinateSystemToViewport ( )
inline

Set/get the coordinate system which this coordinate is defined in.

The options are Display, Normalized Display, Viewport, Normalized Viewport, View, and World.

Definition at line 210 of file vtkCoordinate.h.

◆ SetCoordinateSystemToNormalizedViewport()

void vtkCoordinate::SetCoordinateSystemToNormalizedViewport ( )
inline

Set/get the coordinate system which this coordinate is defined in.

The options are Display, Normalized Display, Viewport, Normalized Viewport, View, and World.

Definition at line 211 of file vtkCoordinate.h.

◆ SetCoordinateSystemToView()

void vtkCoordinate::SetCoordinateSystemToView ( )
inline

Set/get the coordinate system which this coordinate is defined in.

The options are Display, Normalized Display, Viewport, Normalized Viewport, View, and World.

Definition at line 215 of file vtkCoordinate.h.

◆ SetCoordinateSystemToPose()

void vtkCoordinate::SetCoordinateSystemToPose ( )
inline

Set/get the coordinate system which this coordinate is defined in.

The options are Display, Normalized Display, Viewport, Normalized Viewport, View, and World.

Definition at line 216 of file vtkCoordinate.h.

◆ SetCoordinateSystemToWorld()

void vtkCoordinate::SetCoordinateSystemToWorld ( )
inline

Set/get the coordinate system which this coordinate is defined in.

The options are Display, Normalized Display, Viewport, Normalized Viewport, View, and World.

Definition at line 217 of file vtkCoordinate.h.

◆ GetCoordinateSystemAsString()

const char * vtkCoordinate::GetCoordinateSystemAsString ( )

◆ SetValue() [1/3]

virtual void vtkCoordinate::SetValue ( double  ,
double  ,
double   
)
virtual

Set/get the value of this coordinate.

This can be thought of as the position of this coordinate in its coordinate system.

◆ SetValue() [2/3]

virtual void vtkCoordinate::SetValue ( double  [3])
virtual

Set/get the value of this coordinate.

This can be thought of as the position of this coordinate in its coordinate system.

◆ GetValue() [1/3]

virtual double * vtkCoordinate::GetValue ( )
virtual

Set/get the value of this coordinate.

This can be thought of as the position of this coordinate in its coordinate system.

◆ GetValue() [2/3]

virtual void vtkCoordinate::GetValue ( double &  ,
double &  ,
double &   
)
virtual

Set/get the value of this coordinate.

This can be thought of as the position of this coordinate in its coordinate system.

◆ GetValue() [3/3]

virtual void vtkCoordinate::GetValue ( double  [3])
virtual

Set/get the value of this coordinate.

This can be thought of as the position of this coordinate in its coordinate system.

◆ SetValue() [3/3]

void vtkCoordinate::SetValue ( double  a,
double  b 
)
inline

Set/get the value of this coordinate.

This can be thought of as the position of this coordinate in its coordinate system.

Definition at line 229 of file vtkCoordinate.h.

◆ SetReferenceCoordinate()

virtual void vtkCoordinate::SetReferenceCoordinate ( vtkCoordinate )
virtual

If this coordinate is relative to another coordinate, then specify that coordinate as the ReferenceCoordinate.

If this is NULL the coordinate is assumed to be absolute.

◆ GetReferenceCoordinate()

virtual vtkCoordinate * vtkCoordinate::GetReferenceCoordinate ( )
virtual

If this coordinate is relative to another coordinate, then specify that coordinate as the ReferenceCoordinate.

If this is NULL the coordinate is assumed to be absolute.

◆ SetViewport()

void vtkCoordinate::SetViewport ( vtkViewport viewport)

If you want this coordinate to be relative to a specific vtkViewport (vtkRenderer) then you can specify that here.

NOTE: this is a raw pointer, not a weak pointer nor a reference counted object, to avoid reference cycle loop between rendering classes and filter classes.

◆ GetViewport()

virtual vtkViewport * vtkCoordinate::GetViewport ( )
virtual

If you want this coordinate to be relative to a specific vtkViewport (vtkRenderer) then you can specify that here.

NOTE: this is a raw pointer, not a weak pointer nor a reference counted object, to avoid reference cycle loop between rendering classes and filter classes.

◆ GetComputedWorldValue()

double * vtkCoordinate::GetComputedWorldValue ( vtkViewport )

Return the computed value in a specified coordinate system.

◆ GetComputedViewportValue()

int * vtkCoordinate::GetComputedViewportValue ( vtkViewport )

Return the computed value in a specified coordinate system.

◆ GetComputedDisplayValue()

int * vtkCoordinate::GetComputedDisplayValue ( vtkViewport )

Return the computed value in a specified coordinate system.

◆ GetComputedLocalDisplayValue()

int * vtkCoordinate::GetComputedLocalDisplayValue ( vtkViewport )

Return the computed value in a specified coordinate system.

◆ GetComputedDoubleViewportValue()

double * vtkCoordinate::GetComputedDoubleViewportValue ( vtkViewport )

◆ GetComputedDoubleDisplayValue()

double * vtkCoordinate::GetComputedDoubleDisplayValue ( vtkViewport )

◆ GetComputedValue()

double * vtkCoordinate::GetComputedValue ( vtkViewport )

GetComputedValue() will return either World, Viewport or Display based on what has been set as the coordinate system.

This is good for objects like vtkLineSource, where the user might want to use them as World or Viewport coordinates.

◆ GetComputedUserDefinedValue()

virtual double * vtkCoordinate::GetComputedUserDefinedValue ( vtkViewport )
inlinevirtual

GetComputedUserDefinedValue() is to be used only when the coordinate system is VTK_USERDEFINED.

The user must subclass vtkCoordinate and override this function, when set as the TransformCoordinate in 2D-Mappers, the user can customize display of 2D polygons

Definition at line 282 of file vtkCoordinate.h.

Member Data Documentation

◆ Value

double vtkCoordinate::Value[3]
protected

Definition at line 288 of file vtkCoordinate.h.

◆ CoordinateSystem

int vtkCoordinate::CoordinateSystem
protected

Definition at line 289 of file vtkCoordinate.h.

◆ ReferenceCoordinate

vtkCoordinate* vtkCoordinate::ReferenceCoordinate
protected

Definition at line 290 of file vtkCoordinate.h.

◆ Viewport

vtkViewport* vtkCoordinate::Viewport
protected

Definition at line 291 of file vtkCoordinate.h.

◆ ComputedWorldValue

double vtkCoordinate::ComputedWorldValue[3]
protected

Definition at line 292 of file vtkCoordinate.h.

◆ ComputedDisplayValue

int vtkCoordinate::ComputedDisplayValue[2]
protected

Definition at line 293 of file vtkCoordinate.h.

◆ ComputedViewportValue

int vtkCoordinate::ComputedViewportValue[2]
protected

Definition at line 294 of file vtkCoordinate.h.

◆ Computing

int vtkCoordinate::Computing
protected

Definition at line 295 of file vtkCoordinate.h.

◆ ComputedDoubleDisplayValue

double vtkCoordinate::ComputedDoubleDisplayValue[2]
protected

Definition at line 297 of file vtkCoordinate.h.

◆ ComputedDoubleViewportValue

double vtkCoordinate::ComputedDoubleViewportValue[2]
protected

Definition at line 298 of file vtkCoordinate.h.

◆ ComputedUserDefinedValue

double vtkCoordinate::ComputedUserDefinedValue[3]
protected

Definition at line 299 of file vtkCoordinate.h.


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