Float properties This is the father of all properties handling floats. 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 |
float | getValue (void) const |
virtual void | Paste (const Property &from) |
PropertyFloat (void) | |
Value Constructor Construct with explicite Values. | |
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 (float lValue) |
virtual | ~PropertyFloat () |
A destructor. | |
Static Public Member Functions | |
static void * | create (void) |
static Base::Type | getClassTypeId (void) |
static void | init (void) |
Protected Attributes | |
float | _dValue |
Float properties This is the father of all properties handling floats.
Use this type only in rare cases. Mostly you want to use the more specialized types like e.g. PropertyLenth. These properties fulfill also the needs of the unit system. See PropertyUnits.h for all properties with units.
Definition at line 308 of file PropertyStandard.h.
PropertyFloat::PropertyFloat | ( | void | ) |
Value Constructor Construct with explicite Values.
Definition at line 733 of file PropertyStandard.cpp.
References _dValue.
Referenced by Copy().
PropertyFloat::~PropertyFloat | ( | ) | [virtual] |
A destructor.
A more elaborate description of the destructor.
Definition at line 738 of file PropertyStandard.cpp.
Property * PropertyFloat::Copy | ( | void | ) | const [virtual] |
Returns a new copy of the property (mainly for Undo/Redo and transactions).
Implements App::Property.
Definition at line 795 of file PropertyStandard.cpp.
References _dValue, draftTools::p, and PropertyFloat().
void * App::PropertyFloat::create | ( | void | ) | [static] |
Reimplemented from App::Property.
Reimplemented in App::PropertyFloatConstraint, App::PropertyDistance, App::PropertyLength, App::PropertyAngle, App::PropertySpeed, App::PropertyAcceleration, and Points::PropertyGreyValue.
Definition at line 727 of file PropertyStandard.cpp.
Base::Type App::PropertyFloat::getClassTypeId | ( | void | ) | [static] |
Reimplemented from App::Property.
Reimplemented in App::PropertyFloatConstraint, App::PropertyDistance, App::PropertyLength, App::PropertyAngle, App::PropertySpeed, App::PropertyAcceleration, and Points::PropertyGreyValue.
Definition at line 727 of file PropertyStandard.cpp.
Referenced by Gui::PropertyEditor::PropertyFloatItem::value().
virtual const char* App::PropertyFloat::getEditorName | ( | void | ) | const [inline, virtual] |
Get the class name of the associated property editor item.
Reimplemented from App::Property.
Reimplemented in App::PropertyFloatConstraint, App::PropertyDistance, App::PropertyLength, App::PropertyAngle, App::PropertySpeed, and App::PropertyAcceleration.
Definition at line 328 of file PropertyStandard.h.
virtual unsigned int App::PropertyFloat::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 339 of file PropertyStandard.h.
PyObject * PropertyFloat::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 758 of file PropertyStandard.cpp.
References _dValue.
Base::Type App::PropertyFloat::getTypeId | ( | void | ) | const [virtual] |
Reimplemented from App::Property.
Reimplemented in App::PropertyFloatConstraint, App::PropertyDistance, App::PropertyLength, App::PropertyAngle, App::PropertySpeed, App::PropertyAcceleration, and Points::PropertyGreyValue.
Definition at line 727 of file PropertyStandard.cpp.
float PropertyFloat::getValue | ( | void | ) | const |
Definition at line 753 of file PropertyStandard.cpp.
References _dValue.
Referenced by PartGui::ViewProvider2DObject::createGrid(), Gui::PointMarker::customEvent(), Gui::ViewProviderAnnotationLabel::drawImage(), Robot::TrajectoryDressUpObject::execute(), Part::Wedge::execute(), Part::Helix::execute(), Part::Torus::execute(), Part::Cone::execute(), Part::Cylinder::execute(), Part::Ellipsoid::execute(), Part::Sphere::execute(), Part::Plane::execute(), Part::Vertex::execute(), Inspection::Feature::execute(), Drawing::FeatureViewPart::execute(), PartDesign::Revolution::execute(), Part::Revolution::execute(), PartDesign::Pocket::execute(), Part::Circle::execute(), Part::Box::execute(), PartDesign::Pad::execute(), Mesh::Cube::execute(), Mesh::Torus::execute(), Mesh::Cone::execute(), Mesh::Cylinder::execute(), Mesh::Ellipsoid::execute(), Mesh::Sphere::execute(), Mesh::FillHoles::execute(), Mesh::FixDeformations::execute(), PartDesign::Fillet::execute(), Robot::Edge2TracObject::execute(), MeshGui::ViewProviderMeshNode::onChanged(), InspectionGui::ViewProviderInspection::onChanged(), FemGui::ViewProviderFemMesh::onChanged(), PartGui::ViewProviderPartExt::onChanged(), MeshGui::ViewProviderMeshDefects::onChanged(), Gui::ViewProviderAnnotation::onChanged(), PointsGui::ViewProviderPoints::onChanged(), PartGui::ViewProviderPartBase::onChanged(), MeshGui::ViewProviderMesh::onChanged(), Robot::RobotObject::onChanged(), Robot::RobotObject::Restore(), Part::Box::Restore(), RobotGui::TaskRobot6Axis::setRobot(), SketcherGui::ViewProviderSketch::snapToGrid(), PartDesignGui::TaskFilletParameters::TaskFilletParameters(), PartDesignGui::TaskPadParameters::TaskPadParameters(), PartDesignGui::TaskPocketParameters::TaskPocketParameters(), PartDesignGui::TaskRevolutionParameters::TaskRevolutionParameters(), RobotGui::TaskTrajectoryDressUpParameter::TaskTrajectoryDressUpParameter(), RobotGui::ViewProviderRobotObject::updateData(), Gui::ViewProviderMeasureDistance::updateData(), ImageGui::ViewProviderImagePlane::updateData(), FemGui::ViewProviderFemMesh::ViewProviderFemMesh(), PartGui::ViewProviderPartBase::ViewProviderPartBase(), PartGui::ViewProviderPartExt::ViewProviderPartExt(), and PointsGui::ViewProviderPoints::ViewProviderPoints().
void App::PropertyFloat::init | ( | void | ) | [static] |
Reimplemented from App::Property.
Reimplemented in App::PropertyFloatConstraint, App::PropertyDistance, App::PropertyLength, App::PropertyAngle, App::PropertySpeed, App::PropertyAcceleration, and Points::PropertyGreyValue.
Definition at line 727 of file PropertyStandard.cpp.
void PropertyFloat::Paste | ( | const Property & | from | ) | [virtual] |
Definition at line 802 of file PropertyStandard.cpp.
References _dValue, App::Property::aboutToSetValue(), and App::Property::hasSetValue().
void PropertyFloat::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 787 of file PropertyStandard.cpp.
References Base::XMLReader::getAttributeAsFloat(), Base::XMLReader::readElement(), and setValue().
void PropertyFloat::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 782 of file PropertyStandard.cpp.
References _dValue, Base::Writer::ind(), and Base::Writer::Stream().
void PropertyFloat::setPyObject | ( | PyObject * | value | ) | [virtual] |
Reimplemented from Base::BaseClass.
Reimplemented in App::PropertyFloatConstraint, and App::PropertyLength.
Definition at line 763 of file PropertyStandard.cpp.
References _dValue, App::Property::aboutToSetValue(), draftlibs::dxfReader::error(), and App::Property::hasSetValue().
void PropertyFloat::setValue | ( | float | lValue | ) |
Definition at line 746 of file PropertyStandard.cpp.
References _dValue, App::Property::aboutToSetValue(), and App::Property::hasSetValue().
Referenced by App::MeasureDistance::execute(), Robot::RobotObject::onChanged(), Restore(), Part::Box::Restore(), MeshGui::DlgSettingsMeshView::saveSettings(), SketcherGui::TaskSketcherGeneral::setGridSize(), App::PropertyLength::setPyObject(), and RobotGui::TaskTrajectoryDressUpParameter::writeValues().
float App::PropertyFloat::_dValue [protected] |
Definition at line 342 of file PropertyStandard.h.
Referenced by Copy(), getPyObject(), getValue(), Paste(), PropertyFloat(), Save(), App::PropertyFloatConstraint::setPyObject(), setPyObject(), and setValue().