]> Shamusworld >> Repos - architektonas/blobdiff - src/base/rs_entity.cpp
Refactored CAD tool bars to use predefined actions.
[architektonas] / src / base / rs_entity.cpp
index d633d222c67de02c8e0370f0477c15e144b4ae61..da69974e9f3dbf4406ff6a92988c7d3972b91f8b 100644 (file)
@@ -20,8 +20,8 @@
 #include "rs_debug.h"
 #include "rs_document.h"
 #include "rs_ellipse.h"
-#include "rs_graphic.h"
-#include "rs_graphicview.h"
+#include "drawing.h"
+#include "graphicview.h"
 #include "rs_insert.h"
 #include "rs_layer.h"
 #include "rs_line.h"
@@ -426,10 +426,10 @@ void RS_Entity::setParent(RS_EntityContainer * p)
  * or the parent's parent graphic or NULL if none of the parents
  * are stored in a graphic.
  */
-RS_Graphic * RS_Entity::getGraphic()
+Drawing * RS_Entity::getGraphic()
 {
        if (rtti() == RS2::EntityGraphic)
-               return (RS_Graphic *)this;
+               return (Drawing *)this;
        else if (parent == NULL)
                return NULL;
        else
@@ -552,7 +552,7 @@ Vector RS_Entity::getSize() const
  */
 void RS_Entity::addGraphicVariable(const QString & key, double val, int code)
 {
-       RS_Graphic * graphic = getGraphic();
+       Drawing * graphic = getGraphic();
 
        if (graphic != NULL)
                graphic->addVariable(key, val, code);
@@ -566,7 +566,7 @@ void RS_Entity::addGraphicVariable(const QString & key, double val, int code)
  */
 void RS_Entity::addGraphicVariable(const QString & key, int val, int code)
 {
-       RS_Graphic * graphic = getGraphic();
+       Drawing * graphic = getGraphic();
 
        if (graphic != NULL)
                graphic->addVariable(key, val, code);
@@ -580,7 +580,7 @@ void RS_Entity::addGraphicVariable(const QString & key, int val, int code)
  */
 void RS_Entity::addGraphicVariable(const QString & key, const QString & val, int code)
 {
-       RS_Graphic * graphic = getGraphic();
+       Drawing * graphic = getGraphic();
 
        if (graphic != NULL)
                graphic->addVariable(key, val, code);
@@ -597,7 +597,7 @@ void RS_Entity::addGraphicVariable(const QString & key, const QString & val, int
  */
 double RS_Entity::getGraphicVariableDouble(const QString & key, double def)
 {
-       RS_Graphic * graphic = getGraphic();
+       Drawing * graphic = getGraphic();
        double ret = def;
 
        if (graphic != NULL)
@@ -617,7 +617,7 @@ double RS_Entity::getGraphicVariableDouble(const QString & key, double def)
  */
 int RS_Entity::getGraphicVariableInt(const QString & key, int def)
 {
-       RS_Graphic * graphic = getGraphic();
+       Drawing * graphic = getGraphic();
        int ret = def;
 
        if (graphic != NULL)
@@ -637,7 +637,7 @@ int RS_Entity::getGraphicVariableInt(const QString & key, int def)
  */
 QString RS_Entity::getGraphicVariableString(const QString & key, const QString & def)
 {
-       RS_Graphic * graphic = getGraphic();
+       Drawing * graphic = getGraphic();
        QString ret = def;
 
        if (graphic != NULL)
@@ -652,7 +652,7 @@ QString RS_Entity::getGraphicVariableString(const QString & key, const QString &
  */
 RS2::Unit RS_Entity::getGraphicUnit()
 {
-       RS_Graphic * graphic = getGraphic();
+       Drawing * graphic = getGraphic();
        RS2::Unit ret = RS2::None;
 
        if (graphic != NULL)
@@ -736,7 +736,7 @@ RS2::Unit RS_Entity::getGraphicUnit()
  * Implementations must drag the reference point(s) of all
  * (sub-)entities that are very close to ref by offset.
  */
-/*virtual*/ void RS_Entity::moveRef(const Vector & /*ref*/, const Vector & /*offset*/)
+/*virtual*/ void RS_Entity::moveRef(const Vector &/*ref*/, const Vector &/*offset*/)
 {
        return;
 }
@@ -745,7 +745,7 @@ RS2::Unit RS_Entity::getGraphicUnit()
  * Implementations must drag the reference point(s) of selected
  * (sub-)entities that are very close to ref by offset.
  */
-/*virtual*/ void RS_Entity::moveSelectedRef(const Vector & /*ref*/, const Vector & /*offset*/)
+/*virtual*/ void RS_Entity::moveSelectedRef(const Vector &/*ref*/, const Vector &/*offset*/)
 {
        return;
 }
@@ -786,7 +786,7 @@ RS_Layer * RS_Entity::getLayer(bool resolve) const
  */
 void RS_Entity::setLayer(const QString & name)
 {
-       RS_Graphic * graphic = getGraphic();
+       Drawing * graphic = getGraphic();
 
        if (graphic != NULL)
                layer = graphic->findLayer(name);
@@ -809,7 +809,7 @@ void RS_Entity::setLayer(RS_Layer * l)
  */
 void RS_Entity::setLayerToActive()
 {
-       RS_Graphic * graphic = getGraphic();
+       Drawing * graphic = getGraphic();
 
        if (graphic != NULL)
                layer = graphic->getActiveLayer();
@@ -917,7 +917,7 @@ void RS_Entity::stretch(Vector firstCorner, Vector secondCorner, Vector offset)
  * @return Factor for scaling the line styles considering the current
  * paper scaling and the fact that styles are stored in Millimeter.
  */
-double RS_Entity::getStyleFactor(RS_GraphicView * view)
+double RS_Entity::getStyleFactor(GraphicView * view)
 {
        double styleFactor = 1.0;
 
@@ -930,7 +930,7 @@ double RS_Entity::getStyleFactor(RS_GraphicView * view)
                        //styleFactor = getStyleFactor();
                        // the factor caused by the unit:
                        RS2::Unit unit = RS2::None;
-                       RS_Graphic * g = getGraphic();
+                       Drawing * g = getGraphic();
 
                        if (g != NULL)
                        {
@@ -949,7 +949,7 @@ double RS_Entity::getStyleFactor(RS_GraphicView * view)
 
                if (view->isPrinting() || view->isPrintPreview() || view->isDraftMode() == false)
                {
-                       RS_Graphic * graphic = getGraphic();
+                       Drawing * graphic = getGraphic();
 
                        if (graphic != NULL && graphic->getPaperScale() > 1.0e-6)
                                styleFactor /= graphic->getPaperScale();
@@ -1100,4 +1100,3 @@ std::ostream & operator<<(std::ostream & os, RS_Entity & e)
 
        return os;
 }
-