the Link Poperty with sub elements This property links a object and a defined sequence of sub elements. More...
#include <PropertyLinks.h>
Public Member Functions | |
virtual Property * | Copy (void) const |
Returns a new copy of the property (mainly for Undo/Redo and transactions). | |
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. | |
const std::vector< std::string > & | getSubValues (void) const |
return the list of sub elements | |
std::vector< std::string > | getSubValuesStartsWith (const char *) const |
return the list of sub elements starts with a special string | |
virtual Base::Type | getTypeId (void) const |
template<typename _type > | |
_type | getValue (void) const |
Returns the link type checked. | |
App::DocumentObject * | getValue (Base::Type t) const |
Returns the link type checked. | |
App::DocumentObject * | getValue (void) const |
This method returns the linked DocumentObject. | |
virtual void | Paste (const Property &from) |
PropertyLinkSub () | |
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 (App::DocumentObject *, const std::vector< std::string > &SubList=std::vector< std::string >()) |
Sets the property. | |
~PropertyLinkSub () | |
A destructor. | |
Static Public Member Functions | |
static void * | create (void) |
static Base::Type | getClassTypeId (void) |
static void | init (void) |
Protected Attributes | |
std::vector< std::string > | _cSubList |
App::DocumentObject * | _pcLinkSub |
the Link Poperty with sub elements This property links a object and a defined sequence of sub elements.
This subelemts (like Edges of a Shape) are stored as names, which can be resolved by the ComplexGeoDataType interface to concrete sub objects.
Definition at line 106 of file PropertyLinks.h.
PropertyLinkSub::PropertyLinkSub | ( | ) |
A constructor.
A more elaborate description of the constructor.
Definition at line 169 of file PropertyLinks.cpp.
Referenced by Copy().
PropertyLinkSub::~PropertyLinkSub | ( | ) |
A destructor.
A more elaborate description of the destructor.
Definition at line 176 of file PropertyLinks.cpp.
Property * PropertyLinkSub::Copy | ( | void | ) | const [virtual] |
Returns a new copy of the property (mainly for Undo/Redo and transactions).
Implements App::Property.
Definition at line 310 of file PropertyLinks.cpp.
References _cSubList, _pcLinkSub, draftTools::p, and PropertyLinkSub().
void * App::PropertyLinkSub::create | ( | void | ) | [static] |
Reimplemented from App::Property.
Definition at line 163 of file PropertyLinks.cpp.
Base::Type App::PropertyLinkSub::getClassTypeId | ( | void | ) | [static] |
Reimplemented from App::Property.
Definition at line 163 of file PropertyLinks.cpp.
Referenced by App::Document::breakDependency(), and Gui::TaskView::TaskSelectLinkProperty::TaskSelectLinkProperty().
virtual unsigned int App::PropertyLinkSub::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 157 of file PropertyLinks.h.
PyObject * PropertyLinkSub::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 216 of file PropertyLinks.cpp.
References _cSubList, _pcLinkSub, App::DocumentObject::getPyObject(), Py::new_reference_to(), Py::None(), and draftlibs::fcvec::tup().
const std::vector< std::string > & PropertyLinkSub::getSubValues | ( | void | ) | const |
return the list of sub elements
Definition at line 197 of file PropertyLinks.cpp.
References _cSubList.
Referenced by Sketcher::SketchObject::execute(), and Part::RuledSurface::execute().
std::vector< std::string > PropertyLinkSub::getSubValuesStartsWith | ( | const char * | starter | ) | const |
return the list of sub elements starts with a special string
Definition at line 202 of file PropertyLinks.cpp.
References _cSubList.
Referenced by PartDesign::Fillet::execute(), and Robot::Edge2TracObject::execute().
Base::Type App::PropertyLinkSub::getTypeId | ( | void | ) | const [virtual] |
Reimplemented from App::Property.
Definition at line 163 of file PropertyLinks.cpp.
Referenced by Restore().
_type App::PropertyLinkSub::getValue | ( | void | ) | const [inline] |
Returns the link type checked.
Definition at line 144 of file PropertyLinks.h.
App::DocumentObject * PropertyLinkSub::getValue | ( | Base::Type | t | ) | const |
Returns the link type checked.
Definition at line 211 of file PropertyLinks.cpp.
References _pcLinkSub, App::PropertyContainer::getTypeId(), and Base::Type::isDerivedFrom().
App::DocumentObject * PropertyLinkSub::getValue | ( | void | ) | const |
This method returns the linked DocumentObject.
Definition at line 192 of file PropertyLinks.cpp.
References _pcLinkSub.
Referenced by CmdPartDesignRevolution::activated(), CmdPartDesignPocket::activated(), CmdPartDesignPad::activated(), Sketcher::SketchObjectPy::addExternal(), Sketcher::SketchObject::addExternal(), App::Document::breakDependency(), Sketcher::SketchObject::execute(), Part::RuledSurface::execute(), PartDesign::Fillet::execute(), Robot::Edge2TracObject::execute(), PartDesign::Fillet::mustExecute(), PartDesign::Chamfer::mustExecute(), PartDesignGui::ViewProviderRevolution::onDelete(), PartDesignGui::ViewProviderPocket::onDelete(), PartDesignGui::ViewProviderPad::onDelete(), PartDesignGui::ViewProviderFillet::onDelete(), PartDesignGui::TaskDlgRevolutionParameters::reject(), PartDesignGui::TaskDlgPocketParameters::reject(), PartDesignGui::TaskDlgPadParameters::reject(), PartDesignGui::TaskDlgFilletParameters::reject(), RobotGui::TaskEdge2TracParameter::setHideShowObject(), SketcherGui::SketchSelection::setUp(), and PartDesignGui::TaskPadParameters::TaskPadParameters().
void App::PropertyLinkSub::init | ( | void | ) | [static] |
Reimplemented from App::Property.
Definition at line 163 of file PropertyLinks.cpp.
void PropertyLinkSub::Paste | ( | const Property & | from | ) | [virtual] |
Definition at line 318 of file PropertyLinks.cpp.
References _cSubList, _pcLinkSub, App::Property::aboutToSetValue(), and App::Property::hasSetValue().
void PropertyLinkSub::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 277 of file PropertyLinks.cpp.
References Base::Console(), RobotExampleTrajectoryOutOfShapes::count, Base::XMLReader::getAttribute(), Base::XMLReader::getAttributeAsInteger(), App::PropertyContainer::getClassTypeId(), App::Property::getContainer(), getTypeId(), Base::BaseClass::isDerivedFrom(), Base::XMLReader::readElement(), Base::XMLReader::readEndElement(), setValue(), and Base::ConsoleSingleton::Warning().
void PropertyLinkSub::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 262 of file PropertyLinks.cpp.
References _cSubList, _pcLinkSub, Base::Writer::decInd(), App::DocumentObject::getNameInDocument(), Base::Writer::incInd(), Base::Writer::ind(), and Base::Writer::Stream().
void PropertyLinkSub::setPyObject | ( | PyObject * | value | ) | [virtual] |
Reimplemented from Base::BaseClass.
Definition at line 233 of file PropertyLinks.cpp.
References Py::SeqBase< T >::begin(), Py::SeqBase< T >::end(), draftlibs::dxfReader::error(), App::DocumentObjectPy::getDocumentObjectPtr(), setValue(), Py::SeqBase< T >::size(), draftlibs::fcvec::tup(), and App::DocumentObjectPy::Type.
void PropertyLinkSub::setValue | ( | App::DocumentObject * | lValue, | |
const std::vector< std::string > & | SubList = std::vector<std::string>() | |||
) |
Sets the property.
Definition at line 184 of file PropertyLinks.cpp.
References _cSubList, _pcLinkSub, App::Property::aboutToSetValue(), and App::Property::hasSetValue().
Referenced by App::Document::breakDependency(), Restore(), and setPyObject().
std::vector<std::string> App::PropertyLinkSub::_cSubList [protected] |
Definition at line 163 of file PropertyLinks.h.
Referenced by Copy(), getPyObject(), getSubValues(), getSubValuesStartsWith(), Paste(), Save(), and setValue().
App::DocumentObject* App::PropertyLinkSub::_pcLinkSub [protected] |
Definition at line 162 of file PropertyLinks.h.
Referenced by Copy(), getPyObject(), getValue(), Paste(), Save(), and setValue().