#define __ENTITY_H__
#include <QtCore>
-#include "rs.h"
+#include "enums.h"
#include "layer.h"
#include "mathextra.h"
#include "pen.h"
#include "vector.h"
#include "vectorsolutions.h"
-class RS_Arc;
-class RS_Block;
-class RS_Circle;
-class RS_Document;
-class RS_EntityContainer;
+class Arc;
+class Block;
+class Circle;
+class Document;
+class EntityContainer;
class Drawing;
class GraphicView;
-class RS_Insert;
-class RS_Line;
-class RS_Point;
-class RS_Polyline;
-class RS_Text;
+class Insert;
+class Line;
+class Point;
+class Polyline;
+class Text;
class PaintInterface;
/**
*
* @author Andrew Mustun
*/
-class RS_Entity: public RS_Undoable
+class Entity: public Undoable
{
public:
- RS_Entity(RS_EntityContainer * parent = NULL);
- virtual ~RS_Entity();
+ Entity(EntityContainer * parent = NULL);
+ virtual ~Entity();
void init();
virtual void initId();
- virtual RS_Entity * clone() = 0;
- virtual void reparent(RS_EntityContainer * parent);
+ virtual Entity * clone() = 0;
+ virtual void reparent(EntityContainer * parent);
void resetBorders();
virtual RS2::EntityType rtti() const;
virtual RS2::UndoableType undoRtti();
virtual unsigned long int countDeep() = 0;
virtual double getLength();
- RS_EntityContainer * getParent() const;
- void setParent(RS_EntityContainer * p);
+ EntityContainer * getParent() const;
+ void setParent(EntityContainer * p);
Drawing * getGraphic();
- RS_Block * getBlock();
- RS_Insert * getInsert();
- RS_Entity * getBlockOrInsert();
- RS_Document * getDocument();
+ Block * getBlock();
+ Insert * getInsert();
+ Entity * getBlockOrInsert();
+ Document * getDocument();
void setLayer(const QString & name);
- void setLayer(RS_Layer * l);
+ void setLayer(Layer * l);
void setLayerToActive();
- RS_Layer * getLayer(bool resolve = true) const;
- void setPen(const RS_Pen & pen);
+ Layer * getLayer(bool resolve = true) const;
+ void setPen(const Pen & pen);
void setPenToActive();
- RS_Pen getPen(bool resolve = true) const;
+ Pen getPen(bool resolve = true) const;
/**
* Must be overwritten to return true if an entity type
* @return The closest coordinate.
*/
virtual Vector getNearestPointOnEntity(const Vector& /*coord*/,
- bool onEntity = true, double * dist = NULL, RS_Entity ** entity = NULL) = 0;
+ bool onEntity = true, double * dist = NULL, Entity ** entity = NULL) = 0;
/**
* Must be overwritten to get the (nearest) center point to the
*
* @return The measured distance between \p coord and the entity.
*/
- virtual double getDistanceToPoint(const Vector & coord, RS_Entity ** entity = NULL,
+ virtual double getDistanceToPoint(const Vector & coord, Entity ** entity = NULL,
RS2::ResolveLevel level = RS2::ResolveNone, double solidDist = RS_MAXDOUBLE) = 0;
virtual bool isPointOnEntity(const Vector & coord, double tolerance = RS_TOLERANCE);
void setUserDefVar(QString key, QString val);
void delUserDefVar(QString key);
- friend std::ostream & operator<<(std::ostream & os, RS_Entity & e);
+ friend std::ostream & operator<<(std::ostream & os, Entity & e);
/** Recalculates the borders of this entity. */
virtual void calculateBorders() = 0;
protected:
//! Entity's parent entity or NULL is this entity has no parent.
- RS_EntityContainer * parent;
+ EntityContainer * parent;
//! minimum coordinates
Vector minV;
//! maximum coordinates
Vector maxV;
//! Pointer to layer
- RS_Layer * layer;
+ Layer * layer;
//! Entity id
unsigned long int id;
//! pen (attributes) for this entity
- RS_Pen pen;
+ Pen pen;
//! auto updating enabled?
bool updateEnabled;