]> Shamusworld >> Repos - architektonas/commitdiff
Changed RS_Graphic to Drawing; this is less confusing as a drawing is
authorShamus Hammons <jlhamm@acm.org>
Thu, 3 Jun 2010 13:16:49 +0000 (13:16 +0000)
committerShamus Hammons <jlhamm@acm.org>
Thu, 3 Jun 2010 13:16:49 +0000 (13:16 +0000)
what the class is and not a bitmap (which is what is implied).

132 files changed:
architektonas.pro
src/actions/rs_actionblocksadd.cpp
src/actions/rs_actionblocksattributes.cpp
src/actions/rs_actionblocksedit.cpp
src/actions/rs_actionblocksfreezeall.cpp
src/actions/rs_actionblocksremove.cpp
src/actions/rs_actionblockstoggleview.cpp
src/actions/rs_actionfilenew.cpp
src/actions/rs_actionfileopen.cpp
src/actions/rs_actionfilesave.cpp
src/actions/rs_actionfilesaveas.cpp
src/actions/rs_actionlayersadd.cpp
src/actions/rs_actionlayersedit.cpp
src/actions/rs_actionlayersfreezeall.cpp
src/actions/rs_actionlayersremove.cpp
src/actions/rs_actionlayerstogglelock.cpp
src/actions/rs_actionlayerstoggleview.cpp
src/actions/rs_actionlibraryinsert.h
src/base/drawing.cpp [moved from src/base/rs_graphic.cpp with 70% similarity]
src/base/drawing.h [moved from src/base/rs_graphic.h with 95% similarity]
src/base/rs_actioninterface.h
src/base/rs_block.cpp
src/base/rs_clipboard.h
src/base/rs_commandevent.h
src/base/rs_constructionline.cpp
src/base/rs_constructionline.h
src/base/rs_creation.cpp
src/base/rs_creation.h
src/base/rs_dialogfactory.h
src/base/rs_dialogfactoryadapter.h
src/base/rs_dialogfactoryinterface.h
src/base/rs_dimaligned.cpp
src/base/rs_dimangular.cpp
src/base/rs_dimdiametric.cpp
src/base/rs_dimension.cpp
src/base/rs_dimlinear.cpp
src/base/rs_dimradial.cpp
src/base/rs_ellipse.cpp
src/base/rs_entity.cpp
src/base/rs_entity.h
src/base/rs_eventhandler.cpp
src/base/rs_fileio.cpp
src/base/rs_fileio.h
src/base/rs_filtercxf.cpp
src/base/rs_filtercxf.h
src/base/rs_filterdxf.cpp
src/base/rs_filterdxf.h
src/base/rs_filterdxf1.cpp
src/base/rs_filterdxf1.h
src/base/rs_filterinterface.h
src/base/rs_font.h
src/base/rs_graphicview.cpp
src/base/rs_graphicview.h
src/base/rs_grid.cpp
src/base/rs_hatch.cpp
src/base/rs_infoarea.cpp
src/base/rs_infoarea.h
src/base/rs_information.cpp
src/base/rs_information.h
src/base/rs_insert.cpp
src/base/rs_insert.h
src/base/rs_layer.cpp
src/base/rs_layer.h
src/base/rs_layerlist.cpp
src/base/rs_layerlist.h
src/base/rs_layerlistlistener.h
src/base/rs_leader.cpp
src/base/rs_leader.h
src/base/rs_line.cpp
src/base/rs_line.h
src/base/rs_linetypepattern.cpp
src/base/rs_linetypepattern.h
src/base/rs_mainwindowinterface.h
src/base/rs_math.cpp
src/base/rs_math.h
src/base/rs_modification.cpp
src/base/rs_modification.h
src/base/rs_pattern.cpp
src/base/rs_pattern.h
src/base/rs_patternlist.cpp
src/base/rs_patternlist.h
src/base/rs_pen.h
src/base/rs_point.cpp
src/base/rs_point.h
src/base/rs_polyline.cpp
src/base/rs_polyline.h
src/base/rs_preview.cpp
src/base/rs_previewactioninterface.cpp
src/base/rs_python.cpp
src/base/rs_python.h
src/base/rs_python_wrappers.cpp
src/base/rs_script.cpp
src/base/rs_script.h
src/base/rs_scriptlist.cpp
src/base/rs_scriptlist.h
src/base/rs_selection.cpp
src/base/rs_selection.h
src/base/rs_simplepython.cpp
src/base/rs_simplepython.h
src/base/rs_snapper.cpp
src/base/rs_solid.cpp
src/base/rs_solid.h
src/base/rs_spline.cpp
src/base/rs_spline.h
src/base/rs_staticgraphicview.cpp
src/base/rs_staticgraphicview.h
src/base/rs_text.cpp
src/base/rs_undo.cpp
src/base/rs_undo.h
src/base/rs_undoable.cpp
src/base/rs_undocycle.cpp
src/base/rs_units.cpp
src/base/rs_units.h
src/base/rs_utility.cpp
src/base/rs_utility.h
src/base/rs_variable.cpp
src/base/rs_variable.h
src/base/vector.h
src/forms/coordinatewidget.cpp
src/forms/coordinatewidget.h
src/forms/dlgattributes.cpp
src/forms/dlgoptionsdrawing.cpp
src/forms/dlgoptionsdrawing.h
src/forms/librarywidget.cpp
src/mainapp/main.cpp
src/mainapp/qc_applicationwindow.cpp
src/mainapp/qc_mdiwindow.cpp
src/mainapp/qc_mdiwindow.h
src/widgets/qg_dialogfactory.cpp
src/widgets/qg_dialogfactory.h
src/widgets/qg_filedialog.cpp
src/widgets/qg_graphicview.cpp

index 66d591e5efa7f69b70a41ce48449c29b3d628901..b14716495622f9cd9a08788f7eaaa703590a7e3e 100644 (file)
@@ -58,7 +58,7 @@ HEADERS = \
        src/base/rs_font.h \
        src/base/rs_fontchar.h \
        src/base/rs_fontlist.h \
-       src/base/rs_graphic.h \
+       src/base/drawing.h \
        src/base/rs_hatch.h \
        src/base/rs_insert.h \
        src/base/rs_image.h \
@@ -140,7 +140,7 @@ SOURCES = \
        src/base/rs_entitycontainer.cpp \
        src/base/rs_font.cpp \
        src/base/rs_fontlist.cpp \
-       src/base/rs_graphic.cpp \
+       src/base/drawing.cpp \
        src/base/rs_hatch.cpp \
        src/base/rs_insert.cpp \
        src/base/rs_image.cpp \
@@ -170,6 +170,7 @@ SOURCES = \
        src/base/rs_filterdxf.cpp \
        src/base/rs_filterdxf1.cpp \
        src/base/rs_filterinterface.cpp \
+       src/base/rs_commandevent.cpp \
        src/base/rs_dialogfactory.cpp \
        src/base/rs_eventhandler.cpp \
        src/base/rs_graphicview.cpp \
index 5ef6ff19c32f9febaaef942a09761611f3bf778d..d6705fedf092328a139a2460ed8e0718a735d295 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "rs_actionblocksadd.h"
 
-#include "rs_graphic.h"
+#include "drawing.h"
 #include "rs_dialogfactory.h"
 
 RS_ActionBlocksAdd::RS_ActionBlocksAdd(RS_EntityContainer& container,
index 978039b65a76ff7eaf1645f6bbfa4071bb786f0b..9c363e31ebe05ecbd36d0fca53fae260b8a71796 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "rs_actionblocksattributes.h"
 
-#include "rs_graphic.h"
+#include "drawing.h"
 #include "rs_dialogfactory.h"
 
 
index 1a0208d43c7c4a8381910a71a89c4b5066eb1ca2..e63c7a258410d11e2270215852057854c04f6043 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "rs_actionblocksedit.h"
 
-#include "rs_graphic.h"
+#include "drawing.h"
 #include "rs_dialogfactory.h"
 
 
index 01cdea62fe873c626c8debcd6b5594fccceac461..13305d3bcbadedbb9cbb69b79d2fb8698028b4f4 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "rs_actionblocksfreezeall.h"
 
-#include "rs_graphic.h"
+#include "drawing.h"
 
 RS_ActionBlocksFreezeAll::RS_ActionBlocksFreezeAll(bool freeze, RS_EntityContainer & container,
        RS_GraphicView& graphicView): RS_ActionInterface("Freeze all Blocks",
index 219aa800eee8f1f87a8155696afd84c1ab1e8dd8..d51e5b0eb7ce21bc302548e0e22c7ee8d046eaf5 100644 (file)
@@ -27,7 +27,7 @@
 #include "rs_actionblocksremove.h"
 
 #include "rs_block.h"
-#include "rs_graphic.h"
+#include "drawing.h"
 #include "rs_insert.h"
 #include "rs_dialogfactory.h"
 
index 1fc96178e2446c0b09cea0b7b7ee750a748df87c..66fd128c7201880eb458b85c1ab115d710358855 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "rs_actionblockstoggleview.h"
 
-#include "rs_graphic.h"
+#include "drawing.h"
 
 
 
index 2dbee34fc460e80053c6681638b5c0bdc0d7b364..7c9c5ecbe66153cd5e53eeb5a3780f77f39e2184 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "rs_actionfilenew.h"
 
-#include "rs_graphic.h"
+#include "drawing.h"
 
 RS_ActionFileNew::RS_ActionFileNew(RS_EntityContainer & container,
        RS_GraphicView & graphicView):
index 667228e2ad5d0a69e15a114abcfa933af3fb2f57..7093bbcbd235e842448511b75e0af063b353cbe4 100644 (file)
@@ -1,7 +1,7 @@
 
 #include "rs_actionfileopen.h"
 
-#include "rs_graphic.h"
+#include "drawing.h"
 
 RS_ActionFileOpen::RS_ActionFileOpen(RS_EntityContainer & container,
        RS_GraphicView & graphicView):
index 06906cbbacf8064966875bdb5bc7cd02308d5e49..4446afcce7ebfb6e6368a0f5406970cd269d299e 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "rs_actionfilesave.h"
 
-#include "rs_graphic.h"
+#include "drawing.h"
 //Added by qt3to4:
 //#include <QPixmap>
 
index d85a4ac334ec1b068042b54db6b01ab8b7e99aa5..8a5d23e8f67704cd0467c298cf750a55d5f16304 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "rs_actionfilesaveas.h"
 
-#include "rs_graphic.h"
+#include "drawing.h"
 //Added by qt3to4:
 //#include <QPixmap>
 
index eea48b929aa22a4807437fabf675ff9298eb0aca..f200b943e2fa19afbc225c60b57f70a6deb6754c 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "rs_actionlayersadd.h"
 
-#include "rs_graphic.h"
+#include "drawing.h"
 
 
 
index b6d7c54c1d1804d86367bd7f65e491574c4927e7..879da0196ad1f441ab32fe2939b1fda3a6229d8d 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "rs_actionlayersedit.h"
 
-#include "rs_graphic.h"
+#include "drawing.h"
 
 
 
index 6e79f83d8052eaf14af412d247e4ab48ef6dbfe7..7e7dc9088dcea233fd62ea6340bd851c753a4480 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "rs_actionlayersfreezeall.h"
 
-#include "rs_graphic.h"
+#include "drawing.h"
 
 RS_ActionLayersFreezeAll::RS_ActionLayersFreezeAll(bool freeze,
         RS_EntityContainer& container,
index f1eba1611441855cef8cdbefdf216d7dca80085c..937dda1dad71c24cd78ec1122121301e56184a7c 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "rs_actionlayersremove.h"
 
-#include "rs_graphic.h"
+#include "drawing.h"
 
 
 
index 93cb56d34e2e96cbbac63de2360f8dc83fd7ba12..fe09a12ce26d2f6e028563030014fbf1fd0567cf 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "rs_actionlayerstogglelock.h"
 
-#include "rs_graphic.h"
+#include "drawing.h"
 
 
 
index 09f0cc6d7bf3f6049930b1c83a4c40ae05c37bc0..14e8990782d8640873444b7e986d0c9efa112fd4 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "rs_actionlayerstoggleview.h"
 
-#include "rs_graphic.h"
+#include "drawing.h"
 
 
 
index 12730d8c07863f89465180222352d547b352cff5..fa8ec4e3fe32d6b5dab9c7edfd4efe7ace335f1d 100644 (file)
@@ -138,7 +138,7 @@ public:
 protected:
        //RS_Block* block;
        //RS_InsertData data;
-       RS_Graphic prev;
+       Drawing prev;
        RS_LibraryInsertData data;
        
        /** Last status before entering option. */
similarity index 70%
rename from src/base/rs_graphic.cpp
rename to src/base/drawing.cpp
index f2ed6048df0b1feeacf1645a7678f802f3f26891..dbdc1e2f8716e4c7abb3e2382f0087fd462b3172 100644 (file)
@@ -1,4 +1,4 @@
-// rs_graphic.cpp
+// drawing.cpp
 //
 // Part of the Architektonas Project
 // Originally part of QCad Community Edition by Andrew Mustun
 // Who  When        What
 // ---  ----------  -----------------------------------------------------------
 // JLH  05/21/2010  Added this text. :-)
+// JLH  06/02/2010  Changed all references of this class from RS_Graphic to
+//                  Drawing, as that makes it more clear that this is what it
+//                  is (a CAD drawing, not a bitmap).
 //
 
-#include "rs_graphic.h"
+#include "drawing.h"
 
 #include "rs_debug.h"
 #include "rs_fileio.h"
@@ -23,7 +26,7 @@
 /**
  * Default constructor.
  */
-RS_Graphic::RS_Graphic(RS_EntityContainer * parent): RS_Document(parent), layerList(),
+Drawing::Drawing(RS_EntityContainer * parent): RS_Document(parent), layerList(),
        blockList(true)
 #ifdef RS_CAM
        , camData()
@@ -58,12 +61,12 @@ RS_Graphic::RS_Graphic(RS_EntityContainer * parent): RS_Document(parent), layerL
 /**
  * Destructor.
  */
-RS_Graphic::~RS_Graphic()
+Drawing::~Drawing()
 {
 }
 
 /** @return RS2::EntityGraphic */
-/*virtual*/ RS2::EntityType RS_Graphic::rtti() const
+/*virtual*/ RS2::EntityType Drawing::rtti() const
 {
        return RS2::EntityGraphic;
 }
@@ -71,7 +74,7 @@ RS_Graphic::~RS_Graphic()
 /**
  * Counts the entities on the given layer.
  */
-unsigned long int RS_Graphic::countLayerEntities(RS_Layer * layer)
+unsigned long int Drawing::countLayerEntities(RS_Layer * layer)
 {
     int c = 0;
 
@@ -89,12 +92,12 @@ unsigned long int RS_Graphic::countLayerEntities(RS_Layer * layer)
     return c;
 }
 
-/*virtual*/ RS_LayerList * RS_Graphic::getLayerList()
+/*virtual*/ RS_LayerList * Drawing::getLayerList()
 {
        return &layerList;
 }
 
-/*virtual*/ RS_BlockList * RS_Graphic::getBlockList()
+/*virtual*/ RS_BlockList * Drawing::getBlockList()
 {
        return &blockList;
 }
@@ -103,9 +106,9 @@ unsigned long int RS_Graphic::countLayerEntities(RS_Layer * layer)
  * Clears all layers, blocks and entities of this graphic.
  * A default layer (0) is created.
  */
-void RS_Graphic::newDoc()
+void Drawing::newDoc()
 {
-       RS_DEBUG->print("RS_Graphic::newDoc");
+       RS_DEBUG->print("Drawing::newDoc");
 
        clear();
 
@@ -121,11 +124,11 @@ void RS_Graphic::newDoc()
 /**
  * Saves this graphic with the current filename and settings.
  */
-bool RS_Graphic::save()
+bool Drawing::save()
 {
        bool ret = false;
 
-       RS_DEBUG->print("RS_Graphic::save");
+       RS_DEBUG->print("Drawing::save");
        RS_DEBUG->print("  file: %s", filename.toLatin1().data());
        RS_DEBUG->print("  format: %d", (int)formatType);
 
@@ -139,7 +142,7 @@ bool RS_Graphic::save()
                blockList.setModified(false);
        }
 
-       RS_DEBUG->print("RS_Graphic::save ok");
+       RS_DEBUG->print("Drawing::save ok");
 
        return ret;
 }
@@ -147,9 +150,9 @@ bool RS_Graphic::save()
 /**
  * Saves this graphic with the given filename and current settings.
  */
-bool RS_Graphic::saveAs(const QString & filename, RS2::FormatType type)
+bool Drawing::saveAs(const QString & filename, RS2::FormatType type)
 {
-       RS_DEBUG->print("RS_Graphic::saveAs");
+       RS_DEBUG->print("Drawing::saveAs");
 
        this->filename = filename;
        this->formatType = type;
@@ -160,9 +163,9 @@ bool RS_Graphic::saveAs(const QString & filename, RS2::FormatType type)
 /**
  * Loads the given fils into this graphic.
  */
-bool RS_Graphic::open(const QString &filename, RS2::FormatType type)
+bool Drawing::open(const QString &filename, RS2::FormatType type)
 {
-       RS_DEBUG->print("RS_Graphic::open(%s)", filename.toLatin1().data());
+       RS_DEBUG->print("Drawing::open(%s)", filename.toLatin1().data());
 
        bool ret = false;
 
@@ -178,46 +181,46 @@ bool RS_Graphic::open(const QString &filename, RS2::FormatType type)
        layerList.setModified(false);
        blockList.setModified(false);
 
-       //cout << *((RS_Graphic*)graphic);
+       //cout << *((Drawing*)graphic);
        //calculateBorders();
 
-       RS_DEBUG->print("RS_Graphic::open(%s): OK", filename.toLatin1().data());
+       RS_DEBUG->print("Drawing::open(%s): OK", filename.toLatin1().data());
 
        return ret;
 }
 
 // Wrappers for Layer functions:
-void RS_Graphic::clearLayers()
+void Drawing::clearLayers()
 {
        layerList.clear();
 }
 
-uint RS_Graphic::countLayers() const
+uint Drawing::countLayers() const
 {
        return layerList.count();
 }
 
-RS_Layer * RS_Graphic::layerAt(uint i)
+RS_Layer * Drawing::layerAt(uint i)
 {
        return layerList.at(i);
 }
 
-void RS_Graphic::activateLayer(const QString & name)
+void Drawing::activateLayer(const QString & name)
 {
        layerList.activate(name);
 }
 
-void RS_Graphic::activateLayer(RS_Layer * layer)
+void Drawing::activateLayer(RS_Layer * layer)
 {
        layerList.activate(layer);
 }
 
-RS_Layer * RS_Graphic::getActiveLayer()
+RS_Layer * Drawing::getActiveLayer()
 {
        return layerList.getActive();
 }
 
-/*virtual*/ void RS_Graphic::addLayer(RS_Layer * layer)
+/*virtual*/ void Drawing::addLayer(RS_Layer * layer)
 {
        layerList.add(layer);
 }
@@ -225,7 +228,7 @@ RS_Layer * RS_Graphic::getActiveLayer()
 /**
  * Removes the given layer and undoes all entities on it.
  */
-/*virtual*/ void RS_Graphic::removeLayer(RS_Layer * layer)
+/*virtual*/ void Drawing::removeLayer(RS_Layer * layer)
 {
        if (layer != NULL && layer->getName() != "0")
        {
@@ -267,186 +270,186 @@ RS_Layer * RS_Graphic::getActiveLayer()
        }
 }
 
-/*virtual*/ void RS_Graphic::editLayer(RS_Layer * layer, const RS_Layer & source)
+/*virtual*/ void Drawing::editLayer(RS_Layer * layer, const RS_Layer & source)
 {
        layerList.edit(layer, source);
 }
 
-RS_Layer * RS_Graphic::findLayer(const QString & name)
+RS_Layer * Drawing::findLayer(const QString & name)
 {
        return layerList.find(name);
 }
 
-void RS_Graphic::toggleLayer(const QString & name)
+void Drawing::toggleLayer(const QString & name)
 {
        layerList.toggle(name);
 }
 
-void RS_Graphic::toggleLayer(RS_Layer * layer)
+void Drawing::toggleLayer(RS_Layer * layer)
 {
        layerList.toggle(layer);
 }
 
-void RS_Graphic::toggleLayerLock(RS_Layer * layer)
+void Drawing::toggleLayerLock(RS_Layer * layer)
 {
        layerList.toggleLock(layer);
 }
 
-void RS_Graphic::freezeAllLayers(bool freeze)
+void Drawing::freezeAllLayers(bool freeze)
 {
        layerList.freezeAll(freeze);
 }
 
-void RS_Graphic::addLayerListListener(RS_LayerListListener * listener)
+void Drawing::addLayerListListener(RS_LayerListListener * listener)
 {
        layerList.addListener(listener);
 }
 
-void RS_Graphic::removeLayerListListener(RS_LayerListListener * listener)
+void Drawing::removeLayerListListener(RS_LayerListListener * listener)
 {
        layerList.removeListener(listener);
 }
 
 // Wrapper for block functions:
 
-void RS_Graphic::clearBlocks()
+void Drawing::clearBlocks()
 {
        blockList.clear();
 }
 
-uint RS_Graphic::countBlocks()
+uint Drawing::countBlocks()
 {
        return blockList.count();
 }
 
-RS_Block * RS_Graphic::blockAt(uint i)
+RS_Block * Drawing::blockAt(uint i)
 {
        return blockList.at(i);
 }
 
-void RS_Graphic::activateBlock(const QString & name)
+void Drawing::activateBlock(const QString & name)
 {
        blockList.activate(name);
 }
 
-void RS_Graphic::activateBlock(RS_Block * block)
+void Drawing::activateBlock(RS_Block * block)
 {
        blockList.activate(block);
 }
 
-RS_Block * RS_Graphic::getActiveBlock()
+RS_Block * Drawing::getActiveBlock()
 {
        return blockList.getActive();
 }
 
-/*virtual*/ bool RS_Graphic::addBlock(RS_Block * block, bool notify/*= true*/)
+/*virtual*/ bool Drawing::addBlock(RS_Block * block, bool notify/*= true*/)
 {
        return blockList.add(block, notify);
 }
 
-/*virtual*/ void RS_Graphic::addBlockNotification()
+/*virtual*/ void Drawing::addBlockNotification()
 {
        blockList.addNotification();
 }
 
-/*virtual*/ void RS_Graphic::removeBlock(RS_Block * block)
+/*virtual*/ void Drawing::removeBlock(RS_Block * block)
 {
        blockList.remove(block);
 }
 
-RS_Block * RS_Graphic::findBlock(const QString & name)
+RS_Block * Drawing::findBlock(const QString & name)
 {
        return blockList.find(name);
 }
 
-QString RS_Graphic::newBlockName()
+QString Drawing::newBlockName()
 {
        return blockList.newName();
 }
 
-void RS_Graphic::toggleBlock(const QString & name)
+void Drawing::toggleBlock(const QString & name)
 {
        blockList.toggle(name);
 }
 
-void RS_Graphic::toggleBlock(RS_Block * block)
+void Drawing::toggleBlock(RS_Block * block)
 {
        blockList.toggle(block);
 }
 
-void RS_Graphic::freezeAllBlocks(bool freeze)
+void Drawing::freezeAllBlocks(bool freeze)
 {
        blockList.freezeAll(freeze);
 }
 
-void RS_Graphic::addBlockListListener(RS_BlockListListener * listener)
+void Drawing::addBlockListListener(RS_BlockListListener * listener)
 {
        blockList.addListener(listener);
 }
 
-void RS_Graphic::removeBlockListListener(RS_BlockListListener * listener)
+void Drawing::removeBlockListListener(RS_BlockListListener * listener)
 {
        blockList.removeListener(listener);
 }
 
 // Wrappers for variable functions:
-void RS_Graphic::clearVariables()
+void Drawing::clearVariables()
 {
        variableDict.clear();
 }
 
-int RS_Graphic::countVariables()
+int Drawing::countVariables()
 {
        return variableDict.count();
 }
 
-void RS_Graphic::addVariable(const QString & key, const Vector & value, int code)
+void Drawing::addVariable(const QString & key, const Vector & value, int code)
 {
        variableDict.add(key, value, code);
 }
 
-void RS_Graphic::addVariable(const QString & key, const QString & value, int code)
+void Drawing::addVariable(const QString & key, const QString & value, int code)
 {
        variableDict.add(key, value, code);
 }
 
-void RS_Graphic::addVariable(const QString & key, int value, int code)
+void Drawing::addVariable(const QString & key, int value, int code)
 {
        variableDict.add(key, value, code);
 }
 
-void RS_Graphic::addVariable(const QString & key, double value, int code)
+void Drawing::addVariable(const QString & key, double value, int code)
 {
        variableDict.add(key, value, code);
 }
 
-Vector RS_Graphic::getVariableVector(const QString & key, const Vector & def)
+Vector Drawing::getVariableVector(const QString & key, const Vector & def)
 {
        return variableDict.getVector(key, def);
 }
 
-QString RS_Graphic::getVariableString(const QString & key, const QString & def)
+QString Drawing::getVariableString(const QString & key, const QString & def)
 {
        return variableDict.getString(key, def);
 }
 
-int RS_Graphic::getVariableInt(const QString & key, int def)
+int Drawing::getVariableInt(const QString & key, int def)
 {
        return variableDict.getInt(key, def);
 }
 
-double RS_Graphic::getVariableDouble(const QString & key, double def)
+double Drawing::getVariableDouble(const QString & key, double def)
 {
        return variableDict.getDouble(key, def);
 }
 
-void RS_Graphic::removeVariable(const QString & key)
+void Drawing::removeVariable(const QString & key)
 {
        variableDict.remove(key);
 }
 
 //Q3Dict<RS_Variable> & getVariableDict()
-QMultiHash<QString, RS_Variable *> & RS_Graphic::getVariableDict()
+QMultiHash<QString, RS_Variable *> & Drawing::getVariableDict()
 {
        return variableDict.getVariableDict();
 }
@@ -454,7 +457,7 @@ QMultiHash<QString, RS_Variable *> & RS_Graphic::getVariableDict()
 /**
  * @return true if the grid is switched on (visible).
  */
-bool RS_Graphic::isGridOn()
+bool Drawing::isGridOn()
 {
        int on = getVariableInt("$GRIDMODE", 1);
        return (on != 0);
@@ -463,7 +466,7 @@ bool RS_Graphic::isGridOn()
 /**
  * Enables / disables the grid.
  */
-void RS_Graphic::setGridOn(bool on)
+void Drawing::setGridOn(bool on)
 {
        addVariable("$GRIDMODE", (int)on, 70);
 }
@@ -471,7 +474,7 @@ void RS_Graphic::setGridOn(bool on)
 /**
  * Sets the unit of this graphic to 'u'
  */
-void RS_Graphic::setUnit(RS2::Unit u)
+void Drawing::setUnit(RS2::Unit u)
 {
        setPaperSize(RS_Units::convert(getPaperSize(), getUnit(), u));
 
@@ -483,7 +486,7 @@ void RS_Graphic::setUnit(RS2::Unit u)
 /**
  * Gets the unit of this graphic
  */
-RS2::Unit RS_Graphic::getUnit()
+RS2::Unit Drawing::getUnit()
 {
        return (RS2::Unit)getVariableInt("$INSUNITS", 0);
        //return unit;
@@ -493,7 +496,7 @@ RS2::Unit RS_Graphic::getUnit()
  * @return The linear format type for this document.
  * This is determined by the variable "$LUNITS".
  */
-RS2::LinearFormat RS_Graphic::getLinearFormat()
+RS2::LinearFormat Drawing::getLinearFormat()
 {
        int lunits = getVariableInt("$LUNITS", 2);
 
@@ -528,7 +531,7 @@ RS2::LinearFormat RS_Graphic::getLinearFormat()
  * @return The linear precision for this document.
  * This is determined by the variable "$LUPREC".
  */
-int RS_Graphic::getLinearPrecision()
+int Drawing::getLinearPrecision()
 {
        return getVariableInt("$LUPREC", 4);
 }
@@ -537,7 +540,7 @@ int RS_Graphic::getLinearPrecision()
  * @return The angle format type for this document.
  * This is determined by the variable "$AUNITS".
  */
-RS2::AngleFormat RS_Graphic::getAngleFormat()
+RS2::AngleFormat Drawing::getAngleFormat()
 {
        int aunits = getVariableInt("$AUNITS", 0);
 
@@ -572,7 +575,7 @@ RS2::AngleFormat RS_Graphic::getAngleFormat()
  * @return The linear precision for this document.
  * This is determined by the variable "$LUPREC".
  */
-int RS_Graphic::getAnglePrecision()
+int Drawing::getAnglePrecision()
 {
        return getVariableInt("$AUPREC", 4);
 }
@@ -582,7 +585,7 @@ int RS_Graphic::getAnglePrecision()
  * This is the distance from the lower left paper edge to the zero
  * point of the drawing. DXF: $PINSBASE.
  */
-Vector RS_Graphic::getPaperInsertionBase()
+Vector Drawing::getPaperInsertionBase()
 {
        return getVariableVector("$PINSBASE", Vector(0.0,0.0));
 }
@@ -590,7 +593,7 @@ Vector RS_Graphic::getPaperInsertionBase()
 /**
  * Sets the PINSBASE variable.
  */
-void RS_Graphic::setPaperInsertionBase(const Vector & p)
+void Drawing::setPaperInsertionBase(const Vector & p)
 {
        addVariable("$PINSBASE", p, 10);
 }
@@ -598,7 +601,7 @@ void RS_Graphic::setPaperInsertionBase(const Vector & p)
 /**
  * @return Paper size in graphic units.
  */
-Vector RS_Graphic::getPaperSize()
+Vector Drawing::getPaperSize()
 {
        Vector def = RS_Units::convert(Vector(210.0, 297.0), RS2::Millimeter, getUnit());
 
@@ -611,7 +614,7 @@ Vector RS_Graphic::getPaperSize()
 /**
  * Sets a new paper size.
  */
-void RS_Graphic::setPaperSize(const Vector & s)
+void Drawing::setPaperSize(const Vector & s)
 {
        addVariable("$PLIMMIN", Vector(0.0, 0.0), 10);
        addVariable("$PLIMMAX", s, 10);
@@ -623,7 +626,7 @@ void RS_Graphic::setPaperSize(const Vector & s)
  *
  * @param landscape will be set to true for landscape and false for portrait if not NULL.
  */
-RS2::PaperFormat RS_Graphic::getPaperFormat(bool * landscape)
+RS2::PaperFormat Drawing::getPaperFormat(bool * landscape)
 {
        Vector size = RS_Units::convert(getPaperSize(), getUnit(), RS2::Millimeter);
 
@@ -636,7 +639,7 @@ RS2::PaperFormat RS_Graphic::getPaperFormat(bool * landscape)
 /**
  * Sets the paper format to the given format.
  */
-void RS_Graphic::setPaperFormat(RS2::PaperFormat f, bool landscape)
+void Drawing::setPaperFormat(RS2::PaperFormat f, bool landscape)
 {
        Vector size = RS_Units::paperFormatToSize(f);
 
@@ -654,7 +657,7 @@ void RS_Graphic::setPaperFormat(RS2::PaperFormat f, bool landscape)
 /**
  * @return Paper space scaling (DXF: $PSVPSCALE).
  */
-double RS_Graphic::getPaperScale()
+double Drawing::getPaperScale()
 {
        double ret;
 
@@ -669,7 +672,7 @@ double RS_Graphic::getPaperScale()
 /**
  * Sets a new scale factor for the paper space.
  */
-void RS_Graphic::setPaperScale(double s)
+void Drawing::setPaperScale(double s)
 {
        addVariable("$PSVPSCALE", s, 40);
 }
@@ -677,7 +680,7 @@ void RS_Graphic::setPaperScale(double s)
 /**
  * Centers drawing on page. Affects DXF variable $PINSBASE.
  */
-void RS_Graphic::centerToPage()
+void Drawing::centerToPage()
 {
        Vector size = getPaperSize();
        double scale = getPaperScale();
@@ -688,7 +691,7 @@ void RS_Graphic::centerToPage()
 /**
  * Fits drawing on page. Affects DXF variable $PINSBASE.
  */
-void RS_Graphic::fitToPage()
+void Drawing::fitToPage()
 {
        double border = RS_Units::convert(25.0, RS2::Millimeter, getUnit());
        Vector ps = getPaperSize() - Vector(border, border);
@@ -713,7 +716,7 @@ void RS_Graphic::fitToPage()
  * @retval true The document has been modified since it was last saved.
  * @retval false The document has not been modified since it was last saved.
  */
-/*virtual*/ bool RS_Graphic::isModified() const
+/*virtual*/ bool Drawing::isModified() const
 {
        return modified || layerList.isModified() || blockList.isModified();
 }
@@ -721,7 +724,7 @@ void RS_Graphic::fitToPage()
 /**
  * Sets the documents modified status to 'm'.
  */
-/*virtual*/ void RS_Graphic::setModified(bool m)
+/*virtual*/ void Drawing::setModified(bool m)
 {
        modified = m;
        layerList.setModified(m);
@@ -729,12 +732,12 @@ void RS_Graphic::fitToPage()
 }
 
 #ifdef RS_CAM
-RS_CamData & RS_Graphic::getCamData()
+RS_CamData & Drawing::getCamData()
 {
        return camData;
 }
 
-void RS_Graphic::setCamData(const RS_CamData & d)
+void Drawing::setCamData(const RS_CamData & d)
 {
        camData = d;
 }
@@ -743,9 +746,9 @@ void RS_Graphic::setCamData(const RS_CamData & d)
 /**
  * Dumps the entities to stdout.
  */
-std::ostream & operator<<(std::ostream & os, RS_Graphic & g)
+std::ostream & operator<<(std::ostream & os, Drawing & g)
 {
-    os << "--- Graphic: \n";
+    os << "--- Drawing: \n";
     os << "---" << *g.getLayerList() << "\n";
     os << "---" << *g.getBlockList() << "\n";
     os << "---" << (RS_Undo&)g << "\n";
similarity index 95%
rename from src/base/rs_graphic.h
rename to src/base/drawing.h
index 2b0cba142e2d0535df3816e480206b5375f80992..22b22177e1578b235b87df493eb356f7c85d5666 100644 (file)
  *
  * @author Andrew Mustun
  */
-class RS_Graphic: public RS_Document
+class Drawing: public RS_Document
 {
 public:
-    RS_Graphic(RS_EntityContainer * parent = NULL);
-    virtual ~RS_Graphic();
+    Drawing(RS_EntityContainer * parent = NULL);
+    virtual ~Drawing();
 
     virtual RS2::EntityType rtti() const;
     virtual unsigned long int countLayerEntities(RS_Layer * layer);
@@ -118,7 +118,7 @@ public:
        void setCamData(const RS_CamData & d);
 #endif
 
-    friend std::ostream & operator<<(std::ostream & os, RS_Graphic & g);
+    friend std::ostream & operator<<(std::ostream & os, Drawing & g);
 
 private:
        RS_LayerList layerList;
index 66a38b214e6661eb4eb1b0f78bf2a05373eb72cf..ed76836ee94700b1f8ab85ef959443f4cf22e073 100644 (file)
@@ -6,7 +6,7 @@
 #include "rs_entitycontainer.h"
 #include "rs_commandevent.h"
 //#include "rs_event.h"
-#include "rs_graphic.h"
+#include "drawing.h"
 #include "rs_graphicview.h"
 #include "rs_snapper.h"
 #include "rs_preview.h"
@@ -99,7 +99,7 @@ class RS_ActionInterface: public QObject, public RS_Snapper
                * Pointer to the graphic is this container is a graphic.
                * NULL otherwise
                */
-               RS_Graphic * graphic;
+               Drawing * graphic;
 
                /**
                * Pointer to the document (graphic or block) or NULL.
index 193f9041312179059ba4464d9ac013992dd6cfe9..15db0de549846d3cefe8b111be34d84012544c37 100644 (file)
@@ -15,7 +15,7 @@
 #include "rs_block.h"
 
 #include <iomanip>
-#include "rs_graphic.h"
+#include "drawing.h"
 
 /**
  * @param parent The graphic this block belongs to.
@@ -44,7 +44,7 @@ RS_Entity * RS_Block::clone()
 
 RS_LayerList * RS_Block::getLayerList()
 {
-       RS_Graphic * g = getGraphic();
+       Drawing * g = getGraphic();
 
        if (g != NULL)
                return g->getLayerList();
@@ -54,7 +54,7 @@ RS_LayerList * RS_Block::getLayerList()
 
 RS_BlockList * RS_Block::getBlockList()
 {
-       RS_Graphic * g = getGraphic();
+       Drawing * g = getGraphic();
 
        if (g != NULL)
                return g->getBlockList();
@@ -64,7 +64,7 @@ RS_BlockList * RS_Block::getBlockList()
 
 bool RS_Block::save()
 {
-       RS_Graphic * g = getGraphic();
+       Drawing * g = getGraphic();
 
        if (g != NULL)
                return g->save();
@@ -74,7 +74,7 @@ bool RS_Block::save()
 
 bool RS_Block::saveAs(const QString & filename, RS2::FormatType type)
 {
-       RS_Graphic * g = getGraphic();
+       Drawing * g = getGraphic();
 
        if (g != NULL)
                return g->saveAs(filename, type);
@@ -87,7 +87,7 @@ bool RS_Block::saveAs(const QString & filename, RS2::FormatType type)
  */
 void RS_Block::setModified(bool m)
 {
-       RS_Graphic * p = getGraphic();
+       Drawing * p = getGraphic();
 
        if (p)
                p->setModified(m);
index 842fc695c3664d87598806673c5f6e0da4a3f432..5e8c27036726d50e46e36b8c6e9af78c2df9e17a 100644 (file)
@@ -2,7 +2,7 @@
 #define RS_CLIPBOARD_H
 
 #include <iostream>
-#include "rs_graphic.h"
+#include "drawing.h"
 
 #define RS_CLIPBOARD RS_Clipboard::instance()
 
@@ -69,7 +69,7 @@ public:
                return graphic.nextEntity();
        }
 
-       RS_Graphic* getGraphic() {
+       Drawing* getGraphic() {
                return &graphic;
        }
 
@@ -78,7 +78,7 @@ public:
 protected:
     static RS_Clipboard* uniqueInstance;
 
-       RS_Graphic graphic;
+       Drawing graphic;
 };
 
 #endif
index 5a0dd5b8fb8fc3c5ac24ac8b1874d60e1da3aa49..6d6ca7c0c861dd3a3d1f035b7c57c4641e21d9d4 100644 (file)
@@ -7,41 +7,11 @@
 class RS_CommandEvent
 {
        public:
-               /**
-               * Creates a new command event that is not yet accepted.
-               *
-               * @param cmd the command that was triggered.
-               */
-               RS_CommandEvent(const QString & cmd)
-               {
-                       this->cmd = cmd;
-                       accepted = false;
-               }
+               RS_CommandEvent(const QString & cmd);
 
-               /**
-               * @return the command that was triggered, usually by
-               * the user.
-               */
-               QString getCommand()
-               {
-                       return cmd;
-               }
-
-               /**
-               * Sets the event state to accepted.
-               */
-               void accept()
-               {
-                       accepted = true;
-               }
-
-               /**
-               * @return Whether the event was already accepted or not.
-               */
-               bool isAccepted()
-               {
-                       return accepted;
-               }
+               QString getCommand();
+               void accept();
+               bool isAccepted();
 
        protected:
                QString cmd;
index 6d85373ed480cf89c22ef51c5b8df0b1e231094c..de542770ad82f9e0e6cb2f959cc94de55a2ae8ba 100644 (file)
@@ -10,6 +10,7 @@
 // Who  When        What
 // ---  ----------  -----------------------------------------------------------
 // JLH  05/28/2010  Added this text. :-)
+// JLH  06/02/2010  Moved implementation from header to here WHERE IT BELONGS.
 //
 
 #include "rs_constructionline.h"
@@ -39,6 +40,47 @@ RS_Entity * RS_ConstructionLine::clone()
        return c;
 }
 
+/**    @return RS2::EntityConstructionLine */
+/*virtual*/ RS2::EntityType RS_ConstructionLine::rtti() const
+{
+       return RS2::EntityConstructionLine;
+}
+
+/**
+ * @todo
+ * @return Start point of the entity.
+ */
+/*virtual*/ Vector RS_ConstructionLine::getStartpoint() const
+{
+       return Vector(false);
+}
+
+/**
+ * @todo
+ * @return End point of the entity.
+ */
+/*virtual*/ Vector RS_ConstructionLine::getEndpoint() const
+{
+       return Vector(false);
+}
+
+/** @return Copy of data that defines the line. */
+RS_ConstructionLineData RS_ConstructionLine::getData() const
+{
+       return data;
+}
+
+/** @return First definition point. */
+Vector RS_ConstructionLine::getPoint1() const
+{
+       return data.point1;
+}
+/** @return Second definition point. */
+Vector RS_ConstructionLine::getPoint2() const
+{
+       return data.point2;
+}
+
 void RS_ConstructionLine::calculateBorders()
 {
        minV = Vector::minimum(data.point1, data.point2);
index 0a91f6c13bcd7440a636a5e1af858aa3c345a1c9..321d0e45aaaafcde19359c04477a060c46289d57 100644 (file)
  */
 class RS_ConstructionLineData
 {
-public:
-    /**
-     * Default constructor. Leaves the data object uninitialized.
-     */
-    RS_ConstructionLineData() {}
-
-    RS_ConstructionLineData(const Vector& point1,
-                            const Vector& point2) {
-
-        this->point1 = point1;
-        this->point2 = point2;
-    }
-
-    friend class RS_ConstructionLine;
-
-    friend std::ostream& operator << (std::ostream& os,
-                                      const RS_ConstructionLineData& ld) {
-
-        os << "(" << ld.point1 <<
-        "/" << ld.point2 <<
-        ")";
-        return os;
-    }
-
-private:
-    Vector point1;
-    Vector point2;
+       public:
+               /**
+                * Default constructor. Leaves the data object uninitialized.
+                */
+               RS_ConstructionLineData() {}
+
+               RS_ConstructionLineData(const Vector & point1, const Vector & point2)
+               {
+                       this->point1 = point1;
+                       this->point2 = point2;
+               }
+
+               friend class RS_ConstructionLine;
+
+               friend std::ostream & operator<<(std::ostream & os, const RS_ConstructionLineData & ld)
+               {
+                       os << "(" << ld.point1 <<
+                       "/" << ld.point2 <<
+                       ")";
+                       return os;
+               }
+
+       private:
+               Vector point1;
+               Vector point2;
 };
 
-
 /**
  * Class for a construction line entity.
  *
  * @author Andrew Mustun
  */
-class RS_ConstructionLine : public RS_AtomicEntity {
-public:
-    RS_ConstructionLine(RS_EntityContainer* parent,
-                        const RS_ConstructionLineData& d);
-
-    virtual RS_Entity* clone();
-
-    virtual ~RS_ConstructionLine();
-
-    /**        @return RS2::EntityConstructionLine */
-    virtual RS2::EntityType rtti() const {
-        return RS2::EntityConstructionLine;
-    }
-
-       /**
-        * @todo
-        * @return Start point of the entity.
-        */
-    virtual Vector getStartpoint() const {
-        return Vector(false);
-    }
-    /**
-        * @todo
-        * @return End point of the entity.
-        */
-    virtual Vector getEndpoint() const {
-        return Vector(false);
-    }
-
-    /** @return Copy of data that defines the line. */
-    RS_ConstructionLineData getData() const {
-        return data;
-    }
-
-    /** @return First definition point. */
-    Vector getPoint1() const {
-        return data.point1;
-    }
-    /** @return Second definition point. */
-    Vector getPoint2() const {
-        return data.point2;
-    }
-
-    virtual Vector getNearestEndpoint(const Vector& coord,
-                                         double* dist = NULL);
-    virtual Vector getNearestPointOnEntity(const Vector& coord,
-            bool onEntity = true, double* dist = NULL, RS_Entity** entity=NULL);
-    virtual Vector getNearestCenter(const Vector& coord,
-                                       double* dist = NULL);
-    virtual Vector getNearestMiddle(const Vector& coord,
-                                       double* dist = NULL);
-    virtual Vector getNearestDist(double distance,
-                                     const Vector& coord,
-                                     double* dist = NULL);
-    virtual double getDistanceToPoint(const Vector& coord,
-                                      RS_Entity** entity=NULL,
-                                      RS2::ResolveLevel level=RS2::ResolveNone,
-                                                                         double solidDist = RS_MAXDOUBLE);
-
-    virtual void move(Vector offset);
-    virtual void rotate(Vector center, double angle);
-    virtual void scale(Vector center, Vector factor);
-    virtual void mirror(Vector axisPoint1, Vector axisPoint2);
-
-//    virtual void draw(RS_Painter* /*painter*/, RS_GraphicView* /*view*/,
-    virtual void draw(PaintInterface * /*painter*/, RS_GraphicView* /*view*/,
-               double /*patternOffset*/) {}
-
-    friend std::ostream& operator << (std::ostream& os,
-                                      const RS_ConstructionLine& l);
-
-    virtual void calculateBorders();
-
-protected:
-    RS_ConstructionLineData data;
+class RS_ConstructionLine: public RS_AtomicEntity
+{
+       public:
+               RS_ConstructionLine(RS_EntityContainer * parent, const RS_ConstructionLineData & d);
+               virtual ~RS_ConstructionLine();
+
+               virtual RS_Entity * clone();
+               virtual RS2::EntityType rtti() const;
+               virtual Vector getStartpoint() const;
+               virtual Vector getEndpoint() const;
+               RS_ConstructionLineData getData() const;
+               Vector getPoint1() const;
+               Vector getPoint2() const;
+               virtual Vector getNearestEndpoint(const Vector & coord, double * dist = NULL);
+               virtual Vector getNearestPointOnEntity(const Vector & coord,
+                       bool onEntity = true, double * dist = NULL, RS_Entity ** entity = NULL);
+               virtual Vector getNearestCenter(const Vector & coord, double * dist = NULL);
+               virtual Vector getNearestMiddle(const Vector & coord, double * dist = NULL);
+               virtual Vector getNearestDist(double distance, const Vector & coord,
+                       double * dist = NULL);
+               virtual double getDistanceToPoint(const Vector & coord, RS_Entity ** entity = NULL,
+                       RS2::ResolveLevel level = RS2::ResolveNone, double solidDist = RS_MAXDOUBLE);
+               virtual void move(Vector offset);
+               virtual void rotate(Vector center, double angle);
+               virtual void scale(Vector center, Vector factor);
+               virtual void mirror(Vector axisPoint1, Vector axisPoint2);
+               virtual void draw(PaintInterface * /*painter*/, RS_GraphicView * /*view*/,
+                       double /*patternOffset*/) {}
+
+               friend std::ostream & operator<<(std::ostream & os, const RS_ConstructionLine & l);
+               virtual void calculateBorders();
+
+       protected:
+               RS_ConstructionLineData data;
 };
 
 #endif
index 2fe863d3c8505203e03d248f80a441385ec6729b..fb99b2f25e215529f007e0f334f823d462d950e6 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <QtCore>
 #include "rs_constructionline.h"
-#include "rs_graphic.h"
+#include "drawing.h"
 #include "rs_graphicview.h"
 #include "rs_information.h"
 #include "rs_modification.h"
@@ -26,7 +26,7 @@
  * Default constructor.
  *
  * @param container The container to which we will add
- *        entities. Usually that's an RS_Graphic entity but
+ *        entities. Usually that's an Drawing entity but
  *        it can also be a polyline, text, ...
  */
 RS_Creation::RS_Creation(RS_EntityContainer * container, RS_GraphicView * graphicView,
@@ -1200,7 +1200,7 @@ RS_Block * RS_Creation::createBlock(const RS_BlockData & data,
 RS_Insert * RS_Creation::createLibraryInsert(RS_LibraryInsertData & data)
 {
        RS_DEBUG->print("RS_Creation::createLibraryInsert");
-       RS_Graphic g;
+       Drawing g;
 
        if (!g.open(data.file, RS2::FormatUnknown))
        {
index 1b814a8c069fdaa7ca17206911e46c91e59a251e..e2a6c887e05e60fd7c833839fbadd4c13eda30f4 100644 (file)
@@ -76,7 +76,7 @@ class RS_Creation
 
        protected:
                RS_EntityContainer * container;
-               RS_Graphic * graphic;
+               Drawing * graphic;
                RS_Document * document;
                RS_GraphicView * graphicView;
                bool handleUndo;
index 733f7cca778bcefc8823caed002494197e1172d7..19d64f486c5dd827bf69ce336fe4dc41beeb7f88 100644 (file)
@@ -22,7 +22,6 @@ class RS_DialogFactory
 
                void setFactoryObject(RS_DialogFactoryInterface * fo);
                RS_DialogFactoryInterface * getFactoryObject();
-
                void commandMessage(const QString & m);
 
        private:
index 49d3cb64182d82372ef6b7835ea9a410814dbda2..cb376b420a49aca65510e2ed6cec5bceb38511d9 100644 (file)
@@ -46,9 +46,9 @@ class RS_DialogFactoryAdapter : public RS_DialogFactoryInterface
                virtual bool requestTextDialog(RS_Text *) { return false; }
                virtual bool requestHatchDialog(RS_Hatch *) { return false; }
                virtual void requestOptionsGeneralDialog() {}
-               virtual void requestOptionsDrawingDialog(RS_Graphic &) {}
+               virtual void requestOptionsDrawingDialog(Drawing &) {}
 #ifdef RS_CAM
-               virtual bool requestCamOptionsDialog(RS_Graphic& ) { printf("fake\n"); return false; }
+               virtual bool requestCamOptionsDialog(Drawing& ) { printf("fake\n"); return false; }
 #endif
                virtual void updateCoordinateWidget(const Vector &, const Vector &, bool = false) {}
                virtual void updateMouseWidget(const QString &, const QString &) {}
index 70215068dac3abc48bd76d4b8fe3d297fe822d1f..14527f5fe19f3585cd8c767af4909a528f872a2a 100644 (file)
@@ -17,7 +17,7 @@ class RS_DimensionData;
 class RS_Document;
 class RS_Entity;
 class RS_EventHandler;
-class RS_Graphic;
+class Drawing;
 class RS_GraphicView;
 class RS_Grid;
 class RS_Hatch;
@@ -324,10 +324,10 @@ public:
         *
         * @param graphic Graphic document.
      */
-    virtual void requestOptionsDrawingDialog(RS_Graphic & graphic) = 0;
+    virtual void requestOptionsDrawingDialog(Drawing & graphic) = 0;
 
 #ifdef RS_CAM
-    virtual bool requestCamOptionsDialog(RS_Graphic & graphic) = 0;
+    virtual bool requestCamOptionsDialog(Drawing & graphic) = 0;
 #endif
 
     /**
index 67acabbcecfd89607cda87bd166153264a5faf05..4d89293f802052a3e6c3a29f0af9b6d2c7b17a46 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "rs_dimaligned.h"
 
-#include "rs_graphic.h"
+#include "drawing.h"
 #include "rs_units.h"
 #include "rs_constructionline.h"
 
@@ -83,7 +83,7 @@ VectorSolutions RS_DimAligned::getRefPoints()
 QString RS_DimAligned::getMeasuredLabel()
 {
        double dist = edata.extensionPoint1.distanceTo(edata.extensionPoint2);
-       RS_Graphic * graphic = getGraphic();
+       Drawing * graphic = getGraphic();
        QString ret;
 
        if (graphic != NULL)
index 8f409426a49f4b5be6dfeb2417db62e8cd4fd8a3..8728ea9e77602301f58d11b33cc2f2b483dd8b5d 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "rs_constructionline.h"
 #include "rs_filterdxf.h"
-#include "rs_graphic.h"
+#include "drawing.h"
 #include "rs_information.h"
 #include "rs_solid.h"
 #include "rs_text.h"
index 7e60a2676f0a059f1d41f3f16591c2390e506ba9..81135da40609633c867b94e398c63324414961fb 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "rs_text.h"
 #include "rs_solid.h"
-#include "rs_graphic.h"
+#include "drawing.h"
 #include "rs_units.h"
 
 /**
@@ -70,7 +70,7 @@ QString RS_DimDiametric::getMeasuredLabel()
     // Definitive dimension line:
     double dist = data.definitionPoint.distanceTo(edata.definitionPoint);
 
-       RS_Graphic* graphic = getGraphic();
+       Drawing* graphic = getGraphic();
 
     QString ret;
        if (graphic!=NULL) {
index e99f2990910f25dbb8b15c839c078d3277e567aa..01097c6c6f443ce8ca1a77b21e1815ed81604015 100644 (file)
@@ -38,12 +38,12 @@ RS_DimensionData RS_Dimension::getData() const
 
 Vector RS_Dimension::getNearestRef(const Vector & coord, double * dist)
 {
-    return RS_Entity::getNearestRef(coord, dist);
+       return RS_Entity::getNearestRef(coord, dist);
 }
 
 Vector RS_Dimension::getNearestSelectedRef(const Vector & coord, double * dist)
 {
-    return RS_Entity::getNearestSelectedRef(coord, dist);
+       return RS_Entity::getNearestSelectedRef(coord, dist);
 }
 
 /**
@@ -56,29 +56,25 @@ Vector RS_Dimension::getNearestSelectedRef(const Vector & coord, double * dist)
  */
 QString RS_Dimension::getLabel(bool resolve)
 {
-       if (!resolve) {
+       if (!resolve)
                return data.text;
-       }
-
-    QString ret="";
-
-    // One space suppresses the text:
-    if (data.text==" ") {
-        ret = "";
-    }
 
-    // No text prints actual measurement:
-    else if (data.text=="") {
-        ret = getMeasuredLabel();
-    }
+       QString ret = "";
 
-    // Others print the text (<> is replaced by the measurement)
-    else {
-        ret = data.text;
-        ret = ret.replace(QString("<>"), getMeasuredLabel());
-    }
+       // One space suppresses the text:
+       if (data.text == " ")
+               ret = "";
+       // No text prints actual measurement:
+       else if (data.text == "")
+               ret = getMeasuredLabel();
+       // Others print the text (<> is replaced by the measurement)
+       else
+       {
+               ret = data.text;
+               ret = ret.replace(QString("<>"), getMeasuredLabel());
+       }
 
-    return ret;
+       return ret;
 }
 
 /**
@@ -94,123 +90,125 @@ void RS_Dimension::setLabel(const QString & l)
  *
  * @param forceAutoText Automatically reposition the text label.
  */
-void RS_Dimension::updateCreateDimensionLine(const Vector& p1,
-        const Vector& p2, bool arrow1, bool arrow2, bool forceAutoText)
+void RS_Dimension::updateCreateDimensionLine(const Vector & p1,
+       const Vector & p2, bool arrow1, bool arrow2, bool forceAutoText)
 {
-    // text height (DIMTXT)
-    double dimtxt = getTextHeight();
-    // text distance to line (DIMGAP)
-    double dimgap = getDimensionLineGap();
-
-    // length of dimension line:
-    double distance = p1.distanceTo(p2);
-
-    // do we have to put the arrows outside of the line?
-    bool outsideArrows = (distance<getArrowSize()*2.5);
-
-    // arrow angles:
-    double arrowAngle1, arrowAngle2;
-
-    // Create dimension line:
-    RS_Line* dimensionLine = new RS_Line(this, RS_LineData(p1, p2));
-    dimensionLine->setPen(RS_Pen(RS2::FlagInvalid));
-    dimensionLine->setLayer(NULL);
-    addEntity(dimensionLine);
-
-    if (outsideArrows==false) {
-        arrowAngle1 = dimensionLine->getAngle2();
-        arrowAngle2 = dimensionLine->getAngle1();
-    } else {
-        arrowAngle1 = dimensionLine->getAngle1();
-        arrowAngle2 = dimensionLine->getAngle2();
-
-        // extend dimension line outside arrows
-        Vector dir;
-        dir.setPolar(getArrowSize()*2, arrowAngle2);
-        dimensionLine->setStartpoint(p1 + dir);
-        dimensionLine->setEndpoint(p2 - dir);
-    }
-
-    // Arrows:
-    RS_SolidData sd;
-    RS_Solid* arrow;
-
-    if (arrow1) {
-        // arrow 1
-        arrow = new RS_Solid(this, sd);
-        arrow->shapeArrow(p1,
-                          arrowAngle1,
-                          getArrowSize());
-        arrow->setPen(RS_Pen(RS2::FlagInvalid));
-        arrow->setLayer(NULL);
-        addEntity(arrow);
-    }
-
-    if (arrow2) {
-        // arrow 2:
-        arrow = new RS_Solid(this, sd);
-        arrow->shapeArrow(p2,
-                          arrowAngle2,
-                          getArrowSize());
-        arrow->setPen(RS_Pen(RS2::FlagInvalid));
-        arrow->setLayer(NULL);
-        addEntity(arrow);
-    }
-
-    // Text label:
-    RS_TextData textData;
-    Vector textPos;
+       // text height (DIMTXT)
+       double dimtxt = getTextHeight();
+       // text distance to line (DIMGAP)
+       double dimgap = getDimensionLineGap();
+
+       // length of dimension line:
+       double distance = p1.distanceTo(p2);
+
+       // do we have to put the arrows outside of the line?
+       bool outsideArrows = (distance<getArrowSize()*2.5);
+
+       // arrow angles:
+       double arrowAngle1, arrowAngle2;
+
+       // Create dimension line:
+       RS_Line * dimensionLine = new RS_Line(this, RS_LineData(p1, p2));
+       dimensionLine->setPen(RS_Pen(RS2::FlagInvalid));
+       dimensionLine->setLayer(NULL);
+       addEntity(dimensionLine);
+
+       if (outsideArrows == false)
+       {
+               arrowAngle1 = dimensionLine->getAngle2();
+               arrowAngle2 = dimensionLine->getAngle1();
+       }
+       else
+       {
+               arrowAngle1 = dimensionLine->getAngle1();
+               arrowAngle2 = dimensionLine->getAngle2();
+
+               // extend dimension line outside arrows
+               Vector dir;
+               dir.setPolar(getArrowSize() * 2, arrowAngle2);
+               dimensionLine->setStartpoint(p1 + dir);
+               dimensionLine->setEndpoint(p2 - dir);
+       }
+
+       // Arrows:
+       RS_SolidData sd;
+       RS_Solid * arrow;
+
+       if (arrow1)
+       {
+               // arrow 1
+               arrow = new RS_Solid(this, sd);
+               arrow->shapeArrow(p1, arrowAngle1, getArrowSize());
+               arrow->setPen(RS_Pen(RS2::FlagInvalid));
+               arrow->setLayer(NULL);
+               addEntity(arrow);
+       }
+
+       if (arrow2)
+       {
+               // arrow 2:
+               arrow = new RS_Solid(this, sd);
+               arrow->shapeArrow(p2, arrowAngle2, getArrowSize());
+               arrow->setPen(RS_Pen(RS2::FlagInvalid));
+               arrow->setLayer(NULL);
+               addEntity(arrow);
+       }
+
+       // Text label:
+       RS_TextData textData;
+       Vector textPos;
 
        double dimAngle1 = dimensionLine->getAngle1();
        double textAngle;
-       bool corrected=false;
+       bool corrected = false;
        textAngle = RS_Math::makeAngleReadable(dimAngle1, true, &corrected);
 
-    if (data.middleOfText.valid && !forceAutoText) {
-        textPos = data.middleOfText;
-    } else {
-        textPos = dimensionLine->getMiddlepoint();
-
-        Vector distV;
-
-        // rotate text so it's readable from the bottom or right (ISO)
-        // quadrant 1 & 4
-        if (corrected) {
-            distV.setPolar(dimgap + dimtxt/2.0, dimAngle1-M_PI/2.0);
-        } else {
-            distV.setPolar(dimgap + dimtxt/2.0, dimAngle1+M_PI/2.0);
-        }
-
-        // move text away from dimension line:
-        textPos+=distV;
-        //// the next update should still be able to adjust this
-        ////   auto text position. leave it invalid
+       if (data.middleOfText.valid && !forceAutoText)
+       {
+               textPos = data.middleOfText;
+       }
+       else
+       {
+               textPos = dimensionLine->getMiddlepoint();
+
+               Vector distV;
+
+               // rotate text so it's readable from the bottom or right (ISO)
+               // quadrant 1 & 4
+               if (corrected)
+               {
+                       distV.setPolar(dimgap + dimtxt / 2.0, dimAngle1 - M_PI / 2.0);
+               }
+               else
+               {
+                       distV.setPolar(dimgap + dimtxt / 2.0, dimAngle1 + M_PI / 2.0);
+               }
+
+               // move text away from dimension line:
+               textPos += distV;
+               //// the next update should still be able to adjust this
+               ////   auto text position. leave it invalid
                data.middleOfText = textPos;
-    }
-
-    textData = RS_TextData(textPos,
-                           dimtxt, 30.0,
-                           RS2::VAlignMiddle,
-                           RS2::HAlignCenter,
-                           RS2::LeftToRight,
-                           RS2::Exact,
-                           1.0,
-                           getLabel(),
-                           "standard",
-                           textAngle);
-
-    RS_Text* text = new RS_Text(this, textData);
-
-    // move text to the side:
-    Vector distH;
-    if (text->getUsedTextWidth()>distance) {
-        distH.setPolar(text->getUsedTextWidth()/2.0
-                       +distance/2.0+dimgap, textAngle);
-        text->move(distH);
-    }
-    text->setPen(RS_Pen(RS2::FlagInvalid));
-    text->setLayer(NULL);
-    addEntity(text);
+       }
+
+       textData = RS_TextData(textPos, dimtxt, 30.0, RS2::VAlignMiddle, RS2::HAlignCenter,
+               RS2::LeftToRight, RS2::Exact, 1.0, getLabel(), "standard", textAngle);
+
+       RS_Text * text = new RS_Text(this, textData);
+
+       // move text to the side:
+       Vector distH;
+
+       if (text->getUsedTextWidth() > distance)
+       {
+               distH.setPolar(text->getUsedTextWidth() / 2.0
+                       + distance / 2.0 + dimgap, textAngle);
+               text->move(distH);
+       }
+
+       text->setPen(RS_Pen(RS2::FlagInvalid));
+       text->setLayer(NULL);
+       addEntity(text);
 }
 
 Vector RS_Dimension::getDefinitionPoint()
index ad32e7df389a5a19457ce829437453f295c819c3..9797e36549db66e3e679f50b3a4b9589aa786677 100644 (file)
@@ -17,7 +17,7 @@
 #include "rs_constructionline.h"
 #include "rs_text.h"
 #include "rs_solid.h"
-#include "rs_graphic.h"
+#include "drawing.h"
 #include "rs_units.h"
 
 /**
@@ -91,10 +91,11 @@ QString RS_DimLinear::getMeasuredLabel()
        // Definitive dimension line:
        double dist = dimP1.distanceTo(dimP2);
 
-       RS_Graphic* graphic = getGraphic();
+       Drawing * graphic = getGraphic();
 
        QString ret;
-       if (graphic!=NULL)
+
+       if (graphic != NULL)
        {
                ret = RS_Units::formatLinear(dist, graphic->getUnit(),
                        graphic->getLinearFormat(), graphic->getLinearPrecision());
@@ -103,6 +104,8 @@ QString RS_DimLinear::getMeasuredLabel()
        {
                ret = QString("%1").arg(dist);
        }
+//It's properly creating the label...
+//printf("RS_DimLinear::getMeasuredLabel: label=\"%s\"\n", ret.toAscii().data());
 
        return ret;
 }
index 3ac579bfb1204e94d13aa05ab78194669ca576ec..4f18083b7da88e2ecd76355404e45c308b66f4c6 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "rs_dimradial.h"
 
-#include "rs_graphic.h"
+#include "drawing.h"
 #include "rs_solid.h"
 #include "rs_text.h"
 #include "rs_units.h"
@@ -69,7 +69,7 @@ QString RS_DimRadial::getMeasuredLabel()
     // Definitive dimension line:
     double dist = data.definitionPoint.distanceTo(edata.definitionPoint);
 
-    RS_Graphic* graphic = getGraphic();
+    Drawing* graphic = getGraphic();
 
     QString ret;
     if (graphic!=NULL) {
index 8300a182891da9fe95530e41d3a6082411cf7819..c3a5cf1c8d7bfb72797db2cfb32989464ea3364f 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "rs_ellipse.h"
 
-#include "rs_graphic.h"
+#include "drawing.h"
 #include "rs_graphicview.h"
 #include "rs_information.h"
 #include "paintintf.h"
index d633d222c67de02c8e0370f0477c15e144b4ae61..fc7dbeab804b20affd93e124d7c014da0d40151e 100644 (file)
@@ -20,7 +20,7 @@
 #include "rs_debug.h"
 #include "rs_document.h"
 #include "rs_ellipse.h"
-#include "rs_graphic.h"
+#include "drawing.h"
 #include "rs_graphicview.h"
 #include "rs_insert.h"
 #include "rs_layer.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)
@@ -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();
@@ -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();
index 74105c602a56947a1a6ea6e6b3554d66884e4105..7764832ead6f708391134f0028d8e07d7b22fbaa 100644 (file)
@@ -15,7 +15,7 @@ class RS_Block;
 class RS_Circle;
 class RS_Document;
 class RS_EntityContainer;
-class RS_Graphic;
+class Drawing;
 class RS_GraphicView;
 class RS_Insert;
 class RS_Line;
@@ -59,7 +59,7 @@ class RS_Entity: public RS_Undoable
                virtual double getLength();
                RS_EntityContainer * getParent() const;
                void setParent(RS_EntityContainer * p);
-               RS_Graphic * getGraphic();
+               Drawing * getGraphic();
                RS_Block * getBlock();
                RS_Insert * getInsert();
                RS_Entity * getBlockOrInsert();
index 9f68a951f1d9515b3718bc3a28f0002ce8a887a0..29e03186f83c9ae02efed0a8c8679a5dcd31c053 100644 (file)
@@ -220,18 +220,23 @@ void RS_EventHandler::keyPressEvent(QKeyEvent * e)
  */
 void RS_EventHandler::keyReleaseEvent(QKeyEvent* e)
 {
-    if (actionIndex>=0 && currentActions[actionIndex]!=NULL &&
-            !currentActions[actionIndex]->isFinished()) {
-        currentActions[actionIndex]->keyReleaseEvent(e);
-    } else {
-        if (defaultAction!=NULL) {
-            defaultAction->keyReleaseEvent(e);
-        }
-               else {
+       if (actionIndex >= 0 && currentActions[actionIndex] != NULL &&
+               !currentActions[actionIndex]->isFinished())
+       {
+               currentActions[actionIndex]->keyReleaseEvent(e);
+       }
+       else
+       {
+               if (defaultAction != NULL)
+               {
+                       defaultAction->keyReleaseEvent(e);
+               }
+               else
+               {
                        e->ignore();
                }
-        //RS_DEBUG->print("currently no action defined");
-    }
+               //RS_DEBUG->print("currently no action defined");
+       }
 }
 
 /**
@@ -252,7 +257,6 @@ void RS_EventHandler::commandEvent(RS_CommandEvent * e)
                                if (actionIndex >= 0 && currentActions[actionIndex] != NULL
                                        && !currentActions[actionIndex]->isFinished())
                                {
-//                                     int commaPos = cmd.find(',');
                                        int commaPos = cmd.indexOf(',');
                                        RS_DEBUG->print("RS_EventHandler::commandEvent: 001");
                                        bool ok1, ok2;
@@ -461,7 +465,7 @@ void RS_EventHandler::setCurrentAction(RS_ActionInterface * action)
                return;
 
        // Predecessor of the new action or NULL:
-       RS_ActionInterface* predecessor = NULL;
+       RS_ActionInterface * predecessor = NULL;
 
        // Suspend current action:
        if (actionIndex >= 0 && currentActions[actionIndex] != NULL
@@ -494,14 +498,10 @@ void RS_EventHandler::setCurrentAction(RS_ActionInterface * action)
 
                // Move up actionstack (optimize):
                for(int i=0; i<RS_MAXACTIONS-1; ++i)
-               {
                        currentActions[i] = currentActions[i + 1];
-               }
        }
        else if (actionIndex < RS_MAXACTIONS - 1)
-       {
                actionIndex++;
-       }
 
        // Set current action:
        currentActions[actionIndex] = action;
@@ -580,65 +580,75 @@ bool RS_EventHandler::hasAction()
  */
 void RS_EventHandler::cleanUp()
 {
-    RS_DEBUG->print("RS_EventHandler::cleanUp");
-
-    int o=0;   // old index
-    int n=0;   // new index
-    int resume=0; // index of action to resume
-    bool doResume=false; // do we need to resume an action
-    actionIndex = -1;
-
-    debugActions();
-    do {
-        // search first used action (o)
-        while (currentActions[o]==NULL && o<RS_MAXACTIONS) {
-            o++;
-        }
+       RS_DEBUG->print("RS_EventHandler::cleanUp");
 
-        // delete action if it is finished
-        if (o<RS_MAXACTIONS && currentActions[o]!=NULL &&
-                currentActions[o]->isFinished()) {
-            delete currentActions[o];
-            currentActions[o] = NULL;
+       int o = 0;                              // old index
+       int n = 0;                              // new index
+       int resume = 0;                 // index of action to resume
+       bool doResume = false;  // do we need to resume an action
+       actionIndex = -1;
 
-            doResume = true;
-        }
+       debugActions();
 
-        // move a running action up in the stack
-        if (o<RS_MAXACTIONS && currentActions[o]!=NULL) {
-            if (n!=o) {
-                currentActions[n] = currentActions[o];
-                resume = n;
-                currentActions[o] = NULL;
-            } else {
-                if (o<RS_MAXACTIONS) {
-                    o++;
-                }
-            }
-            actionIndex = n;
-            if (n<RS_MAXACTIONS-1) {
-                n++;
-            }
-        }
-    } while (o<RS_MAXACTIONS);
-
-    debugActions();
-
-    // Resume last used action:
-    if (doResume) {
-        if (currentActions[resume]!=NULL &&
-                !currentActions[resume]->isFinished()) {
-
-            currentActions[resume]->resume();
-            currentActions[resume]->showOptions();
-        } else {
-            if (defaultAction!=NULL) {
-                defaultAction->resume();
-                       defaultAction->showOptions();
-            }
-        }
-    }
-    RS_DEBUG->print("RS_EventHandler::cleanUp: OK");
+       do
+       {
+               // search first used action (o)
+               while (currentActions[o] == NULL && o < RS_MAXACTIONS)
+                       o++;
+
+               // delete action if it is finished
+               if (o < RS_MAXACTIONS && currentActions[o] != NULL
+                       && currentActions[o]->isFinished())
+               {
+                       delete currentActions[o];
+                       currentActions[o] = NULL;
+                       doResume = true;
+               }
+
+               // move a running action up in the stack
+               if (o < RS_MAXACTIONS && currentActions[o] != NULL)
+               {
+                       if (n != o)
+                       {
+                               currentActions[n] = currentActions[o];
+                               resume = n;
+                               currentActions[o] = NULL;
+                       }
+                       else
+                       {
+                               if (o < RS_MAXACTIONS)
+                                       o++;
+                       }
+
+                       actionIndex = n;
+
+                       if (n < RS_MAXACTIONS - 1)
+                               n++;
+               }
+       }
+       while (o < RS_MAXACTIONS);
+
+       debugActions();
+
+       // Resume last used action:
+       if (doResume)
+       {
+               if (currentActions[resume] != NULL && !currentActions[resume]->isFinished())
+               {
+                       currentActions[resume]->resume();
+                       currentActions[resume]->showOptions();
+               }
+               else
+               {
+                       if (defaultAction != NULL)
+                       {
+                               defaultAction->resume();
+                               defaultAction->showOptions();
+                       }
+               }
+       }
+
+       RS_DEBUG->print("RS_EventHandler::cleanUp: OK");
 }
 
 /**
index e58d1fbecf4243592ac1a828240974d6bfb658a1..8d1e9efa87dd94ac32e96713a94e2048c6b233dc 100644 (file)
@@ -91,11 +91,11 @@ RS_FilterInterface * RS_FileIO::getExportFilter(RS2::FormatType t)
  * of the given file.
  *
  * @param graphic The container to which we will add
- *        entities. Usually that's an RS_Graphic entity but
+ *        entities. Usually that's an Drawing entity but
  *        it can also be a polyline, text, ...
  * @param file Path and name of the file to import.
  */
-bool RS_FileIO::fileImport(RS_Graphic & graphic, const QString & file, RS2::FormatType type)
+bool RS_FileIO::fileImport(Drawing & graphic, const QString & file, RS2::FormatType type)
 {
        RS_DEBUG->print("Trying to import file '%s'...", file.toLatin1().data());
 
@@ -145,7 +145,7 @@ bool RS_FileIO::fileImport(RS_Graphic & graphic, const QString & file, RS2::Form
  *
  * @param file Path and name of the file to import.
  */
-bool RS_FileIO::fileExport(RS_Graphic & graphic, const QString & file, RS2::FormatType type)
+bool RS_FileIO::fileExport(Drawing & graphic, const QString & file, RS2::FormatType type)
 {
        RS_DEBUG->print("RS_FileIO::fileExport");
        //RS_DEBUG->print("Trying to export file '%s'...", file.latin1());
index 4eeb2c90cc1d982345e7796a5b7b1ed0e51afdc9..320463ad04ee29294d3f10caa233f7cf24da070d 100644 (file)
@@ -6,7 +6,7 @@
 
 #define RS_FILEIO RS_FileIO::instance()
 
-class RS_Graphic;
+class Drawing;
 
 /**
  * API Class for importing files.
@@ -26,10 +26,10 @@ class RS_FileIO
                RS_FilterInterface * getImportFilter(RS2::FormatType t);
                RS_FilterInterface * getExportFilter(RS2::FormatType t);
 
-               bool fileImport(RS_Graphic & graphic, const QString & file,
+               bool fileImport(Drawing & graphic, const QString & file,
                        RS2::FormatType type = RS2::FormatUnknown);
 
-               bool fileExport(RS_Graphic & graphic, const QString & file,
+               bool fileExport(Drawing & graphic, const QString & file,
                        RS2::FormatType type = RS2::FormatUnknown);
 
                RS2::FormatType detectFormat(const QString & file);
index 887bf5d2184e8f8b2e29e45537069f5848b895a3..b3bbfe46bcd900963f6ef208cf8d07bfa0f540b6 100644 (file)
@@ -46,7 +46,7 @@ RS_FilterCXF::~RS_FilterCXF()
  * will be created or the graphics from which the entities are
  * taken to be stored in a file.
  */
-bool RS_FilterCXF::fileImport(RS_Graphic & g, const QString & file, RS2::FormatType /*type*/)
+bool RS_FilterCXF::fileImport(Drawing & g, const QString & file, RS2::FormatType /*type*/)
 {
        RS_DEBUG->print("CXF Filter: importing file '%s'...", file.toLatin1().data());
 
@@ -104,7 +104,7 @@ bool RS_FilterCXF::fileImport(RS_Graphic & g, const QString & file, RS2::FormatT
  *
  * @param file Full path to the CXF file that will be written.
  */
-bool RS_FilterCXF::fileExport(RS_Graphic & g, const QString & file, RS2::FormatType /*type*/)
+bool RS_FilterCXF::fileExport(Drawing & g, const QString & file, RS2::FormatType /*type*/)
 {
        RS_DEBUG->print("CXF Filter: exporting file '%s'...", file.toLatin1().data());
 
index 7e713d7e94e5cfb9061c0d8f6ec5c243d99a9ca8..85e81dc988701c4cde1cab873d9e366016e3ede1 100644 (file)
@@ -30,8 +30,8 @@ class RS_FilterCXF: public RS_FilterInterface
                        return (t==RS2::FormatCXF);
                }*/
 
-               virtual bool fileImport(RS_Graphic & g, const QString & file, RS2::FormatType /*type*/);
-               virtual bool fileExport(RS_Graphic & g, const QString & file, RS2::FormatType /*type*/);
+               virtual bool fileImport(Drawing & g, const QString & file, RS2::FormatType /*type*/);
+               virtual bool fileExport(Drawing & g, const QString & file, RS2::FormatType /*type*/);
 
                void stream(std::ofstream & fs, double value);
 };
index 1d2f45c0f8ef4e95fdbb4ea84c9d3674062cabaa..546d2ea428d989192466a2559dc3dd035e8e32a9 100644 (file)
@@ -70,7 +70,7 @@ RS_FilterDXF::~RS_FilterDXF()
  * will be created or the graphics from which the entities are
  * taken to be stored in a file.
  */
-bool RS_FilterDXF::fileImport(RS_Graphic & g, const QString & file, RS2::FormatType /*type*/)
+bool RS_FilterDXF::fileImport(Drawing & g, const QString & file, RS2::FormatType /*type*/)
 {
        RS_DEBUG->print("RS_FilterDXF::fileImport");
        //RS_DEBUG->timestamp();
@@ -1073,7 +1073,7 @@ void RS_FilterDXF::setVariableVector(const char * key, double v1, double v2, dou
 
        // update document's variable list:
        if (currentContainer->rtti() == RS2::EntityGraphic)
-               ((RS_Graphic *)currentContainer)->addVariable(QString(key), Vector(v1, v2, v3), code);
+               ((Drawing *)currentContainer)->addVariable(QString(key), Vector(v1, v2, v3), code);
 }
 
 /**
@@ -1088,7 +1088,7 @@ void RS_FilterDXF::setVariableString(const char * key, const char * value, int c
 
     // update document's variable list:
     if (currentContainer->rtti()==RS2::EntityGraphic) {
-        ((RS_Graphic*)currentContainer)->addVariable(QString(key),
+        ((Drawing*)currentContainer)->addVariable(QString(key),
                 QString(value), code);
     }
 }
@@ -1103,7 +1103,7 @@ void RS_FilterDXF::setVariableInt(const char* key, int value, int code) {
 
     // update document's variable list:
     if (currentContainer->rtti()==RS2::EntityGraphic) {
-        ((RS_Graphic*)currentContainer)->addVariable(QString(key),
+        ((Drawing*)currentContainer)->addVariable(QString(key),
                 value, code);
     }
 }
@@ -1119,7 +1119,7 @@ void RS_FilterDXF::setVariableDouble(const char* key, double value, int code) {
     // update document's variable list:
     if (currentContainer->rtti() == RS2::EntityGraphic)
        {
-        ((RS_Graphic *)currentContainer)->addVariable(QString(key), value, code);
+        ((Drawing *)currentContainer)->addVariable(QString(key), value, code);
     }
 }
 
@@ -1129,7 +1129,7 @@ void RS_FilterDXF::setVariableDouble(const char* key, double value, int code) {
  *
  * @param file Full path to the DXF file that will be written.
  */
-bool RS_FilterDXF::fileExport(RS_Graphic & g, const QString & file, RS2::FormatType type)
+bool RS_FilterDXF::fileExport(Drawing & g, const QString & file, RS2::FormatType type)
 {
        RS_DEBUG->print("RS_FilterDXF::fileExport: exporting file '%s'...",
                (const char *)QFile::encodeName(file));
index 5262b682ab5c575c34a25e983730f6f8369dead3..ce3d57420841cbdfe2ce26705af3d2da587ec141 100644 (file)
@@ -51,7 +51,7 @@ class RS_FilterDXF: public RS_FilterInterface, DL_CreationInterface
                }*/
 
                // Import:
-               virtual bool fileImport(RS_Graphic& g, const QString& file, RS2::FormatType /*type*/);
+               virtual bool fileImport(Drawing& g, const QString& file, RS2::FormatType /*type*/);
 
                // Methods from DL_CreationInterface:
                virtual void addLayer(const DL_LayerData & data);
@@ -97,7 +97,7 @@ class RS_FilterDXF: public RS_FilterInterface, DL_CreationInterface
                virtual void setVariableDouble(const char * key, double value, int code);
 
                // Export:
-               virtual bool fileExport(RS_Graphic & g, const QString & file, RS2::FormatType type);
+               virtual bool fileExport(Drawing & g, const QString & file, RS2::FormatType type);
 
                void writeVariables(DL_WriterA & dw);
                void writeLayer(DL_WriterA & dw, RS_Layer * l);
@@ -156,7 +156,7 @@ class RS_FilterDXF: public RS_FilterInterface, DL_CreationInterface
 
        private:
                /** Pointer to the graphic we currently operate on. */
-               RS_Graphic * graphic;
+               Drawing * graphic;
                /** File name. Used to find out the full path of images. */
                QString file;
                /** string for concatinating text parts of MTEXT entities. */
index c0463783eef6491e3a6ec6d38b1c714fd964aefb..3d65ea54c436aa2717310b1cc3c225d2403c3d89 100644 (file)
@@ -44,7 +44,7 @@ RS_FilterDXF1::RS_FilterDXF1(): RS_FilterInterface()
  * will be created or the graphics from which the entities are
  * taken to be stored in a file.
  */
-bool RS_FilterDXF1::fileImport(RS_Graphic& g, const QString& file, RS2::FormatType /*type*/)
+bool RS_FilterDXF1::fileImport(Drawing& g, const QString& file, RS2::FormatType /*type*/)
 {
        RS_DEBUG->print("DXF1 Filter: importing file '%s'...", file.toLatin1().data());
 
index bb6de8013c6c32b657ddb0f63a5c5d1b9efa8f87..5f86af52548573ab70f3222fd9e3dbdff5dc38b3 100644 (file)
@@ -36,9 +36,9 @@ public:
                return false;
        }*/
 
-    virtual bool fileImport(RS_Graphic& g, const QString& file, RS2::FormatType /*type*/);
+    virtual bool fileImport(Drawing& g, const QString& file, RS2::FormatType /*type*/);
 
-    virtual bool fileExport(RS_Graphic& /*g*/, const QString& /*file*/,
+    virtual bool fileExport(Drawing& /*g*/, const QString& /*file*/,
                RS2::FormatType /*type*/) {
         RS_DEBUG->print(RS_Debug::D_WARNING,
                         "Exporting of QCad 1.x file not implemented");
@@ -88,7 +88,7 @@ public:
 
 protected:
     /** Pointer to the graphic we currently operate on. */
-    RS_Graphic* graphic;
+    Drawing* graphic;
     FILE*   fPointer;         // File pointer
     char*   fBuf;             // Filebuffer
     int     fBufP;            // Filebuffer-Pointer (walks through 'fBuf')
index 3cec6366a900d93f4ed7ad427519e3dca4cea7bd..730203bce5a3b4682a336184d91dfac69ffee864 100644 (file)
@@ -2,7 +2,7 @@
 #define RS_FILTERINTERFACE_H
 
 #include <QtCore>
-#include "rs_graphic.h"
+#include "drawing.h"
 
 /**
  * This is the interface that must be implemented for all
@@ -29,14 +29,14 @@ class RS_FilterInterface
                * class should read a file from disk and put the entities
                * into the current entity container.
                */
-               virtual bool fileImport(RS_Graphic & g, const QString & file, RS2::FormatType type) = 0;
+               virtual bool fileImport(Drawing & g, const QString & file, RS2::FormatType type) = 0;
 
                /**
                * The implementation of this method in a inherited format
                * class should write the entities in the current entity container
                * to a file on the disk.
                */
-               virtual bool fileExport(RS_Graphic & g, const QString & file, RS2::FormatType type) = 0;
+               virtual bool fileExport(Drawing & g, const QString & file, RS2::FormatType type) = 0;
 
        protected:
                void addImportFormat(RS2::FormatType type);
@@ -44,7 +44,7 @@ class RS_FilterInterface
 
        protected:
                //! Pointer to the graphic we currently operate on.
-               //RS_Graphic* graphic;
+               //Drawing* graphic;
 
                //! Vector of file extensions this filter can import.
 //             Q3ValueList<RS2::FormatType> importFormats;
index 515979a634145a66081e38d594e8e2edd9613d45..3b6d21cac927ffd0f5afef0274d523179207da66 100644 (file)
@@ -6,7 +6,7 @@
 #include "rs_blocklist.h"
 
 /**
- * Class for representing a font. This is implemented as a RS_Graphic
+ * Class for representing a font. This is implemented as a Drawing
  * with a name (the font name) and several blocks, one for each letter
  * in the font.
  *
index 29ab3f4c5632d184c85835a766a3123a1cdd5002..28d86c9852815bd877e6121e38328b51cb2509bc 100644 (file)
@@ -19,7 +19,7 @@
 #include "rs_application.h"
 #include "rs_block.h"
 #include "rs_eventhandler.h"
-#include "rs_graphic.h"
+#include "drawing.h"
 #include "rs_grid.h"
 #include "rs_insert.h"
 #include "rs_layer.h"
@@ -122,10 +122,10 @@ void RS_GraphicView::cleanUp()
  * connected to this view is a graphic and valid.
  * NULL otherwise.
  */
-RS_Graphic * RS_GraphicView::getGraphic()
+Drawing * RS_GraphicView::getGraphic()
 {
        if (container != NULL && container->rtti() == RS2::EntityGraphic)
-               return (RS_Graphic*)container;
+               return (Drawing*)container;
        else
                return NULL;
 }
@@ -395,7 +395,7 @@ bool RS_GraphicView::isGridOn()
 {
        if (container != NULL)
        {
-               RS_Graphic * g = container->getGraphic();
+               Drawing * g = container->getGraphic();
 
                if (g != NULL)
                        return g->isGridOn();
@@ -592,10 +592,10 @@ void RS_GraphicView::mouseMoveEvent(QMouseEvent * e)
 {
        RS_DEBUG->print("RS_GraphicView::mouseMoveEvent begin");
 
-       RS_Graphic * graphic = NULL;
+       Drawing * graphic = NULL;
 
        if (container->rtti() == RS2::EntityGraphic)
-               graphic = (RS_Graphic *)container;
+               graphic = (Drawing *)container;
 
        RS_DEBUG->print("RS_GraphicView::mouseMoveEvent 001");
 
@@ -1157,7 +1157,7 @@ void RS_GraphicView::zoomPage()
        if (simulationRunning)
                return;
 
-       RS_Graphic * graphic = container->getGraphic();
+       Drawing * graphic = container->getGraphic();
 
        if (graphic == NULL)
                return;
@@ -1324,7 +1324,7 @@ void RS_GraphicView::setPenForEntity(RS_Entity * e)
                {
                        double uf = 1.0;  // unit factor
                        double wf = 1.0;  // width factor
-                       RS_Graphic * graphic = container->getGraphic();
+                       Drawing * graphic = container->getGraphic();
 
                        if (graphic != NULL)
                        {
@@ -2096,7 +2096,7 @@ void RS_GraphicView::drawPaper()
        if (container == NULL)
                return;
 
-       RS_Graphic * graphic = container->getGraphic();
+       Drawing * graphic = container->getGraphic();
 
        if (graphic == NULL)
                return;
index f783388f74b48f66c050ffc7e5acbc7d8a898bc7..d4bcdf0bbfa7ad6d067a7f5af9b70783837dee89 100644 (file)
@@ -32,7 +32,7 @@ public:
 
        void cleanUp();
 
-    RS_Graphic * getGraphic();
+    Drawing * getGraphic();
     void setDrawingMode(RS2::DrawingMode m);
     RS2::DrawingMode getDrawingMode();
     void setDeleteMode(bool m);
index 61368edc9f25228fa1b7aa006aabe74b1e9ba175..3f2252a0378c4dcc0731ba14348318c0150d03d0 100644 (file)
@@ -15,7 +15,7 @@
 #include "rs_grid.h"
 
 #include "rs_units.h"
-#include "rs_graphic.h"
+#include "drawing.h"
 #include "settings.h"
 
 /**
@@ -51,7 +51,7 @@ void RS_Grid::update()
        if (!graphicView->isGridOn())
                return;
 
-       RS_Graphic * graphic = graphicView->getGraphic();
+       Drawing * graphic = graphicView->getGraphic();
 
        // auto scale grid?
        settings.beginGroup("Appearance");
index 4532355e4cb077556b42328d2104ade10de3200c..36237db4eb51310c7aa8de1a376e4a838dee2bd4 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <QtCore>
 #include "rs_graphicview.h"
-#include "rs_graphic.h"
+#include "drawing.h"
 #include "rs_information.h"
 #include "rs_pattern.h"
 #include "rs_patternlist.h"
index bbd304deb5cfbf0fa78b181abbf3bdd629c2a57b..a55d7519c95588e8a960a83f71c569d5234998c8 100644 (file)
@@ -1,28 +1,16 @@
-/****************************************************************************
-** $Id: rs_infoarea.cpp 1892 2004-07-09 23:54:59Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
+// rs_infoarea.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -----------------------------------------------------------
+// JLH  06/01/2010  Added this text. :-)
+//
 
 #include "rs_infoarea.h"
 
index 7ddafbb07d73e064f70d0acfa143fb7228d425f3..31f3738a8b9410310881ecb5a542369129490184 100644 (file)
@@ -1,29 +1,3 @@
-/****************************************************************************
-** $Id: rs_infoarea.h 1892 2004-07-09 23:54:59Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
 #ifndef RS_INFOAREA_H
 #define RS_INFOAREA_H
 
index bcb6082136b3d1eb5d9c60183cf4cd80ee738330..e9ec4d8d51d4fd77af30912c1adf0a6876bc34b2 100644 (file)
@@ -1,52 +1,39 @@
-/****************************************************************************
-** $Id: rs_information.cpp 2378 2005-05-16 17:05:15Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use 
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
+// rs_information.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -----------------------------------------------------------
+// JLH  06/01/2010  Added this text. :-)
+//
 
 #include "rs_information.h"
 
 #include "rs_constructionline.h"
 
-
 /**
  * Default constructor.
  *
  * @param container The container to which we will add
- *        entities. Usually that's an RS_Graphic entity but
+ *        entities. Usually that's an Drawing entity but
  *        it can also be a polyline, text, ...
  */
-RS_Information::RS_Information(RS_EntityContainer& container) {
-    this->container = &container;
+RS_Information::RS_Information(RS_EntityContainer& container)
+{
+       this->container = &container;
 }
 
-
-
 /**
  * @return true: if the entity is a dimensioning enity.
  *         false: otherwise
  */
-bool RS_Information::isDimension(RS2::EntityType type) {
+bool RS_Information::isDimension(RS2::EntityType type)
+{
     if (type==RS2::EntityDimAligned ||
             type==RS2::EntityDimLinear ||
             type==RS2::EntityDimRadial ||
@@ -137,7 +124,7 @@ bool RS_Information::isTrimmable(RS_Entity* e1, RS_Entity* e2) {
  * @param coord Coordinate (typically a mouse coordinate)
  *
  * @return the coordinate found or an invalid vector
- * if there are no elements at all in this graphics 
+ * if there are no elements at all in this graphics
  * container.
  */
 Vector RS_Information::getNearestEndpoint(const Vector& coord,
@@ -147,16 +134,16 @@ Vector RS_Information::getNearestEndpoint(const Vector& coord,
 
 
 /**
- * Gets the nearest point to the given coordinate which is on an entity. 
+ * Gets the nearest point to the given coordinate which is on an entity.
  *
  * @param coord Coordinate (typically a mouse coordinate)
- * @param dist Pointer to a double which will contain the 
+ * @param dist Pointer to a double which will contain the
  *        measured distance after return or NULL
  * @param entity Pointer to a pointer which will point to the
  *        entity on which the point is or NULL
  *
  * @return the coordinate found or an invalid vector
- * if there are no elements at all in this graphics 
+ * if there are no elements at all in this graphics
  * container.
  */
 Vector RS_Information::getNearestPointOnEntity(const Vector& coord,
@@ -172,11 +159,11 @@ Vector RS_Information::getNearestPointOnEntity(const Vector& coord,
  * Gets the nearest entity to the given coordinate.
  *
  * @param coord Coordinate (typically a mouse coordinate)
- * @param dist Pointer to a double which will contain the 
+ * @param dist Pointer to a double which will contain the
  *             masured distance after return
  * @param level Level of resolving entities.
  *
- * @return the entity found or NULL if there are no elements 
+ * @return the entity found or NULL if there are no elements
  * at all in this graphics container.
  */
 RS_Entity* RS_Information::getNearestEntity(const Vector& coord,
@@ -229,8 +216,8 @@ VectorSolutions RS_Information::getIntersection(RS_Entity* e1,
             RS_Ellipse* ellipse = (RS_Ellipse*)e1;
             ret = getIntersectionLineEllipse((RS_Line*)e2, ellipse);
                        tol = 1.0e-1;
-        } 
-               
+        }
+
                // ellipse / arc, ellipse / ellipse: not supported:
                else {
             return ret;
@@ -606,7 +593,7 @@ VectorSolutions RS_Information::getIntersectionLineEllipse(RS_Line* line,
             RS_DEBUG->print("RS_Information::getIntersectionLineEllipse: intersection 1");
             Vector ret1(false);
             Vector ret2(false);
-            //if ( 0 <= t_a && t_a <= 1 ) { 
+            //if ( 0 <= t_a && t_a <= 1 ) {
                 //RS_DEBUG->print("RS_Information::getIntersectionLineEllipse: 0<=t_a<=1");
                 ret1 = a1.lerp(a2, t_a);
                 RS_DEBUG->print("RS_Information::getIntersectionLineEllipse: ret1: %f/%f", ret1.x, ret1.y);
@@ -830,4 +817,4 @@ bool RS_Information::isPointInsideContour(const Vector& point,
 
     return ((counter%2)==1);
 }
-       
+
index 3a6fea6d5e7acbfaf054999e9a0273ac5939bbd3..21a91234dbace54a9e5398261868a05d06fa6c53 100644 (file)
@@ -1,29 +1,3 @@
-/****************************************************************************
-** $Id: rs_information.h 1926 2004-11-20 00:42:21Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
 #ifndef RS_INFORMATION_H
 #define RS_INFORMATION_H
 
index 6c17ba427f8127d91484485e35b369e84f39efd9..ec12668880de62312f7f09ce27535ef896b0e6ae 100644 (file)
@@ -1,33 +1,21 @@
-/****************************************************************************
-** $Id: rs_insert.cpp 2371 2005-04-29 11:44:39Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
+// rs_insert.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -----------------------------------------------------------
+// JLH  06/01/2010  Added this text. :-)
+//
 
 #include "rs_insert.h"
 
 #include "rs_block.h"
-#include "rs_graphic.h"
+#include "drawing.h"
 
 /**
  * @param parent The graphic this block belongs to.
@@ -141,22 +129,22 @@ void RS_Insert::update()
        if (updateEnabled == false)
                return;
 
-    clear();
+       clear();
 
-    RS_Block * blk = getBlockForInsert();
+       RS_Block * blk = getBlockForInsert();
 
        if (blk == NULL)
        {
-        //return NULL;
+               //return NULL;
                RS_DEBUG->print("RS_Insert::update: Block is NULL");
-        return;
-    }
+               return;
+       }
 
-    if (isUndone())
+       if (isUndone())
        {
                RS_DEBUG->print("RS_Insert::update: Insert is in undo list");
-        return;
-    }
+               return;
+       }
 
        if (fabs(data.scaleFactor.x) < 1.0e-6 || fabs(data.scaleFactor.y) < 1.0e-6)
        {
@@ -164,86 +152,86 @@ void RS_Insert::update()
                return;
        }
 
-    RS_Pen tmpPen;
+       RS_Pen tmpPen;
 
        /*Q3PtrListIterator<RS_Entity> it = createIterator();
-    RS_Entity* e;
-    while ( (e = it.current()) != NULL ) {
-        ++it;*/
+       RS_Entity* e;
+       while ( (e = it.current()) != NULL ) {
+               ++it;*/
 
        RS_DEBUG->print("RS_Insert::update: cols: %d, rows: %d", data.cols, data.rows);
        RS_DEBUG->print("RS_Insert::update: block has %d entities", blk->count());
 
-    for(RS_Entity * e=blk->firstEntity(); e!=NULL; e=blk->nextEntity())
+       for(RS_Entity * e=blk->firstEntity(); e!=NULL; e=blk->nextEntity())
        {
-        for(int c=0; c<data.cols; ++c)
+               for(int c=0; c<data.cols; ++c)
                {
-            RS_DEBUG->print("RS_Insert::update: col %d", c);
+                       RS_DEBUG->print("RS_Insert::update: col %d", c);
 
                        for(int r=0; r<data.rows; ++r)
                        {
-                RS_DEBUG->print("RS_Insert::update: row %d", r);
+                               RS_DEBUG->print("RS_Insert::update: row %d", r);
 
-                if (e->rtti() == RS2::EntityInsert && data.updateMode != RS2::PreviewUpdate)
+                               if (e->rtti() == RS2::EntityInsert && data.updateMode != RS2::PreviewUpdate)
                                {
                                        RS_DEBUG->print("RS_Insert::update: updating sub-insert");
-                    ((RS_Insert *)e)->update();
-                }
+                                       ((RS_Insert *)e)->update();
+                               }
 
                                RS_DEBUG->print("RS_Insert::update: cloning entity");
 
-                RS_Entity * ne = e->clone();
-                ne->initId();
+                               RS_Entity * ne = e->clone();
+                               ne->initId();
                                ne->setUpdateEnabled(false);
-                ne->setParent(this);
-                ne->setVisible(getFlag(RS2::FlagVisible));
+                               ne->setParent(this);
+                               ne->setVisible(getFlag(RS2::FlagVisible));
 
                                RS_DEBUG->print("RS_Insert::update: transforming entity");
 
-                // Move:
+                               // Move:
                                RS_DEBUG->print("RS_Insert::update: move 1");
                                if (fabs(data.scaleFactor.x) > 1.0e-6 && fabs(data.scaleFactor.y) > 1.0e-6)
                                {
-                       ne->move(data.insertionPoint + Vector(data.spacing.x / data.scaleFactor.x * c,
+                                       ne->move(data.insertionPoint + Vector(data.spacing.x / data.scaleFactor.x * c,
                                                data.spacing.y / data.scaleFactor.y * r));
                                }
                                else
                                {
-                       ne->move(data.insertionPoint);
+                                       ne->move(data.insertionPoint);
                                }
 
                                // Move because of block base point:
                                RS_DEBUG->print("RS_Insert::update: move 2");
-                ne->move(blk->getBasePoint() * -1);
-                // Scale:
+                               ne->move(blk->getBasePoint() * -1);
+                               // Scale:
                                RS_DEBUG->print("RS_Insert::update: scale");
-                ne->scale(data.insertionPoint, data.scaleFactor);
-                // Rotate:
+                               ne->scale(data.insertionPoint, data.scaleFactor);
+                               // Rotate:
                                RS_DEBUG->print("RS_Insert::update: rotate");
-                ne->rotate(data.insertionPoint, data.angle);
-                // Select:
-                ne->setSelected(isSelected());
+                               ne->rotate(data.insertionPoint, data.angle);
+                               // Select:
+                               ne->setSelected(isSelected());
 
-                // individual entities can be on indiv. layers
-                tmpPen = ne->getPen(false);
+                               // individual entities can be on indiv. layers
+                               tmpPen = ne->getPen(false);
 
-                // color from block (free floating):
-                if (tmpPen.getColor() == RS_Color(RS2::FlagByBlock))
-                    tmpPen.setColor(getPen().getColor());
+                               // color from block (free floating):
+                               if (tmpPen.getColor() == RS_Color(RS2::FlagByBlock))
+                                       tmpPen.setColor(getPen().getColor());
 
-                // line width from block (free floating):
-                if (tmpPen.getWidth() == RS2::WidthByBlock)
-                    tmpPen.setWidth(getPen().getWidth());
+                               // line width from block (free floating):
+                               if (tmpPen.getWidth() == RS2::WidthByBlock)
+                                       tmpPen.setWidth(getPen().getWidth());
 
-                // line type from block (free floating):
-                if (tmpPen.getLineType() == RS2::LineByBlock)
-                    tmpPen.setLineType(getPen().getLineType());
+                               // line type from block (free floating):
+                               if (tmpPen.getLineType() == RS2::LineByBlock)
+                                       tmpPen.setLineType(getPen().getLineType());
 
-                // now that we've evaluated all flags, let's strip them:
-                // TODO: strip all flags (width, line type)
-                //tmpPen.setColor(tmpPen.getColor().stripFlags());
+                               // now that we've evaluated all flags, let's strip them:
+                               // TODO: strip all flags (width, line type)
+                               //tmpPen.setColor(tmpPen.getColor().stripFlags());
 
-                ne->setPen(tmpPen);
+                               ne->setPen(tmpPen);
 
                                ne->setUpdateEnabled(true);
 
@@ -254,10 +242,10 @@ void RS_Insert::update()
                                }
 
                                RS_DEBUG->print("RS_Insert::update: adding new entity");
-                addEntity(ne);
-            }
-        }
-    }
+                               addEntity(ne);
+                       }
+               }
+       }
 
        calculateBorders();
 
@@ -383,23 +371,21 @@ void RS_Insert::move(Vector offset)
     update();
 }
 
-
-
-void RS_Insert::rotate(Vector center, double angle) {
+void RS_Insert::rotate(Vector center, double angle)
+{
        RS_DEBUG->print("RS_Insert::rotate1: insertionPoint: %f/%f "
            "/ center: %f/%f",
                data.insertionPoint.x, data.insertionPoint.y,
                center.x, center.y);
     data.insertionPoint.rotate(center, angle);
-    data.angle = RS_Math::correctAngle(data.angle+angle);
+    data.angle = RS_Math::correctAngle(data.angle + angle);
        RS_DEBUG->print("RS_Insert::rotate2: insertionPoint: %f/%f",
                data.insertionPoint.x, data.insertionPoint.y);
     update();
 }
 
-
-
-void RS_Insert::scale(Vector center, Vector factor) {
+void RS_Insert::scale(Vector center, Vector factor)
+{
        RS_DEBUG->print("RS_Insert::scale1: insertionPoint: %f/%f",
                data.insertionPoint.x, data.insertionPoint.y);
     data.insertionPoint.scale(center, factor);
@@ -410,24 +396,22 @@ void RS_Insert::scale(Vector center, Vector factor) {
     update();
 }
 
-
-
-void RS_Insert::mirror(Vector axisPoint1, Vector axisPoint2) {
-    data.insertionPoint.mirror(axisPoint1, axisPoint2);
+void RS_Insert::mirror(Vector axisPoint1, Vector axisPoint2)
+{
+       data.insertionPoint.mirror(axisPoint1, axisPoint2);
 
        Vector vec;
        vec.setPolar(1.0, data.angle);
-       vec.mirror(Vector(0.0,0.0), axisPoint2-axisPoint1);
+       vec.mirror(Vector(0.0, 0.0), axisPoint2 - axisPoint1);
        data.angle = vec.angle();
 
-       data.scaleFactor.y*=-1;
+       data.scaleFactor.y *= -1;
 
     update();
 }
 
-
-std::ostream& operator << (std::ostream& os, const RS_Insert& i) {
+std::ostream & operator<<(std::ostream & os, const RS_Insert & i)
+{
     os << " Insert: " << i.getData() << std::endl;
     return os;
 }
-
index 9b4fdf400b5c51a26b77d4a4882580383bc2af15..aafb2f4ca2c7d3de560897dd42dbd40b1928b254 100644 (file)
@@ -1,35 +1,9 @@
-/****************************************************************************
-** $Id: rs_insert.h 2367 2005-04-04 16:57:36Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
 #ifndef RS_INSERT_H
 #define RS_INSERT_H
 
 #include "rs_entitycontainer.h"
 #include "rs_block.h"
-#include "rs_graphic.h"
+#include "drawing.h"
 
 /**
  * Holds the data that defines an insert.
index 725463b0492f25c8d9baf6019d0e7847445b53cb..b0f890eab2da538ec966c341b4cb64eb2e8130e6 100644 (file)
@@ -1,32 +1,19 @@
-/****************************************************************************
-** $Id: rs_layer.cpp 1938 2004-12-09 23:09:53Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
+// rs_layer.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -----------------------------------------------------------
+// JLH  06/01/2010  Added this text. :-)
+//
 
 #include "rs_layer.h"
 
-//#include <iostream>
 #include "rs_color.h"
 #include "rs_math.h"
 
index 145738243a9172fb046512e3c377a9f4494332ee..2b566860b4112301e38c376dfe73d9ecc7470b24 100644 (file)
@@ -1,29 +1,3 @@
-/****************************************************************************
-** $Id: rs_layer.h 1822 2004-02-29 00:29:32Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
 #ifndef RS_LAYER_H
 #define RS_LAYER_H
 
index fc79decdf5f9f250084bd502129f9d3e11ec9d01..def554bbad67b5b64e281161bc4cabb20b47e640 100644 (file)
@@ -1,28 +1,16 @@
-/****************************************************************************
-** $Id: rs_layerlist.cpp 1938 2004-12-09 23:09:53Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
+// rs_layerlist.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -----------------------------------------------------------
+// JLH  06/01/2010  Added this text. :-)
+//
 
 #include "rs_layerlist.h"
 
index 0e2b8fdfa62d91372ea973277011bb13750cb203..1a8a91e3ae21909edebec75f6d85052c1ad6417a 100644 (file)
@@ -1,29 +1,3 @@
-/****************************************************************************
-** $Id: rs_layerlist.h 1869 2004-04-09 19:56:42Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
 #ifndef RS_LAYERLIST_H
 #define RS_LAYERLIST_H
 
index 1b0864a6620baf7941c63a0434d50e7f9ee309f4..21649793b1afdfbe09e0d8d20c0743725e12c6d1 100644 (file)
@@ -1,29 +1,3 @@
-/****************************************************************************
-** $Id: rs_layerlistlistener.h 1648 2003-06-11 06:56:01Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
 #ifndef RS_LAYERLISTLISTENER_H
 #define RS_LAYERLISTLISTENER_H
 
index 60f67c999f41b04a00857fa2c0ae0af326c775a0..d2d9f8dc380e348fe291e6120f383b58b96d90d9 100644 (file)
@@ -1,28 +1,16 @@
-/****************************************************************************
-** $Id: rs_leader.cpp 1938 2004-12-09 23:09:53Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
+// rs_leader.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -----------------------------------------------------------
+// JLH  06/01/2010  Added this text. :-)
+//
 
 #include "rs_leader.h"
 
index 3c124acf8f39ecd3c8b8a329f83f34a0c73f96b8..ca6074017880703129707e1149b5aa36022ffb44 100644 (file)
@@ -1,29 +1,3 @@
-/****************************************************************************
-** $Id: rs_leader.h 2367 2005-04-04 16:57:36Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
 #ifndef RS_LEADER_H
 #define RS_LEADER_H
 
index 83f37421e88bc2f6395ba2988057847be6b562b3..8813b3e699f43b34e078bd6b5a9ce9a1b16d8e40 100644 (file)
@@ -1,9 +1,22 @@
+// rs_line.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -----------------------------------------------------------
+// JLH  06/01/2010  Added this text. :-)
+//
 
 #include "rs_line.h"
 
 #include "rs_debug.h"
 #include "rs_graphicview.h"
-#include "rs_graphic.h"
+#include "drawing.h"
 #include "paintintf.h"
 
 /**
index 4bcff0f8b92954ea15ab41d5d267a7248eece2d1..04a4c8651ab1e0eddc24975fc8a9c0f533e57396 100644 (file)
@@ -1,29 +1,3 @@
-/****************************************************************************
-** $Id: rs_line.h 1907 2004-09-04 19:56:42Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
 #ifndef RS_LINE_H
 #define RS_LINE_H
 
index 036e12e152bc61612b2731d8adf595d1415d6e8f..aab37aced0edf589bd9a78f7d4cdb4980d0ae75c 100644 (file)
@@ -1,31 +1,35 @@
-/****************************************************************************
-** $Id: rs_linetypepattern.cpp 1648 2003-06-11 06:56:01Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use 
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
+// rs_linetypepattern.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -----------------------------------------------------------
+// JLH  06/01/2010  Added this text. :-)
+//
 
 #include "rs_linetypepattern.h"
 
+RS_LineTypePattern::RS_LineTypePattern(int count ...)
+{
+       va_list ap;
+       int i = 0;
+       num = count;
+
+       va_start(ap, count);
+       pattern = new double[num];
+
+       for(i=0; i<count; i++)
+               pattern[i] = va_arg(ap, double);
 
+       va_end(ap);
+}
 
+RS_LineTypePattern::~RS_LineTypePattern()
+{
+       delete[] pattern;
+}
index dbc3e20e96cb48a03a155667edbd1366a7ada59b..93ef8b7e6d05a215b0b095df4d49fcb0cf0a435f 100644 (file)
@@ -1,30 +1,3 @@
-/****************************************************************************
-** $Id: rs_linetypepattern.h 1676 2003-08-08 14:05:26Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use 
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-
 #ifndef RS_LINETYPEPATTERN_H
 #define RS_LINETYPEPATTERN_H
 
 /**
  * Stores a line type pattern.
  */
-class RS_LineTypePattern {
-public:
-    RS_LineTypePattern(int count ...) {
-        va_list ap;
-        int i=0;
-        num = count;
-
-        va_start(ap, count);
-        pattern = new double[num];
-        for (i=0; i<count; i++) {
-            pattern[i] = va_arg(ap, double);
-        }
-        va_end(ap);
-    }
-
-    ~RS_LineTypePattern() {
-        delete[] pattern;
-    }
-
-public:
-    double* pattern;
-    int num;
+class RS_LineTypePattern
+{
+       public:
+               RS_LineTypePattern(int count ...);
+               ~RS_LineTypePattern();
+
+       public:
+               double * pattern;
+               int num;
 };
 
 // Create line patterns
@@ -78,7 +38,7 @@ static RS_LineTypePattern patternDivideLine2(
     6, 6.0, -2.9, 0.15, -2.9, 0.15, -2.9);
 static RS_LineTypePattern patternDivideLineX2(
     6, 24.0, -11.9, 0.15, -11.9, 0.15, -11.9);
-       
+
 static RS_LineTypePattern patternCenterLine(4, 32.0, -6.0, 6.0, -6.0);
 static RS_LineTypePattern patternCenterLine2(4, 16.0, -3.0, 3.0, -3.0);
 static RS_LineTypePattern patternCenterLineX2(4, 64.0, -12.0, 12.0, -12.0);
index ce35dd415ebc74f594a361d2ddae9eaf3b01b591..e3e0bdb3a320050e98614f114a99c236c08f42ad 100644 (file)
@@ -1,29 +1,3 @@
-/****************************************************************************
-** $Id: rs_mainwindowinterface.h 1944 2004-12-17 04:31:59Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
 #ifndef RS_MAINWINDOWINTERFACE_H
 #define RS_MAINWINDOWINTERFACE_H
 
index 78c0b9a88e327812e73422951f8ae0fb89c93526..6bad02f3c0a999b56763c28d3d07a1e4778e1f75 100644 (file)
@@ -1,28 +1,16 @@
-/****************************************************************************
-** $Id: rs_math.cpp 1938 2004-12-09 23:09:53Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
+// rs_math.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -----------------------------------------------------------
+// JLH  06/01/2010  Added this text. :-)
+//
 
 #include "rs_math.h"
 
index d30912d60f2f5058880e432b448d947592b2bbfd..b225d691ab8e381ba7f8d507073e43e50dabcd08 100644 (file)
@@ -1,29 +1,3 @@
-/****************************************************************************
-** $Id: rs_math.h 2392 2005-05-17 13:52:38Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
 #ifndef RS_MATH_H
 #define RS_MATH_H
 
index 1c1b19becb922aa848df8b0f7baadec7df8dc0f6..29179b944dd01f436a9f3f971e82b68509de80f2 100644 (file)
@@ -1,10 +1,23 @@
+// rs_modification.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -----------------------------------------------------------
+// JLH  06/01/2010  Added this text. :-)
+//
 
 #include "rs_modification.h"
 
 #include "rs_clipboard.h"
 #include "rs_creation.h"
 #include "rs_entity.h"
-#include "rs_graphic.h"
+#include "drawing.h"
 #include "rs_information.h"
 #include "rs_insert.h"
 #include "rs_polyline.h"
@@ -15,7 +28,7 @@
  * Default constructor.
  *
  * @param container The container to which we will add
- *        entities. Usually that's an RS_Graphic entity but
+ *        entities. Usually that's an Drawing entity but
  *        it can also be a polyline, text, ...
  * @param graphicView Pointer to graphic view or NULL if you don't want the
  *        any views to be updated.
@@ -137,7 +150,7 @@ bool RS_Modification::changeAttributes(RS_AttributesData & data)
 /**
  * Copies all selected entities from the given container to the clipboard.
  * Layers and blocks that are needed are also copied if the container is
- * or is part of an RS_Graphic.
+ * or is part of an Drawing.
  *
  * @param container The entity container.
  * @param ref Reference point. The entities will be moved by -ref.
@@ -184,7 +197,7 @@ void RS_Modification::copy(const Vector& ref, const bool cut) {
 /**
  * Copies the given entity from the given container to the clipboard.
  * Layers and blocks that are needed are also copied if the container is
- * or is part of an RS_Graphic.
+ * or is part of an Drawing.
  *
  * @param e The entity.
  * @param ref Reference point. The entities will be moved by -ref.
@@ -322,13 +335,13 @@ void RS_Modification::copyBlocks(RS_Entity* e) {
 /**
  * Pastes all entities from the clipboard into the container.
  * Layers and blocks that are needed are also copied if the container is
- * or is part of an RS_Graphic.
+ * or is part of an Drawing.
  *
  * @param data Paste data.
  * @param source The source from where to paste. NULL means the source
  *      is the clipboard.
  */
-void RS_Modification::paste(const RS_PasteData& data, RS_Graphic* source) {
+void RS_Modification::paste(const RS_PasteData& data, Drawing* source) {
 
     if (graphic==NULL) {
         RS_DEBUG->print(RS_Debug::D_WARNING,
index ba7077507b64f02cfe9965c8b12f08860835887d..28cdb84c98bee86b3fad427794a04a40d98b0260 100644 (file)
@@ -1,29 +1,3 @@
-/****************************************************************************
-** $Id: rs_modification.h 1946 2004-12-24 19:27:43Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
 #ifndef RS_MODIFICATION_H
 #define RS_MODIFICATION_H
 
@@ -189,7 +163,7 @@ class RS_PasteData
  * There's no interaction handled in this class.
  *
  * All modifications can be undone / redone if the container
- * is a RS_Graphic.
+ * is a Drawing.
  *
  * This class is connected to an entity container and
  * can be connected to a graphic view.
@@ -211,7 +185,7 @@ class RS_Modification
        public:
                void copyLayers(RS_Entity * e);
                void copyBlocks(RS_Entity * e);
-               void paste(const RS_PasteData & data, RS_Graphic * source = NULL);
+               void paste(const RS_PasteData & data, Drawing * source = NULL);
 
                bool move(RS_MoveData & data);
                bool rotate(RS_RotateData & data);
@@ -259,7 +233,7 @@ class RS_Modification
 
        protected:
                RS_EntityContainer * container;
-               RS_Graphic * graphic;
+               Drawing * graphic;
                RS_Document * document;
                RS_GraphicView * graphicView;
                bool handleUndo;
index 5952dfae56c0f19034c4e16063b52ed01f2e158d..79f4fac6672d6bab561d8f8d0f5e035c776cbbcb 100644 (file)
@@ -1,35 +1,23 @@
-/****************************************************************************
-** $Id: rs_pattern.cpp 1938 2004-12-09 23:09:53Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
+// rs_pattern.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -----------------------------------------------------------
+// JLH  06/01/2010  Added this text. :-)
+//
 
 #include "rs_pattern.h"
 
 #include <QtCore>
 #include "rs_system.h"
 #include "rs_fileio.h"
-#include "rs_graphic.h"
+#include "drawing.h"
 
 /**
  * Constructor.
@@ -108,7 +96,7 @@ bool RS_Pattern::loadPattern()
                return false;
        }
 
-       RS_Graphic * gr = new RS_Graphic();
+       Drawing * gr = new Drawing();
 
        // TODO: Find out why the new dxf filter doesn't work for patterns:
        RS_FILEIO->fileImport(*gr, path, RS2::FormatDXF1);
index c4219e8e1ef6acb49cf2fa0df8dc0cfe7c02004e..98344ecccd812be73de13a947afe61e5641b5988 100644 (file)
@@ -1,29 +1,3 @@
-/****************************************************************************
-** $Id: rs_pattern.h 1819 2004-02-18 16:03:00Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
 #ifndef RS_PATTERN_H
 #define RS_PATTERN_H
 
index defd47a402f75fca1d86063bc2590cd88c4b5321..8095a723fac98cf69eb569e1f1410417f6b535d3 100644 (file)
@@ -1,28 +1,16 @@
-/****************************************************************************
-** $Id: rs_patternlist.cpp 1938 2004-12-09 23:09:53Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
+// rs_patternlist.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -----------------------------------------------------------
+// JLH  06/01/2010  Added this text. :-)
+//
 
 #include "rs_patternlist.h"
 
index 734d2669c7ddf1a2c504c59845fa17ee6dae50dd..f5c1061460d934c9a2bebc34db8e63fe0e2e71a4 100644 (file)
@@ -1,29 +1,3 @@
-/****************************************************************************
-** $Id: rs_patternlist.h 1915 2004-09-20 12:08:35Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
 #ifndef RS_PATTERNLIST_H
 #define RS_PATTERNLIST_H
 
index 4dcf7d9be223f7842ee9925595993fa2b3d723cc..21b3729c299d5d467034728a9789c28447e7c96b 100644 (file)
@@ -1,29 +1,3 @@
-/****************************************************************************
-** $Id: rs_pen.h 1760 2003-10-13 19:52:37Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
 #ifndef RS_PEN_H
 #define RS_PEN_H
 
index b9725fff149c9ccf43d630dfdd86d638c483ebae..be98cc58deb38f4cae28475f8ea9de8e1bdc1cff 100644 (file)
@@ -1,28 +1,16 @@
-/****************************************************************************
-** $Id: rs_point.cpp 1907 2004-09-04 19:56:42Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
+// rs_point.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -----------------------------------------------------------
+// JLH  06/01/2010  Added this text. :-)
+//
 
 #include "rs_point.h"
 
index 20e36ee03be0408a7afb3afafc4f4568030c6131..be314e0f42d942292a7b777aa3eff0c4426fd929 100644 (file)
@@ -1,29 +1,3 @@
-/****************************************************************************
-** $Id: rs_point.h 1938 2004-12-09 23:09:53Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
 #ifndef RS_POINT_H
 #define RS_POINT_H
 
index 4c868e1c4bca46843bcf544168a7565152b79d0d..80a0232cb4d50290b7aece45c15d5cca7a111b18 100644 (file)
@@ -1,28 +1,16 @@
-/****************************************************************************
-** $Id: rs_polyline.cpp 1959 2005-03-08 14:09:02Z js $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
+// rs_polyline.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -----------------------------------------------------------
+// JLH  06/01/2010  Added this text. :-)
+//
 
 #include "rs_polyline.h"
 
index daa303e2c831d58ec17d23f6047432da127018ff..778700fae9c65f536a06ef109aeadd66e610d536 100644 (file)
@@ -1,29 +1,3 @@
-/****************************************************************************
-** $Id: rs_polyline.h 2367 2005-04-04 16:57:36Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
 #ifndef RS_POLYLINE_H
 #define RS_POLYLINE_H
 
index b6f426864ca80d50f2bf20942d46c0fb7a4e9d73..f2d9bc0d102859b410ab32f2dd1b328a518ac679 100644 (file)
@@ -1,5 +1,6 @@
-// preview.cpp
+// rs_preview.cpp
 //
+// Part of the Architektonas Project
 // Originally part of QCad Community Edition by Andrew Mustun
 // Extensively rewritten and refactored by James L. Hammons
 // (C) 2010 Underground Software
index e34da9e0d4b860d6b7922f06516d9f292f4501c0..eb6a5c2cca09e97f253ae0a523870c2fcfe3ed31 100644 (file)
@@ -1,3 +1,16 @@
+// rs_previewactioninterface.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -----------------------------------------------------------
+// JLH  06/02/2010  Added this text. :-)
+//
 
 #include "rs_previewactioninterface.h"
 
index 49b2cddf97aecc78054db22cfb73242da7463463..aadbd9ce8cc0366f59f489a2d77e6a4285daa718 100644 (file)
@@ -1,28 +1,16 @@
-/****************************************************************************
-** $Id: rs_python.cpp 1741 2003-09-30 22:50:17Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use 
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
+// rs_python.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -----------------------------------------------------------
+// JLH  06/02/2010  Added this text. :-)
+//
 
 #include "rs_python.h"
 
@@ -101,7 +89,7 @@ int RS_Python::launch(const QString& script) {
         Py_XDECREF(mod);
     } else {
         printf("*** ERROR LOADING SCRIPT '%s' ***\n", script.latin1());
-       PyErr_Print();  
+       PyErr_Print();
     }
     Py_XDECREF(modname);
     //Py_Finalize();
index 4c0f2ccef59720d713c32e3c148e4b9662e902a6..cea41f9dd38e80c7a3d4f1e81bd76a8cd02218e9 100644 (file)
@@ -1,29 +1,3 @@
-/****************************************************************************
-** $Id: rs_python.h 1960 2005-03-12 12:22:01Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use 
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
 #ifndef RS_PYTHON_H
 #define RS_PYTHON_H
 
@@ -31,7 +5,7 @@
 
 #include "Python.h"
 
-#include "rs_graphic.h"
+#include "drawing.h"
 
 #define RS_PYTHON RS_Python::instance()
 
@@ -49,11 +23,11 @@ private:
 public:
     static RS_Python* instance();
 
-    void setGraphic(RS_Graphic* g) {
+    void setGraphic(Drawing* g) {
         graphic = g;
     }
 
-    RS_Graphic* getGraphic() {
+    Drawing* getGraphic() {
         return graphic;
     }
 
@@ -61,7 +35,7 @@ public:
 
 private:
     static RS_Python* uniqueInstance;
-    RS_Graphic* graphic;
+    Drawing* graphic;
 };
 
 #endif
index b805b623c7694cd282734715e32fcc4f57c0600a..9af577ac2c8c7f337e9ba0a164ac441aaeb20a97 100644 (file)
@@ -40,7 +40,7 @@ using namespace boost::python;
 #include "rs_entitycontainer.h"
 #include "rs_entity.h"
 #include "rs_flags.h"
-#include "rs_graphic.h"
+#include "drawing.h"
 #include "rs_image.h"
 #include "rs_insert.h"
 #include "rs_layer.h"
@@ -52,7 +52,7 @@ using namespace boost::python;
 #include "rs_vector.h"
 
 /* Global root functions */
-RS_Graphic* currentGraphic() { return RS_PYTHON->getGraphic(); }
+Drawing* currentGraphic() { return RS_PYTHON->getGraphic(); }
 
     /* more to be added later (access to global properties, all documents,
        creation of new documents, ... */
@@ -118,7 +118,7 @@ namespace QString_Python_Conversions {
    void fname(container& cont, std::auto_ptr<entity> obj) \
    { cont.addfunc(obj.get()); obj.release(); }
 
-TRANSFER_OWNERSHIP_FUNCTION(RS_Graphic_addLayer, RS_Graphic, addLayer, RS_Layer)
+TRANSFER_OWNERSHIP_FUNCTION(Drawing_addLayer, Drawing, addLayer, RS_Layer)
 TRANSFER_OWNERSHIP_FUNCTION(RS_LayerList_add, RS_LayerList, add, RS_Layer)
 
 #define ADDVERTEX_FUNCTION(fname, entity) \
@@ -139,8 +139,8 @@ void (RS_LayerList::*RS_LayerList_activate_string)(const QString&) = &RS_LayerLi
 void (RS_LayerList::*RS_LayerList_activate_layer)(RS_Layer*) = &RS_LayerList::activate;
 void (RS_LayerList::*RS_LayerList_toggle_string)(const QString&) = &RS_LayerList::toggle;
 void (RS_LayerList::*RS_LayerList_toggle_layer)(const QString&) = &RS_LayerList::toggle;
-void (RS_Graphic::*RS_Graphic_toggleLayer_string)(const QString&) = &RS_Graphic::toggleLayer;
-void (RS_Graphic::*RS_Graphic_toggleLayer_layer)(RS_Layer*) = &RS_Graphic::toggleLayer;
+void (Drawing::*Drawing_toggleLayer_string)(const QString&) = &Drawing::toggleLayer;
+void (Drawing::*Drawing_toggleLayer_layer)(RS_Layer*) = &Drawing::toggleLayer;
 void (RS_Entity::*RS_Entity_setLayer_string)(const QString&) = &RS_Entity::setLayer;
 void (RS_Entity::*RS_Entity_setLayer_layer)(RS_Layer*) = &RS_Entity::setLayer;
 
@@ -382,16 +382,16 @@ BOOST_PYTHON_MODULE(qcad)
        .add_property("filename", &RS_Document::getFilename)
     ;
     
-    class_<RS_Graphic, bases<RS_Document> >("Graphic", init<RS_EntityContainer*>())
-        .def("count", &RS_Graphic::count)
-        .def("findLayer", &RS_Graphic::findLayer, return_value_policy<reference_existing_object>())
-       .def("editLayer", &RS_Graphic::editLayer)
-       .def("addLayer", RS_Graphic_addLayer)
-       .def("removeLayer", &RS_Graphic::removeLayer)
-       .def("toggleLayer", RS_Graphic_toggleLayer_string)
-       .def("toggleLayer", RS_Graphic_toggleLayer_layer)
-       .def("clearLayers", &RS_Graphic::clearLayers)
-       .def("freezeAllLayers", &RS_Graphic::freezeAllLayers)
+    class_<Drawing, bases<RS_Document> >("Graphic", init<RS_EntityContainer*>())
+        .def("count", &Drawing::count)
+        .def("findLayer", &Drawing::findLayer, return_value_policy<reference_existing_object>())
+       .def("editLayer", &Drawing::editLayer)
+       .def("addLayer", Drawing_addLayer)
+       .def("removeLayer", &Drawing::removeLayer)
+       .def("toggleLayer", Drawing_toggleLayer_string)
+       .def("toggleLayer", Drawing_toggleLayer_layer)
+       .def("clearLayers", &Drawing::clearLayers)
+       .def("freezeAllLayers", &Drawing::freezeAllLayers)
     ;
 
     /* Entity types */
index e2cb16f992054cc72b782bdc5723529b4e3feaf0..e9de814ed191432f43d6d3699895398247a9b370 100644 (file)
@@ -1,28 +1,16 @@
-/****************************************************************************
-** $Id: rs_script.cpp 1938 2004-12-09 23:09:53Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
+// rs_script.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -----------------------------------------------------------
+// JLH  06/02/2010  Added this text. :-)
+//
 
 #include "rs_script.h"
 
index 807916c241adb452cf577cb25551047943b461f3..9db7d02abdab5a7827c626c3c7f1bcc6d5f891e4 100644 (file)
@@ -1,29 +1,3 @@
-/****************************************************************************
-** $Id: rs_script.h 1960 2005-03-12 12:22:01Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
 #ifndef RS_SCRIPT_H
 #define RS_SCRIPT_H
 
index 6c289b4292f97c283d3c9740f747cdc9feec8f70..b1f4e8674e47f8252c75a351d3d72a47541a9051 100644 (file)
@@ -1,28 +1,16 @@
-/****************************************************************************
-** $Id: rs_scriptlist.cpp 1960 2005-03-12 12:22:01Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
+// rs_scriptlist.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -----------------------------------------------------------
+// JLH  06/02/2010  Added this text. :-)
+//
 
 #include "rs_scriptlist.h"
 
index b955767ad145b41ed9ed4a4bc12aca7179230662..c3de735bdfc0160b503f7231fd5ae89de1fc10e5 100644 (file)
@@ -1,29 +1,3 @@
-/****************************************************************************
-** $Id: rs_scriptlist.h 1960 2005-03-12 12:22:01Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
 #ifndef RS_SCRIPTLIST_H
 #define RS_SCRIPTLIST_H
 
index 14e8153fbae53e2dc4b4d22be8e65305e6a121e4..046775b7375540cca4f04c325f7631f02fd7fd83 100644 (file)
@@ -1,16 +1,29 @@
+// rs_selection.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -----------------------------------------------------------
+// JLH  06/02/2010  Added this text. :-)
+//
 
 #include "rs_selection.h"
 
 #include "rs_information.h"
 #include "rs_polyline.h"
 #include "rs_entity.h"
-#include "rs_graphic.h"
+#include "drawing.h"
 
 /**
  * Default constructor.
  *
  * @param container The container to which we will add
- *        entities. Usually that's an RS_Graphic entity but
+ *        entities. Usually that's an Drawing entity but
  *        it can also be a polyline, text, ...
  */
 RS_Selection::RS_Selection(RS_EntityContainer & container, RS_GraphicView * graphicView)
@@ -67,6 +80,11 @@ void RS_Selection::selectAll(bool select)
                graphicView->redraw();
 }
 
+void RS_Selection::deselectAll()
+{
+       selectAll(false);
+}
+
 /**
  * Selects all entities on visible layers.
  */
@@ -111,6 +129,11 @@ void RS_Selection::selectWindow(const Vector & v1, const Vector & v2, bool selec
                graphicView->redraw();
 }
 
+void RS_Selection::deselectWindow(const Vector & v1, const Vector & v2)
+{
+       selectWindow(v1, v2, false);
+}
+
 /**
  * Selects all entities that are intersected by the given line.
  *
@@ -171,6 +194,11 @@ void RS_Selection::selectIntersected(const Vector & v1, const Vector & v2, bool
        }
 }
 
+void RS_Selection::deselectIntersected(const Vector & v1, const Vector & v2)
+{
+       selectIntersected(v1, v2, false);
+}
+
 /**
  * Selects all entities that are connected to the given entity.
  *
@@ -294,3 +322,8 @@ void RS_Selection::selectLayer(const QString & layerName, bool select)
                }
        }
 }
+
+void RS_Selection::deselectLayer(QString & layerName)
+{
+       selectLayer(layerName, false);
+}
index c888e0490c5cf0d1d760542cfd2f127695ce7d32..d1239e11ec2f351f8c429e83c1304aea2f0e9a7f 100644 (file)
@@ -1,78 +1,42 @@
-/****************************************************************************
-** $Id: rs_selection.h 1868 2004-04-05 23:12:06Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use 
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
 #ifndef RS_SELECTION_H
 #define RS_SELECTION_H
 
 #include "rs_entitycontainer.h"
 #include "rs_graphicview.h"
 
-
-
 /**
- * API Class for selecting entities. 
+ * API Class for selecting entities.
  * There's no interaction handled in this class.
  * This class is connected to an entity container and
  * can be connected to a graphic view.
  *
  * @author Andrew Mustun
  */
-class RS_Selection {
-public:
-    RS_Selection(RS_EntityContainer& entityContainer,
-                 RS_GraphicView* graphicView=NULL);
-
-    void selectSingle(RS_Entity* e);
-    void selectAll(bool select=true);
-    void deselectAll() {
-        selectAll(false);
-    }
-    void invertSelection();
-    void selectWindow(const Vector& v1, const Vector& v2,
-                      bool select=true, bool cross=false);
-    void deselectWindow(const Vector& v1, const Vector& v2) {
-        selectWindow(v1, v2, false);
-    }
-    void selectIntersected(const Vector& v1, const Vector& v2,
-                      bool select=true);
-    void deselectIntersected(const Vector& v1, const Vector& v2) {
-               selectIntersected(v1, v2, false);
-       }
-    void selectContour(RS_Entity* e);
-       
-    void selectLayer(RS_Entity* e);
-    void selectLayer(const QString& layerName, bool select=true);
-    void deselectLayer(QString& layerName) {
-               selectLayer(layerName, false);
-       }
-
-protected:
-    RS_EntityContainer* container;
-    RS_Graphic* graphic;
-    RS_GraphicView* graphicView;
+class RS_Selection
+{
+       public:
+               RS_Selection(RS_EntityContainer & entityContainer,
+                                       RS_GraphicView * graphicView = NULL);
+
+               void selectSingle(RS_Entity * e);
+               void selectAll(bool select = true);
+               void deselectAll();
+               void invertSelection();
+               void selectWindow(const Vector & v1, const Vector & v2,
+                       bool select = true, bool cross = false);
+               void deselectWindow(const Vector & v1, const Vector & v2);
+               void selectIntersected(const Vector & v1, const Vector & v2,
+                       bool select = true);
+               void deselectIntersected(const Vector & v1, const Vector & v2);
+               void selectContour(RS_Entity * e);
+               void selectLayer(RS_Entity * e);
+               void selectLayer(const QString & layerName, bool select = true);
+               void deselectLayer(QString & layerName);
+
+       protected:
+               RS_EntityContainer * container;
+               Drawing * graphic;
+               RS_GraphicView * graphicView;
 };
 
 #endif
index a25563d6036cb424fcb8e839a4b002d2d6fbd6bf..99ad24b4c09c25f2bc29d1551b125a3c77847bf3 100644 (file)
@@ -1,29 +1,16 @@
-/****************************************************************************
-** $Id: rs_simplepython.cpp 1775 2003-11-02 12:20:46Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use 
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
+// rs_simplepython.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -----------------------------------------------------------
+// JLH  06/02/2010  Added this text. :-)
+//
 
 #ifdef RS_OPT_SIMPLEPYTHON
 #include "rs_simplepython.h"
@@ -91,7 +78,7 @@ int RS_SimplePython::launch(const QString& script) {
 
 
 /**
- * A test method exposed to Python 
+ * A test method exposed to Python
  */
 long inc(long i) {
     printf("c: inc called\n");
@@ -117,7 +104,7 @@ void rsPyAddLine(double x1, double y1, double x2, double y2) {
     //printf("c: addLine called\n");
     //printf("c: parameter from python: %f\n", x1);
 
-    RS_Graphic* graphic = RS_SIMPLEPYTHON->getGraphic();
+    Drawing* graphic = RS_SIMPLEPYTHON->getGraphic();
     if (graphic!=NULL) {
         graphic->addEntity(new RS_Line(graphic,
                                        RS_LineData(RS_Vector(x1, y1),
index ca03bb3427ec4fa0062397bed77ae0bf537cf3a9..9466165c29d8187ea212cd800835da15f461c57f 100644 (file)
@@ -1,29 +1,3 @@
-/****************************************************************************
-** $Id: rs_simplepython.h 1960 2005-03-12 12:22:01Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use 
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
 #ifndef RS_SIMPLEPYTHON_H
 #define RS_SIMPLEPYTHON_H
 
@@ -31,7 +5,7 @@
 
 #include "Python.h"
 
-#include "rs_graphic.h"
+#include "drawing.h"
 
 #define RS_SIMPLEPYTHON RS_SimplePython::instance()
 
  *
  * @author Andrew Mustun
  */
-class RS_SimplePython {
-private:
-    RS_SimplePython() {
-        graphic = NULL;
-    }
+class RS_SimplePython
+{
+       private:
+               RS_SimplePython()
+               {
+                       graphic = NULL;
+               }
 
-public:
-    static RS_SimplePython* instance();
+       public:
+               static RS_SimplePython * instance();
 
-    void setGraphic(RS_Graphic* g) {
-        graphic = g;
-    }
+               void setGraphic(Drawing* g)
+               {
+                       graphic = g;
+               }
 
-    RS_Graphic* getGraphic() {
-        return graphic;
-    }
+               Drawing * getGraphic()
+               {
+                       return graphic;
+               }
 
-    int launch(const QString& script);
+               int launch(const QString& script);
 
-private:
-    static RS_SimplePython* uniqueInstance;
+       private:
+               static RS_SimplePython * uniqueInstance;
 
-    RS_Graphic* graphic;
+               Drawing * graphic;
 };
 
-
-
 /**
  * Global method needed by the python lib for initialisation.
  */
index e670a08312022b1403ed01225adb234f3aa219e9..1ee3007862032c1f1700345fec5ffe7a819ef85a 100644 (file)
@@ -1,5 +1,6 @@
 // rs_snapper.cpp
 //
+// Part of the Architektonas Project
 // Originally part of QCad Community Edition by Andrew Mustun
 // Extensively rewritten and refactored by James L. Hammons
 // (C) 2010 Underground Software
@@ -15,7 +16,7 @@
 
 #include "rs_dialogfactory.h"
 #include "rs_entitycontainer.h"
-#include "rs_graphic.h"
+#include "drawing.h"
 #include "rs_graphicview.h"
 #include "rs_grid.h"
 #include "rs_information.h"
index 0b447a7319d898ee17b8374590f96980f9ad9e2e..2badd754754d78ee1a3e7974e7f75b4d45a1218b 100644 (file)
@@ -1,61 +1,47 @@
-/****************************************************************************
-** $Id: rs_solid.cpp 1938 2004-12-09 23:09:53Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
+// rs_solid.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -----------------------------------------------------------
+// JLH  06/02/2010  Added this text. :-)
+//
 
 #include "rs_solid.h"
 
 #include "rs_graphicview.h"
-//#include "rs_painter.h"
 #include "paintintf.h"
 
 /**
  * Default constructor.
  */
-RS_Solid::RS_Solid(RS_EntityContainer* parent,
-                   const RS_SolidData& d)
-        :RS_AtomicEntity(parent), data(d) {
-    calculateBorders();
+RS_Solid::RS_Solid(RS_EntityContainer * parent, const RS_SolidData& d):
+       RS_AtomicEntity(parent), data(d)
+{
+       calculateBorders();
 }
 
-
-
 /**
  * @return Corner number 'num'.
  */
-Vector RS_Solid::getCorner(int num) {
-    if (num>=0 && num<4) {
-        return data.corner[num];
-    } else {
-        RS_DEBUG->print("Illegal corner requested from Solid",
-                        RS_Debug::D_WARNING);
-        return Vector(false);
-    }
+Vector RS_Solid::getCorner(int num)
+{
+       if (num >= 0 && num < 4)
+       {
+               return data.corner[num];
+       }
+       else
+       {
+               RS_DEBUG->print("Illegal corner requested from Solid", RS_Debug::D_WARNING);
+               return Vector(false);
+       }
 }
 
-
-
 /**
  * Shapes this Solid into a standard arrow (used in dimensions).
  *
@@ -63,157 +49,139 @@ Vector RS_Solid::getCorner(int num) {
  * @param angle Direction of the arrow.
  * @param arrowSize Size of arrow (length).
  */
-void RS_Solid::shapeArrow(const Vector& point,
-                          double angle,
-                          double arrowSize) {
-
-    double cosv1, sinv1, cosv2, sinv2;
-    double arrowSide = arrowSize/cos(0.165);
+void RS_Solid::shapeArrow(const Vector & point, double angle, double arrowSize)
+{
+       double cosv1, sinv1, cosv2, sinv2;
+       double arrowSide = arrowSize/cos(0.165);
 
-    cosv1 = cos(angle+0.165)*arrowSide;
-    sinv1 = sin(angle+0.165)*arrowSide;
-    cosv2 = cos(angle-0.165)*arrowSide;
-    sinv2 = sin(angle-0.165)*arrowSide;
+       cosv1 = cos(angle+0.165)*arrowSide;
+       sinv1 = sin(angle+0.165)*arrowSide;
+       cosv2 = cos(angle-0.165)*arrowSide;
+       sinv2 = sin(angle-0.165)*arrowSide;
 
-    data.corner[0] = point;
-    data.corner[1] = Vector(point.x - cosv1, point.y - sinv1);
-    data.corner[2] = Vector(point.x - cosv2, point.y - sinv2);
-    data.corner[3] = Vector(false);
+       data.corner[0] = point;
+       data.corner[1] = Vector(point.x - cosv1, point.y - sinv1);
+       data.corner[2] = Vector(point.x - cosv2, point.y - sinv2);
+       data.corner[3] = Vector(false);
 
-    calculateBorders();
+       calculateBorders();
 }
 
+void RS_Solid::calculateBorders()
+{
+       resetBorders();
 
-
-void RS_Solid::calculateBorders() {
-    resetBorders();
-
-    for (int i=0; i<4; ++i) {
-        if (data.corner[i].valid) {
-            minV = Vector::minimum(minV, data.corner[i]);
-            maxV = Vector::maximum(maxV, data.corner[i]);
-        }
-    }
+       for(int i=0; i<4; ++i)
+       {
+               if (data.corner[i].valid)
+               {
+                       minV = Vector::minimum(minV, data.corner[i]);
+                       maxV = Vector::maximum(maxV, data.corner[i]);
+               }
+       }
 }
 
+Vector RS_Solid::getNearestEndpoint(const Vector & coord, double * dist)
+{
+       double minDist = RS_MAXDOUBLE;
+       double curDist;
+       Vector ret;
 
+       for (int i=0; i<4; ++i)
+       {
+               if (data.corner[i].valid)
+               {
+                       curDist = data.corner[i].distanceTo(coord);
 
-Vector RS_Solid::getNearestEndpoint(const Vector& coord, double* dist) {
-
-    double minDist = RS_MAXDOUBLE;
-    double curDist;
-    Vector ret;
-
-    for (int i=0; i<4; ++i) {
-        if (data.corner[i].valid) {
-            curDist = data.corner[i].distanceTo(coord);
-            if (curDist<minDist) {
-                ret = data.corner[i];
-                minDist = curDist;
-            }
-        }
-    }
+                       if (curDist < minDist)
+                       {
+                               ret = data.corner[i];
+                               minDist = curDist;
+                       }
+               }
+       }
 
-    if (dist!=NULL) {
-        *dist = minDist;
-    }
+       if (dist != NULL)
+               *dist = minDist;
 
-    return ret;
+       return ret;
 }
 
-
-
 /**
  * @todo Implement this.
  */
-Vector RS_Solid::getNearestPointOnEntity(const Vector& /*coord*/,
-        bool /*onEntity*/, double* /*dist*/, RS_Entity** /*entity*/) {
-
-    Vector ret(false);
-    return ret;
+Vector RS_Solid::getNearestPointOnEntity(const Vector & /*coord*/,
+       bool /*onEntity*/, double * /*dist*/, RS_Entity ** /*entity*/)
+{
+       Vector ret(false);
+       return ret;
 }
 
+Vector RS_Solid::getNearestCenter(const Vector & /*coord*/, double * dist)
+{
+       if (dist != NULL)
+               *dist = RS_MAXDOUBLE;
 
+       return Vector(false);
+}
 
-Vector RS_Solid::getNearestCenter(const Vector& /*coord*/,
-                                     double* dist) {
-
-    if (dist!=NULL) {
+Vector RS_Solid::getNearestMiddle(const Vector & /*coord*/, double * dist)
+{
+    if (dist != NULL)
         *dist = RS_MAXDOUBLE;
-    }
 
-    return Vector(false);
+       return Vector(false);
 }
 
-
-
-Vector RS_Solid::getNearestMiddle(const Vector& /*coord*/,
-                                     double* dist) {
-    if (dist!=NULL) {
+Vector RS_Solid::getNearestDist(double /*distance*/, const Vector & /*coord*/, double * dist)
+{
+    if (dist != NULL)
         *dist = RS_MAXDOUBLE;
-    }
-    return Vector(false);
-}
-
-
 
-Vector RS_Solid::getNearestDist(double /*distance*/,
-                                   const Vector& /*coord*/,
-                                   double* dist) {
-    if (dist!=NULL) {
-        *dist = RS_MAXDOUBLE;
-    }
-    return Vector(false);
+       return Vector(false);
 }
 
-
-
 /**
  * @return Distance from one of the boundry lines of this solid to given point.
  *
  * @todo implement
  */
-double RS_Solid::getDistanceToPoint(const Vector& /*coord*/,
-                                    RS_Entity** /*entity*/,
-                                    RS2::ResolveLevel /*level*/,
-                                                                   double /*solidDist*/) {
-    return RS_MAXDOUBLE;
+double RS_Solid::getDistanceToPoint(const Vector & /*coord*/, RS_Entity ** /*entity*/,
+       RS2::ResolveLevel /*level*/, double /*solidDist*/)
+{
+       return RS_MAXDOUBLE;
 }
 
+void RS_Solid::move(Vector offset)
+{
+       for(int i=0; i<4; ++i)
+               data.corner[i].move(offset);
 
-
-void RS_Solid::move(Vector offset) {
-    for (int i=0; i<4; ++i) {
-        data.corner[i].move(offset);
-    }
-    calculateBorders();
+       calculateBorders();
 }
 
+void RS_Solid::rotate(Vector center, double angle)
+{
+       for(int i=0; i<4; ++i)
+               data.corner[i].rotate(center, angle);
 
-
-void RS_Solid::rotate(Vector center, double angle) {
-    for (int i=0; i<4; ++i) {
-        data.corner[i].rotate(center, angle);
-    }
-    calculateBorders();
+       calculateBorders();
 }
 
+void RS_Solid::scale(Vector center, Vector factor)
+{
+       for(int i=0; i<4; ++i)
+               data.corner[i].scale(center, factor);
 
-
-void RS_Solid::scale(Vector center, Vector factor) {
-    for (int i=0; i<4; ++i) {
-        data.corner[i].scale(center, factor);
-    }
-    calculateBorders();
+       calculateBorders();
 }
 
+void RS_Solid::mirror(Vector axisPoint1, Vector axisPoint2)
+{
+       for(int i=0; i<4; ++i)
+               data.corner[i].mirror(axisPoint1, axisPoint2);
 
-
-void RS_Solid::mirror(Vector axisPoint1, Vector axisPoint2) {
-    for (int i=0; i<4; ++i) {
-        data.corner[i].mirror(axisPoint1, axisPoint2);
-    }
-    calculateBorders();
+       calculateBorders();
 }
 
 //void RS_Solid::draw(RS_Painter* painter, RS_GraphicView* view, double /*patternOffset*/)
index 49120cd00daf19248503640fb4250f28bf0edc64..ab7a543a9b41911e23beb7ab814b3f923a689964 100644 (file)
@@ -1,29 +1,3 @@
-/****************************************************************************
-** $Id: rs_solid.h 2371 2005-04-29 11:44:39Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
 #ifndef RS_SOLID_H
 #define RS_SOLID_H
 
index 5969232b522b031a9c5e88e305527e7f8a1b43d5..8b4c3a516980618cb193428596e7594dabf69476 100644 (file)
@@ -1,34 +1,22 @@
-/****************************************************************************
-** $Id: rs_spline.cpp 2367 2005-04-04 16:57:36Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
+// rs_spline.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -----------------------------------------------------------
+// JLH  06/02/2010  Added this text. :-)
+//
 
 #include "rs_spline.h"
 
 #include "rs_debug.h"
 #include "rs_graphicview.h"
-#include "rs_graphic.h"
+#include "drawing.h"
 #include "paintintf.h"
 
 /**
index eccb2be20776da0e206c977eea8dbdb8941e6d4b..5927ddf308a3eb0dfb347994cfb02bc20ecbea7e 100644 (file)
@@ -1,29 +1,3 @@
-/****************************************************************************
-** $Id: rs_spline.h 1914 2004-09-19 11:05:34Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
 #ifndef RS_SPLINE_H
 #define RS_SPLINE_H
 
index e5dac4d19cfe3fb849e47272200cd4e9d23234f4..19727044d58c166ce6ffbfb498a10e1361570afa 100644 (file)
@@ -1,26 +1,20 @@
-/*****************************************************************************
-**  $Id: rs_staticgraphicview.cpp 1686 2003-08-25 22:50:31Z andrew $
-**
-**  This is part of the QCad Qt GUI
-**  Copyright (C) 2001 Andrew Mustun
-**
-**  This program is free software; you can redistribute it and/or modify
-**  it under the terms of the GNU General Public License (version 2) as
-**  published by the Free Software Foundation.
-**
-**  This program is distributed in the hope that it will be useful,
-**  but WITHOUT ANY WARRANTY; without even the implied warranty of
-**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-**  GNU General Public License for more details.
-**
-**  You should have received a copy of the GNU General Public License
-**  along with this program; if not, write to the Free Software
-**  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-******************************************************************************/
+// rs_staticgraphicview.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -----------------------------------------------------------
+// JLH  06/02/2010  Added this text. :-)
+//
 
 #include "rs_staticgraphicview.h"
 
-#include "rs_graphic.h"
+#include "drawing.h"
 
 /**
  * Constructor.
index 1124c5d45ab06196f8cccd18bc120e3a21f87bcf..180c21320774c3d0af9dcb2d2deda5f21853d88c 100644 (file)
@@ -1,23 +1,3 @@
-/*****************************************************************************
-**  $Id: rs_staticgraphicview.h 1686 2003-08-25 22:50:31Z andrew $
-**
-**  This is part of the QCad Qt GUI
-**  Copyright (C) 2001 Andrew Mustun
-**
-**  This program is free software; you can redistribute it and/or modify
-**  it under the terms of the GNU General Public License (version 2) as
-**  published by the Free Software Foundation.
-**
-**  This program is distributed in the hope that it will be useful,
-**  but WITHOUT ANY WARRANTY; without even the implied warranty of
-**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-**  GNU General Public License for more details.
-**
-**  You should have received a copy of the GNU General Public License
-**  along with this program; if not, write to the Free Software
-**  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-******************************************************************************/
-
 #ifndef RS_STATICGRAPHICVIEW_H
 #define RS_STATICGRAPHICVIEW_H
 
index 3b44ae2b23073759b939220d9ae67be1e1e7ada9..56a8cf75e5135a847956ef164191610ac9c7d91f 100644 (file)
@@ -23,9 +23,9 @@
  */
 RS_Text::RS_Text(RS_EntityContainer * parent, const RS_TextData & d): RS_EntityContainer(parent), data(d)
 {
-    usedTextHeight = 0.0;
-    usedTextWidth = 0.0;
-    setText(data.text);
+       usedTextHeight = 0.0;
+       usedTextWidth = 0.0;
+       setText(data.text);
 }
 
 /*virtual*/ RS_Text::~RS_Text()
@@ -59,15 +59,17 @@ RS_TextData RS_Text::getData() const
  */
 int RS_Text::getNumberOfLines()
 {
-    int c=1;
+       int c = 1;
 
-    for (int i=0; i<(int)data.text.length(); ++i) {
-        if (data.text.at(i).unicode()==0x0A) {
-            c++;
-        }
-    }
+       for(int i=0; i<(int)data.text.length(); ++i)
+       {
+               if (data.text.at(i).unicode() == 0x0A)
+               {
+                       c++;
+               }
+       }
 
-    return c;
+       return c;
 }
 
 /**
@@ -77,186 +79,181 @@ int RS_Text::getNumberOfLines()
  */
 void RS_Text::update()
 {
-    RS_DEBUG->print("RS_Text::update");
-
-    clear();
-
-    if (isUndone()) {
-        return;
-    }
-
-    usedTextWidth = 0.0;
-    usedTextHeight = 0.0;
-
-    RS_Font* font = RS_FONTLIST->requestFont(data.style);
-
-    if (font==NULL) {
-        return;
-    }
-
-    Vector letterPos = Vector(0.0, -9.0);
-    Vector letterSpace = Vector(font->getLetterSpacing(), 0.0);
-    Vector space = Vector(font->getWordSpacing(), 0.0);
-    int lineCounter = 0;
-
-    // Every single text line gets stored in this entity container
-    //  so we can move the whole line around easely:
-    RS_EntityContainer* oneLine = new RS_EntityContainer(this);
-
-    // First every text line is created with
-    //   alignement: top left
-    //   angle: 0
-    //   height: 9.0
-    // Rotation, scaling and centering is done later
-
-    // For every letter:
-    for (int i=0; i<(int)data.text.length(); ++i) {
-        switch (data.text.at(i).unicode()) {
-        case 0x0A:
-            // line feed:
-            updateAddLine(oneLine, lineCounter++);
-            oneLine = new RS_EntityContainer(this);
-            letterPos = Vector(0.0, -9.0);
-            break;
-
-        case 0x20:
-            // Space:
-            letterPos+=space;
-            break;
-
-        case 0x5C: {
-                // code (e.g. \S, \P, ..)
-                i++;
-                int ch = data.text.at(i).unicode();
-                switch (ch) {
-                case 'P':
-                    updateAddLine(oneLine, lineCounter++);
-                    oneLine = new RS_EntityContainer(this);
-                    letterPos = Vector(0.0, -9.0);
-                    break;
-
-                case 'S': {
-                        QString up;
-                        QString dw;
-                        //letterPos += letterSpace;
-
-                        // get upper string:
-                        i++;
-                        while (data.text.at(i).unicode()!='^' &&
-                                                      //data.text.at(i).unicode()!='/' &&
-                                                      data.text.at(i).unicode()!='\\' &&
-                                                      //data.text.at(i).unicode()!='#' &&
-                                i<(int)data.text.length()) {
-                            up += data.text.at(i);
-                            i++;
-                        }
-
-                        i++;
-
-                                               if (data.text.at(i-1).unicode()=='^' &&
-                                                    data.text.at(i).unicode()==' ') {
-                                                       i++;
-                                               }
-
-                        // get lower string:
-                        while (data.text.at(i).unicode()!=';' &&
-                                i<(int)data.text.length()) {
-                            dw += data.text.at(i);
-                            i++;
-                        }
-
-                        // add texts:
-                        RS_Text* upper =
-                            new RS_Text(
-                                oneLine,
-                                RS_TextData(letterPos + Vector(0.0,9.0),
-                                            4.0, 100.0, RS2::VAlignTop,
-                                                                                       RS2::HAlignLeft,
-                                            RS2::LeftToRight, RS2::Exact,
-                                            1.0, up, data.style,
-                                            0.0, RS2::Update));
-                                               upper->setLayer(NULL);
-                       upper->setPen(RS_Pen(RS2::FlagInvalid));
-                                               oneLine->addEntity(upper);
-
-                        RS_Text* lower =
-                            new RS_Text(
-                                oneLine,
-                                RS_TextData(letterPos+Vector(0.0,4.0),
-                                            4.0, 100.0, RS2::VAlignTop,
-                                                                                       RS2::HAlignLeft,
-                                            RS2::LeftToRight, RS2::Exact,
-                                            1.0, dw, data.style,
-                                            0.0, RS2::Update));
-                                               lower->setLayer(NULL);
-                       lower->setPen(RS_Pen(RS2::FlagInvalid));
-                        oneLine->addEntity(lower);
-
-                        // move cursor:
-                        upper->calculateBorders();
-                        lower->calculateBorders();
-
-                        double w1 = upper->getSize().x;
-                        double w2 = lower->getSize().x;
-
-                        if (w1>w2) {
-                            letterPos += Vector(w1, 0.0);
-                        } else {
-                            letterPos += Vector(w2, 0.0);
-                        }
-                        letterPos += letterSpace;
-                    }
-                    break;
-
-                default:
-                    break;
-                }
-            }
-            break;
-
-        default: {
-                // One Letter:
-                if (font->findLetter(QString(data.text.at(i))) != NULL) {
-
-                                       RS_DEBUG->print("RS_Text::update: insert a "
-                                         "letter at pos: %f/%f", letterPos.x, letterPos.y);
-
-                    RS_InsertData d(QString(data.text.at(i)),
-                                    letterPos,
-                                    Vector(1.0, 1.0),
-                                    0.0,
-                                    1,1, Vector(0.0,0.0),
-                                    font->getLetterList(), RS2::NoUpdate);
-
-                    RS_Insert* letter = new RS_Insert(this, d);
-                    Vector letterWidth;
-                    letter->setPen(RS_Pen(RS2::FlagInvalid));
-                    letter->setLayer(NULL);
-                    letter->update();
-                    letter->forcedCalculateBorders();
-
-                                       // until 2.0.4.5:
-                    //letterWidth = Vector(letter->getSize().x, 0.0);
-                                       // from 2.0.4.6:
-                    letterWidth = Vector(letter->getMax().x-letterPos.x, 0.0);
-
-                    oneLine->addEntity(letter);
-
-                    // next letter position:
-                    letterPos += letterWidth;
-                    letterPos += letterSpace;
-                }
-            }
-            break;
-        }
-    }
-
-    updateAddLine(oneLine, lineCounter);
-    usedTextHeight -= data.height*data.lineSpacingFactor*1.6
-                      - data.height;
-    forcedCalculateBorders();
-
-    RS_DEBUG->print("RS_Text::update: OK");
+       RS_DEBUG->print("RS_Text::update");
+
+       clear();
+
+       if (isUndone())
+               return;
+
+       usedTextWidth = 0.0;
+       usedTextHeight = 0.0;
+
+       RS_Font * font = RS_FONTLIST->requestFont(data.style);
+
+       if (font == NULL)
+               return;
+
+       Vector letterPos = Vector(0.0, -9.0);
+       Vector letterSpace = Vector(font->getLetterSpacing(), 0.0);
+       Vector space = Vector(font->getWordSpacing(), 0.0);
+       int lineCounter = 0;
+
+       // Every single text line gets stored in this entity container
+       //  so we can move the whole line around easely:
+       RS_EntityContainer * oneLine = new RS_EntityContainer(this);
+
+       // First every text line is created with
+       //   alignement: top left
+       //   angle: 0
+       //   height: 9.0
+       // Rotation, scaling and centering is done later
+
+       // For every letter:
+       for(int i=0; i<(int)data.text.length(); ++i)
+       {
+               switch (data.text.at(i).unicode())
+               {
+               case 0x0A:
+                       // line feed:
+                       updateAddLine(oneLine, lineCounter++);
+                       oneLine = new RS_EntityContainer(this);
+                       letterPos = Vector(0.0, -9.0);
+                       break;
+
+               case 0x20:
+                       // Space:
+                       letterPos += space;
+                       break;
+
+               case 0x5C:
+               {
+                       // code (e.g. \S, \P, ..)
+                       i++;
+                       int ch = data.text.at(i).unicode();
+
+                       switch (ch)
+                       {
+                       case 'P':
+                               updateAddLine(oneLine, lineCounter++);
+                               oneLine = new RS_EntityContainer(this);
+                               letterPos = Vector(0.0, -9.0);
+                               break;
+
+                       case 'S':
+                       {
+                               QString up;
+                               QString dw;
+                               //letterPos += letterSpace;
+
+                               // get upper string:
+                               i++;
+                               while (data.text.at(i).unicode() != '^'
+                                       && data.text.at(i).unicode() != '\\'
+                                       && i < (int)data.text.length())
+                               {
+                                       up += data.text.at(i);
+                                       i++;
+                               }
+
+                               i++;
+
+                               if (data.text.at(i - 1).unicode() == '^'
+                                       && data.text.at(i).unicode() == ' ')
+                               {
+                                       i++;
+                               }
+
+                               // get lower string:
+                               while (data.text.at(i).unicode() != ';' && i < (int)data.text.length())
+                               {
+                                       dw += data.text.at(i);
+                                       i++;
+                               }
+
+                               // add texts:
+                               RS_Text * upper = new RS_Text(oneLine,
+                                       RS_TextData(letterPos + Vector(0.0, 9.0),
+                                               4.0, 100.0, RS2::VAlignTop,
+                                               RS2::HAlignLeft,
+                                               RS2::LeftToRight, RS2::Exact,
+                                               1.0, up, data.style,
+                                               0.0, RS2::Update));
+                               upper->setLayer(NULL);
+                               upper->setPen(RS_Pen(RS2::FlagInvalid));
+                               oneLine->addEntity(upper);
+
+                               RS_Text * lower = new RS_Text(oneLine,
+                                       RS_TextData(letterPos+Vector(0.0, 4.0),
+                                               4.0, 100.0, RS2::VAlignTop,
+                                               RS2::HAlignLeft,
+                                               RS2::LeftToRight, RS2::Exact,
+                                               1.0, dw, data.style,
+                                               0.0, RS2::Update));
+                               lower->setLayer(NULL);
+                               lower->setPen(RS_Pen(RS2::FlagInvalid));
+                               oneLine->addEntity(lower);
+
+                               // move cursor:
+                               upper->calculateBorders();
+                               lower->calculateBorders();
+
+                               double w1 = upper->getSize().x;
+                               double w2 = lower->getSize().x;
+
+                               if (w1 > w2)
+                                       letterPos += Vector(w1, 0.0);
+                               else
+                                       letterPos += Vector(w2, 0.0);
+
+                               letterPos += letterSpace;
+                       }
+                               break;
+
+                       default:
+                               break;
+                       }
+               }
+                       break;
+
+               default:
+               {
+                       // One Letter:
+                       if (font->findLetter(QString(data.text.at(i))) != NULL)
+                       {
+                               RS_DEBUG->print("RS_Text::update: insert a "
+                               "letter at pos: %f/%f", letterPos.x, letterPos.y);
+
+                               RS_InsertData d(QString(data.text.at(i)), letterPos, Vector(1.0, 1.0),
+                                       0.0, 1,1, Vector(0.0, 0.0), font->getLetterList(), RS2::NoUpdate);
+
+                               RS_Insert * letter = new RS_Insert(this, d);
+                               letter->setPen(RS_Pen(RS2::FlagInvalid));
+                               letter->setLayer(NULL);
+                               letter->update();
+                               letter->forcedCalculateBorders();
+
+                               // until 2.0.4.5:
+                               //letterWidth = Vector(letter->getSize().x, 0.0);
+                               // from 2.0.4.6:
+                               Vector letterWidth = Vector(letter->getMax().x - letterPos.x, 0.0);
+
+                               oneLine->addEntity(letter);
+
+                               // next letter position:
+                               letterPos += letterWidth;
+                               letterPos += letterSpace;
+                       }
+               }
+                       break;
+               }
+       }
+
+       updateAddLine(oneLine, lineCounter);
+       usedTextHeight -= data.height * data.lineSpacingFactor * 1.6 - data.height;
+       forcedCalculateBorders();
+
+       RS_DEBUG->print("RS_Text::update: OK");
 }
 
 /**
@@ -268,75 +265,73 @@ void RS_Text::update()
  */
 void RS_Text::updateAddLine(RS_EntityContainer* textLine, int lineCounter)
 {
-    RS_DEBUG->print("RS_Text::updateAddLine: width: %f", textLine->getSize().x);
+       RS_DEBUG->print("RS_Text::updateAddLine: width: %f", textLine->getSize().x);
 
        //textLine->forcedCalculateBorders();
-    //RS_DEBUG->print("RS_Text::updateAddLine: width 2: %f", textLine->getSize().x);
+       //RS_DEBUG->print("RS_Text::updateAddLine: width 2: %f", textLine->getSize().x);
 
-    // Move to correct line position:
-    textLine->move(Vector(0.0, -9.0 * lineCounter
-                             * data.lineSpacingFactor * 1.6));
+       // Move to correct line position:
+       textLine->move(Vector(0.0, -9.0 * lineCounter * data.lineSpacingFactor * 1.6));
 
        textLine->forcedCalculateBorders();
        Vector textSize = textLine->getSize();
 
        RS_DEBUG->print("RS_Text::updateAddLine: width 2: %f", textSize.x);
 
-    // Horizontal Align:
-    switch (data.halign) {
-    case RS2::HAlignCenter:
-               RS_DEBUG->print("RS_Text::updateAddLine: move by: %f", -textSize.x/2.0);
-        textLine->move(Vector(-textSize.x/2.0, 0.0));
-        break;
+       // Horizontal Align:
+       switch (data.halign)
+       {
+       case RS2::HAlignCenter:
+               RS_DEBUG->print("RS_Text::updateAddLine: move by: %f", -textSize.x / 2.0);
+               textLine->move(Vector(-textSize.x / 2.0, 0.0));
+               break;
 
-    case RS2::HAlignRight:
-        textLine->move(Vector(-textSize.x, 0.0));
-        break;
+       case RS2::HAlignRight:
+               textLine->move(Vector(-textSize.x, 0.0));
+               break;
 
-    default:
-        break;
-    }
+       default:
+               break;
+       }
 
-    // Vertical Align:
-    double vSize = getNumberOfLines()*9.0*data.lineSpacingFactor*1.6
-                   - (9.0*data.lineSpacingFactor*1.6 - 9.0);
+       // Vertical Align:
+       double vSize = getNumberOfLines() * 9.0 * data.lineSpacingFactor * 1.6 - (9.0 * data.lineSpacingFactor * 1.6 - 9.0);
 
-    switch (data.valign) {
-    case RS2::VAlignMiddle:
-        textLine->move(Vector(0.0, vSize/2.0));
-        break;
+       switch (data.valign)
+       {
+       case RS2::VAlignMiddle:
+               textLine->move(Vector(0.0, vSize / 2.0));
+               break;
 
-    case RS2::VAlignBottom:
-        textLine->move(Vector(0.0, vSize));
-        break;
+       case RS2::VAlignBottom:
+               textLine->move(Vector(0.0, vSize));
+               break;
 
-    default:
-        break;
-    }
+       default:
+               break;
+       }
 
-    // Scale:
-    textLine->scale(Vector(0.0,0.0),
-                    Vector(data.height/9.0, data.height/9.0));
+       // Scale:
+       textLine->scale(Vector(0.0, 0.0), Vector(data.height / 9.0, data.height / 9.0));
 
-    textLine->forcedCalculateBorders();
+       textLine->forcedCalculateBorders();
 
-    // Update actual text size (before rotating, after scaling!):
-    if (textLine->getSize().x>usedTextWidth) {
-        usedTextWidth = textLine->getSize().x;
-    }
+       // Update actual text size (before rotating, after scaling!):
+       if (textLine->getSize().x > usedTextWidth)
+               usedTextWidth = textLine->getSize().x;
 
-    usedTextHeight += data.height*data.lineSpacingFactor*1.6;
+       usedTextHeight += data.height * data.lineSpacingFactor * 1.6;
 
-    // Rotate:
-    textLine->rotate(Vector(0.0,0.0), data.angle);
+       // Rotate:
+       textLine->rotate(Vector(0.0, 0.0), data.angle);
 
-    // Move:
-    textLine->move(data.insertionPoint);
-    textLine->setPen(RS_Pen(RS2::FlagInvalid));
-    textLine->setLayer(NULL);
-    textLine->forcedCalculateBorders();
+       // Move:
+       textLine->move(data.insertionPoint);
+       textLine->setPen(RS_Pen(RS2::FlagInvalid));
+       textLine->setLayer(NULL);
+       textLine->forcedCalculateBorders();
 
-    addEntity(textLine);
+       addEntity(textLine);
 }
 
 Vector RS_Text::getInsertionPoint()
@@ -577,84 +572,86 @@ Vector RS_Text::getNearestRef(const Vector & coord, double * dist)
 
 void RS_Text::move(Vector offset)
 {
-    data.insertionPoint.move(offset);
-    update();
+       data.insertionPoint.move(offset);
+       update();
 }
 
 void RS_Text::rotate(Vector center, double angle)
 {
-    data.insertionPoint.rotate(center, angle);
-    data.angle = RS_Math::correctAngle(data.angle+angle);
-    update();
+       data.insertionPoint.rotate(center, angle);
+       data.angle = RS_Math::correctAngle(data.angle + angle);
+       update();
 }
 
 void RS_Text::scale(Vector center, Vector factor)
 {
-    data.insertionPoint.scale(center, factor);
-    data.width*=factor.x;
-    data.height*=factor.x;
-    update();
+       data.insertionPoint.scale(center, factor);
+       data.width *= factor.x;
+       data.height *= factor.x;
+       update();
 }
 
 void RS_Text::mirror(Vector axisPoint1, Vector axisPoint2)
 {
-    data.insertionPoint.mirror(axisPoint1, axisPoint2);
-    //double ang = axisPoint1.angleTo(axisPoint2);
-    bool readable = RS_Math::isAngleReadable(data.angle);
-
-    Vector vec;
-    vec.setPolar(1.0, data.angle);
-    vec.mirror(Vector(0.0,0.0), axisPoint2-axisPoint1);
-    data.angle = vec.angle();
-
-    bool corr;
-    data.angle = RS_Math::makeAngleReadable(data.angle, readable, &corr);
-
-    if (corr) {
-        if (data.halign==RS2::HAlignLeft) {
-            data.halign=RS2::HAlignRight;
-        } else if (data.halign==RS2::HAlignRight) {
-            data.halign=RS2::HAlignLeft;
-        }
-    } else {
-        if (data.valign==RS2::VAlignTop) {
-            data.valign=RS2::VAlignBottom;
-        } else if (data.valign==RS2::VAlignBottom) {
-            data.valign=RS2::VAlignTop;
-        }
-    }
-    update();
+       data.insertionPoint.mirror(axisPoint1, axisPoint2);
+       //double ang = axisPoint1.angleTo(axisPoint2);
+       bool readable = RS_Math::isAngleReadable(data.angle);
+
+       Vector vec;
+       vec.setPolar(1.0, data.angle);
+       vec.mirror(Vector(0.0, 0.0), axisPoint2 - axisPoint1);
+       data.angle = vec.angle();
+
+       bool corr;
+       data.angle = RS_Math::makeAngleReadable(data.angle, readable, &corr);
+
+       if (corr)
+       {
+               if (data.halign == RS2::HAlignLeft)
+               {
+                       data.halign = RS2::HAlignRight;
+               }
+               else if (data.halign == RS2::HAlignRight)
+               {
+                       data.halign = RS2::HAlignLeft;
+               }
+       }
+       else
+       {
+               if (data.valign == RS2::VAlignTop)
+               {
+                       data.valign = RS2::VAlignBottom;
+               }
+               else if (data.valign == RS2::VAlignBottom)
+               {
+                       data.valign = RS2::VAlignTop;
+               }
+       }
+
+       update();
 }
 
 bool RS_Text::hasEndpointsWithinWindow(Vector /*v1*/, Vector /*v2*/)
 {
-    return false;
+       return false;
 }
 
-
-
 /**
  * Implementations must stretch the given range of the entity
  * by the given offset.
  */
-void RS_Text::stretch(Vector firstCorner,
-                      Vector secondCorner,
-                      Vector offset) {
-
-    if (getMin().isInWindow(firstCorner, secondCorner) &&
-            getMax().isInWindow(firstCorner, secondCorner)) {
-
-        move(offset);
-    }
+void RS_Text::stretch(Vector firstCorner, Vector secondCorner, Vector offset)
+{
+       if (getMin().isInWindow(firstCorner, secondCorner)
+               && getMax().isInWindow(firstCorner, secondCorner))
+               move(offset);
 }
 
-
-
 /**
  * Dumps the point's data to stdout.
  */
-std::ostream& operator << (std::ostream& os, const RS_Text& p) {
-    os << " Text: " << p.getData() << "\n";
-    return os;
+std::ostream & operator<<(std::ostream & os, const RS_Text & p)
+{
+       os << " Text: " << p.getData() << "\n";
+       return os;
 }
-
index 7ccad0871b5bbb1e21e0844d7a827876991157fc..d653713b39804166cb58a70e7b6f12a0f3bacc9d 100644 (file)
@@ -1,3 +1,16 @@
+// rs_undo.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -----------------------------------------------------------
+// JLH  06/02/2010  Added this text. :-)
+//
 
 #include "rs_undo.h"
 
index b643aeeffe0b67043ac5a99b919bb55963450ffb..701f06f998e311df77dcb90d81214d7416f4f12b 100644 (file)
@@ -1,29 +1,3 @@
-/****************************************************************************
-** $Id: rs_undo.h 1648 2003-06-11 06:56:01Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
 #ifndef RS_UNDO_H
 #define RS_UNDO_H
 
index 84f10b51fed5f211de7da77e9d5999cc2f90da63..a371e604dfafcbb06a55b5777ef5e00648a2b8ab 100644 (file)
@@ -1,28 +1,16 @@
-/****************************************************************************
-** $Id: rs_undoable.cpp 1648 2003-06-11 06:56:01Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
+// rs_undoable.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -----------------------------------------------------------
+// JLH  06/02/2010  Added this text. :-)
+//
 
 #include "rs_undoable.h"
 
index fe63ea1efa068c464aad4f592089b2cb4f9e0a8d..65c8798c65038f1e0ff05a2f0b6fa7baf0dbee59 100644 (file)
@@ -1,5 +1,6 @@
-// undocycle.h
+// rs_undocycle.cpp
 //
+// Part of the Architektonas Project
 // Originally part of QCad Community Edition by Andrew Mustun
 // Extensively rewritten and refactored by James L. Hammons
 // (C) 2010 Underground Software
index 7b7bcd69f27a25dc21cdd9fde7ccfbe66d2c3690..ddeae904d001d8ed1da674ed69bda9d21b584065 100644 (file)
@@ -1,28 +1,16 @@
-/****************************************************************************
-** $Id: rs_units.cpp 1938 2004-12-09 23:09:53Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
+// rs_units.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -----------------------------------------------------------
+// JLH  05/05/2010  Moved implementation from header to this file. :-)
+//
 
 #include "rs_units.h"
 
index c8f0eafa9268b3f02ea304646e90e3bbd810636f..a10c54f99e134cbc8f852c2ad551fa77ac98e705 100644 (file)
@@ -1,29 +1,3 @@
-/****************************************************************************
-** $Id: rs_units.h 1877 2004-05-15 09:09:21Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
 #ifndef RS_UNITS_H
 #define RS_UNITS_H
 
index 6d3d6c975e6f42b4bbb0768cc8d7fff368b75fff..51790c901d135e2bf95193ac305b578843359e42 100644 (file)
@@ -1,28 +1,16 @@
-/****************************************************************************
-** $Id: rs_utility.cpp 1648 2003-06-11 06:56:01Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
+// rs_utility.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -----------------------------------------------------------
+// JLH  05/05/2010  Moved implementation from header to this file. :-)
+//
 
 #include "rs_utility.h"
 
index 1a970be44a5e88280719e33458a67dac630ffb77..7ca446dc77cd3b7186a3a59445513756eeba37fe 100644 (file)
@@ -1,34 +1,6 @@
-/****************************************************************************
-** $Id: rs_utility.h 1648 2003-06-11 06:56:01Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-
 #ifndef RS_UTILITY_H
 #define RS_UTILITY_H
 
-//#include "rs_string.h"
 #include <QtCore>
 
 /**
index e6670be632214c9235a30c58a05f48760fd9595d..06648d911506fee6fbd76f538f2cfe2ff15b33c2 100644 (file)
@@ -1,5 +1,6 @@
 // rs_variable.cpp
 //
+// Part of the Architektonas Project
 // Originally part of QCad Community Edition by Andrew Mustun
 // Extensively rewritten and refactored by James L. Hammons
 // (C) 2010 Underground Software
index 657f240bf5b16049734508e0e43d7e2d8dfb29bf..74b180d8eeba22a81844e73d458db41f29d2fa1f 100644 (file)
@@ -1,29 +1,3 @@
-/****************************************************************************
-** $Id: rs_variable.h 1648 2003-06-11 06:56:01Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
 #ifndef RS_VARIABLE_H
 #define RS_VARIABLE_H
 
index 9bd429a052629ca9f07312249966edc1a8bee4bc..b57d2595ebbaef02f0aad9f969a6b4097f5082d3 100644 (file)
@@ -3,8 +3,6 @@
 
 #include <iostream>                                                            // Needed for 'friend ostream' below
 
-//#include "rs.h"
-
 /**
  * Represents a 3d vector (x/y/z)
  *
index fd136569897d3b9704e7a5a2276fa1b52a906cf3..bce0b02eb595935143bf9c56586a2d2ec2854ec1 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "coordinatewidget.h"
 
-#include "rs_graphic.h"
+#include "drawing.h"
 #include "settings.h"
 #include "rs_units.h"
 
@@ -55,7 +55,7 @@ CoordinateWidget::~CoordinateWidget()
 {
 }
 
-void CoordinateWidget::setGraphic(RS_Graphic * graphic)
+void CoordinateWidget::setGraphic(Drawing * graphic)
 {
        this->graphic = graphic;
        setCoordinates(Vector(0.0, 0.0), Vector(0.0, 0.0), true);
index ee228a590809782057edfd14423e6cf82418088c..1dfee98752b33a5ff60d6f0b55876a74fb40eb0a 100644 (file)
@@ -4,7 +4,7 @@
 #include "ui_coordinatewidget.h"
 #include "rs.h"
 
-class RS_Graphic;
+class Drawing;
 class Vector;
 
 class CoordinateWidget: public QWidget
@@ -16,12 +16,12 @@ class CoordinateWidget: public QWidget
                ~CoordinateWidget();
 
        public slots:
-               void setGraphic(RS_Graphic * graphic);
+               void setGraphic(Drawing * graphic);
                void setCoordinates(const Vector & abs, const Vector & rel, bool updateFormat);
                void setCoordinates(double x, double y, double rx, double ry, bool updateFormat);
 
        private:
-               RS_Graphic * graphic;
+               Drawing * graphic;
                int prec;
                RS2::LinearFormat format;
                int aprec;
index a36bc191cd2878dfc13aa0b66fe99fad05527982..83c3a18fa16e6831625de528815322a198ed6458 100644 (file)
@@ -35,7 +35,7 @@ void DlgAttributes::setData(RS_AttributesData * data, RS_LayerList & layerList)
        //pen = line->getPen();
        ui.wPen->setPen(data->pen, true, true, "Pen");
 
-       //RS_Graphic* graphic = line->getGraphic();
+       //Drawing* graphic = line->getGraphic();
        //if (graphic!=NULL) {
        ui.cbLayer->init(layerList, false, true);
        //}
index b498ad592e902c4cd438c01aec14e1eebb436176..320777a0aafcebee2a8449d2c0358867fb185063 100644 (file)
@@ -16,7 +16,7 @@
 #include "rs.h"
 #include "rs_debug.h"
 #include "rs_filterdxf.h"
-#include "rs_graphic.h"
+#include "drawing.h"
 #include "rs_math.h"
 #include "rs_units.h"
 #include "vector.h"
@@ -126,7 +126,7 @@ DlgOptionsDrawing::~DlgOptionsDrawing()
 /**
 * Sets the graphic and updates the GUI to match the drawing.
 */
-void DlgOptionsDrawing::setGraphic(RS_Graphic * g)
+void DlgOptionsDrawing::setGraphic(Drawing * g)
 {
        graphic = g;
 
index 92d76bc993aacd91003e50a19ceed36b15b89a68..c0c7103ab2df3b9c97c4223754c01bcf145cbf90 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "ui_dlgoptionsdrawing.h"
 
-class RS_Graphic;
+class Drawing;
 
 class DlgOptionsDrawing: public QDialog
 {
@@ -14,7 +14,7 @@ class DlgOptionsDrawing: public QDialog
                ~DlgOptionsDrawing();
 
        public slots:
-               void setGraphic(RS_Graphic * g);
+               void setGraphic(Drawing * g);
                void validate();
                void updateLengthPrecision();
                void updateAnglePrecision();
@@ -24,7 +24,7 @@ class DlgOptionsDrawing: public QDialog
 
        private:
                QStringList listPrec1;
-               RS_Graphic * graphic;
+               Drawing * graphic;
 
        private:
                Ui::DlgOptionsDrawing ui;
index 193914e9941e8158fddbdb5cd6a6925814817e5d..77f2b78b2445e4ff81020750ba5d482b8e26d2c3 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "librarywidget.h"
 
-#include "rs_graphic.h"
+#include "drawing.h"
 #include "rs_staticgraphicview.h"
 #include "rs_system.h"
 #include "paintintf.h"
@@ -385,7 +385,7 @@ QString LibraryWidget::getPathToPixmap(const QString & dir, const QString & dxfF
        qpntr.eraseRect(0, 0, 128, 128);
 
        RS_StaticGraphicView gv(128, 128, painter);
-       RS_Graphic graphic;
+       Drawing graphic;
 
        if (graphic.open(dxfPath, RS2::FormatUnknown))
        {
index 3c0a154addb8199b70feae5b6beafe8c445d8580..5bbc2ebdd7c6d5d6a0ede16091f0e22bad6c3cd6 100644 (file)
@@ -366,7 +366,7 @@ QStringList handleArgs(int argc, char * argv[])
        if (machine.isEmpty() == false && input.isEmpty() == false && output.isEmpty() == false)
        {
                RS_FilterCAM fc;
-               RS_Graphic gr;
+               Drawing gr;
                RS_FILEIO->fileImport(gr, input, RS2::FormatUnknown);
                RS_CamDialog dlg(gr, NULL);
                dlg.activateMachineGenerator(machine);
index 6aea0849501d797dcf4c0f385fa8fada5148dc4c..1c762552b1539d9533ddded7aa4cd214e48a8020 100644 (file)
@@ -1872,7 +1872,7 @@ void QC_ApplicationWindow::slotCamExportAuto() {
 
     RS_Document* d = getDocument();
     if (d!=NULL) {
-        RS_Graphic* graphic = (RS_Graphic*)d;
+        Drawing* graphic = (Drawing*)d;
 
         RS_CamDialog dlg(graphic, this);
         dlg.exec();
@@ -1931,7 +1931,7 @@ QC_MDIWindow * QC_ApplicationWindow::slotFileNew(RS_Document * doc)
 
        // only graphics offer block lists, blocks don't
        RS_DEBUG->print("  adding listeners");
-       RS_Graphic * graphic = w->getDocument()->getGraphic();
+       Drawing * graphic = w->getDocument()->getGraphic();
 
        if (graphic != NULL)
        {
@@ -2358,7 +2358,7 @@ bool QC_ApplicationWindow::slotFileExport(const QString & name, const QString &
                return false;
        }
 
-       RS_Graphic * graphic = w->getDocument()->getGraphic();
+       Drawing * graphic = w->getDocument()->getGraphic();
 
        if (graphic == NULL)
        {
@@ -2490,7 +2490,7 @@ void QC_ApplicationWindow::slotFilePrint()
                return;
        }
 
-       RS_Graphic * graphic = w->getDocument()->getGraphic();
+       Drawing * graphic = w->getDocument()->getGraphic();
 
        if (graphic == NULL)
        {
@@ -2632,7 +2632,7 @@ void QC_ApplicationWindow::slotFilePrintPreview(bool on)
 
                                // only graphics offer block lists, blocks don't
                                RS_DEBUG->print("  adding listeners");
-                               RS_Graphic * graphic = w->getDocument()->getGraphic();
+                               Drawing * graphic = w->getDocument()->getGraphic();
 
                                if (graphic != NULL)
                                {
@@ -2711,7 +2711,7 @@ void QC_ApplicationWindow::slotViewGrid(bool toggle)
 
        if (m != NULL)
        {
-               RS_Graphic * g = m->getGraphic();
+               Drawing * g = m->getGraphic();
 
                if (g != NULL)
                        g->setGridOn(toggle);
@@ -2734,7 +2734,7 @@ void QC_ApplicationWindow::slotViewDraft(bool toggle)
 
     /*QC_MDIWindow* m = getMDIWindow();
     if (m!=NULL) {
-        RS_Graphic* g = m->getGraphic();
+        Drawing* g = m->getGraphic();
         if (g!=NULL) {
             g->setDraftOn(toggle);
         }
@@ -3384,7 +3384,7 @@ void QC_ApplicationWindow::slotTestDrawFreehand()
 {
        RS_DEBUG->print("QC_ApplicationWindow::slotTestDrawFreehand()");
 
-    //RS_Graphic* g = document->getMarking();
+    //Drawing* g = document->getMarking();
     /*
 
        RS_ActionDrawLineFree* action =
@@ -3445,7 +3445,7 @@ void QC_ApplicationWindow::slotTestInsertBlock()
 
        if (d != NULL && d->rtti() == RS2::EntityGraphic)
        {
-               RS_Graphic * graphic = (RS_Graphic *)d;
+               Drawing * graphic = (Drawing *)d;
 
                if (graphic == NULL)
                        return;
@@ -3546,7 +3546,7 @@ void QC_ApplicationWindow::slotTestInsertEllipse()
 
        if (d != NULL)
        {
-               RS_Graphic * graphic = (RS_Graphic *)d;
+               Drawing * graphic = (Drawing *)d;
 
                if (graphic == NULL)
                        return;
@@ -3688,7 +3688,7 @@ void QC_ApplicationWindow::slotTestInsertText()
 
        if (d != NULL)
        {
-               RS_Graphic * graphic = (RS_Graphic *)d;
+               Drawing * graphic = (Drawing *)d;
 
                if (graphic == NULL)
                        return;
@@ -3791,7 +3791,7 @@ void QC_ApplicationWindow::slotTestInsertImage()
 
        if (d != NULL)
        {
-               RS_Graphic * graphic = (RS_Graphic *)d;
+               Drawing * graphic = (Drawing *)d;
 
                if (graphic == NULL)
                        return;
@@ -3818,7 +3818,7 @@ void QC_ApplicationWindow::slotTestUnicode()
     slotFileOpen("./fonts/unicode.cxf", RS2::FormatCXF);
     RS_Document* d = getDocument();
     if (d!=NULL) {
-        RS_Graphic* graphic = (RS_Graphic*)d;
+        Drawing* graphic = (Drawing*)d;
         if (graphic==NULL) {
             return;
         }
@@ -3876,7 +3876,7 @@ void QC_ApplicationWindow::slotTestMath01()
 
     RS_Document* d = getDocument();
     if (d!=NULL) {
-        RS_Graphic* graphic = (RS_Graphic*)d;
+        Drawing* graphic = (Drawing*)d;
         if (graphic==NULL) {
             return;
         }
index 90ae5ee56ccf99d8eb8adc88da37abebb3998188..f1173f86951026d93cdd52601dbc9308d9e7cc56 100644 (file)
@@ -224,7 +224,7 @@ void QC_MDIWindow::initDoc(RS_Document * doc)
 
        if (doc == NULL)
        {
-               document = new RS_Graphic();
+               document = new Drawing();
                document->newDoc();
                owner = true;
        }
@@ -487,7 +487,7 @@ RS_Document * QC_MDIWindow::getDocument()
 }
 
 /** @return Pointer to graphic or NULL */
-RS_Graphic * QC_MDIWindow::getGraphic()
+Drawing * QC_MDIWindow::getGraphic()
 {
        return document->getGraphic();
 }
index e0dd4144a490f1256df8eb2627de79f775daf435..e07ed7fae2a1ec67834a76fdf9d5643090ee49b4 100644 (file)
@@ -39,7 +39,7 @@ class QC_MDIWindow: public QMdiSubWindow
        public:
                QC_GraphicView * getGraphicView();
                RS_Document * getDocument();
-               RS_Graphic * getGraphic();
+               Drawing * getGraphic();
                RS_EventHandler * getEventHandler();
 
                void addChildWindow(QC_MDIWindow * w);
index e267e6a3417678f75267381a025012d3b491d47c..f698cdb363eb8c51ee613894c441f844d6ba4f5b 100644 (file)
 
 #include "qg_dialogfactory.h"
 
+#include "qg_layerwidget.h"
+#include "qg_mainwindowinterface.h"
+#include "rs_actiondimlinear.h"
+#include "rs_actioninterface.h"
+#include "rs_document.h"
 #include "rs_patternlist.h"
 #include "settings.h"
 #include "rs_system.h"
-#include "rs_actioninterface.h"
-#include "rs_document.h"
-#include "rs_actiondimlinear.h"
+#include "rs_text.h"
 
 #if 0
 #include "ui/qg_arcoptions.h"
 #include "rs_camdialog.h"
 #endif
 
-#include "qg_layerwidget.h"
-#include "qg_mainwindowinterface.h"
-
 //QG_DialogFactory* QG_DialogFactory::uniqueInstance = NULL;
 
 /**
@@ -1877,9 +1877,179 @@ bool QG_DialogFactory::requestRotate2Dialog(RS_Rotate2Data & data)
        return false;
 }
 
+/**
+ * Shows a dialog to edit the given entity.
+ */
 bool QG_DialogFactory::requestModifyEntityDialog(RS_Entity * entity)
 {
-       return false;
+       if (entity == NULL)
+               return false;
+
+       bool ret = false;
+
+       switch (entity->rtti())
+       {
+//NOTE: These #if 0's are put here until these missing dialogs can be ported to Qt4.
+#if 0
+       case RS2::EntityPoint:
+       {
+               QG_DlgPoint dlg(parent);
+               dlg.setPoint(*((RS_Point *)entity));
+
+               if (dlg.exec())
+               {
+                       dlg.updatePoint();
+                       ret = true;
+               }
+       }
+               break;
+
+       case RS2::EntityLine:
+       {
+               QG_DlgLine dlg(parent);
+               dlg.setLine(*((RS_Line *)entity));
+
+               if (dlg.exec())
+               {
+                       dlg.updateLine();
+                       ret = true;
+               }
+       }
+               break;
+
+       case RS2::EntityArc:
+       {
+               QG_DlgArc dlg(parent);
+               dlg.setArc(*((RS_Arc *)entity));
+
+               if (dlg.exec())
+               {
+                       dlg.updateArc();
+                       ret = true;
+               }
+       }
+               break;
+
+       case RS2::EntityCircle:
+       {
+               QG_DlgCircle dlg(parent);
+               dlg.setCircle(*((RS_Circle *)entity));
+
+               if (dlg.exec())
+               {
+                       dlg.updateCircle();
+                       ret = true;
+               }
+       }
+               break;
+
+       case RS2::EntityEllipse:
+       {
+               QG_DlgEllipse dlg(parent);
+               dlg.setEllipse(*((RS_Ellipse *)entity));
+
+               if (dlg.exec())
+               {
+                       dlg.updateEllipse();
+                       ret = true;
+               }
+       }
+               break;
+
+       case RS2::EntitySpline:
+       {
+               QG_DlgSpline dlg(parent);
+               dlg.setSpline(*((RS_Spline *)entity));
+
+               if (dlg.exec())
+               {
+                       dlg.updateSpline();
+                       ret = true;
+               }
+       }
+               break;
+
+       case RS2::EntityInsert:
+       {
+               QG_DlgInsert dlg(parent);
+               dlg.setInsert(*((RS_Insert *)entity));
+
+               if (dlg.exec())
+               {
+                       dlg.updateInsert();
+                       ret = true;
+                       entity->update();
+               }
+       }
+               break;
+
+       case RS2::EntityDimAligned:
+       case RS2::EntityDimAngular:
+       case RS2::EntityDimDiametric:
+       case RS2::EntityDimRadial:
+       {
+               QG_DlgDimension dlg(parent);
+               dlg.setDim(*((RS_Dimension *)entity));
+
+               if (dlg.exec())
+               {
+                       dlg.updateDim();
+                       ret = true;
+                       ((RS_Dimension *)entity)->update(true);
+               }
+       }
+               break;
+
+       case RS2::EntityDimLinear:
+       {
+               QG_DlgDimLinear dlg(parent);
+               dlg.setDim(*((RS_DimLinear *)entity));
+
+               if (dlg.exec())
+               {
+                       dlg.updateDim();
+                       ret = true;
+                       ((RS_DimLinear *)entity)->update(true);
+               }
+       }
+               break;
+#endif
+
+       case RS2::EntityText:
+       {
+               DlgText dlg(parent);
+               dlg.setText(*((RS_Text *)entity), false);
+
+               if (dlg.exec())
+               {
+                       dlg.updateText();
+                       ret = true;
+                       ((RS_Text *)entity)->update();
+               }
+       }
+               break;
+
+#if 0
+       case RS2::EntityHatch:
+       {
+               QG_DlgHatch dlg(parent);
+               dlg.setHatch(*((RS_Hatch *)entity), false);
+
+               if (dlg.exec())
+               {
+                       dlg.updateHatch();
+                       ret = true;
+                       ((RS_Hatch *)entity)->update();
+               }
+       }
+               break;
+#endif
+
+       default:
+               break;
+       }
+
+       return ret;
 }
 
  /*
@@ -1918,7 +2088,7 @@ bool QG_DialogFactory::requestHatchDialog(RS_Hatch * hatch)
 /**
  * Shows a dialog for CAM options.
  */
-bool QG_DialogFactory::requestCamOptionsDialog(RS_Graphic& graphic)
+bool QG_DialogFactory::requestCamOptionsDialog(Drawing& graphic)
 {
        RS_DEBUG->print("QG_DialogFactory::requestCamOptionsDialog");
        RS_CamDialog dlg(graphic, parent);
@@ -1947,7 +2117,7 @@ void QG_DialogFactory::requestOptionsGeneralDialog()
 /**
  * Shows dialog for drawing options.
  */
-void QG_DialogFactory::requestOptionsDrawingDialog(RS_Graphic & graphic)
+void QG_DialogFactory::requestOptionsDrawingDialog(Drawing & graphic)
 {
        DlgOptionsDrawing dlg(parent);
        dlg.setGraphic(&graphic);
index 5fff2cf87fc3b307ca418cde77d05fa5645622a7..aee54b575fa2a59e133088a771e699ebeb216094 100644 (file)
@@ -106,11 +106,11 @@ class QG_DialogFactory: public RS_DialogFactoryInterface
                virtual bool requestHatchDialog(RS_Hatch * hatch);
 
 #ifdef RS_CAM
-               virtual bool requestCamOptionsDialog(RS_Graphic & graphic);
+               virtual bool requestCamOptionsDialog(Drawing & graphic);
 #endif
 
                virtual void requestOptionsGeneralDialog();
-               virtual void requestOptionsDrawingDialog(RS_Graphic & graphic);
+               virtual void requestOptionsDrawingDialog(Drawing & graphic);
 
                virtual void requestPreviousMenu();
 
index dabf93ffbe4af72a98ed6ef89561808bb41cdc93..26e1b69332a5c4c324dff9aa2c48604c6f67a264 100644 (file)
@@ -17,7 +17,7 @@
 #include "qg_graphicview.h"
 #include "settings.h"
 #include "rs_system.h"
-#include "rs_graphic.h"
+#include "drawing.h"
 
 /**
  * Shows a dialog for choosing a file name. Saving the file is up to
@@ -200,7 +200,7 @@ QString QG_FileDialog::getOpenFileName(QWidget * parent, RS2::FormatType * type)
        fileDlg->selectNameFilter(defFilter);
 
        // preview:
-       RS_Graphic * gr = new RS_Graphic;
+       Drawing * gr = new Drawing;
        QG_GraphicView * prev = new QG_GraphicView(parent);
        prev->setContainer(gr);
        prev->setBorders(1, 1, 1, 1);
index b7d010ca178f4b2f4ebce28c3842c35a7e19ac20..c26d8af1710d6aca3b10245762dd301d2bad8884 100644 (file)
@@ -19,7 +19,7 @@
 #include "rs_actionzoomscroll.h"
 #include "rs_actionmodifydelete.h"
 #include "rs_actionselectsingle.h"
-#include "rs_graphic.h"
+#include "drawing.h"
 #include "settings.h"
 #include "rs_system.h"
 #include "rs_patternlist.h"
@@ -1010,13 +1010,13 @@ of VectorWorks & etc. as well...
  */
 void QG_GraphicView::previewUrl(const Q3Url & u)
 {
-       //static RS_Graphic* gr = new RS_Graphic();
+       //static Drawing* gr = new Drawing();
 
        RS_DEBUG->print("QG_GraphicView::previewUrl");
 
        if (container != NULL && container->rtti() == RS2::EntityGraphic)
        {
-               ((RS_Graphic *)container)->open(u.path(), RS2::FormatUnknown);
+               ((Drawing *)container)->open(u.path(), RS2::FormatUnknown);
                zoomAuto();
        }
        //setContainer(gr);