Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages

RS_Leader Class Reference

Class for a leader entity (kind of a polyline arrow). More...

#include <rs_leader.h>

Inheritance diagram for RS_Leader:

RS_EntityContainer RS_Entity RS_Undoable RS_Flags List of all members.

Public Member Functions

 RS_Leader (RS_EntityContainer *parent=NULL)
 Constructor.
 RS_Leader (RS_EntityContainer *parent, const RS_LeaderData &d)
 Constructor.
virtual ~RS_Leader ()
 Destructor.
virtual RS_Entityclone ()
virtual RS2::EntityType rtti () const
virtual void update ()
 Implementation of update.
RS_LeaderData getData () const
bool hasArrowHead ()
virtual RS_EntityaddVertex (const RS_Vector &v)
 Adds a vertex from the endpoint of the last element or sets the startpoint to the point 'v'.
virtual void addEntity (RS_Entity *entity)
 Reimplementation of the addEntity method for a normal container.
virtual double getLength ()
virtual RS_VectorSolutions getRefPoints ()
 Must be overwritten to get all reference points of the entity.
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 void move (const RS_Vector &offset)
 Implementations must move the entity by the given vector.
virtual void rotate (const RS_Vector &center, double angle)
 Implementations must rotate the entity by the given angle around the given center.
virtual void scale (const RS_Vector &center, 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 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 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.

Protected Attributes

RS_LeaderData data
bool empty

Detailed Description

Class for a leader entity (kind of a polyline arrow).

Author:
Andrew Mustun


Constructor & Destructor Documentation

RS_Leader::RS_Leader RS_EntityContainer parent,
const RS_LeaderData d
 

Constructor.

Parameters:
d Leader data


Member Function Documentation

void RS_Leader::addEntity RS_Entity entity  )  [virtual]
 

Reimplementation of the addEntity method for a normal container.

This reimplementation deletes the given entity!

To add entities use addVertex() instead.

Reimplemented from RS_EntityContainer.

RS_Entity * RS_Leader::addVertex const RS_Vector v  )  [virtual]
 

Adds a vertex from the endpoint of the last element or sets the startpoint to the point 'v'.

The very first vertex added is the starting point.

Parameters:
v vertex coordinate
Returns:
Pointer to the entity that was addded or NULL if this was the first vertex added.

RS_LeaderData RS_Leader::getData  )  const [inline]
 

Returns:
Copy of data that defines the leader.

virtual double RS_Leader::getLength  )  [inline, virtual]
 

Returns:
Total length of all entities in this container.

Reimplemented from RS_EntityContainer.

RS_Vector RS_Leader::getNearestRef const RS_Vector coord,
double *  dist = NULL
[virtual]
 

Must be overwritten to get the nearest reference point for this entity.

Parameters:
coord Coordinate (typically a mouse coordinate)
dist Pointer to a value which will contain the measured distance between 'coord' and the closest point. The passed pointer can also be NULL in which case the distance will be lost.
Returns:
The closest point with the given distance to the endpoint.

Reimplemented from RS_EntityContainer.

RS_Vector RS_Leader::getNearestSelectedRef const RS_Vector coord,
double *  dist = NULL
[virtual]
 

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.

Parameters:
coord Coordinate (typically a mouse coordinate)
dist Pointer to a value which will contain the measured distance between 'coord' and the closest point. The passed pointer can also be NULL in which case the distance will be lost.
Returns:
The closest point with the given distance to the endpoint.

Reimplemented from RS_EntityContainer.

bool RS_Leader::hasArrowHead  )  [inline]
 

Returns:
true: if this leader has an arrow at the beginning.

virtual RS2::EntityType RS_Leader::rtti  )  const [inline, virtual]
 

Returns:
RS2::EntityDimLeader

Reimplemented from RS_EntityContainer.

void RS_Leader::stretch const RS_Vector firstCorner,
const RS_Vector secondCorner,
const RS_Vector offset
[virtual]
 

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_EntityContainer.

void RS_Leader::update  )  [virtual]
 

Implementation of update.

Updates the arrow.

Reimplemented from RS_EntityContainer.


The documentation for this class was generated from the following files:
Generated on Sat Jan 6 13:48:23 2007 for qcadlib by  doxygen 1.4.4