SPAtransf
List of: Classes
Subjects: Construction Geometry, Modifying Models, Transforms
Contents: Base

Purpose: Represents a general 3D affine transformation.

Derivation: SPAtransf : -

Filename: base/baseutil/vector/transf.hxx

Description: This class represents a general 3D affine transformation. It is a 4 X 3 matrix by which to multiply a homogeneous vector, but it is stored specially for efficiency.

References: BASE SPAmatrix, SPAvector

Constructor: public: SPAtransf::SPAtransf ();


C++ allocation constructor requests memory for this object but does not populate it.






public: SPAtransf::SPAtransf (


SPAtransf const& // transform


);


C++ copy constructor requests memory for this object and populates it with the data from the object supplied as an argument.






public: void* operator SPAtransf::new (


size_t alloc_size // size of requested




// memory block


);


C++ constructor.






public: void* operator SPAtransf::new (


size_t alloc_size, // size of requested




// memory block


AcisMemType alloc_type, // eDefault, or




// eSession, or




// eDocument, or




// eTemporary


const char* alloc_file, // name of file in




// which new occurred


int alloc_line, // line of file in




// which new occurred


int* alloc_file_index // must always be




// &alloc_file_index


);


New operator for single instances on older compilers where overloading of new and delete are not permitted, and the MMGR_FREELIST compiler flag is given.






public: void* operator new SPAtransf::[] (


size_t alloc_size // size of requested




// memory block


);


New operator for arrays of instances on older compilers where overloading of new and delete are not permitted, and the MMGR_FREELIST compiler flag is given.




Destructor: public: void operator SPAtransf::delete (


void* alloc_ptr // pointer to memory




// block to delete


);


Delete operator for single instances on older compilers where overloading of new and delete are not permitted, and the MMGR_FREELIST compiler flag is given.






public: void operator delete SPAtransf::[] (


void* alloc_ptr // pointer to memory




// block to delete


);


Delete operator for arrays of instances.



Methods: public: SPAmatrix SPAtransf::affine () const;


Returns the affine portion of the transformation. Always normalized: det == + or -1






public: logical SPAtransf::compose (


const transf_decompose_data& // transformation



data,
// data


logical rotate_xyz_axes
// rotate x, y, z


);


Interprets the transf_decompose_data structure as a series of transformations:


[scalex] [scaley] [scalez] [shearxy] [shearxz] [shearyz][rotatex] [rotatey] [rotatez] [translatex] [translatey] [translatez]


Or, if the logical rotate_xyz_axes is FALSE, the sequence is:


[scalex] [scaley] [scalez] [shearxy] [shearxz] [shearyz] [rotate_radians] [rotate_axis] [translatex] [translatey] [translatez]






public: void SPAtransf::debug (


char const*, // leader string


FILE* // pointer



= debug_file_ptr


) const;


Outputs details of a transf to the specified file.






public: logical SPAtransf::decompose (


transf_decompose_data& data // output data


) const;


Decomposes a non-degenerate transformation into data that represents a unique sequence of scaling, shearing, rotating and translating.






public: logical SPAtransf::identity () const;


If level is unspecified or 0, returns the type identifier transf_TYPE. If level is specified, returns transf_TYPE for that level of derivation from ENTITY. The level of this class is defined as transf_LEVEL.






public: SPAtransf SPAtransf::inverse () const;


Returns the inverse transformation. There must be no shear in the given transformation.






public: void* operator SPAtransf::new [](


size_t alloc_size, // size of requested




// memory block


AcisMemType alloc_type, // eDefault, or




// eSession, or




// eDocument, or




// eTemporary


const char* alloc_file, // name of file in




// which new occurred


int alloc_line, // line of file in




// which new occurred


int* alloc_file_index // must always be




// &alloc_file_index


);


New operator for arrays of instances, with decorations to keep track of the file and line where the new was issued. This version is available only on newer compilers that permit overloading of new and delete, and when the MMGR_ENABLED compiler flag is given.






public: logical SPAtransf::operator!= (


SPAtransf const& rhs // transformation


) const;


Compares two transformations. This method does not allow any tolerance so it is not a general equality operator, but it it returns FALSE if one argument is a copy of the other.






public: SPAtransf const& SPAtransf::operator*= (


SPAtransf const& // transformation


);


Multiplies two transformations.






public: logical SPAtransf::operator== (


SPAtransf const& // transformation


) const;


Compares two transformations. This method does not allow any tolerance so it is not a general equality operator, but it it returns TRUE if one argument is a copy of the other.






public: void SPAtransf::print () const;


Print transform data.






public: logical SPAtransf::reflect () const;


Determines if the transformation has a reflection component.






public: logical SPAtransf::rotate () const;


Determines if the transformation has a rotate component.






public: double SPAtransf::scaling () const;


Returns the scaling factor of transformation.






public: logical SPAtransf::shear () const;


Determines if the transformation has a shear component.






public: SPAvector SPAtransf::translation () const;


Return the translation portion of the transformation.






friend: SPAposition operator* (


SPAposition const&, // position


SPAtransf const& // transformation


);


Transform a position.






friend: SPAtransf operator* (


SPAtransf const&, // first transform


SPAtransf const& // second transform


);


Multiplies two transforms.






friend: SPAtransf operator* (


SPAtransf const& t1, // first transform


SPAtransf const* t2 // second transform


);


Multiplies two transforms.






friend: SPAunit_vector operator* (


SPAunit_vector const&, // unit vector


SPAtransf const& // transformation


);


Transforms a unit vector. This method ignores the translation and scaling parts, but complains if there is a shear.






friend: SPAvector operator* (


SPAvector const&, // vector


SPAtransf const& // transformation


);


Transforms a vector, ignoring the translation part of the transformation.

Internal Use: SPAtransf




Related Fncs: coordinate_transf, reflect_transf, rotate_transf, scale_transf, translate_transf
PDF/BASE/03CL.PDF
HTM/DATA/BASE/BASE/03CL/0025.HTM