|
QCAD Application Framework
CAD Application Development and Automation.
|
Base class for all entity classes. More...
#include <REntity.h>
Public Member Functions | |
| virtual const RShape * | castToConstShape () const |
| virtual RShape * | castToShape () |
| | |
| virtual REntity * | clone () const =0 |
| void | copyAttributesFrom (REntity *entity) |
| Copies all attributes (layer, block, color, line weight, line style) from the given entity. | |
| void | dump () |
| virtual void | exportEntity (RExporter &e, bool preview=false) const =0 |
| Exports the entity to the given exporter. | |
| virtual bool | flipHorizontal () |
| | |
| virtual bool | flipVertical () |
| | |
| RBlock::Id | getBlockId () const |
| | |
| QString | getBlockName () |
| | |
| virtual RBox | getBoundingBox () const |
| | |
| virtual QList< RBox > | getBoundingBoxes () const |
| | |
| virtual QList< RVector > | getCenterPoints (const RBox &queryBox=RDEFAULT_RBOX) const |
| | |
| virtual RVector | getClosestPointOnEntity (const RVector &point, double range=RNANDOUBLE, bool limited=true) const |
| | |
| virtual QSharedPointer< RShape > | getClosestShape (const RVector &pos, double range=RNANDOUBLE) const |
| | |
| RColor | getColor () const |
| | |
| RColor | getColor (bool resolve, const QStack< RBlockReferenceEntity * > &blockRefStack) |
| | |
| virtual int | getComplexity () const |
| virtual REntityData & | getData ()=0 |
| virtual const REntityData & | getData () const =0 |
| virtual double | getDistanceTo (const RVector &point, bool limited=true, double range=0.0, bool draft=false) const |
| | |
| int | getDrawOrder () const |
| | |
| virtual QList< RVector > | getEndPoints (const RBox &queryBox=RDEFAULT_RBOX) const |
| | |
| virtual QList< RVector > | getIntersectionPoints (const REntity &other, bool limited=true, const RBox &queryBox=RDEFAULT_RBOX) const |
| | |
| virtual QList< RVector > | getIntersectionPoints (const RShape &shape, bool limited=true, const RBox &queryBox=RDEFAULT_RBOX) const |
| | |
| RLayer::Id | getLayerId () const |
| | |
| QString | getLayerName () |
| | |
| RLinetype::Id | getLinetypeId () const |
| | |
| RLinetype::Id | getLinetypeId (bool resolve, const QStack< RBlockReferenceEntity * > &blockRefStack) const |
| | |
| RLineweight::Lineweight | getLineweight () const |
| | |
| RLineweight::Lineweight | getLineweight (bool resolve, const QStack< RBlockReferenceEntity * > &blockRefStack) const |
| | |
| double | getLineweightInUnits (const QStack< RBlockReferenceEntity * > &blockRefStack) const |
| | |
| virtual QList< RVector > | getMiddlePoints (const RBox &queryBox=RDEFAULT_RBOX) const |
| | |
| virtual RVector | getPointOnEntity () const |
| | |
| virtual QList< RVector > | getPointsWithDistanceToEnd (double distance, RS::From from=RS::FromAny, const RBox &queryBox=RDEFAULT_RBOX) const |
| | |
| virtual QPair< QVariant, RPropertyAttributes > | getProperty (RPropertyTypeId propertyTypeId, bool humanReadable=false, bool noAttributes=false) |
| virtual QList< RVector > | getReferencePoints (RS::ProjectionRenderingHint hint=RS::RenderTop) const |
| | |
| virtual QList< QSharedPointer < RShape > > | getShapes (const RBox &queryBox=RDEFAULT_RBOX) const |
| | |
| virtual RS::EntityType | getType () const |
| virtual RVector | getVectorTo (const RVector &point, bool limited=true) const |
| | |
| virtual bool | intersectsWith (const RShape &shape) const |
| | |
| bool | isEditable (bool allowInvisible=false) const |
| virtual bool | isInside (const RBox &box) const |
| | |
| virtual bool | isOnEntity (const RVector &point, bool limited=true) const |
| | |
| bool | isSelected () const |
| | |
| virtual bool | isSelectedForPropertyEditing () |
| bool | isVisible () const |
| virtual bool | mirror (const RLine &axis) |
| | |
| virtual bool | mirror (const RVector &axis1, const RVector &axis2) |
| | |
| virtual bool | move (const RVector &offset) |
| Moves this entity by the given offset. | |
| virtual bool | moveReferencePoint (const RVector &referencePoint, const RVector &targetPoint) |
| Moves the given reference point to the given target point or does nothing if this entity has no reference point as the given location. | |
| REntity (RDocument *document, Id objectId=-1) | |
| virtual bool | rotate (double rotation, const RVector ¢er=RDEFAULT_RVECTOR) |
| | |
| virtual bool | scale (const RVector &scaleFactors, const RVector ¢er=RDEFAULT_RVECTOR) |
| | |
| virtual bool | scale (double scaleFactor, const RVector ¢er=RDEFAULT_RVECTOR) |
| | |
| void | setBlockId (RBlock::Id blockId) |
| | |
| void | setColor (const RColor &color) |
| | |
| void | setDocument (RDocument *document) |
| void | setDrawOrder (int drawOrder) |
| Sets the draw order of this entity. | |
| void | setLayerId (RLayer::Id layerId) |
| | |
| void | setLinetype (RLinetype linetype) |
| | |
| void | setLinetypeId (RLinetype::Id linetypeId) |
| | |
| void | setLineweight (RLineweight::Lineweight lineweight) |
| | |
| virtual bool | setProperty (RPropertyTypeId propertyTypeId, const QVariant &value) |
| Sets the given property to the given value. | |
| void | setSelected (bool on) |
| Selects or deselects this entity. | |
| virtual bool | stretch (const RPolyline &area, const RVector &offset) |
| Stretches the end points of this entity that are inside area by offset. | |
| void | update () const |
| Entities can reimplement this function to invalidate any internal cache (mark the entity as dirty). | |
| virtual | ~REntity () |
Public Member Functions inherited from RObject | |
| 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 QSet< RPropertyTypeId > | getPropertyTypeIds () const |
| virtual bool | hasPropertyType (RPropertyTypeId propertyTypeId) |
| 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. | |
| virtual void | setUndone (bool on) |
| virtual | ~RObject () |
Static Public Member Functions | |
| static void | init () |
Static Public Member Functions inherited from RObject | |
| template<class T > | |
| static bool | setMember (T &variable, const QVariant &value, bool condition=true) |
Static Public Attributes | |
| static RPropertyTypeId | PropertyBlock |
| static RPropertyTypeId | PropertyColor |
| static RPropertyTypeId | PropertyCustom |
| static RPropertyTypeId | PropertyDrawOrder |
| static RPropertyTypeId | PropertyHandle |
| static RPropertyTypeId | PropertyLayer |
| static RPropertyTypeId | PropertyLinetype |
| static RPropertyTypeId | PropertyLineweight |
| static RPropertyTypeId | PropertyType |
Static Public Attributes inherited from RObject | |
| static const Handle | INVALID_HANDLE = -1 |
| static const Id | INVALID_ID = -1 |
Protected Member Functions | |
| virtual void | print (QDebug dbg) const |
| Stream operator for QDebug. | |
Protected Member Functions inherited from RObject | |
| void | setHandle (RObject::Handle h) |
| void | setId (RObject::Id id) |
| bool | setMember (QList< double > &variable, const QVariant &value, bool condition) |
Additional Inherited Members | |
Public Types inherited from RObject | |
| typedef int | Handle |
| typedef int | Id |
| enum | XYZ { X, Y, Z } |
Static Protected Member Functions inherited from RObject | |
| 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) |
Base class for all entity classes.
Entities can be exported using an implementor of the exporter interface by calling exportEntity.
|
virtual |
|
inlinevirtual |
\par Non-Scriptable:
This function is not available in script environments.
|
inlinevirtual |
|
pure virtual |
Implements RObject.
Implemented in RDimAngularEntity, RDimOrdinateEntity, RDimRotatedEntity, REllipseEntity, RDimAlignedEntity, RDimDiametricEntity, RDimRadialEntity, RSolidEntity, RTextEntity, RArcEntity, RImageEntity, RHatchEntity, RLineEntity, RSplineEntity, RCircleEntity, RPolylineEntity, RBlockReferenceEntity, RLeaderEntity, and RPointEntity.
| void REntity::copyAttributesFrom | ( | REntity * | entity | ) |
Copies all attributes (layer, block, color, line weight, line style) from the given entity.
| void REntity::dump | ( | ) |
|
pure virtual |
Exports the entity to the given exporter.
The exporter might be a file exporter, a graphics scene or any other platform one can export entities to.
Implemented in RLeaderEntity, REllipseEntity, RSolidEntity, RTextEntity, RDimensionEntity, RArcEntity, RHatchEntity, RLineEntity, RPolylineEntity, RImageEntity, RSplineEntity, RCircleEntity, RBlockReferenceEntity, and RPointEntity.
|
inlinevirtual |
|
inlinevirtual |
|
inline |
|
inline |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
point on this entity. Used for snap to points on entity.
|
inlinevirtual |
|
inline |
| RColor REntity::getColor | ( | bool | resolve, |
| const QStack< RBlockReferenceEntity * > & | blockRefStack | ||
| ) |
|
inlinevirtual |
Reimplemented from RObject.
Reimplemented in RPolylineEntity, RSplineEntity, and RHatchEntity.
|
pure virtual |
Implemented in RTextEntity, RDimAngularEntity, REllipseEntity, RDimOrdinateEntity, RDimRotatedEntity, RDimAlignedEntity, RDimDiametricEntity, RSolidEntity, RDimensionEntity, RDimRadialEntity, RArcEntity, RSplineEntity, RHatchEntity, RDimLinearEntity, RLineEntity, RPolylineEntity, RImageEntity, RCircleEntity, RBlockReferenceEntity, RLeaderEntity, and RPointEntity.
|
pure virtual |
Implemented in RTextEntity, RDimAngularEntity, RDimOrdinateEntity, RDimRotatedEntity, REllipseEntity, RDimAlignedEntity, RDimDiametricEntity, RDimRadialEntity, RSolidEntity, RArcEntity, RSplineEntity, RDimensionEntity, RHatchEntity, RLineEntity, RPolylineEntity, RImageEntity, RCircleEntity, RLeaderEntity, RBlockReferenceEntity, RDimLinearEntity, and RPointEntity.
|
inlinevirtual |
|
inline |
|
inlinevirtual |
|
virtual |
|
virtual |
|
inline |
|
inline |
|
inline |
| RLinetype::Id REntity::getLinetypeId | ( | bool | resolve, |
| const QStack< RBlockReferenceEntity * > & | blockRefStack | ||
| ) | const |
|
inline |
| RLineweight::Lineweight REntity::getLineweight | ( | bool | resolve, |
| const QStack< RBlockReferenceEntity * > & | blockRefStack | ||
| ) | const |
| double REntity::getLineweightInUnits | ( | const QStack< RBlockReferenceEntity * > & | blockRefStack | ) | const |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
distance to either endpoint. Used for snap to points with distance on entity.
|
virtual |
Reimplemented from RObject.
Reimplemented in RDimAngularEntity, REllipseEntity, RDimOrdinateEntity, RDimRotatedEntity, RDimAlignedEntity, RDimDiametricEntity, RDimRadialEntity, RSolidEntity, RTextEntity, RDimensionEntity, RArcEntity, RDimLinearEntity, RHatchEntity, RLineEntity, RPolylineEntity, RImageEntity, RSplineEntity, RCircleEntity, RBlockReferenceEntity, RLeaderEntity, and RPointEntity.
|
inlinevirtual |
|
inlinevirtual |
Reimplemented in RHatchEntity, and RTextEntity.
|
inlinevirtual |
Reimplemented in RDimAngularEntity, RDimOrdinateEntity, RDimRotatedEntity, REllipseEntity, RDimAlignedEntity, RDimDiametricEntity, RDimRadialEntity, RSolidEntity, RTextEntity, RDimensionEntity, RArcEntity, RLineEntity, RImageEntity, RSplineEntity, RCircleEntity, RHatchEntity, RPolylineEntity, RBlockReferenceEntity, RLeaderEntity, and RPointEntity.
|
inlinevirtual |
| point | the point to which the distance was measured |
| limited,: | If true, an invalid vector is returned if the closest point on the entity is outside of the entity (e.g. in the extension line of a line or outside the start / end angle of an arc). |
|
static |
Reimplemented from RObject.
Reimplemented in RDimAngularEntity, RDimOrdinateEntity, RDimRotatedEntity, REllipseEntity, RDimLinearEntity, RDimAlignedEntity, RDimensionEntity, RDimDiametricEntity, RDimRadialEntity, RSolidEntity, RTextEntity, RArcEntity, RImageEntity, RHatchEntity, RLineEntity, RSplineEntity, RCircleEntity, RPolylineEntity, RBlockReferenceEntity, RLeaderEntity, and RPointEntity.
|
inlinevirtual |
| bool REntity::isEditable | ( | bool | allowInvisible = false | ) | const |
|
inlinevirtual |
|
inlinevirtual |
|
inline |
|
inlinevirtual |
Implements RObject.
| bool REntity::isVisible | ( | ) | const |
|
inlinevirtual |
|
inlinevirtual |
Moves this entity by the given offset.
|
inlinevirtual |
Moves the given reference point to the given target point or does nothing if this entity has no reference point as the given location.
|
protectedvirtual |
Stream operator for QDebug.
Reimplemented from RObject.
Reimplemented in REllipseEntity, RSplineEntity, RPolylineEntity, RLeaderEntity, RTextEntity, RArcEntity, RLineEntity, RSolidEntity, RDimensionEntity, RDimRotatedEntity, RHatchEntity, RBlockReferenceEntity, RDimOrdinateEntity, RImageEntity, RDimAlignedEntity, RDimDiametricEntity, RDimAngularEntity, RDimRadialEntity, RDimLinearEntity, RCircleEntity, and RPointEntity.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inline |
|
inline |
|
inline |
Sets the draw order of this entity.
|
inline |
|
inline |
|
inline |
|
inline |
|
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 from RObject.
Reimplemented in RDimAngularEntity, REllipseEntity, RDimOrdinateEntity, RDimRotatedEntity, RDimAlignedEntity, RDimDiametricEntity, RDimRadialEntity, RSolidEntity, RTextEntity, RDimensionEntity, RArcEntity, RDimLinearEntity, RLineEntity, RPolylineEntity, RImageEntity, RSplineEntity, RCircleEntity, RHatchEntity, RBlockReferenceEntity, RLeaderEntity, and RPointEntity.
| void REntity::setSelected | ( | bool | on | ) |
Selects or deselects this entity.
Stretches the end points of this entity that are inside area by offset.
|
inline |
Entities can reimplement this function to invalidate any internal cache (mark the entity as dirty).
Reimplemented in RBlockReferenceEntity.
|
static |
Reimplemented in 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 RDimAlignedEntity, RDimAngularEntity, RDimDiametricEntity, RDimensionEntity, RDimLinearEntity, RDimOrdinateEntity, RDimRadialEntity, RDimRotatedEntity, RPolylineEntity, RTextEntity, RArcEntity, REllipseEntity, RLeaderEntity, RCircleEntity, RHatchEntity, RImageEntity, RLineEntity, RPointEntity, RSolidEntity, RSplineEntity, and RBlockReferenceEntity.
|
static |
Reimplemented from RObject.
Reimplemented in 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 RDimAlignedEntity, RDimAngularEntity, RDimDiametricEntity, RDimensionEntity, RDimLinearEntity, RDimOrdinateEntity, RDimRadialEntity, RDimRotatedEntity, RPolylineEntity, RTextEntity, RArcEntity, REllipseEntity, RLeaderEntity, RCircleEntity, RHatchEntity, RImageEntity, RLineEntity, RPointEntity, RSolidEntity, RSplineEntity, and RBlockReferenceEntity.
|
static |
Reimplemented from RObject.
Reimplemented in 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 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 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 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 RDimAlignedEntity, RDimAngularEntity, RDimDiametricEntity, RDimensionEntity, RDimLinearEntity, RDimOrdinateEntity, RDimRadialEntity, RDimRotatedEntity, RPolylineEntity, RTextEntity, RArcEntity, REllipseEntity, RLeaderEntity, RCircleEntity, RHatchEntity, RImageEntity, RLineEntity, RPointEntity, RSolidEntity, RSplineEntity, and RBlockReferenceEntity.