Integer properties This is the father of all properties handling Integers. More...
#include <PropertyStandard.h>
Public Member Functions | |
virtual Property * | Copy (void) const |
Returns a new copy of the property (mainly for Undo/Redo and transactions). | |
virtual 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 |
long | getValue (void) const |
This method returns a string representation of the property. | |
virtual void | Paste (const Property &from) |
PropertyInteger () | |
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 (long) |
Sets the property. | |
~PropertyInteger () | |
Static Public Member Functions | |
static void * | create (void) |
static Base::Type | getClassTypeId (void) |
static void | init (void) |
Protected Attributes | |
long | _lValue |
Integer properties This is the father of all properties handling Integers.
Definition at line 49 of file PropertyStandard.h.
PropertyInteger::PropertyInteger | ( | ) |
PropertyInteger::~PropertyInteger | ( | ) |
Definition at line 65 of file PropertyStandard.cpp.
Property * PropertyInteger::Copy | ( | void | ) | const [virtual] |
Returns a new copy of the property (mainly for Undo/Redo and transactions).
Implements App::Property.
Definition at line 118 of file PropertyStandard.cpp.
References _lValue, draftTools::p, and PropertyInteger().
void * App::PropertyInteger::create | ( | void | ) | [static] |
Reimplemented from App::Property.
Reimplemented in App::PropertyEnumeration, App::PropertyIntegerConstraint, and App::PropertyPercent.
Definition at line 53 of file PropertyStandard.cpp.
Base::Type App::PropertyInteger::getClassTypeId | ( | void | ) | [static] |
Reimplemented from App::Property.
Reimplemented in App::PropertyEnumeration, App::PropertyIntegerConstraint, and App::PropertyPercent.
Definition at line 53 of file PropertyStandard.cpp.
Referenced by Gui::PropertyEditor::PropertyIntegerItem::value().
virtual const char* App::PropertyInteger::getEditorName | ( | void | ) | const [inline, virtual] |
Get the class name of the associated property editor item.
Reimplemented from App::Property.
Reimplemented in App::PropertyEnumeration, and App::PropertyIntegerConstraint.
Definition at line 64 of file PropertyStandard.h.
virtual unsigned int App::PropertyInteger::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 75 of file PropertyStandard.h.
References Py::long.
PyObject * PropertyInteger::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.
Reimplemented in App::PropertyEnumeration.
Definition at line 86 of file PropertyStandard.cpp.
References _lValue.
Base::Type App::PropertyInteger::getTypeId | ( | void | ) | const [virtual] |
Reimplemented from App::Property.
Reimplemented in App::PropertyEnumeration, App::PropertyIntegerConstraint, and App::PropertyPercent.
Definition at line 53 of file PropertyStandard.cpp.
long PropertyInteger::getValue | ( | void | ) | const |
This method returns a string representation of the property.
Definition at line 81 of file PropertyStandard.cpp.
References _lValue.
Referenced by PartGui::ViewProvider2DObject::createGrid(), Gui::ViewProviderAnnotationLabel::drawImage(), Robot::TrajectoryDressUpObject::execute(), App::FeatureTest::execute(), Mesh::Torus::execute(), Mesh::Cone::execute(), Mesh::Cylinder::execute(), Mesh::Ellipsoid::execute(), Mesh::Sphere::execute(), Mesh::RemoveComponents::execute(), Mesh::FillHoles::execute(), App::PropertyEnumeration::getValueAsString(), App::PropertyEnumeration::isValue(), Gui::ViewProviderMeasureDistance::onChanged(), Gui::ViewProviderGeometryObject::onChanged(), PartGui::ViewProviderPartExt::onChanged(), Gui::ViewProviderAnnotation::onChanged(), PartGui::ViewProviderPartBase::onChanged(), MeshGui::ViewProviderMesh::onChanged(), Sandbox::SandboxObject::onChanged(), and RobotGui::TaskTrajectoryDressUpParameter::TaskTrajectoryDressUpParameter().
void App::PropertyInteger::init | ( | void | ) | [static] |
Reimplemented from App::Property.
Reimplemented in App::PropertyEnumeration, App::PropertyIntegerConstraint, and App::PropertyPercent.
Definition at line 53 of file PropertyStandard.cpp.
void PropertyInteger::Paste | ( | const Property & | from | ) | [virtual] |
Definition at line 125 of file PropertyStandard.cpp.
References _lValue, App::Property::aboutToSetValue(), and App::Property::hasSetValue().
void PropertyInteger::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.
Reimplemented in App::PropertyEnumeration.
Definition at line 110 of file PropertyStandard.cpp.
References Base::XMLReader::getAttributeAsInteger(), Base::XMLReader::readElement(), and setValue().
void PropertyInteger::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.
Reimplemented in App::PropertyEnumeration.
Definition at line 105 of file PropertyStandard.cpp.
References _lValue, Base::Writer::ind(), and Base::Writer::Stream().
void PropertyInteger::setPyObject | ( | PyObject * | value | ) | [virtual] |
Reimplemented from Base::BaseClass.
Reimplemented in App::PropertyEnumeration, and App::PropertyIntegerConstraint.
Definition at line 91 of file PropertyStandard.cpp.
References _lValue, App::Property::aboutToSetValue(), draftlibs::dxfReader::error(), and App::Property::hasSetValue().
void PropertyInteger::setValue | ( | long | lValue | ) |
Sets the property.
Reimplemented in App::PropertyEnumeration.
Definition at line 74 of file PropertyStandard.cpp.
References _lValue, App::Property::aboutToSetValue(), and App::Property::hasSetValue().
Referenced by App::FeatureTest::execute(), Gui::ViewProviderGeometryObject::onChanged(), Sandbox::SandboxObject::resetValue(), Restore(), Sandbox::DocumentTestThread::run(), and Sandbox::SandboxObject::setIntValue().
long App::PropertyInteger::_lValue [protected] |
Definition at line 78 of file PropertyStandard.h.
Referenced by Copy(), getPyObject(), getValue(), Paste(), PropertyInteger(), App::PropertyEnumeration::Save(), Save(), App::PropertyIntegerConstraint::setPyObject(), setPyObject(), and setValue().