#include "qg_dialogfactory.h"
#include "graphicview.h"
-#include "qg_layerwidget.h"
+#include "layerwidget.h"
#include "qg_mainwindowinterface.h"
#include "actiondimlinear.h"
#include "actioninterface.h"
-#include "rs_blocklist.h"
-#include "rs_document.h"
-#include "rs_hatch.h"
-#include "rs_patternlist.h"
+#include "blocklist.h"
+#include "document.h"
+#include "hatch.h"
+#include "layerlist.h"
+#include "patternlist.h"
#include "settings.h"
-#include "rs_system.h"
-#include "rs_text.h"
+#include "system.h"
+#include "text.h"
#include "arcoptions.h"
#include "arctangentialoptions.h"
#include "linerelangleoptions.h"
#include "mousewidget.h"
#include "moverotateoptions.h"
+#include "polylineoptions.h"
#include "printpreviewoptions.h"
#include "roundoptions.h"
#include "selectionwidget.h"
#include "textoptions.h"
#include "trimamountoptions.h"
-#ifdef RS_PROF
-#include "qg_polylineoptions.h"
-#endif
-
#ifdef RS_CAM
-#include "rs_camdialog.h"
+#include "camdialog.h"
#endif
//QG_DialogFactory* QG_DialogFactory::uniqueInstance = NULL;
*/
//QG_DialogFactory::QG_DialogFactory(QWidget * parent, QWidget * ow):
QG_DialogFactory::QG_DialogFactory(QWidget * parent, QToolBar * ow):
- RS_DialogFactoryInterface()
+ DialogFactoryInterface()
{
- RS_DEBUG->print("QG_DialogFactory::QG_DialogFactory");
+ DEBUG->print("QG_DialogFactory::QG_DialogFactory");
this->parent = parent;
setOptionWidget(ow);
cadToolBar = NULL;
commandWidget = NULL;
mainWindow = NULL;
- RS_DEBUG->print("QG_DialogFactory::QG_DialogFactory: OK");
+ DEBUG->print("QG_DialogFactory::QG_DialogFactory: OK");
}
/**
*/
QG_DialogFactory::~QG_DialogFactory()
{
- RS_DEBUG->print("QG_DialogFactory::~QG_DialogFactory");
- RS_DEBUG->print("QG_DialogFactory::~QG_DialogFactory: OK");
+ DEBUG->print("QG_DialogFactory::~QG_DialogFactory");
+ DEBUG->print("QG_DialogFactory::~QG_DialogFactory: OK");
}
/**
///*virtual*/ void QG_DialogFactory::setOptionWidget(QWidget * ow)
/*virtual*/ void QG_DialogFactory::setOptionWidget(QToolBar * ow)
{
- RS_DEBUG->print("QG_DialogFactory::setOptionWidget");
+ DEBUG->print("QG_DialogFactory::setOptionWidget");
optionWidget = ow;
- RS_DEBUG->print("QG_DialogFactory::setOptionWidget: OK");
+ DEBUG->print("QG_DialogFactory::setOptionWidget: OK");
}
/**
/**
* Requests a new document from the main window.
*/
-GraphicView * QG_DialogFactory::requestNewDocument(const QString & fileName, RS_Document * doc)
+GraphicView * QG_DialogFactory::requestNewDocument(const QString & fileName, Document * doc)
{
if (mainWindow != NULL)
{
* @return a pointer to the newly created layer that
* should be added.
*/
-RS_Layer * QG_DialogFactory::requestNewLayerDialog(RS_LayerList * layerList)
+Layer * QG_DialogFactory::requestNewLayerDialog(LayerList * layerList)
{
- RS_Layer * layer = NULL;
+ Layer * layer = NULL;
QString layer_name = "noname";
int i = 2;
}
// Layer for parameter livery
- layer = new RS_Layer(layer_name);
+ layer = new Layer(layer_name);
// QG_LayerDialog dlg(parent, "Layer Dialog");
LayerDialog dlg(parent);
*
* @return a pointer to the layer that should be removed.
*/
-RS_Layer * QG_DialogFactory::requestLayerRemovalDialog(RS_LayerList * layerList)
+Layer * QG_DialogFactory::requestLayerRemovalDialog(LayerList * layerList)
{
- RS_Layer * layer = NULL;
+ Layer * layer = NULL;
if (layerList == NULL)
{
- RS_DEBUG->print(RS_Debug::D_WARNING,
+ DEBUG->print(Debug::D_WARNING,
"QG_DialogFactory::requestLayerRemovalDialog(): layerList is NULL");
return NULL;
/*
if (layerList==NULL) {
if (container!=NULL && container->rtti()==RS2::EntityGraphic) {
- layerList = (RS_LayerList*)container;
+ layerList = (LayerList*)container;
} else {
return NULL;
}
* @return A pointer to a new layer with the changed attributes
* or NULL if the dialog was cancelled.
*/
-RS_Layer * QG_DialogFactory::requestEditLayerDialog(RS_LayerList * layerList)
+Layer * QG_DialogFactory::requestEditLayerDialog(LayerList * layerList)
{
- RS_DEBUG->print("QG_DialogFactory::requestEditLayerDialog");
- RS_Layer * layer = NULL;
- /*
- if (layerList==NULL) {
- if (container!=NULL && container->rtti()==RS2::EntityGraphic) {
- layerList = (RS_LayerList*)container;
- } else {
- return NULL;
- }
- }
- */
+ DEBUG->print("QG_DialogFactory::requestEditLayerDialog");
+ Layer * layer = NULL;
- if (layerList == NULL)
+ if (!layerList)
{
- RS_DEBUG->print(RS_Debug::D_WARNING, "QG_DialogFactory::requestEditLayerDialog(): "
+ DEBUG->print(Debug::D_WARNING, "QG_DialogFactory::requestEditLayerDialog(): "
"layerList is NULL");
return NULL;
}
// Layer for parameter livery
- if (layerList->getActive() != NULL)
+ if (layerList->getActive())
{
- layer = new RS_Layer(*layerList->getActive());
+ layer = new Layer(*layerList->getActive());
// QG_LayerDialog dlg(parent, QMessageBox::tr("Layer Dialog"));
LayerDialog dlg(parent);
* @return a pointer to the newly created block that
* should be added.
*/
-RS_BlockData QG_DialogFactory::requestNewBlockDialog(RS_BlockList * blockList)
+BlockData QG_DialogFactory::requestNewBlockDialog(BlockList * blockList)
{
- //RS_Block* block = NULL;
- RS_BlockData ret;
- ret = RS_BlockData("", Vector(false), false);
+ //Block* block = NULL;
+ BlockData ret;
+ ret = BlockData("", Vector(false), false);
if (blockList == NULL)
{
- RS_DEBUG->print(RS_Debug::D_WARNING, "QG_DialogFactory::requestNewBlockDialog(): "
+ DEBUG->print(Debug::D_WARNING, "QG_DialogFactory::requestNewBlockDialog(): "
"blockList is NULL");
return ret;
}
// Block for parameter livery
- //block = new RS_Block(container, "noname", Vector(0.0,0.0));
+ //block = new Block(container, "noname", Vector(0.0,0.0));
BlockDialog dlg(parent);
dlg.setBlockList(blockList);
*
* @return a pointer to the modified block or NULL on cancellation.
*/
-RS_BlockData QG_DialogFactory::requestBlockAttributesDialog(RS_BlockList * blockList)
+BlockData QG_DialogFactory::requestBlockAttributesDialog(BlockList * blockList)
{
- //RS_Block* block = NULL;
- RS_BlockData ret;
- ret = RS_BlockData("", Vector(false), false);
+ //Block* block = NULL;
+ BlockData ret;
+ ret = BlockData("", Vector(false), false);
if (blockList == NULL)
{
- RS_DEBUG->print(RS_Debug::D_WARNING, "QG_DialogFactory::requestBlockAttributesDialog(): "
+ DEBUG->print(Debug::D_WARNING, "QG_DialogFactory::requestBlockAttributesDialog(): "
"blockList is NULL");
return ret;
}
/*
if (blockList==NULL) {
if (container!=NULL && container->rtti()==RS2::EntityGraphic) {
- blockList = (RS_BlockList*)container;
+ blockList = (BlockList*)container;
} else {
return NULL;
}
ret = dlg.getBlockData();
}
//else {
- // ret = RS_BlockData("", Vector(false));
+ // ret = BlockData("", Vector(false));
//}
return ret;
}
-/*virtual*/ void QG_DialogFactory::requestEditBlockWindow(RS_BlockList * /*blockList*/)
+/*virtual*/ void QG_DialogFactory::requestEditBlockWindow(BlockList * /*blockList*/)
{
}
-/*virtual*/ void QG_DialogFactory::closeEditBlockWindow(RS_Block * /*blockList*/)
+/*virtual*/ void QG_DialogFactory::closeEditBlockWindow(Block * /*blockList*/)
{
}
*
* @return a pointer to the block that should be removed.
*/
-RS_Block * QG_DialogFactory::requestBlockRemovalDialog(RS_BlockList * blockList)
+Block * QG_DialogFactory::requestBlockRemovalDialog(BlockList * blockList)
{
- RS_Block * block = NULL;
+ Block * block = NULL;
if (blockList == NULL)
{
- RS_DEBUG->print(RS_Debug::D_WARNING, "QG_DialogFactory::requestBlockRemovalDialog(): "
+ DEBUG->print(Debug::D_WARNING, "QG_DialogFactory::requestBlockRemovalDialog(): "
"blockList is NULL");
return NULL;
}
// read default settings:
RS_SETTINGS->beginGroup("/Paths");
QString defDir = RS_SETTINGS->readEntry("/Save",
- RS_SYSTEM->getHomeDir());
+ SYSTEM->getHomeDir());
QString defFilter = RS_SETTINGS->readEntry("/SaveFilter",
"Drawing Exchange (*.dxf)");
RS_SETTINGS->endGroup();
// read default settings:
settings.beginGroup("Paths");
- QString defDir = settings.value("OpenImage", RS_SYSTEM->getHomeDir()).toString();
+ QString defDir = settings.value("OpenImage", SYSTEM->getHomeDir()).toString();
QString defFilter = settings.value("ImageFilter", "Portable Network Graphic (*.png)").toString();
settings.endGroup();
void QG_DialogFactory::requestOptions(ActionInterface * action, bool on, bool update)
{
- RS_DEBUG->print("QG_DialogFactory::requestOptions");
+ DEBUG->print("QG_DialogFactory::requestOptions");
if (action == NULL)
{
- RS_DEBUG->print(RS_Debug::D_WARNING, "QG_DialogFactory::requestOptions: action is NULL");
+ DEBUG->print(Debug::D_WARNING, "QG_DialogFactory::requestOptions: action is NULL");
return;
}
break;
case RS2::ActionDrawLine:
- RS_DEBUG->print("QG_DialogFactory::requestOptions: line");
+ DEBUG->print("QG_DialogFactory::requestOptions: line");
requestLineOptions(action, on);
- RS_DEBUG->print("QG_DialogFactory::requestOptions: line: OK");
+ DEBUG->print("QG_DialogFactory::requestOptions: line: OK");
break;
case RS2::ActionDrawPolyline:
break;
}
- RS_DEBUG->print("QG_DialogFactory::requestOptions: OK");
+ DEBUG->print("QG_DialogFactory::requestOptions: OK");
}
/**
toolWidget->setAction(action);
}
- RS_DEBUG->print("QG_DialogFactory::requestLineOptions: OK");
+ DEBUG->print("QG_DialogFactory::requestLineOptions: OK");
}
/**
*/
void QG_DialogFactory::requestPolylineOptions(ActionInterface * action, bool on, bool update)
{
-#ifdef RS_PROF
static PolylineOptions * toolWidget = NULL;
if (!optionWidget)
toolWidget = new PolylineOptions(optionWidget);
toolWidget->setAction(action, update);
}
-#endif
}
/**
*/
void QG_DialogFactory::requestToolBar(RS2::ToolBarId id)
{
- if (cadToolBar != NULL)
+ if (cadToolBar)
cadToolBar->showToolBar(id);
}
* Shows a dialog to edit the attributes of the given dimension entity.
*/
/*
-bool QG_DialogFactory::requestDimAlignedDialog(RS_DimAligned* dim) {
+bool QG_DialogFactory::requestDimAlignedDialog(DimAligned* dim) {
if (dim==NULL) {
return false;
}
/**
* Shows attributes options dialog presenting the given data.
*/
-bool QG_DialogFactory::requestAttributesDialog(RS_AttributesData & data, RS_LayerList & layerList)
+bool QG_DialogFactory::requestAttributesDialog(AttributesData & data, LayerList & layerList)
{
DlgAttributes dlg(parent);
dlg.setData(&data, layerList);
/**
* Shows move options dialog presenting the given data.
*/
-bool QG_DialogFactory::requestMoveDialog(RS_MoveData & data)
+bool QG_DialogFactory::requestMoveDialog(MoveData & data)
{
DlgMove dlg(parent);
dlg.setData(&data);
/**
* Shows rotate options dialog presenting the given data.
*/
-bool QG_DialogFactory::requestRotateDialog(RS_RotateData & data)
+bool QG_DialogFactory::requestRotateDialog(RotateData & data)
{
DlgRotate dlg(parent);
dlg.setData(&data);
/**
* Shows scale options dialog presenting the given data.
*/
-bool QG_DialogFactory::requestScaleDialog(RS_ScaleData & data)
+bool QG_DialogFactory::requestScaleDialog(ScaleData & data)
{
DlgScale dlg(parent);
dlg.setData(&data);
/**
* Shows mirror options dialog presenting the given data.
*/
-bool QG_DialogFactory::requestMirrorDialog(RS_MirrorData & data)
+bool QG_DialogFactory::requestMirrorDialog(MirrorData & data)
{
DlgMirror dlg(parent);
dlg.setData(&data);
/**
* Shows move/rotate options dialog presenting the given data.
*/
-bool QG_DialogFactory::requestMoveRotateDialog(RS_MoveRotateData & data)
+bool QG_DialogFactory::requestMoveRotateDialog(MoveRotateData & data)
{
DlgMoveRotate dlg(parent);
dlg.setData(&data);
/**
* Shows rotate around two centers options dialog presenting the given data.
*/
-bool QG_DialogFactory::requestRotate2Dialog(RS_Rotate2Data & data)
+bool QG_DialogFactory::requestRotate2Dialog(Rotate2Data & data)
{
DlgRotate2 dlg(parent);
dlg.setData(&data);
/**
* Shows a dialog to edit the given entity.
*/
-bool QG_DialogFactory::requestModifyEntityDialog(RS_Entity * entity)
+bool QG_DialogFactory::requestModifyEntityDialog(Entity * entity)
{
if (entity == NULL)
return false;
case RS2::EntityPoint:
{
DlgPoint dlg(parent);
- dlg.setPoint(*((RS_Point *)entity));
+ dlg.setPoint(*((Point *)entity));
if (dlg.exec())
{
case RS2::EntityLine:
{
DlgLine dlg(parent);
- dlg.setLine(*((RS_Line *)entity));
+ dlg.setLine(*((Line *)entity));
if (dlg.exec())
{
case RS2::EntityArc:
{
DlgArc dlg(parent);
- dlg.setArc(*((RS_Arc *)entity));
+ dlg.setArc(*((Arc *)entity));
if (dlg.exec())
{
case RS2::EntityCircle:
{
DlgCircle dlg(parent);
- dlg.setCircle(*((RS_Circle *)entity));
+ dlg.setCircle(*((Circle *)entity));
if (dlg.exec())
{
case RS2::EntityEllipse:
{
DlgEllipse dlg(parent);
- dlg.setEllipse(*((RS_Ellipse *)entity));
+ dlg.setEllipse(*((Ellipse *)entity));
if (dlg.exec())
{
case RS2::EntitySpline:
{
DlgSpline dlg(parent);
- dlg.setSpline(*((RS_Spline *)entity));
+ dlg.setSpline(*((Spline *)entity));
if (dlg.exec())
{
case RS2::EntityInsert:
{
DlgInsert dlg(parent);
- dlg.setInsert(*((RS_Insert *)entity));
+ dlg.setInsert(*((Insert *)entity));
if (dlg.exec())
{
case RS2::EntityDimRadial:
{
DlgDimension dlg(parent);
- dlg.setDim(*((RS_Dimension *)entity));
+ dlg.setDim(*((Dimension *)entity));
if (dlg.exec())
{
dlg.updateDim();
ret = true;
- ((RS_Dimension *)entity)->update(true);
+ ((Dimension *)entity)->update(true);
}
}
break;
case RS2::EntityDimLinear:
{
DlgDimLinear dlg(parent);
- dlg.setDim(*((RS_DimLinear *)entity));
+ dlg.setDim(*((DimLinear *)entity));
if (dlg.exec())
{
dlg.updateDim();
ret = true;
- ((RS_DimLinear *)entity)->update(true);
+ ((DimLinear *)entity)->update(true);
}
}
break;
case RS2::EntityText:
{
DlgText dlg(parent);
- dlg.setText(*((RS_Text *)entity), false);
+ dlg.setText(*((Text *)entity), false);
if (dlg.exec())
{
dlg.updateText();
ret = true;
- ((RS_Text *)entity)->update();
+ ((Text *)entity)->update();
}
}
break;
case RS2::EntityHatch:
{
DlgHatch dlg(parent);
- dlg.setHatch(*((RS_Hatch *)entity), false);
+ dlg.setHatch(*((Hatch *)entity), false);
if (dlg.exec())
{
dlg.updateHatch();
ret = true;
- ((RS_Hatch *)entity)->update();
+ ((Hatch *)entity)->update();
}
}
break;
}
/*
-bool QG_DialogFactory::requestDimAlignedDialog(RS_DimAligned* dim) {
+bool QG_DialogFactory::requestDimAlignedDialog(DimAligned* dim) {
return false;
}
*/
/**
* Shows a dialog to edit the attributes of the given text entity.
*/
-bool QG_DialogFactory::requestTextDialog(RS_Text * text)
+bool QG_DialogFactory::requestTextDialog(Text * text)
{
if (text == NULL)
return false;
/**
* Shows a dialog to edit pattern / hatch attributes of the given entity.
*/
-bool QG_DialogFactory::requestHatchDialog(RS_Hatch * hatch)
+bool QG_DialogFactory::requestHatchDialog(Hatch * hatch)
{
if (hatch == NULL)
return false;
- RS_PATTERNLIST->init();
+ PATTERNLIST->init();
DlgHatch dlg(parent);
dlg.setHatch(*hatch, true);
*/
bool QG_DialogFactory::requestCamOptionsDialog(Drawing& graphic)
{
- RS_DEBUG->print("QG_DialogFactory::requestCamOptionsDialog");
+ DEBUG->print("QG_DialogFactory::requestCamOptionsDialog");
RS_CamDialog dlg(graphic, parent);
- RS_DEBUG->print("QG_DialogFactory::requestCamOptionsDialog: exec");
+ DEBUG->print("QG_DialogFactory::requestCamOptionsDialog: exec");
if (dlg.exec())
{
- RS_DEBUG->print("QG_DialogFactory::requestCamOptionsDialog: OK");
+ DEBUG->print("QG_DialogFactory::requestCamOptionsDialog: OK");
return true;
}
- RS_DEBUG->print("QG_DialogFactory::requestCamOptionsDialog: Cancel");
+ DEBUG->print("QG_DialogFactory::requestCamOptionsDialog: Cancel");
return false;
}
#endif
*/
void QG_DialogFactory::commandMessage(const QString& message)
{
- RS_DEBUG->print("QG_DialogFactory::commandMessage");
+ DEBUG->print("QG_DialogFactory::commandMessage");
if (commandWidget != NULL)
commandWidget->appendHistory(message);
- RS_DEBUG->print("QG_DialogFactory::commandMessage: OK");
+ DEBUG->print("QG_DialogFactory::commandMessage: OK");
}
/*virtual*/ bool QG_DialogFactory::isAdapter()