cgma
|
#include <CubitCoordinateSystem.hpp>
Public Types | |
enum | Type { Rectangular, Cylindrical, Spherical } |
coordinate systems are of the types: More... | |
Public Member Functions | |
CubitCoordinateSystem (int id) | |
default constructor, initializes to rectangular type with an identity transform | |
~CubitCoordinateSystem () | |
virtual CubitBox | bounding_box () |
get the id | |
virtual const std::type_info & | entity_type_info () const |
virtual const char * | class_name () const |
virtual CubitString | entity_name () const |
Type | get_type () const |
get and set the type of this coordinate system | |
void | set_type (Type) |
const CubitTransformMatrix & | get_transform () const |
return the transform of this coordinate system | |
void | set_transform (const CubitTransformMatrix &mat) |
set the transform of this coordinate system | |
CubitTransformMatrix | get_concatenated_transform () const |
Protected Attributes | |
Type | mType |
CubitTransformMatrix | mMatrix |
CubitCoordinateSystem * | mReference |
DLIList< CubitCoordinateSystem * > | mUses |
Definition at line 12 of file CubitCoordinateSystem.hpp.
coordinate systems are of the types:
Definition at line 18 of file CubitCoordinateSystem.hpp.
{ Rectangular, Cylindrical, Spherical };
default constructor, initializes to rectangular type with an identity transform
Definition at line 14 of file CubitCoordinateSystem.cpp.
: mType(Rectangular), mMatrix(CubitTransformMatrix()), mReference(0) { this->set_id(id); }
destructor, if this system is concatenated to others, their matrices will by multiplied by this transform
Definition at line 20 of file CubitCoordinateSystem.cpp.
{ if(mReference) mReference->mUses.remove(this); // if we have uses, make them reference this reference while(mUses.size()) { CubitCoordinateSystem* sys = mUses.get(); sys->set_transform(sys->mMatrix * this->mMatrix); sys->mReference = this->mReference; if(mReference) mReference->mUses.append(sys); mUses.remove(); } this->remove_from_observers(); AppUtil::instance()->send_event(CubitCoordEvent(CubitCoordEvent::COORDINATE_SYSTEM_DELETED, this)); }
CubitBox CubitCoordinateSystem::bounding_box | ( | void | ) | [virtual] |
get the id
Implements CubitEntity.
Definition at line 41 of file CubitCoordinateSystem.cpp.
{ assert(0); // this function is only here b/c CubitEntity requires it CubitBox temp; return temp; }
const char * CubitCoordinateSystem::class_name | ( | ) | const [virtual] |
Implements CubitEntity.
Definition at line 54 of file CubitCoordinateSystem.cpp.
{ return "Coordinate System"; }
CubitString CubitCoordinateSystem::entity_name | ( | ) | const [virtual] |
Implements CubitEntity.
Definition at line 59 of file CubitCoordinateSystem.cpp.
{ CubitString name = class_name(); name += " "; name += CubitString::number( this->id() ); return name; }
const std::type_info & CubitCoordinateSystem::entity_type_info | ( | ) | const [virtual] |
Implements CubitEntity.
Definition at line 49 of file CubitCoordinateSystem.cpp.
{ return typeid(CubitCoordinateSystem); }
return the transform of this coordinate system with reference to the global coordinate system
return the transform of this coordinate system with respect to the global coordinate system
Definition at line 94 of file CubitCoordinateSystem.cpp.
{ CubitTransformMatrix mat; mat = mMatrix; CubitCoordinateSystem* ref; for(ref = mReference; ref != 0; ref = ref->mReference) mat = mat * ref->mMatrix; return mat; }
const CubitTransformMatrix & CubitCoordinateSystem::get_transform | ( | ) | const |
return the transform of this coordinate system
Definition at line 80 of file CubitCoordinateSystem.cpp.
{ return mMatrix; }
get and set the type of this coordinate system
Definition at line 67 of file CubitCoordinateSystem.cpp.
{ return mType; }
void CubitCoordinateSystem::set_transform | ( | const CubitTransformMatrix & | mat | ) |
set the transform of this coordinate system
Definition at line 85 of file CubitCoordinateSystem.cpp.
{ mMatrix = mat; AppUtil::instance()->send_event(CubitCoordEvent(CubitCoordEvent::COORDINATE_SYSTEM_MODIFIED, this)); }
Definition at line 72 of file CubitCoordinateSystem.cpp.
{ mType = type; AppUtil::instance()->send_event(CubitCoordEvent(CubitCoordEvent::COORDINATE_SYSTEM_MODIFIED, this)); }
CubitTransformMatrix CubitCoordinateSystem::mMatrix [protected] |
Definition at line 59 of file CubitCoordinateSystem.hpp.
CubitCoordinateSystem* CubitCoordinateSystem::mReference [protected] |
Definition at line 61 of file CubitCoordinateSystem.hpp.
Type CubitCoordinateSystem::mType [protected] |
Definition at line 57 of file CubitCoordinateSystem.hpp.
DLIList<CubitCoordinateSystem*> CubitCoordinateSystem::mUses [protected] |
Definition at line 63 of file CubitCoordinateSystem.hpp.