cgma
CubitCoordinateSystem Class Reference

#include <CubitCoordinateSystem.hpp>

Inheritance diagram for CubitCoordinateSystem:
CubitEntity CubitObservable

List of all members.

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 CubitTransformMatrixget_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
CubitCoordinateSystemmReference
DLIList< CubitCoordinateSystem * > mUses

Detailed Description

Definition at line 12 of file CubitCoordinateSystem.hpp.


Member Enumeration Documentation

coordinate systems are of the types:

Enumerator:
Rectangular 
Cylindrical 
Spherical 

Definition at line 18 of file CubitCoordinateSystem.hpp.


Constructor & Destructor Documentation

default constructor, initializes to rectangular type with an identity transform

Definition at line 14 of file CubitCoordinateSystem.cpp.

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));
}

Member Function Documentation

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";
}

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;
}

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;
}

set the transform of this coordinate system

Definition at line 85 of file CubitCoordinateSystem.cpp.


Member Data Documentation

Definition at line 57 of file CubitCoordinateSystem.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines