[vtkusers] Drawing a simple line graph (CONTINUES...)

Dean Inglis dean.inglis at sympatico.ca
Tue Jul 3 21:56:19 EDT 2007

Hi Isidro,

1st) if you post code examples, they are useful
if they are complete and can be compiled and run by
anybody. Can you post a very simple and complete
example that illustrates your problem (a tcl script would
be easiest), for example, a line drawn from
(-100,600) to (-800, 500).

2nd) got it.  It might be interesting to show what
happens if you draw the same line/function on an
image with vtkImageCanvasSource2D and visualize with

HOWEVER, I found there is no definition of GetPositionCoordinates()
and GetPosition2Coordinates() methods in vtkActor2D.h . Where are them
defined in?

>From the vtk documentation:

virtual vtkCoordinate* vtkActor2D::GetPositionCoordinate  (     )  [virtual]

   Get the PositionCoordinate instance of vtkCoordinate. This is used for
complicated or relative positioning. The position variable controls the
lower left corner of the Actor2D

Referenced by vtkAxisActor2D::GetPoint1Coordinate().

"Why should I change "reference coordinate" to NULL? In fact, position2 is
relative to position..."

The documentation (as well as the source code) of vtkCoordinate and any
examples or
tests for that class should be more helpful.  Position2 is not necessarily
relative to position(1).

"Finally I tried with actor->PrintSelf(cout,0) and everything seemed to be

PrintSelf will not tell you much other than what Set/Get objects or ivars
are and what they were set to.  Setting an object to, for example,
myObject->DebugOn() and then capturing the output with the following will
tell you much more:

#include "vtkOutputWindow.h"
#include "vtkFileOutputWindow.h"

void myvtkmain(void)
  vtkOutputWindow* ow = vtkOutputWindow::GetInstance();
  vtkFileOutputWindow* fow = vtkFileOutputWindow::New();

  vtkSomeObject* myobject = vtkSomeObject::New();

  // ...



More information about the vtkusers mailing list