// // $Id: ReferencePoint.cpp,v 1.7 2000/04/01 23:09:34 hobbs Exp $ // // File: ReferencePoint.cc // Purpose: // Created: 08-OCT-1997 John Hobbs // // $Revision: 1.7 $ // // // Include files #include #include using namespace dgs; // Global definitions SpacePoint ReferencePoint::local_to_global(const CartesianCoordinate& lpt) const // // Purpose: // States: // { return GeometryElement::local_to_global(lpt); } CartesianCoordinate ReferencePoint::global_to_local(const SpacePoint& gpt) const // // Purpose: Convert a global point to its local point representation // States: // { return get_position().invert(gpt); } CartesianCoordinate ReferencePoint::xform_to_local(const GeometryXform& xf) const // // Purpose: Convert a (local)transform to local coordinates. Lose the // rotation information. // { return CartesianCoordinate(xf[0],xf[1],xf[2]); } GeometryXform ReferencePoint::local_to_xform(const CartesianCoordinate& lpt) const // // Purpose: Create a transformation describing a point referenced to my origin. // with my rotation matrix. // { return GeometryXform(lpt.x(),lpt.y(),lpt.z(),0.0,0.0,0.0); } bool ReferencePoint::position_child_at(const CartesianCoordinate& lpt, GeometryElement& kid) // // Purpose: Position a child surface or volume relative to me // States: // { GeometryXform gxf = local_to_xform(lpt); gxf = get_position().apply(gxf); kid.set_position(gxf); return true; } std::ostream& dgs::operator <<(std::ostream& os, const ReferencePoint& me) // // Purpose: Dump the definition of the reference point // States: // { os << "ReferencePoint " << me.get_position() << std::endl; return os; }