Proposal for changes to vtkMatrix4x4, vtkTransform
David Gobbi
dgobbi at irus.rri.on.ca
Fri Jul 2 12:13:34 EDT 1999
VTK users & developers:
I was wondering if anyone would mind if I changed vtkTransform
so that it was a derived class of vtkMatrix4x4. The changes
are straightforward and wouldn't break anything (I already have
it implemented), but would allow you to use a vtkTransform anywhere that
you would normally use a vtkMatrix4x4.
As well, I'm starting to add warp transformations to
VTK (i.e. a 3D displacement mesh that describes a nonlinear
transformation - it will be a looong time before I'm done), and the
following abstract class would make my life a little easier:
class vtkAbstractTransform : public vtkObject
{
public:
virtual void ApplyToPoint(float in[3], float out[3]) = 0;
virtual void ApplyToPoint(double in[3], double out[3]) = 0;
void ApplyToPoints(vtkPoints *inPts, vtkPoints *outPts);
virtual void Identity() = 0;
virtual void Invert() = 0;
// and these are useful for people who use tcl or python,
float *ApplyToPoint(float in[3])
{ this->ApplyToPoint(in,this->Point); return this->Point; };
float *ApplyToPoint(float x, float y, float z)
{ this->Point[0] = x; this->Point[1] = y; this->Point[2] = z;
return this->ApplyToPoint(this->Point); };
(etc. for double)
private:
float Point[3];
double DoublePoint[3];
}
This class would be the base class of vtkMatrix4x4 as well as other
(not yet implemented) transformations such as quaternions, warp-mesh
transformations, etc.
- David
--David Gobbi, MSc dgobbi at irus.rri.on.ca
Advanced Imaging Research Group
Robarts Research Institute, University of Western Ontario
-----------------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>. For help, send message body containing
"info vtkusers" to the same address. Live long and prosper.
-----------------------------------------------------------------------------
More information about the vtkusers
mailing list