#include <Geometry.h>
Public Member Functions | |
virtual Geometry * | clone (void) const |
returns a cloned object | |
GeomLineSegment () | |
Base::Vector3d | getEndPoint () const |
virtual unsigned int | getMemSize (void) const |
This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB? | |
virtual PyObject * | getPyObject (void) |
This method returns the Python wrapper for a C++ object. | |
Base::Vector3d | getStartPoint () const |
virtual Base::Type | getTypeId (void) const |
const Handle_Geom_Geometry & | handle () const |
virtual void | Restore (Base::XMLReader &) |
This method is used to restore properties from an XML document. | |
virtual void | Save (Base::Writer &) const |
This method is used to save properties to an XML document. | |
void | setHandle (const Handle_Geom_TrimmedCurve &) |
void | setPoints (const Base::Vector3d &p1, const Base::Vector3d &p2) |
virtual | ~GeomLineSegment () |
Static Public Member Functions | |
static void * | create (void) |
static Base::Type | getClassTypeId (void) |
static void | init (void) |
Definition at line 325 of file Geometry.h.
GeomLineSegment::GeomLineSegment | ( | ) |
Definition at line 1023 of file Geometry.cpp.
Referenced by clone().
GeomLineSegment::~GeomLineSegment | ( | ) | [virtual] |
Definition at line 1032 of file Geometry.cpp.
Geometry * GeomLineSegment::clone | ( | void | ) | const [virtual] |
returns a cloned object
Implements Part::Geometry.
Definition at line 1049 of file Geometry.cpp.
References Part::Geometry::Construction, and GeomLineSegment().
Referenced by Sketcher::SketchPy::addGeometry(), Sketcher::Sketch::addLineSegment(), and getPyObject().
void * Part::GeomLineSegment::create | ( | void | ) | [static] |
Reimplemented from Part::GeomCurve.
Definition at line 1021 of file Geometry.cpp.
Base::Type Part::GeomLineSegment::getClassTypeId | ( | void | ) | [static] |
Reimplemented from Part::GeomCurve.
Definition at line 1021 of file Geometry.cpp.
Referenced by CmdSketcherConstrainSymmetric::activated(), CmdSketcherConstrainEqual::activated(), CmdSketcherConstrainAngle::activated(), CmdSketcherConstrainPerpendicular::activated(), CmdSketcherConstrainParallel::activated(), CmdSketcherConstrainDistanceY::activated(), CmdSketcherConstrainDistanceX::activated(), CmdSketcherConstrainPointOnObject::activated(), CmdSketcherConstrainDistance::activated(), CmdSketcherConstrainVertical::activated(), CmdSketcherConstrainHorizontal::activated(), SketcherGui::TrimmingSelection::allow(), SketcherGui::FilletSelection::allow(), DrawSketchHandlerTrimming::releaseButton(), DrawSketchHandlerFillet::releaseButton(), and DrawSketchHandlerLineSet::releaseButton().
Base::Vector3d GeomLineSegment::getEndPoint | ( | ) | const |
Definition at line 1064 of file Geometry.cpp.
References handle().
Referenced by CmdSketcherConstrainAngle::activated(), CmdSketcherConstrainDistanceY::activated(), CmdSketcherConstrainDistanceX::activated(), CmdSketcherConstrainDistance::activated(), Sketcher::Sketch::addLineSegment(), SketcherGui::ViewProviderSketch::draw(), Sketcher::SketchObject::fillet(), Sketcher::SketchObject::getPoint(), SketcherGui::ViewProviderSketch::moveConstraint(), DrawSketchHandlerFillet::releaseButton(), DrawSketchHandlerLineSet::releaseButton(), Part::LinePy::representation(), Save(), and Sketcher::SketchObject::trim().
unsigned int GeomLineSegment::getMemSize | ( | void | ) | const [virtual] |
This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB?
Reimplemented from Part::Geometry.
Definition at line 1099 of file Geometry.cpp.
PyObject * GeomLineSegment::getPyObject | ( | void | ) | [virtual] |
This method returns the Python wrapper for a C++ object.
It's in the responsibility of the programmer to do the correct reference counting. Basically there are two ways how to implement that: Either always return a new Python object then reference counting is not a matter or return always the same Python object then the reference counter must be incremented by one. However, it's absolutely forbidden to return always the same Python object without incrementing the reference counter.
The default implementation returns 'None'.
Reimplemented from Base::BaseClass.
Definition at line 1140 of file Geometry.cpp.
References clone().
Base::Vector3d GeomLineSegment::getStartPoint | ( | ) | const |
Definition at line 1057 of file Geometry.cpp.
References handle().
Referenced by CmdSketcherConstrainAngle::activated(), CmdSketcherConstrainDistanceY::activated(), CmdSketcherConstrainDistanceX::activated(), CmdSketcherConstrainDistance::activated(), Sketcher::Sketch::addLineSegment(), SketcherGui::ViewProviderSketch::draw(), Sketcher::SketchObject::fillet(), Sketcher::SketchObject::getPoint(), SketcherGui::ViewProviderSketch::moveConstraint(), DrawSketchHandlerFillet::releaseButton(), Part::LinePy::representation(), Save(), and Sketcher::SketchObject::trim().
Base::Type Part::GeomLineSegment::getTypeId | ( | void | ) | const [virtual] |
Reimplemented from Part::GeomCurve.
Definition at line 1021 of file Geometry.cpp.
const Handle_Geom_Geometry & GeomLineSegment::handle | ( | ) | const [virtual] |
Implements Part::Geometry.
Definition at line 1044 of file Geometry.cpp.
Referenced by Part::TopoShapeEdgePy::getCurve(), getEndPoint(), getStartPoint(), Part::LinePy::PyInit(), setPoints(), and Part::CylinderPy::uIso().
void Part::GeomLineSegment::init | ( | void | ) | [static] |
Reimplemented from Part::GeomCurve.
Definition at line 1021 of file Geometry.cpp.
Referenced by initPart().
void GeomLineSegment::Restore | ( | Base::XMLReader & | ) | [virtual] |
This method is used to restore properties from an XML document.
It uses the XMLReader class, which bases on SAX, to read the in Save() written information. Again the Vector as an example:
void PropertyVector::Restore(Base::XMLReader &reader) { // read my Element reader.readElement("PropertyVector"); // get the value of my Attribute _cVec.x = (float)reader.getAttributeAsFloat("valueX"); _cVec.y = (float)reader.getAttributeAsFloat("valueY"); _cVec.z = (float)reader.getAttributeAsFloat("valueZ"); }
Reimplemented from Part::Geometry.
Definition at line 1120 of file Geometry.cpp.
References Base::XMLReader::getAttributeAsFloat(), Base::XMLReader::readElement(), and setPoints().
void GeomLineSegment::Save | ( | Base::Writer & | ) | const [virtual] |
This method is used to save properties to an XML document.
A good example you'll find in PropertyStandard.cpp, e.g. the vector:
void PropertyVector::Save (Writer &writer) const { writer << writer.ind() << "<PropertyVector valueX=\"" << _cVec.x << "\" valueY=\"" << _cVec.y << "\" valueZ=\"" << _cVec.z <<"\"/>" << endl; }
The writer.ind() expression writes the indention, just for pretty printing of the XML. As you see, the writing of the XML document is not done with a DOM implementation because of performance reasons. Therefore the programmer has to take care that a valid XML document is written. This means closing tags and writing UTF-8.
Reimplemented from Part::Geometry.
Definition at line 1100 of file Geometry.cpp.
References getEndPoint(), getStartPoint(), Base::Writer::ind(), RobotExample::Start, Base::Writer::Stream(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
void GeomLineSegment::setHandle | ( | const Handle_Geom_TrimmedCurve & | c | ) |
Definition at line 1036 of file Geometry.cpp.
void GeomLineSegment::setPoints | ( | const Base::Vector3d & | p1, | |
const Base::Vector3d & | p2 | |||
) |
Definition at line 1071 of file Geometry.cpp.
References gce_ErrorStatusText(), handle(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
Referenced by Restore().