43#ifndef RDEFAULT_QSET_INT
44#define RDEFAULT_QSET_INT QSet<int>()
47#ifndef RDEFAULT_TOLERANCE_1E_MIN4
48#define RDEFAULT_TOLERANCE_1E_MIN4 1.0e-4
83 this->document = document;
111 virtual QList<QSharedPointer<RShape> >
getShapes(
const RBox& queryBox =
RDEFAULT_RBOX,
bool ignoreComplex =
false,
bool segment =
false, QList<RObject::Id>* entityIds =
NULL)
const {
113 Q_UNUSED(ignoreComplex)
117 return QList<QSharedPointer<RShape> >();
125 QSharedPointer<RShape> shape = getClosestShape(pos, range, ignoreComplex, &ret);
133 virtual QSharedPointer<RShape> getClosestShape(
const RVector& pos,
double range =
RNANDOUBLE,
bool ignoreComplex =
false,
RObject::Id* subEntityId =
NULL)
const;
143 return const_cast<REntityData*
>(
this)->castToShape();
146 virtual RBox getBoundingBox(
bool ignoreEmpty=
false)
const;
148 void copyAttributesFrom(
const REntityData& entityData,
bool copyBlockId =
true);
151 virtual void setZ(
double z);
161 return QList<RBox>() << getBoundingBox(ignoreEmpty);
164 virtual RPolyline getHull(
double offset)
const;
170 return updatesEnabled;
192 return selectionStatus;
199 selectionStatus = on;
206 return selectionStatusWorkingSet;
213 selectionStatusWorkingSet = on;
228 this->drawOrder = drawOrder;
232 this->layerId = layerId;
239 void setLayerName(
const QString& layerName);
240 QString getLayerName()
const;
243 this->blockId = blockId;
251 this->parentId = parentId;
261 QString getBlockName()
const;
268 this->linetypeId = linetypeId;
282 const QStack<QSharedPointer<REntity> >& blockRefStack)
const;
285 this->linetypeScale = linetypeScale;
289 return linetypeScale;
297 const QStack<QSharedPointer<REntity> >& blockRefStack)
const;
299 double getLineweightInUnits(
const QStack<QSharedPointer<REntity> >& blockRefStack)
const;
302 this->lineweight = lineweight;
316 virtual RColor getColor(
const RColor& unresolvedColor,
const QStack<QSharedPointer<REntity> >& blockRefStack)
const;
317 virtual RColor getColor(
bool resolve,
const QStack<QSharedPointer<REntity> >& blockRefStack)
const;
320 QStack<QSharedPointer<REntity> > stack;
321 return getColor(
true, stack);
339 virtual RVector getPointOnEntity()
const;
340 virtual QList<RVector> getEndPoints(
const RBox& queryBox =
RDEFAULT_RBOX, QList<RObject::Id>* subEntityIds =
NULL)
const;
341 virtual QList<RVector> getMiddlePoints(
const RBox& queryBox =
RDEFAULT_RBOX, QList<RObject::Id>* subEntityIds =
NULL)
const;
342 virtual QList<RVector> getCenterPoints(
const RBox& queryBox =
RDEFAULT_RBOX, QList<RObject::Id>* subEntityIds =
NULL)
const;
343 virtual QList<RVector> getArcReferencePoints(
const RBox& queryBox =
RDEFAULT_RBOX)
const;
344 virtual QList<RVector> getPointsWithDistanceToEnd(
358 const REntityData& other,
bool limited =
true,
bool same =
false,
360 QList<QPair<RObject::Id, RObject::Id> >* entityIds =
NULL)
const;
362 const RShape& shape,
bool limited =
true,
367 virtual double getDistanceTo(
const RVector& point,
bool limited =
true,
double range = 0.0,
bool draft =
false,
double strictRange =
RMAXDOUBLE)
const;
374 return box.
contains(getBoundingBox());
379 virtual bool intersectsWith(
const RShape& shape)
const;
387 Q_UNUSED(referencePoint)
404 virtual void scaleVisualProperties(
double scaleFactor);
407 virtual bool flipHorizontal();
408 virtual bool flipVertical();
416 void setAutoUpdatesBlocked(
bool on);
417 bool getAutoUpdatesBlocked()
const;
#define RDEFAULT_RBOX
Definition RBox.h:35
#define RNANDOUBLE
Definition RMath.h:74
Q_DECLARE_METATYPE(RMath *)
#define RMININT
Definition RMath.h:71
#define RMAXDOUBLE
Definition RMath.h:66
#define RDEFAULT_TOLERANCE_1E_MIN4
Definition RShape.h:43
#define RDEFAULT_RVECTOR
Definition RVector.h:38
Block reference entity.
Definition RBlockReferenceEntity.h:38
Represents a box e.g.
Definition RBox.h:46
bool contains(const RBox &other) const
Definition RBox.cpp:408
Color.
Definition RColor.h:43
A graphics document contains and owns entities, layers, user coordinate systems, variables,...
Definition RDocument.h:78
Base class for all entity data classes.
Definition REntityData.h:65
RDocument * getDocument()
Definition REntityData.h:74
virtual void setSelected(bool on)
Selects or deselects this entity.
Definition REntityData.h:198
bool autoUpdatesBlocked
Block auto updates is true during imports, undo and redo.
Definition REntityData.h:429
void setColor(const RColor &color)
Definition REntityData.h:308
double linetypeScale
Definition REntityData.h:435
virtual void setLinetypeId(RObject::Id linetypeId)
Sets the linetype of this entity to the given linetype ID.
Definition REntityData.h:267
static int getDefaultDrawOrder()
Definition REntityData.h:419
virtual void setLayerId(RObject::Id layerId)
Definition REntityData.h:231
virtual bool isSelected() const
Definition REntityData.h:191
virtual RS::EntityType getType() const
Definition REntityData.h:86
const RDocument * getDocument() const
Definition REntityData.h:78
void setLineweight(RLineweight::Lineweight lineweight)
Definition REntityData.h:301
RObject::Id parentId
Definition REntityData.h:433
virtual void setSelectedWorkingSet(bool on)
Selects or deselects this entity for addition to the current working set.
Definition REntityData.h:212
RObject::Id blockId
Definition REntityData.h:432
virtual bool isInside(const RBox &box) const
Definition REntityData.h:373
virtual RShape * castToShape()
Definition REntityData.h:135
virtual bool isSane() const
Definition REntityData.h:100
int drawOrder
Definition REntityData.h:430
RLineweight::Lineweight lineweight
Definition REntityData.h:436
virtual QList< RBox > getBoundingBoxes(bool ignoreEmpty=false) const
Definition REntityData.h:160
virtual RColor getDisplayColor()
Definition REntityData.h:319
virtual RObject::Id getLinetypeId() const
Definition REntityData.h:274
bool selectionStatusWorkingSet
Definition REntityData.h:427
RObject::Id getClosestSubEntityId(const RVector &pos, double range, bool ignoreComplex) const
Convenience function for scripts.
Definition REntityData.h:123
RObject::Id linetypeId
Definition REntityData.h:434
virtual void setParentId(RObject::Id parentId)
Definition REntityData.h:250
RObject::Id layerId
Definition REntityData.h:431
virtual void setLinetypeScale(double linetypeScale)
Definition REntityData.h:284
RObject::Id getParentId() const
Definition REntityData.h:257
virtual bool isSelectedWorkingSet() const
Definition REntityData.h:205
virtual bool moveReferencePoint(const RVector &referencePoint, const RVector &targetPoint, Qt::KeyboardModifiers modifiers=Qt::NoModifier)=0
Moves the given reference point to the given target point or does nothing if this entity has no refer...
virtual RLineweight::Lineweight getLineweight() const
Definition REntityData.h:292
virtual int getDrawOrder() const
Definition REntityData.h:220
virtual bool isUpdatesEnabled() const
Definition REntityData.h:169
virtual ~REntityData()
Definition REntityData.h:72
virtual bool isValid() const
Definition REntityData.h:97
virtual void setBlockId(RObject::Id blockId)
Definition REntityData.h:242
void setUpdatesEnabled(bool on)
Enables / disables cache updates.
Definition REntityData.h:176
virtual void setDrawOrder(int drawOrder)
Sets the draw order of this entity.
Definition REntityData.h:227
RDocument * document
Definition REntityData.h:424
RObject::Id getLayerId() const
Definition REntityData.h:235
bool updatesEnabled
Definition REntityData.h:425
virtual QList< RRefPoint > getReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop) const =0
virtual bool cloneOnChange() const
Reimplement to force clone on change in transactions.
Definition REntityData.h:183
virtual bool clickReferencePoint(const RVector &referencePoint)
Called when user clicks a reference point.
Definition REntityData.h:386
virtual double getLinetypeScale() const
Definition REntityData.h:288
void setDocument(RDocument *document)
Definition REntityData.h:82
virtual void update() const
Entities can reimplement this function to invalidate any internal cache (mark the entity as dirty).
Definition REntityData.h:415
RObject::Id getBlockId() const
Definition REntityData.h:246
virtual const RShape * castToConstShape() const
Definition REntityData.h:142
virtual RColor getColor() const
Definition REntityData.h:312
RColor color
Definition REntityData.h:437
virtual QList< QSharedPointer< RShape > > getShapes(const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=false, bool segment=false, QList< RObject::Id > *entityIds=NULL) const
Definition REntityData.h:111
virtual bool isPointType() const
Definition REntityData.h:93
bool selectionStatus
Definition REntityData.h:426
Base class for all entity classes.
Definition REntity.h:63
Abstract base class for exporters.
Definition RExporter.h:78
Low-level mathematical representation of a line.
Definition RLine.h:41
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RLinetypePattern.h:42
Lineweight
Definition RLineweight.h:44
static const Id INVALID_ID
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RObject.h:70
int Id
Definition RObject.h:69
Low-level mathematical representation of an open polyline or closed polyline (= polygon).
Definition RPolyline.h:50
Represents a reference point of an entity.
Definition RRefPoint.h:18
@ FromAny
Start or end.
Definition RS.h:374
EntityType
Entity types used for property handling / filtering.
Definition RS.h:227
@ EntityUnknown
Unknown entity.
Definition RS.h:242
ProjectionRenderingHint
Sets the current rendering hint for exports.
Definition RS.h:293
@ RenderTop
Definition RS.h:294
Interface for geometrical shape classes.
Definition RShape.h:72
Represents a 3d vector (x/y/z).
Definition RVector.h:47
#define QCADCORE_EXPORT
Definition core_global.h:10
void rotate(void e, void angle, void center)
Rotates the given entity or shape by the given angle around the given center.
Definition simple_modify.js:109
void move(void e, void offset)
Moves the given entity or shape by the given offset.
Definition simple_modify.js:58
void scale(void e, void factor, void focusPoint)
Scales the given entity or shape by the given factor with the given focus point.
Definition simple_modify.js:15
void mirror(void e, void axis)
Mirrors the given entity or shape at the given axis.
Definition simple_modify.js:95
void getIntersectionPoints(void e1, void e2, void limited)
Returns intersection points between the two given entities or shapes.
Definition simple_info.js:12
#define NULL
Definition opennurbs_system.h:256