X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fbase%2Fdrawing.h;h=3163070798c9216f211a9b9d6721becad9a9fdce;hb=2ee84c5948ede7fc2f7b4435c5edef42a030ac05;hp=22b22177e1578b235b87df493eb356f7c85d5666;hpb=89e127aa3dbd74d3158e6dbe0ca1703420c04395;p=architektonas diff --git a/src/base/drawing.h b/src/base/drawing.h index 22b2217..3163070 100644 --- a/src/base/drawing.h +++ b/src/base/drawing.h @@ -1,12 +1,12 @@ -#ifndef RS_GRAPHIC_H -#define RS_GRAPHIC_H +#ifndef __GRAPHIC_H__ +#define __GRAPHIC_H__ -#include "rs_blocklist.h" -#include "rs_layerlist.h" -#include "rs_variabledict.h" -#include "rs_document.h" +#include "blocklist.h" +#include "layerlist.h" +#include "variabledict.h" +#include "document.h" #ifdef RS_CAM -#include "rs_camdata.h" +#include "camdata.h" #endif //class RS_CamData; @@ -16,116 +16,107 @@ * * @author Andrew Mustun */ -class Drawing: public RS_Document +class Drawing: public Document { -public: - Drawing(RS_EntityContainer * parent = NULL); - virtual ~Drawing(); - - virtual RS2::EntityType rtti() const; - virtual unsigned long int countLayerEntities(RS_Layer * layer); - virtual RS_LayerList * getLayerList(); - virtual RS_BlockList * getBlockList(); - virtual void newDoc(); - virtual bool save(); - virtual bool saveAs(const QString& filename, RS2::FormatType type); - virtual bool open(const QString& filename, RS2::FormatType type); - - // Wrappers for Layer functions: - void clearLayers(); - uint countLayers() const; - RS_Layer * layerAt(uint i); - void activateLayer(const QString & name); - void activateLayer(RS_Layer * layer); - RS_Layer * getActiveLayer(); - virtual void addLayer(RS_Layer * layer); - virtual void removeLayer(RS_Layer * layer); - virtual void editLayer(RS_Layer * layer, const RS_Layer & source); - RS_Layer * findLayer(const QString & name); - void toggleLayer(const QString & name); - void toggleLayer(RS_Layer * layer); - void toggleLayerLock(RS_Layer * layer); - void freezeAllLayers(bool freeze); - void addLayerListListener(RS_LayerListListener * listener); - void removeLayerListListener(RS_LayerListListener * listener); - - // Wrapper for block functions: - void clearBlocks(); - uint countBlocks(); - RS_Block * blockAt(uint i); - void activateBlock(const QString & name); - void activateBlock(RS_Block * block); - RS_Block * getActiveBlock(); - virtual bool addBlock(RS_Block * block, bool notify = true); - virtual void addBlockNotification(); - virtual void removeBlock(RS_Block * block); - RS_Block * findBlock(const QString & name); - QString newBlockName(); - void toggleBlock(const QString & name); - void toggleBlock(RS_Block * block); - void freezeAllBlocks(bool freeze); - void addBlockListListener(RS_BlockListListener * listener); - void removeBlockListListener(RS_BlockListListener * listener); - - // Wrappers for variable functions: - void clearVariables(); - int countVariables(); - void addVariable(const QString & key, const Vector & value, int code); - void addVariable(const QString & key, const QString & value, int code); - void addVariable(const QString & key, int value, int code); - void addVariable(const QString & key, double value, int code); - Vector getVariableVector(const QString & key, const Vector & def); - QString getVariableString(const QString & key, const QString & def); - int getVariableInt(const QString & key, int def); - double getVariableDouble(const QString & key, double def); - void removeVariable(const QString & key); -// Q3Dict & getVariableDict(); - QMultiHash & getVariableDict(); - - RS2::LinearFormat getLinearFormat(); - int getLinearPrecision(); - RS2::AngleFormat getAngleFormat(); - int getAnglePrecision(); - - Vector getPaperSize(); - void setPaperSize(const Vector & s); - - Vector getPaperInsertionBase(); - void setPaperInsertionBase(const Vector & p); - - RS2::PaperFormat getPaperFormat(bool * landscape); - void setPaperFormat(RS2::PaperFormat f, bool landscape); - - double getPaperScale(); - void setPaperScale(double s); - - virtual void setUnit(RS2::Unit u); - virtual RS2::Unit getUnit(); - - bool isGridOn(); - void setGridOn(bool on); - - bool isDraftOn(); - void setDraftOn(bool on); - - void centerToPage(); - void fitToPage(); - virtual bool isModified() const; - virtual void setModified(bool m); - + public: + Drawing(EntityContainer * parent = NULL); + virtual ~Drawing(); + + virtual RS2::EntityType rtti() const; + virtual unsigned long int countLayerEntities(Layer * layer); + virtual LayerList * getLayerList(); + virtual BlockList * getBlockList(); + virtual void newDoc(); + virtual bool save(); + virtual bool saveAs(const QString& filename, RS2::FormatType type); + virtual bool open(const QString& filename, RS2::FormatType type); + + // Wrappers for Layer functions: + void clearLayers(); + uint countLayers() const; + Layer * layerAt(uint i); + void activateLayer(const QString & name); + void activateLayer(Layer * layer); + Layer * getActiveLayer(); + virtual void addLayer(Layer * layer); + virtual void removeLayer(Layer * layer); + virtual void editLayer(Layer * layer, const Layer & source); + Layer * findLayer(const QString & name); + void toggleLayer(const QString & name); + void toggleLayer(Layer * layer); + void toggleLayerLock(Layer * layer); + void freezeAllLayers(bool freeze); +// void addLayerListListener(LayerListListener * listener); +// void removeLayerListListener(LayerListListener * listener); + + // Wrapper for block functions: + void clearBlocks(); + uint countBlocks(); + Block * blockAt(uint i); + void activateBlock(const QString & name); + void activateBlock(Block * block); + Block * getActiveBlock(); + virtual bool addBlock(Block * block, bool notify = true); + virtual void addBlockNotification(); + virtual void removeBlock(Block * block); + Block * findBlock(const QString & name); + QString newBlockName(); + void toggleBlock(const QString & name); + void toggleBlock(Block * block); + void freezeAllBlocks(bool freeze); +// void addBlockListListener(BlockListListener * listener); +// void removeBlockListListener(BlockListListener * listener); + + // Wrappers for variable functions: + void clearVariables(); + int countVariables(); + void addVariable(const QString & key, const Vector & value, int code); + void addVariable(const QString & key, const QString & value, int code); + void addVariable(const QString & key, int value, int code); + void addVariable(const QString & key, double value, int code); + Vector getVariableVector(const QString & key, const Vector & def); + QString getVariableString(const QString & key, const QString & def); + int getVariableInt(const QString & key, int def); + double getVariableDouble(const QString & key, double def); + void removeVariable(const QString & key); + // Q3Dict & getVariableDict(); + QMultiHash & getVariableDict(); + + RS2::LinearFormat getLinearFormat(); + int getLinearPrecision(); + RS2::AngleFormat getAngleFormat(); + int getAnglePrecision(); + Vector getPaperSize(); + void setPaperSize(const Vector & s); + Vector getPaperInsertionBase(); + void setPaperInsertionBase(const Vector & p); + RS2::PaperFormat getPaperFormat(bool * landscape); + void setPaperFormat(RS2::PaperFormat f, bool landscape); + double getPaperScale(); + void setPaperScale(double s); + virtual void setUnit(RS2::Unit u); + virtual RS2::Unit getUnit(); + bool isGridOn(); + void setGridOn(bool on); + bool isDraftOn(); + void setDraftOn(bool on); + void centerToPage(); + void fitToPage(); + virtual bool isModified() const; + virtual void setModified(bool m); #ifdef RS_CAM - RS_CamData & getCamData(); - void setCamData(const RS_CamData & d); + RS_CamData & getCamData(); + void setCamData(const RS_CamData & d); #endif - friend std::ostream & operator<<(std::ostream & os, Drawing & g); + friend std::ostream & operator<<(std::ostream & os, Drawing & g); -private: - RS_LayerList layerList; - RS_BlockList blockList; - RS_VariableDict variableDict; + private: + LayerList layerList; + BlockList blockList; + VariableDict variableDict; #ifdef RS_CAM - RS_CamData camData; + RS_CamData camData; #endif };