Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# vtkCoordinate Class Reference

`#include <vtkCoordinate.h>`

Inheritance diagram for vtkCoordinate:

[legend]
Collaboration diagram for vtkCoordinate:

[legend]
List of all members.

## Detailed Description

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

Date:
  2002/06/07 22:11:04

Revision:
  1.29

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
      NORMALIZED DISPLAY -  x-y (0,1) normalized values
      VIEWPORT -            x-y pixel values in viewport
      NORMALIZED VIEWPORT - x-y (0,1) normalized value in viewport
      VIEW -                x-y-z (-1,1) values in camera coordinates. (z is depth)
      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:
  vtkProp2D vtkActor2D vtkScalarBarActor

Created by:
  - Martin, Ken

CVS contributions (if > 5%):
  - Martin, Ken (66%)
  - Biddiscombe, John (14%)
  - Lorensen, Bill (7%)

CVS logs (CVSweb):
  - .`cxx` (`/Common/vtkCoordinate.cxx)`
  - .`h` (`/Common/vtkCoordinate.h)`

Examples:
  vtkCoordinate (Examples)

Tests:
  vtkCoordinate (Tests)

Definition at line 84 of file vtkCoordinate.h.

## Public Types
typedef vtkObject | Superclass
## Public Methods
virtual const char * | GetClassName ()
virtual int | IsA (const char *type)
void | PrintSelf (ostream &os, vtkIndent indent)
const char * | GetCoordinateSystemAsString ()
float * | GetComputedFloatViewportValue (vtkViewport *)
float * | GetComputedFloatDisplayValue (vtkViewport *)
float * | GetComputedValue (vtkViewport *)
virtual void | SetCoordinateSystem (int)
virtual int | GetCoordinateSystem ()
void | SetCoordinateSystemToDisplay ()
void | SetCoordinateSystemToNormalizedDisplay ()
void | SetCoordinateSystemToViewport ()
void | SetCoordinateSystemToNormalizedViewport ()
void | SetCoordinateSystemToView ()
void | SetCoordinateSystemToWorld ()
virtual void | SetValue (float, float, float)
virtual void | SetValue (float[3])
virtual float * | GetValue ()
virtual void | GetValue (float &, float &, float &)
virtual void | GetValue (float[3])
void | SetValue (float a, float b)
virtual void | SetReferenceCoordinate (vtkCoordinate *)
virtual vtkCoordinate * | GetReferenceCoordinate ()
void | SetViewport (vtkViewport *viewport)
virtual vtkViewport * | GetViewport ()
float * | GetComputedWorldValue (vtkViewport *)
int * | GetComputedViewportValue (vtkViewport *)
int * | GetComputedDisplayValue (vtkViewport *)
int * | GetComputedLocalDisplayValue (vtkViewport *)
virtual float * | GetComputedUserDefinedValue (vtkViewport *)
## Static Public Methods
int | IsTypeOf (const char *type)
vtkCoordinate * | SafeDownCast (vtkObject *o)
vtkCoordinate * | New ()
## Protected Methods
| vtkCoordinate ()
| ~vtkCoordinate ()
## Protected Attributes
float | Value [3]
int | CoordinateSystem
vtkCoordinate * | ReferenceCoordinate
vtkViewport * | Viewport
float | ComputedWorldValue [3]
int | ComputedDisplayValue [2]
int | ComputedViewportValue [2]
int | Computing
float | ComputedFloatDisplayValue [2]
float | ComputedFloatViewportValue [2]
float | ComputedUserDefinedValue [3]

## Member Typedef Documentation

typedef vtkObject vtkCoordinate::Superclass

| Reimplemented from vtkObject. Definition at line 87 of file vtkCoordinate.h.

## Constructor & Destructor Documentation

vtkCoordinate::vtkCoordinate | ( |  | ) | `[protected]`

vtkCoordinate::~vtkCoordinate | ( |  | ) | `[protected]`

## Member Function Documentation

virtual const char* vtkCoordinate::GetClassName | ( |  | ) | `[virtual]`

| Reimplemented from vtkObject.

int vtkCoordinate::IsTypeOf | ( | const char * | type | ) | `[static]`

| Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeRevisionMacro found in vtkSetGet.h. Reimplemented from vtkObject.

virtual int vtkCoordinate::IsA | ( | const char * | type | ) | `[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 vtkTypeRevisionMacro found in vtkSetGet.h. Reimplemented from vtkObject.

vtkCoordinate* vtkCoordinate::SafeDownCast | ( | vtkObject * | o | ) | `[static]`

| Reimplemented from vtkObject.

void vtkCoordinate::PrintSelf | ( | ostream & | os,
|  | vtkIndent | indent
| ) | `[virtual]`

| 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.

vtkCoordinate* vtkCoordinate::New | ( |  | ) | `[static]`

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

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.

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.

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 100 of file vtkCoordinate.h. References VTK_DISPLAY.

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 101 of file vtkCoordinate.h. References VTK_NORMALIZED_DISPLAY.

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 103 of file vtkCoordinate.h. References VTK_VIEWPORT.

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 105 of file vtkCoordinate.h. References VTK_NORMALIZED_VIEWPORT.

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 107 of file vtkCoordinate.h. References VTK_VIEW.

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 108 of file vtkCoordinate.h. References VTK_WORLD.

const char* vtkCoordinate::GetCoordinateSystemAsString | ( |  | ) |

virtual void vtkCoordinate::SetValue | ( | float | ,
|  | float | ,
|  | float |
| ) | `[virtual]`

| Set/get the value of this coordinate. This can be thought of as the position of this coordinate in its coordinate system.

virtual void vtkCoordinate::SetValue | ( | float | [3] | ) | `[virtual]`

| Set/get the value of this coordinate. This can be thought of as the position of this coordinate in its coordinate system.

virtual float* 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.

virtual void vtkCoordinate::GetValue | ( | float & | ,
|  | float & | ,
|  | float & |
| ) | `[virtual]`

| Set/get the value of this coordinate. This can be thought of as the position of this coordinate in its coordinate system.

virtual void vtkCoordinate::GetValue | ( | float | [3] | ) | `[virtual]`

| Set/get the value of this coordinate. This can be thought of as the position of this coordinate in its coordinate system.

void vtkCoordinate::SetValue | ( | float | a,
|  | float | 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 118 of file vtkCoordinate.h.

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.

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.

void vtkCoordinate::SetViewport | ( | vtkViewport * | viewport | ) |

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

virtual vtkViewport* vtkCoordinate::GetViewport | ( |  | ) | `[virtual]`

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

float* vtkCoordinate::GetComputedWorldValue | ( | vtkViewport * |  | ) |

| Return the computed value in a specified coordinate system.

int* vtkCoordinate::GetComputedViewportValue | ( | vtkViewport * |  | ) |

| Return the computed value in a specified coordinate system.

int* vtkCoordinate::GetComputedDisplayValue | ( | vtkViewport * |  | ) |

| Return the computed value in a specified coordinate system.

int* vtkCoordinate::GetComputedLocalDisplayValue | ( | vtkViewport * |  | ) |

| Return the computed value in a specified coordinate system.

float* vtkCoordinate::GetComputedFloatViewportValue | ( | vtkViewport * |  | ) |

float* vtkCoordinate::GetComputedFloatDisplayValue | ( | vtkViewport * |  | ) |

float* 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

virtual float* vtkCoordinate::GetComputedUserDefinedValue | ( | vtkViewport * |  | ) | `[inline, virtual]`

| 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 158 of file vtkCoordinate.h.

## Member Data Documentation

float vtkCoordinate::Value[3]`[protected]`

| Definition at line 166 of file vtkCoordinate.h.

int vtkCoordinate::CoordinateSystem`[protected]`

| Definition at line 167 of file vtkCoordinate.h.

vtkCoordinate* vtkCoordinate::ReferenceCoordinate`[protected]`

| Definition at line 168 of file vtkCoordinate.h.

vtkViewport* vtkCoordinate::Viewport`[protected]`

| Definition at line 169 of file vtkCoordinate.h.

float vtkCoordinate::ComputedWorldValue[3]`[protected]`

| Definition at line 170 of file vtkCoordinate.h.

int vtkCoordinate::ComputedDisplayValue[2]`[protected]`

| Definition at line 171 of file vtkCoordinate.h.

int vtkCoordinate::ComputedViewportValue[2]`[protected]`

| Definition at line 172 of file vtkCoordinate.h.

int vtkCoordinate::Computing`[protected]`

| Definition at line 173 of file vtkCoordinate.h.

float vtkCoordinate::ComputedFloatDisplayValue[2]`[protected]`

| Definition at line 175 of file vtkCoordinate.h.

float vtkCoordinate::ComputedFloatViewportValue[2]`[protected]`

| Definition at line 176 of file vtkCoordinate.h.

float vtkCoordinate::ComputedUserDefinedValue[3]`[protected]`

| Definition at line 177 of file vtkCoordinate.h.

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

- Common/vtkCoordinate.h