Vector properties This is the father of all properties handling Integers. More...
#include <PropertyGeo.h>
Public Member Functions | |
virtual Property * | Copy (void) const |
Returns a new copy of the property (mainly for Undo/Redo and transactions). | |
const char * | getEditorName (void) const |
Get the class name of the associated property editor item. | |
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? This method is defined in Base::Persistence. | |
virtual PyObject * | getPyObject (void) |
This method returns the Python wrapper for a C++ object. | |
virtual Base::Type | getTypeId (void) const |
const Base::Placement & | getValue (void) const |
This method returns a string representation of the property. | |
virtual void | Paste (const Property &from) |
PropertyPlacement () | |
A constructor. | |
virtual void | Restore (Base::XMLReader &reader) |
This method is used to restore properties from an XML document. | |
virtual void | Save (Base::Writer &writer) const |
This method is used to save properties to an XML document. | |
virtual void | setPyObject (PyObject *) |
void | setValue (const Base::Placement &pos) |
Sets the property. | |
~PropertyPlacement () | |
A destructor. | |
Static Public Member Functions | |
static void * | create (void) |
static Base::Type | getClassTypeId (void) |
static void | init (void) |
Static Public Attributes | |
static const Placement | Null |
Vector properties This is the father of all properties handling Integers.
Definition at line 209 of file PropertyGeo.h.
PropertyPlacement::PropertyPlacement | ( | ) |
A constructor.
A more elaborate description of the constructor.
Definition at line 476 of file PropertyGeo.cpp.
Referenced by Copy().
PropertyPlacement::~PropertyPlacement | ( | ) |
A destructor.
A more elaborate description of the destructor.
Definition at line 482 of file PropertyGeo.cpp.
Property * PropertyPlacement::Copy | ( | void | ) | const [virtual] |
Returns a new copy of the property (mainly for Undo/Redo and transactions).
Implements App::Property.
Definition at line 557 of file PropertyGeo.cpp.
References draftTools::p, and PropertyPlacement().
void * App::PropertyPlacement::create | ( | void | ) | [static] |
Reimplemented from App::Property.
Definition at line 470 of file PropertyGeo.cpp.
Base::Type App::PropertyPlacement::getClassTypeId | ( | void | ) | [static] |
Reimplemented from App::Property.
Definition at line 470 of file PropertyGeo.cpp.
Referenced by StdCmdPlacement::activated(), Gui::PropertyEditor::PropertyPlacementItem::toolTip(), Gui::ViewProviderGeometryObject::updateData(), and Gui::PropertyEditor::PropertyPlacementItem::value().
const char* App::PropertyPlacement::getEditorName | ( | void | ) | const [inline, virtual] |
Get the class name of the associated property editor item.
Reimplemented from App::Property.
Definition at line 233 of file PropertyGeo.h.
virtual unsigned int App::PropertyPlacement::getMemSize | ( | void | ) | const [inline, 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? This method is defined in Base::Persistence.
Reimplemented from App::Property.
Definition at line 246 of file PropertyGeo.h.
PyObject * PropertyPlacement::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 503 of file PropertyGeo.cpp.
Base::Type App::PropertyPlacement::getTypeId | ( | void | ) | const [virtual] |
Reimplemented from App::Property.
Definition at line 470 of file PropertyGeo.cpp.
const Base::Placement & PropertyPlacement::getValue | ( | void | ) | const |
This method returns a string representation of the property.
Definition at line 498 of file PropertyGeo.cpp.
Referenced by RobotGui::ViewProviderRobotObject::DraggerMotionCallback(), Robot::TrajectoryDressUpObject::execute(), Robot::RobotObject::onChanged(), Robot::RobotObject::Restore(), RobotGui::ViewProviderRobotObject::setAxisTo(), RobotGui::ViewProviderRobotObject::setDragger(), RobotGui::TaskRobot6Axis::setRobot(), RobotGui::TaskTrajectory::setTo(), RobotGui::TaskTrajectory::TaskTrajectory(), RobotGui::TaskTrajectoryDressUpParameter::TaskTrajectoryDressUpParameter(), RobotGui::TrajectorySimulate::TrajectorySimulate(), RobotGui::ViewProviderTrajectory::updateData(), and RobotGui::ViewProviderRobotObject::updateData().
void App::PropertyPlacement::init | ( | void | ) | [static] |
Reimplemented from App::Property.
Definition at line 470 of file PropertyGeo.cpp.
void PropertyPlacement::Paste | ( | const Property & | from | ) | [virtual] |
Definition at line 564 of file PropertyGeo.cpp.
References App::Property::aboutToSetValue(), and App::Property::hasSetValue().
void PropertyPlacement::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"); }
Implements Base::Persistence.
Definition at line 540 of file PropertyGeo.cpp.
References App::Property::aboutToSetValue(), Base::XMLReader::getAttributeAsFloat(), App::Property::hasSetValue(), and Base::XMLReader::readElement().
void PropertyPlacement::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.
Implements Base::Persistence.
Definition at line 527 of file PropertyGeo.cpp.
References Base::Placement::getPosition(), Base::Placement::getRotation(), Base::Writer::ind(), Base::Writer::Stream(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
void PropertyPlacement::setPyObject | ( | PyObject * | value | ) | [virtual] |
Reimplemented from Base::BaseClass.
Definition at line 508 of file PropertyGeo.cpp.
References draftlibs::dxfReader::error(), Base::Placement::fromMatrix(), draftTools::p, setValue(), Base::PlacementPy::Type, Base::MatrixPy::Type, and Base::MatrixPy::value().
void PropertyPlacement::setValue | ( | const Base::Placement & | pos | ) |
Sets the property.
Definition at line 491 of file PropertyGeo.cpp.
References App::Property::aboutToSetValue(), and App::Property::hasSetValue().
Referenced by RobotGui::ViewProviderRobotObject::DraggerMotionCallback(), Robot::RobotObject::onChanged(), Robot::RobotObject::Restore(), setPyObject(), and RobotGui::TaskTrajectoryDressUpParameter::writeValues().
const Placement App::PropertyPlacement::Null [static] |
Definition at line 250 of file PropertyGeo.h.