FreeCAD C++
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
App::Property Class Referenceabstract

#include <App/Property.h>

Detailed Description

Base class of all properties This is the father of all properties. Properties are objects which are used in the document tree to parametrize e.g. features and their graphical output. They are also used to gain access from the scripting facility. /par This abstract base class defines all methods shared by all possible properties. It is also possible to define user properties and use them in the framework...

Public Member Functions

virtual unsigned int getMemSize (void) const
 
const char * getName (void) const
 get the name of this property in the belonging container
 
virtual const char * getEditorName (void) const
 Get the class name of the associated property editor item.
 
short getType (void) const
 Get the type of the property in the container.
 
const char * getGroup (void) const
 Get the group of this property.
 
const char * getDocumentation (void) const
 Get the documentation of this property.
 
void setContainer (PropertyContainer *Father)
 Is called by the framework to set the father (container)
 
PropertyContainergetContainer (void) const
 Get a pointer to the PropertyContainer derived class the property belongs to.
 
virtual void setPathValue (const App::ObjectIdentifier &path, const boost::any &value)
 Set value of property.
 
virtual const boost::any getPathValue (const App::ObjectIdentifier &path) const
 Get value of property.
 
virtual const App::ObjectIdentifier canonicalPath (const App::ObjectIdentifier &p) const
 Convert p to a canonical representation of it.
 
virtual void getPaths (std::vector< App::ObjectIdentifier > &paths) const
 Get valid paths for this property; used by auto completer.
 
virtual PropertyCopy (void) const =0
 Returns a new copy of the property (mainly for Undo/Redo and transactions)
 
virtual void Paste (const Property &from)=0
 Paste the value from the property (mainly for Undo/Redo and transactions)
 
void touch ()
 Set the property touched. More...
 
bool isTouched (void) const
 Test if this property is touched.
 
void purgeTouched (void)
 Reset this property touched.
 
unsigned long getStatus () const
 return the status bits
 
void setReadOnly (bool readOnly)
 Sets property editable/grayed out in property editor.
 
void setSinglePrecision (bool single)
 
bool isSinglePrecision () const
 Gets precision of properties using floating point numbers.
 
- Public Member Functions inherited from Base::Persistence
virtual void Save (Writer &) const =0
 
virtual void Restore (XMLReader &)=0
 
virtual void SaveDocFile (Writer &) const
 
virtual void RestoreDocFile (Reader &)
 
- Public Member Functions inherited from Base::BaseClass
 BaseClass ()
 Construction.
 
virtual ~BaseClass ()
 Destruction.
 

Protected Member Functions

void hasSetValue (void)
 Gets called by all setValue() methods after the value has changed.
 
void aboutToSetValue (void)
 Gets called by all setValue() methods before the value has changed.
 
virtual void verifyPath (const App::ObjectIdentifier &p) const
 Verify a path for the current property.
 

Protected Attributes

std::bitset< 32 > StatusBits
 

Additional Inherited Members

- Static Public Member Functions inherited from Base::Persistence
static std::string encodeAttribute (const std::string &)
 Encodes an attribute upon saving.
 

Member Function Documentation

◆ getMemSize()

virtual unsigned int App::Property::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? This method is defined in Base::Persistence

See also
Base::Persistence

Implements Base::Persistence.

◆ setSinglePrecision()

void App::Property::setSinglePrecision ( bool  single)

Sets precision of properties using floating point numbers to single, the default is double.

◆ touch()

void App::Property::touch ( )

Set the property touched.

Property status handling

Member Data Documentation

◆ StatusBits

std::bitset<32> App::Property::StatusBits
protected

Status bits of the property The first 8 bits are used for the base system the rest can be used in descendent classes to mark special statuses on the objects. The bits and their meaning are listed below: 0 - object is marked as 'touched' 1 - object is marked as 'immutable' 2 - object is marked as 'read-only' (for property editor) 3 - object is marked as 'hidden' (for property editor)