Describes a right-handed coordinate system in 3D space. More...
#include <CoordinateSystem.h>
Public Member Functions | |
CoordinateSystem () | |
Construct a default coordinate system with position in (0,0,0), with X axis (1,0,0), with Y axis (0,1,0) and Z axis (0,0,1) More... | |
Placement | displacement (const CoordinateSystem &cs) const |
This computes the displacement from this coordinate system to the given coordinate system cs. More... | |
const Axis & | getAxis () const |
const Vector3d & | getPosition () const |
const Vector3d & | getXDirection () const |
const Vector3d & | getYDirection () const |
const Vector3d & | getZDirection () const |
void | setAxes (const Axis &, const Vector3d &xd) |
Sets the main axis. More... | |
void | setAxes (const Vector3d &n, const Vector3d &xd) |
Sets the main axis. More... | |
void | setAxis (const Axis &v) |
Sets the main axis. More... | |
void | setPlacement (const Placement &p) |
Set the placement p to the coordinate system. More... | |
void | setPosition (const Vector3d &p) |
void | setXDirection (const Vector3d &) |
The passed vector must not be parallel to the main axis. More... | |
void | setYDirection (const Vector3d &) |
The passed vector must not be parallel to the main axis. More... | |
void | setZDirection (const Vector3d &) |
Sets the main axis. More... | |
void | transform (const Placement &p) |
Apply the placement p to the coordinate system. More... | |
void | transform (const Rotation &r) |
Apply the rotation r to the coordinate system. More... | |
void | transformTo (Vector3d &p) |
Transform the point p to be in this coordinate system. More... | |
~CoordinateSystem () | |
Describes a right-handed coordinate system in 3D space.
CoordinateSystem::CoordinateSystem | ( | ) |
Construct a default coordinate system with position in (0,0,0), with X axis (1,0,0), with Y axis (0,1,0) and Z axis (0,0,1)
CoordinateSystem::~CoordinateSystem | ( | ) |
Placement CoordinateSystem::displacement | ( | const CoordinateSystem & | cs | ) | const |
This computes the displacement from this coordinate system to the given coordinate system cs.
References Base::Axis::getBase(), Base::Axis::getDirection(), getPosition(), getXDirection(), getZDirection(), Base::Rotation::multVec(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
Referenced by draftguitools.gui_stretch.Stretch::doStretch().
const Axis & Base::CoordinateSystem::getAxis | ( | ) | const |
const Vector3d & Base::CoordinateSystem::getPosition | ( | ) | const |
Referenced by displacement().
const Vector3d & Base::CoordinateSystem::getXDirection | ( | ) | const |
Referenced by displacement().
const Vector3d & Base::CoordinateSystem::getYDirection | ( | ) | const |
const Vector3d & Base::CoordinateSystem::getZDirection | ( | ) | const |
Referenced by displacement().
Sets the main axis.
X and Y dir are adjusted accordingly. The main axis must not be parallel to xd
References Base::Vector3< double >::epsilon(), Base::Vector3< _Precision >::Normalize(), Base::Axis::setBase(), Base::Axis::setDirection(), and Base::Vector3< _Precision >::Sqr().
Referenced by setAxis(), and setZDirection().
Sets the main axis.
X and Y dir are adjusted accordingly. The main axis n must not be parallel to xd
References Base::Vector3< double >::epsilon(), Base::Vector3< _Precision >::Normalize(), Base::Axis::setDirection(), and Base::Vector3< _Precision >::Sqr().
void CoordinateSystem::setAxis | ( | const Axis & | v | ) |
Sets the main axis.
X and Y dir are adjusted accordingly. The main axis v must not be parallel to the X axis
References setAxes().
void CoordinateSystem::setPlacement | ( | const Placement & | p | ) |
Set the placement p to the coordinate system.
References Base::Axis::setBase(), and Base::Axis::setDirection().
void Base::CoordinateSystem::setPosition | ( | const Vector3d & | p | ) |
void CoordinateSystem::setXDirection | ( | const Vector3d & | dir | ) |
The passed vector must not be parallel to the main axis.
References Base::Vector3< double >::epsilon(), Base::Axis::getDirection(), Base::Vector3< _Precision >::Normalize(), and Base::Vector3< _Precision >::Sqr().
void CoordinateSystem::setYDirection | ( | const Vector3d & | dir | ) |
The passed vector must not be parallel to the main axis.
References Base::Vector3< double >::epsilon(), Base::Axis::getDirection(), Base::Vector3< _Precision >::Normalize(), and Base::Vector3< _Precision >::Sqr().
void CoordinateSystem::setZDirection | ( | const Vector3d & | dir | ) |
Sets the main axis.
X and Y dir are adjusted accordingly. The main axis must not be parallel to the X axis
References setAxes().
void CoordinateSystem::transform | ( | const Placement & | p | ) |
Apply the placement p to the coordinate system.
Referenced by importSVG.svgHandler::applyTrans(), importSVG.svgHandler::characters(), importSVG.svgHandler::endElement(), ArchSite.Compass::locate(), ArchSite.Compass::rotate(), and ArchSite.Compass::scale().
void CoordinateSystem::transform | ( | const Rotation & | r | ) |
Apply the rotation r to the coordinate system.
References Base::Axis::getDirection(), and Base::Axis::setDirection().
Referenced by importSVG.svgHandler::applyTrans(), importSVG.svgHandler::characters(), importSVG.svgHandler::endElement(), ArchSite.Compass::locate(), ArchSite.Compass::rotate(), and ArchSite.Compass::scale().
void CoordinateSystem::transformTo | ( | Vector3d & | p | ) |
Transform the point p to be in this coordinate system.
References Base::Axis::getBase().