[vtkusers] Drawing a simple line graph (CONTINUES...)
Amy Squillacote
amy.squillacote at kitware.com
Thu Jul 5 08:09:28 EDT 2007
Dean Inglis wrote:
> (3rd)?
> HOWEVER, I found there is no definition of GetPositionCoordinates()
> and GetPosition2Coordinates() methods in vtkActor2D.h . Where are them
> defined in?
>
>
In vtkActor2D.h, you'll see vtkViewportCoordinateMacro(Position) and the
same for Position2. This macro is defined in VTK/Common/vtkSetGet.h. The
definition is as follows.
#define vtkViewportCoordinateMacro(name) \
virtual vtkCoordinate *Get##name##Coordinate () \
{ \
vtkDebugMacro(<< this->GetClassName() << " (" << this << "):
returning " #name "Coordinate address " << this->name##Coordinate ); \
return this->name##Coordinate; \
} \
virtual void Set##name(double x[2]) {this->Set##name(x[0],x[1]);}; \
virtual void Set##name(double x, double y) \
{ \
this->name##Coordinate->SetValue(x,y); \
} \
virtual double *Get##name() \
{ \
return this->name##Coordinate->GetValue(); \
}
So for the Position ivar, the following methods are defined:
GetPositionCoordinate(), SetPosition(double x[2]), SetPosition(double x,
double y), and GetPosition(). Replace "Position" with "Position2" to get
the rest of the method names.
- Amy
--
Amy Squillacote
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
Phone: (518) 371-3971 x106
More information about the vtkusers
mailing list