#include "CubitCoordinateSystem.hpp"<--- Skipping configuration 'DBL_MAX' since the value of 'DBL_MAX' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'DBL_MIN' since the value of 'DBL_MIN' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'M_PI' since the value of 'M_PI' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
#include <cassert>
#include "CubitMessage.hpp"
#include "CubitBox.hpp"
#include "CubitObserver.hpp"
#include "CubitString.hpp"
#include "AppUtil.hpp"
#include "CubitCoordEvent.hpp"
//! default constructor, initializes to rectangular type with an identity transform
CubitCoordinateSystem::CubitCoordinateSystem(int id)
: mType(Rectangular), mMatrix(CubitTransformMatrix()), mReference(0)
{
this->set_id(id);
}
CubitCoordinateSystem::~CubitCoordinateSystem()
{
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()
{
assert(0); // this function is only here b/c CubitEntity requires it
CubitBox temp;
return temp;
}
const std::type_info& CubitCoordinateSystem::entity_type_info() const
{
return typeid(CubitCoordinateSystem);
}
const char* CubitCoordinateSystem::class_name() const
{
return "Coordinate System";
}
CubitString CubitCoordinateSystem::entity_name() const
{
CubitString name = class_name();
name += " ";
name += CubitString::number( this->id() );
return name;
}
CubitCoordinateSystem::Type CubitCoordinateSystem::get_type() const
{
return mType;
}
void CubitCoordinateSystem::set_type(CubitCoordinateSystem::Type type)
{<--- The function 'set_type' is never used.
mType = type;
AppUtil::instance()->send_event(CubitCoordEvent(CubitCoordEvent::COORDINATE_SYSTEM_MODIFIED, this));
}
//! return the transform of this coordinate system
const CubitTransformMatrix& CubitCoordinateSystem::get_transform() const
{<--- The function 'get_transform' is never used.
return mMatrix;
}
void CubitCoordinateSystem::set_transform(const CubitTransformMatrix& mat)
{
mMatrix = mat;
AppUtil::instance()->send_event(CubitCoordEvent(CubitCoordEvent::COORDINATE_SYSTEM_MODIFIED, this));
}
//! return the transform of this coordinate system
//! with respect to the global coordinate system
CubitTransformMatrix CubitCoordinateSystem::get_concatenated_transform() const
{<--- The function 'get_concatenated_transform' is never used.
CubitTransformMatrix mat;
mat = mMatrix;
CubitCoordinateSystem* ref;
for(ref = mReference; ref != 0; ref = ref->mReference)
mat = mat * ref->mMatrix;
return mat;
}