SPAposition
List of: Classes
Subjects: Mathematics
Contents: Base

Purpose: Represents position vectors (points) in 3D Cartesian space that are subject to certain vector and transformation operations.

Derivation: SPAposition : -

Filename: base/baseutil/vector/position.hxx

Description: This class represents position vectors (points) in 3D Cartesian space that are subject to certain vector and transformation operations. This class is distinct from the vector class which is a displacement and is origin independent.

Constructor: public: inline SPAposition::SPAposition ();


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






public: inline SPAposition::SPAposition (


double p[ 3 ] // array of 3 doubles


);


C++ initialize constructor requests memory for this object and populates it with the data supplied as arguments.


Creates a SPAposition using the specified array of three doubles.






public: inline SPAposition::SPAposition (


double xi, // x-coordinate


double yi, // y-coordinate


double zi // z-coordinate


);


C++ initialize constructor requests memory for this object and populates it with the data supplied as arguments.


Creates a SPAposition using the x,y,z coordinates.






public: inline SPAposition::SPAposition (


SPAposition const& p // position


);


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






public: void* operator SPAposition::new (


size_t alloc_size // size of requested




// memory block


);


C++ constructor.






public: void* operator SPAposition::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: void* operator new SPAposition::[] (


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 SPAposition::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 SPAposition::[] (


void* alloc_ptr // pointer to memory




// block to delete


);


Delete operator for arrays of instances.



Methods: public: inline double& SPAposition::coordinate (


int i // ith component


);


Extracts the ith component value.






public: inline double SPAposition::coordinate (


int i // ith component


) const;


Returns the ith component value.






public: void SPAposition::debug (


FILE* // file name



= debug_file_ptr


) const;


Writes information about the position to the debug file or the specified file.






public: void SPAposition::debug_str (


Char* str // string


) const;


Concatenates the information about the position to the passed string.






public: void* operator SPAposition::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: SPAposition const& SPAposition::operator*= (


SPAmatrix const& // matrix


);


Transforms a position.






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


SPAtransf const& // transformation


);


Transforms a position.






public: SPAposition const& SPAposition::operator+= (


SPAvector const& // vector


);


Translates a position by a vector.






public: SPAposition const& SPAposition::operator-= (


SPAvector const& // vector


);


Translates a position by a vector.






public: inline void SPAposition::set_coordinate (


int i, // node position


double new_c // new value


);


Sets the ith component value.






public: inline void SPAposition::set_x (


double new_x // x-coordinate


);


Sets the x-coordinate value.






public: inline void SPAposition::set_y (


double new_y // y-coordinate


);


Sets the y-coordinate value.






public: inline void SPAposition::set_z (


double new_z // z-coordinate


);


Sets the z-coordinate value.






public: inline double& SPAposition::x ();


Extracts the x-coordinate value.






public: inline double SPAposition::x () const;


Returns the x-coordinate value.






public: inline double& SPAposition::y ();


Extracts the y-coordinate value.






public: inline double SPAposition::y () const;


Returns the y-coordinate value.






public: inline double& SPAposition::z ();


Extracts the z-coordinate value.






public: inline double SPAposition::z () const;


Returns the z-coordinate value.






friend: double operator% (


SPAposition const&, // position


SPAvector const& // vector


);


Returns the scalar product of a position with a vector.






friend: double operator% (


SPAvector const&, // vector


SPAposition const& // position


);


Returns the scalar product of a position with a vector.






friend: SPAposition operator* (


SPAmatrix const&, // matrix


SPAposition const& // position


);


Transforms a position.






friend: SPAposition operator* (


SPAposition const&, // position


double // double value


);


Multiplies a position by a double.






friend: SPAposition operator* (


SPAposition const&, // position


SPAmatrix const& // matrix


);


Transforms a position.






friend: SPAposition operator* (


SPAposition const&, // position


SPAtransf const& // transformation


);


Transforms a position.






friend: SPAposition operator* (


SPAposition const&, // position


SPAunit_vector const& // vector


);


Transforms a position using a vector.






friend: SPAposition operator* (


SPAposition const& p, // position


SPAtransf const* t // unit vector


);


Returns the cross product of a position with a unit vector.






friend: SPAposition operator* (


SPAunit_vector const&, // unit vector


SPAposition const& // position


);


Returns the cross product of a position with a unit vector.






friend: SPAposition operator+ (


SPAposition const&, // position


SPAvector const& // vector


);


Translates a position by a vector.






friend: SPAposition operator+ (


SPAvector const&, // vector


SPAposition const& // position


);


Translates a position by a vector.






friend: SPAposition operator- (


SPAposition const&, // position


SPAvector const& // vector


);


Translates a position by a vector.






friend: SPAvector operator- (


SPAposition const&, // position


SPAposition const& // position


);


Returns the displacement (i.e., a vector) as difference of two positions.






friend: logical same_point (


SPAposition const& p1, // position 1


SPAposition const& p2, // position 2


const double res // resolution



= SPAresabs


);


Returns TRUE if the two positions are same i.e., lie within the specified resolution or "SPAresabs" or FALSE otherwise.
PDF/BASE/03CL.PDF
HTM/DATA/BASE/BASE/03CL/0022.HTM