#include <rs_entitycontainer.h>
Inheritance diagram for RS_EntityContainer:

Public Member Functions | |
| RS_EntityContainer (RS_EntityContainer *parent=NULL, bool owner=true) | |
| Default constructor. | |
| virtual | ~RS_EntityContainer () |
| Destructor. | |
| virtual RS_Entity * | clone () |
| virtual void | detach () |
| Detaches shallow copies and creates deep copies of all subentities. | |
| virtual RS2::EntityType | rtti () const |
| void | reparent (RS_EntityContainer *parent) |
| virtual bool | isContainer () const |
| virtual bool | isAtomic () const |
| virtual double | getLength () |
| virtual void | undoStateChanged (bool undone) |
| Called when the undo state changed. | |
| virtual void | setVisible (bool v) |
| virtual void | setProcessed (bool on) |
| Resets all processed flags of all entities. | |
| virtual bool | setSelected (bool select=true) |
| Selects this entity. | |
| virtual bool | toggleSelected () |
| Toggles select on this entity. | |
| virtual void | selectWindow (const RS_Vector &v1, const RS_Vector &v2, bool select=true, bool cross=false) |
| Selects all entities within the given area. | |
| virtual void | addEntity (RS_Entity *entity) |
| Adds a entity to this container and updates the borders of this entity-container if autoUpdateBorders is true. | |
| virtual void | insertEntity (int index, RS_Entity *entity) |
| Inserts a entity to this container at the given position and updates the borders of this entity-container if autoUpdateBorders is true. | |
| virtual void | replaceEntity (int index, RS_Entity *entity) |
| Replaces the entity at the given index with the given entity and updates the borders of this entity-container if autoUpdateBorders is true. | |
| virtual bool | removeEntity (RS_Entity *entity) |
| Removes an entity from this container and updates the borders of this entity-container if autoUpdateBorders is true. | |
| virtual void | moveEntityToBack (RS_Entity *entity, bool toBack=true) |
| Moves the given entity in the background (at the end of the entity list). | |
| virtual void | moveEntityToFront (RS_Entity *entity) |
| Moves the given entity in the foreground (at the end of the entity list). | |
| virtual RS_Entity * | firstEntity (RS2::ResolveLevel level=RS2::ResolveNone) |
| Returns the first entity or NULL if this graphic is empty. | |
| virtual RS_Entity * | lastEntity (RS2::ResolveLevel level=RS2::ResolveNone) |
Returns the last entity or NULL if this graphic is empty. | |
| virtual RS_Entity * | nextEntity (RS2::ResolveLevel level=RS2::ResolveNone) |
Returns the next entity or container or NULL if the last entity returned by next() was the last entity in the container. | |
| virtual RS_Entity * | prevEntity (RS2::ResolveLevel level=RS2::ResolveNone) |
Returns the prev entity or container or NULL if the last entity returned by prev() was the first entity in the container. | |
| virtual RS_Entity * | entityAt (int index) |
| virtual RS_Entity * | currentEntity () |
| virtual int | entityAt () |
| virtual int | findEntity (RS_Entity *entity) |
| Finds the given entity and makes it the current entity if found. | |
| virtual void | clear () |
| Erases all entities in this container and resets the borders. | |
| RS_MutableListIterator< RS_Entity * > | createIterator () |
| Returns the copy to a new iterator for traversing the entities. | |
| virtual bool | isEmpty () |
| virtual int | count () |
| Counts all entities (branches of the tree). | |
| virtual int | countDeep () |
| Counts all entities (leaves of the tree). | |
| virtual int | countSelected () |
| Counts the selected entities in this container. | |
| virtual void | setAutoUpdateBorders (bool enable) |
| Enables / disables automatic update of borders on entity removals and additions. | |
| virtual void | adjustBorders (RS_Entity *entity) |
| Adjusts the borders of this graphic (max/min values). | |
| virtual void | calculateBorders () |
| Recalculates the borders of this entity container. | |
| virtual void | forcedCalculateBorders () |
| Recalculates the borders of this entity container including invisible entities. | |
| virtual int | updateDimensions (bool autoText=true, bool onlySelected=false) |
| Updates all Dimension entities in this container and reposition their labels if autoText is true. | |
| virtual void | updateInserts () |
| Updates all Insert entities in this container. | |
| virtual void | updateSplines () |
| Updates all Spline entities in this container. | |
| virtual void | update () |
| Updates the sub entities of this container. | |
| virtual void | renameInserts (const RS_String &oldName, const RS_String &newName) |
| Renames all inserts with name 'oldName' to 'newName'. | |
| virtual RS_Vector | getNearestEndpoint (const RS_Vector &coord, double *dist=NULL) |
| RS_Entity * | getNearestEntity (const RS_Vector &point, double *dist=NULL, RS2::ResolveLevel level=RS2::ResolveAll) |
| virtual RS_Vector | getNearestPointOnEntity (const RS_Vector &coord, bool onEntity=true, double *dist=NULL, RS_Entity **entity=NULL) |
| Must be overwritten to get the closest coordinate to the given coordinate which is on this entity. | |
| virtual RS_Vector | getNearestCenter (const RS_Vector &coord, double *dist=NULL) |
| Must be overwritten to get the (nearest) center point to the given coordinate for this entity. | |
| virtual RS_Vector | getNearestMiddle (const RS_Vector &coord, double *dist=NULL) |
| Must be overwritten to get the (nearest) middle point to the given coordinate for this entity. | |
| virtual RS_Vector | getNearestDist (double distance, const RS_Vector &coord, double *dist=NULL) |
| Must be overwritten to get the nearest point with a given distance to the endpoint to the given coordinate for this entity. | |
| virtual RS_Vector | getNearestIntersection (const RS_Vector &coord, double *dist=NULL) |
| virtual RS_Vector | getNearestRef (const RS_Vector &coord, double *dist=NULL) |
| Must be overwritten to get the nearest reference point for this entity. | |
| virtual RS_Vector | getNearestSelectedRef (const RS_Vector &coord, double *dist=NULL) |
| Gets the nearest reference point of this entity if it is selected. | |
| virtual double | getDistanceToPoint (const RS_Vector &coord, RS_Entity **entity, RS2::ResolveLevel level=RS2::ResolveNone, double solidDist=RS_MAXDOUBLE) |
| Must be overwritten to get the shortest distance between this entity and a coordinate. | |
| virtual RS2::Side | getSideOfPoint (const RS_Vector &) |
| Implementations must return RS2::RightHand if coord is on the right hand side of this entity, RS2::LeftHand if it is on the left hand side and RS2::NoSide otherwise (on entity, entity has no side, . | |
| virtual bool | optimizeContours () |
| Rearranges the atomic entities in this container in a way that connected entities are stored in the right order and direction. | |
| virtual bool | hasEndpointsWithinWindow (const RS_Vector &v1, const RS_Vector &v2) |
| virtual void | move (const RS_Vector &offset) |
| Implementations must move the entity by the given vector. | |
| virtual void | rotate (const RS_Vector ¢er, double angle) |
| Implementations must rotate the entity by the given angle around the given center. | |
| virtual void | scale (const RS_Vector ¢er, const RS_Vector &factor) |
| Implementations must scale the entity by the given factors. | |
| virtual void | mirror (const RS_Vector &axisPoint1, const RS_Vector &axisPoint2) |
| Implementations must mirror the entity by the given axis. | |
| virtual void | stretch (const RS_Vector &firstCorner, const RS_Vector &secondCorner, const RS_Vector &offset) |
| Implementations must stretch the given range of the entity by the given offset. | |
| virtual void | moveRef (const RS_Vector &ref, const RS_Vector &offset) |
| Implementations must drag the reference point(s) of all (sub-)entities that are very close to ref by offset. | |
| virtual void | moveSelectedRef (const RS_Vector &ref, const RS_Vector &offset) |
| Implementations must drag the reference point(s) of selected (sub-)entities that are very close to ref by offset. | |
| virtual void | draw (RS_Painter *painter, RS_GraphicView *view, double patternOffset=0.0) |
| Implementations must draw the entity on the given device. | |
Protected Attributes | |
| RS_PtrList< RS_Entity > | entities |
| entities in the container | |
| RS_EntityContainer * | subContainer |
| sub container used only temporarly for iteration. | |
Static Protected Attributes | |
| static bool | autoUpdateBorders = true |
| Automatically update the borders of the container when entities are added or removed. | |
Typical entity containers are graphics, polylines, groups, texts, ...)
|
||||||||||||
|
Default constructor.
|
|
|
Erases all entities in this container and resets the borders.
|
|
|
|
|
|
Detaches shallow copies and creates deep copies of all subentities. This is called after cloning entity containers. |
|
|
|
|
|
|
|
|
Returns the first entity or NULL if this graphic is empty.
|
|
||||||||||||||||||||
|
Must be overwritten to get the shortest distance between this entity and a coordinate.
Implements RS_Entity. Reimplemented in RS_Hatch. |
|
|
Reimplemented from RS_Entity. Reimplemented in RS_Dimension, RS_Hatch, RS_Leader, and RS_Text. |
|
||||||||||||
|
Must be overwritten to get the (nearest) center point to the given coordinate for this entity.
Implements RS_Entity. Reimplemented in RS_Spline. |
|
||||||||||||||||
|
Must be overwritten to get the nearest point with a given distance to the endpoint to the given coordinate for this entity.
Implements RS_Entity. Reimplemented in RS_Spline. |
|
||||||||||||
|
Implements RS_Entity. Reimplemented in RS_Spline. |
|
||||||||||||
|
|
|
||||||||||||
|
Must be overwritten to get the (nearest) middle point to the given coordinate for this entity.
Implements RS_Entity. Reimplemented in RS_Spline. |
|
||||||||||||||||||||
|
Must be overwritten to get the closest coordinate to the given coordinate which is on this entity.
Implements RS_Entity. |
|
||||||||||||
|
Must be overwritten to get the nearest reference point for this entity.
Reimplemented from RS_Entity. Reimplemented in RS_Dimension, RS_Insert, RS_Leader, RS_Polyline, RS_Spline, and RS_Text. |
|
||||||||||||
|
Gets the nearest reference point of this entity if it is selected. Containers re-implement this method to return the nearest reference point of a selected sub entity.
Reimplemented from RS_Entity. Reimplemented in RS_Dimension, RS_Leader, RS_Polyline, and RS_Spline. |
|
|
Implementations must return RS2::RightHand if coord is on the right hand side of this entity, RS2::LeftHand if it is on the left hand side and RS2::NoSide otherwise (on entity, entity has no side, . .). Implements RS_Entity. |
|
|
Implements RS_Entity. |
|
|
Implements RS_Entity. Reimplemented in RS_Hatch. |
|
|
Returns the last entity or
|
|
|
Rearranges the atomic entities in this container in a way that connected entities are stored in the right order and direction. Non-recoursive. Only affects atomic entities in this container.
Reimplemented in RS_Polyline. |
|
||||||||||||
|
Renames all inserts with name 'oldName' to 'newName'. This is called after a block was rename to update the inserts. |
|
|
Reimplemented from RS_Entity. Reimplemented in RS_Block, RS_DimAligned, RS_DimAngular, RS_DimDiametric, RS_DimLinear, RS_DimRadial, RS_FontChar, RS_Graphic, RS_Hatch, RS_Insert, RS_Leader, RS_Polyline, RS_Spline, and RS_Text. |
|
||||||||||||||||||||
|
Selects all entities within the given area.
|
|
|
Enables / disables automatic update of borders on entity removals and additions. By default this is turned on. |
|
||||||||||||||||
|
Implementations must stretch the given range of the entity by the given offset. This default implementation moves the whole entity if it is completely inside the given range. Reimplemented from RS_Entity. Reimplemented in RS_DimAligned, RS_DimLinear, RS_Hatch, RS_Leader, RS_Polyline, and RS_Text. |
|
|
Called when the undo state changed. Forwards the event to all sub-entities.
Reimplemented from RS_Entity. |
|
||||||||||||
|
Updates all Dimension entities in this container and reposition their labels if autoText is true. If onlySelected is true, only selected dimensions will be modified, or all if nothing is selected.
|
1.4.4