|
QCAD Application Framework
CAD Application Development and Automation.
|
Abstract base class for all objects. More...
#include <RObject.h>
Public Types | |
| typedef int | Handle |
| typedef int | Id |
| enum | XYZ { X, Y, Z } |
Public Member Functions | |
| virtual RObject * | clone () const =0 |
| virtual int | getComplexity () const |
| QMap< QString, QVariant > | getCustomProperties () const |
| QVariant | getCustomProperty (const QString &key, const QVariant &defaultValue=RDEFAULT_QVARIANT) |
| RDocument * | getDocument () |
| const RDocument * | getDocument () const |
| RObject::Handle | getHandle () const |
| RObject::Id | getId () const |
| virtual QPair< QVariant, RPropertyAttributes > | getProperty (RPropertyTypeId propertyTypeId, bool humanReadable=false, bool noAttributes=false) |
| virtual QSet< RPropertyTypeId > | getPropertyTypeIds () const |
| virtual bool | hasPropertyType (RPropertyTypeId propertyTypeId) |
| virtual bool | isSelectedForPropertyEditing ()=0 |
| bool | isUndone () const |
| void | removeCustomProperty (const QString &key) |
| Removes the custom property with the given name. | |
| RObject (RDocument *document=NULL, Id id=INVALID_ID) | |
| void | setCustomProperty (const QString &key, const QVariant &value) |
| Sets a custom property with the given name. | |
| void | setDocument (RDocument *document) |
| virtual bool | setProperty (RPropertyTypeId propertyTypeId, const QVariant &value) |
| Sets the given property to the given value. | |
| virtual void | setUndone (bool on) |
| virtual | ~RObject () |
Static Public Member Functions | |
| static void | init () |
| template<class T > | |
| static bool | setMember (T &variable, const QVariant &value, bool condition=true) |
Static Public Attributes | |
| static const Handle | INVALID_HANDLE = -1 |
| static const Id | INVALID_ID = -1 |
| static RPropertyTypeId | PropertyCustom |
| static RPropertyTypeId | PropertyHandle |
Protected Member Functions | |
| virtual void | print (QDebug dbg) const |
| Stream operator for QDebug. | |
| void | setHandle (RObject::Handle h) |
| void | setId (RObject::Id id) |
| bool | setMember (QList< double > &variable, const QVariant &value, bool condition) |
Static Protected Member Functions | |
| static bool | setMember (QString &variable, const QVariant &value, bool condition=true) |
| Sets the given property. | |
| static bool | setMember (double &variable, const QVariant &value, bool condition=true) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| static bool | setMember (int &variable, const QVariant &value, bool condition=true) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| static bool | setMember (bool &variable, const QVariant &value, bool condition=true) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| static bool | setMemberVector (QList< RVector > &variable, const QVariant &value, RObject::XYZ xyz) |
| static bool | setMemberX (QList< RVector > &variable, const QVariant &value, bool condition=true) |
| static bool | setMemberY (QList< RVector > &variable, const QVariant &value, bool condition=true) |
| static bool | setMemberZ (QList< RVector > &variable, const QVariant &value, bool condition=true) |
Private Attributes | |
| QMap< QString, QVariant > | customProperties |
| RDocument * | document |
| Handle | handle |
| Id | objectId |
| Unique ID of this object. | |
| bool | undone |
Friends | |
| QDebug | operator<< (QDebug dbg, const RObject &o) |
| class | RStorage |
Abstract base class for all objects.
Objects have an unique ID. Object types may register property types. Objects manage their own set of properties. Example objects are entities, layers, user coordinate systems.
| typedef int RObject::Handle |
| typedef int RObject::Id |
| enum RObject::XYZ |
|
inline |
|
inlinevirtual |
|
pure virtual |
Implemented in RDimAngularEntity, REntity, RDimOrdinateEntity, RDimRotatedEntity, REllipseEntity, RDimAlignedEntity, RUcs, RDimDiametricEntity, RDimRadialEntity, RSolidEntity, RTextEntity, RArcEntity, RImageEntity, RLayer, RHatchEntity, RLineEntity, RSplineEntity, RCircleEntity, RPolylineEntity, RBlockReferenceEntity, RLinetype, RLeaderEntity, RPointEntity, RView, and RBlock.
|
inlinevirtual |
Reimplemented in REntity, RPolylineEntity, RSplineEntity, and RHatchEntity.
| QMap< QString, QVariant > RObject::getCustomProperties | ( | ) | const |
| QVariant RObject::getCustomProperty | ( | const QString & | key, |
| const QVariant & | defaultValue = RDEFAULT_QVARIANT |
||
| ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
virtual |
Reimplemented in REntity, RLayer, RView, RDimAngularEntity, REllipseEntity, RDimOrdinateEntity, RDimRotatedEntity, RDimAlignedEntity, RDimDiametricEntity, RUcs, RDimRadialEntity, RSolidEntity, RTextEntity, RBlock, RDimensionEntity, RArcEntity, RLinetype, RDimLinearEntity, RHatchEntity, RLineEntity, RPolylineEntity, RImageEntity, RSplineEntity, RCircleEntity, RBlockReferenceEntity, RLeaderEntity, and RPointEntity.
|
virtual |
|
inlinevirtual |
|
static |
Reimplemented in RDimAngularEntity, REntity, RDimOrdinateEntity, RDimRotatedEntity, REllipseEntity, RDimLinearEntity, RDimAlignedEntity, RDimensionEntity, RUcs, RDimDiametricEntity, RDimRadialEntity, RSolidEntity, RTextEntity, RArcEntity, RImageEntity, RLayer, RHatchEntity, RLineEntity, RSplineEntity, RCircleEntity, RPolylineEntity, RBlockReferenceEntity, RLinetype, RLeaderEntity, RPointEntity, RView, and RBlock.
|
pure virtual |
|
inline |
|
protectedvirtual |
Stream operator for QDebug.
Reimplemented in REntity, REllipseEntity, RSplineEntity, RPolylineEntity, RLeaderEntity, RTextEntity, RArcEntity, RLineEntity, RSolidEntity, RDimensionEntity, RDimRotatedEntity, RHatchEntity, RBlockReferenceEntity, RDimOrdinateEntity, RImageEntity, RDimAlignedEntity, RDimDiametricEntity, RDimAngularEntity, RDimRadialEntity, RDimLinearEntity, RCircleEntity, RBlock, and RPointEntity.
| void RObject::removeCustomProperty | ( | const QString & | key | ) |
Removes the custom property with the given name.
| void RObject::setCustomProperty | ( | const QString & | key, |
| const QVariant & | value | ||
| ) |
Sets a custom property with the given name.
|
inlineprotected |
|
inlineprotected |
|
inlinestatic |
\par Non-Scriptable:
This function is not available in script environments.
|
staticprotected |
Sets the given property.
\par Non-Scriptable:
This function is not available in script environments.
| variable | a reference to the (member) variable we want to set |
| value | the new value |
| condition | the variable is only set to the new value if condition is true |
| true,: | if condition is true and the value was successfully converted to the same type as the variable. |
|
staticprotected |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
\par Non-Scriptable:
This function is not available in script environments.
|
staticprotected |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
\par Non-Scriptable:
This function is not available in script environments.
|
staticprotected |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
\par Non-Scriptable:
This function is not available in script environments.
|
protected |
\par Non-Scriptable:
This function is not available in script environments.
| value | A list for int / double pairs: QList<QPair<int, double> > |
|
staticprotected |
\par Non-Scriptable:
This function is not available in script environments.
| value | A QList of QPairs of int and double where the int is the index and the double the value. |
|
staticprotected |
\par Non-Scriptable:
This function is not available in script environments.
| value | A list of int / double pairs: QList<QPair<int, double> > representing indexes in the list and values. |
|
staticprotected |
\par Non-Scriptable:
This function is not available in script environments.
| value | A list of int / double pairs: QList<QPair<int, double> > representing indexes in the list and values. |
|
staticprotected |
\par Non-Scriptable:
This function is not available in script environments.
| value | A list of int / double pairs: QList<QPair<int, double> > representing indexes in the list and values. |
|
virtual |
Sets the given property to the given value.
If this property owner does not know a property with that ID, it is up to the property owner what happens. The property might be added into a list of dynamic properties or dropped.
Reimplemented in REntity, RLayer, RView, RDimAngularEntity, REllipseEntity, RDimOrdinateEntity, RDimRotatedEntity, RUcs, RBlock, RDimAlignedEntity, RLinetype, RDimDiametricEntity, RDimRadialEntity, RSolidEntity, RTextEntity, RDimensionEntity, RArcEntity, RDimLinearEntity, RLineEntity, RPolylineEntity, RImageEntity, RSplineEntity, RCircleEntity, RHatchEntity, RBlockReferenceEntity, RLeaderEntity, and RPointEntity.
|
virtual |
Reimplemented in RSplineEntity.
|
friend |
\return The ID of the given property. \return Property ID of the first registered property with
the given group title and property title or -1. \par Non-Scriptable:
This function is not available in script environments.
|
friend |
|
private |
|
private |
|
private |
|
static |
|
static |
|
private |
Unique ID of this object.
|
static |
Reimplemented in REntity, RDimAlignedEntity, RDimAngularEntity, RDimDiametricEntity, RDimensionEntity, RDimLinearEntity, RDimOrdinateEntity, RDimRadialEntity, RDimRotatedEntity, RPolylineEntity, RTextEntity, RArcEntity, REllipseEntity, RLeaderEntity, RCircleEntity, RHatchEntity, RImageEntity, RLineEntity, RPointEntity, RSolidEntity, RSplineEntity, and RBlockReferenceEntity.
|
static |
Reimplemented in REntity, RDimAlignedEntity, RDimAngularEntity, RDimDiametricEntity, RDimensionEntity, RDimLinearEntity, RDimOrdinateEntity, RDimRadialEntity, RDimRotatedEntity, RPolylineEntity, RTextEntity, RArcEntity, REllipseEntity, RLeaderEntity, RCircleEntity, RHatchEntity, RImageEntity, RLineEntity, RPointEntity, RSolidEntity, RSplineEntity, and RBlockReferenceEntity.
|
private |