From d7becda4eb4268c2fe6502876eaab91b7e014236 Mon Sep 17 00:00:00 2001 From: dismine Date: Wed, 6 Nov 2013 15:34:54 +0200 Subject: [PATCH] Change in structure of project file. --HG-- branch : develop --- Valentina.pro | 260 +++---------------- container/container.pri | 13 + dialogs/dialogs.pri | 62 +++++ exception/exception.pri | 17 ++ geometry/geometry.pri | 15 ++ tools/drawTools/drawTools.pri | 40 +++ tools/modelingTools/modelingTools.pri | 38 +++ tools/modelingTools/modelingtools.h | 1 - tools/modelingTools/vmodelingsinglepoint.cpp | 93 ------- tools/modelingTools/vmodelingsinglepoint.h | 29 --- tools/nodeDetails/nodeDetails.pri | 14 + tools/tools.pri | 14 + tools/vgraphicspoint.cpp | 39 --- tools/vgraphicspoint.h | 35 --- widgets/delegate.cpp | 90 ------- widgets/widgets.pri | 19 ++ xml/xml.pri | 7 + 17 files changed, 277 insertions(+), 509 deletions(-) create mode 100644 container/container.pri create mode 100644 dialogs/dialogs.pri create mode 100644 exception/exception.pri create mode 100644 geometry/geometry.pri create mode 100644 tools/drawTools/drawTools.pri create mode 100644 tools/modelingTools/modelingTools.pri delete mode 100644 tools/modelingTools/vmodelingsinglepoint.cpp delete mode 100644 tools/modelingTools/vmodelingsinglepoint.h create mode 100644 tools/nodeDetails/nodeDetails.pri create mode 100644 tools/tools.pri delete mode 100644 tools/vgraphicspoint.cpp delete mode 100644 tools/vgraphicspoint.h delete mode 100644 widgets/delegate.cpp create mode 100644 widgets/widgets.pri create mode 100644 xml/xml.pri diff --git a/Valentina.pro b/Valentina.pro index b523128a3..1de130512 100644 --- a/Valentina.pro +++ b/Valentina.pro @@ -8,231 +8,19 @@ QT += core gui widgets xml svg -TARGET = Valentina TEMPLATE = app + +DEBUG_TARGET = Valentinad +RELEASE_TARGET = Valentina + CONFIG -= debug_and_release debug_and_release_target CONFIG += c++11 precompile_header + QMAKE_CXX = ccache g++ +#DEFINES += ... -SOURCES += main.cpp\ - mainwindow.cpp \ - dialogs/dialogsinglepoint.cpp \ - widgets/vgraphicssimpletextitem.cpp \ - xml/vdomdocument.cpp \ - container/vpointf.cpp \ - container/vcontainer.cpp \ - tools/drawTools/vtoolpoint.cpp \ - container/calculator.cpp \ - dialogs/dialogincrements.cpp \ - container/vstandarttablecell.cpp \ - container/vincrementtablerow.cpp \ - widgets/doubledelegate.cpp \ - dialogs/dialogendline.cpp \ - tools/drawTools/vtoolendline.cpp \ - tools/drawTools/vtoolline.cpp \ - tools/vabstracttool.cpp \ - dialogs/dialogline.cpp \ - tools/drawTools/vtoolalongline.cpp \ - dialogs/dialogtool.cpp \ - dialogs/dialogalongline.cpp \ - tools/drawTools/vtoolshoulderpoint.cpp \ - dialogs/dialogshoulderpoint.cpp \ - tools/drawTools/vtoolnormal.cpp \ - dialogs/dialognormal.cpp \ - tools/drawTools/vtoolbisector.cpp \ - dialogs/dialogbisector.cpp \ - tools/drawTools/vtoollinepoint.cpp \ - tools/drawTools/vtoollineintersect.cpp \ - dialogs/dialoglineintersect.cpp \ - geometry/vspline.cpp \ - tools/drawTools/vtoolsinglepoint.cpp \ - geometry/varc.cpp \ - widgets/vcontrolpointspline.cpp \ - tools/drawTools/vtoolspline.cpp \ - dialogs/dialogspline.cpp \ - tools/drawTools/vtoolarc.cpp \ - dialogs/dialogarc.cpp \ - geometry/vsplinepoint.cpp \ - geometry/vsplinepath.cpp \ - tools/drawTools/vtoolsplinepath.cpp \ - dialogs/dialogsplinepath.cpp \ - widgets/vmaingraphicsscene.cpp \ - widgets/vmaingraphicsview.cpp \ - tools/vdatatool.cpp \ - xml/vtoolrecord.cpp \ - dialogs/dialoghistory.cpp \ - tools/drawTools/vtoolpointofcontact.cpp \ - dialogs/dialogpointofcontact.cpp \ - geometry/vnodedetail.cpp \ - geometry/vdetail.cpp \ - dialogs/dialogdetail.cpp \ - tools/vtooldetail.cpp \ - widgets/vtablegraphicsview.cpp \ - widgets/vitem.cpp \ - tablewindow.cpp \ - tools/nodeDetails/vnodearc.cpp \ - tools/nodeDetails/vnodepoint.cpp \ - tools/nodeDetails/vnodespline.cpp \ - tools/nodeDetails/vnodesplinepath.cpp \ - tools/drawTools/vdrawtool.cpp \ - tools/nodeDetails/vabstractnode.cpp \ - tools/modelingTools/vmodelingtool.cpp \ - tools/modelingTools/vmodelingalongline.cpp \ - tools/modelingTools/vmodelingarc.cpp \ - tools/modelingTools/vmodelingbisector.cpp \ - tools/modelingTools/vmodelingendline.cpp \ - tools/modelingTools/vmodelingline.cpp \ - tools/modelingTools/vmodelinglineintersect.cpp \ - tools/modelingTools/vmodelinglinepoint.cpp \ - tools/modelingTools/vmodelingnormal.cpp \ - tools/modelingTools/vmodelingpoint.cpp \ - tools/modelingTools/vmodelingpointofcontact.cpp \ - tools/modelingTools/vmodelingshoulderpoint.cpp \ - tools/modelingTools/vmodelingspline.cpp \ - tools/modelingTools/vmodelingsplinepath.cpp \ - exception/vexception.cpp \ - exception/vexceptionbadid.cpp \ - exception/vexceptionwrongparameterid.cpp \ - exception/vexceptionconversionerror.cpp \ - exception/vexceptionemptyparameter.cpp \ - exception/vexceptionobjecterror.cpp \ - widgets/vapplication.cpp \ - exception/vexceptionuniqueid.cpp \ - tools/drawTools/vtoolheight.cpp \ - tools/modelingTools/vmodelingheight.cpp \ - dialogs/dialogheight.cpp \ - tools/drawTools/vtooltriangle.cpp \ - tools/modelingTools/vmodelingtriangle.cpp \ - dialogs/dialogtriangle.cpp \ - dialogs/dialogpointofintersection.cpp \ - tools/drawTools/vtoolpointofintersection.cpp \ - tools/modelingTools/vmodelingpointofintersection.cpp - -HEADERS += mainwindow.h \ - widgets/vmaingraphicsscene.h \ - dialogs/dialogsinglepoint.h \ - options.h \ - widgets/vgraphicssimpletextitem.h \ - xml/vdomdocument.h \ - container/vpointf.h \ - container/vcontainer.h \ - tools/drawTools/vtoolpoint.h \ - container/calculator.h \ - dialogs/dialogincrements.h \ - container/vstandarttablecell.h \ - container/vincrementtablerow.h \ - widgets/doubledelegate.h \ - dialogs/dialogendline.h \ - tools/drawTools/vtoolendline.h \ - tools/drawTools/vtoolline.h \ - tools/vabstracttool.h \ - dialogs/dialogline.h \ - tools/drawTools/vtoolalongline.h \ - dialogs/dialogtool.h \ - dialogs/dialogalongline.h \ - tools/drawTools/vtoolshoulderpoint.h \ - dialogs/dialogshoulderpoint.h \ - tools/drawTools/vtoolnormal.h \ - dialogs/dialognormal.h \ - tools/drawTools/vtoolbisector.h \ - dialogs/dialogbisector.h \ - tools/drawTools/vtoollinepoint.h \ - tools/drawTools/vtoollineintersect.h \ - dialogs/dialoglineintersect.h \ - geometry/vspline.h \ - tools/drawTools/vtoolsinglepoint.h \ - geometry/varc.h \ - widgets/vcontrolpointspline.h \ - tools/drawTools/vtoolspline.h \ - dialogs/dialogspline.h \ - tools/drawTools/vtoolarc.h \ - dialogs/dialogarc.h \ - geometry/vsplinepoint.h \ - geometry/vsplinepath.h \ - tools/drawTools/vtoolsplinepath.h \ - dialogs/dialogsplinepath.h \ - widgets/vmaingraphicsview.h \ - tools/vdatatool.h \ - xml/vtoolrecord.h \ - dialogs/dialoghistory.h \ - tools/drawTools/vtoolpointofcontact.h \ - dialogs/dialogpointofcontact.h \ - geometry/vnodedetail.h \ - geometry/vdetail.h \ - dialogs/dialogdetail.h \ - tools/vtooldetail.h \ - widgets/vtablegraphicsview.h \ - widgets/vitem.h \ - tablewindow.h \ - tools/tools.h \ - tools/drawTools/drawtools.h \ - tools/nodeDetails/nodedetails.h \ - tools/nodeDetails/vnodearc.h \ - tools/nodeDetails/vnodepoint.h \ - tools/nodeDetails/vnodespline.h \ - tools/nodeDetails/vnodesplinepath.h \ - stable.h \ - tools/drawTools/vdrawtool.h \ - tools/nodeDetails/vabstractnode.h \ - dialogs/dialogs.h \ - tools/modelingTools/modelingtools.h \ - tools/modelingTools/vmodelingtool.h \ - tools/modelingTools/vmodelingalongline.h \ - tools/modelingTools/vmodelingarc.h \ - tools/modelingTools/vmodelingbisector.h \ - tools/modelingTools/vmodelingendline.h \ - tools/modelingTools/vmodelingline.h \ - tools/modelingTools/vmodelinglineintersect.h \ - tools/modelingTools/vmodelinglinepoint.h \ - tools/modelingTools/vmodelingnormal.h \ - tools/modelingTools/vmodelingpoint.h \ - tools/modelingTools/vmodelingpointofcontact.h \ - tools/modelingTools/vmodelingshoulderpoint.h \ - tools/modelingTools/vmodelingspline.h \ - tools/modelingTools/vmodelingsplinepath.h \ - exception/vexception.h \ - exception/vexceptionbadid.h \ - exception/vexceptionwrongparameterid.h \ - exception/vexceptionconversionerror.h \ - exception/vexceptionemptyparameter.h \ - exception/vexceptionobjecterror.h \ - widgets/vapplication.h \ - exception/vexceptionuniqueid.h \ - tools/drawTools/vtoolheight.h \ - tools/modelingTools/vmodelingheight.h \ - dialogs/dialogheight.h \ - tools/drawTools/vtooltriangle.h \ - tools/modelingTools/vmodelingtriangle.h \ - dialogs/dialogtriangle.h \ - dialogs/dialogpointofintersection.h \ - tools/drawTools/vtoolpointofintersection.h \ - tools/modelingTools/vmodelingpointofintersection.h \ - version.h - -FORMS += mainwindow.ui \ - dialogs/dialogsinglepoint.ui \ - dialogs/dialogincrements.ui \ - dialogs/dialogendline.ui \ - dialogs/dialogline.ui \ - dialogs/dialogalongline.ui \ - dialogs/dialogshoulderpoint.ui \ - dialogs/dialognormal.ui \ - dialogs/dialogbisector.ui \ - dialogs/dialoglineintersect.ui \ - dialogs/dialogspline.ui \ - dialogs/dialogarc.ui \ - dialogs/dialogsplinepath.ui \ - dialogs/dialoghistory.ui \ - dialogs/dialogpointofcontact.ui \ - dialogs/dialogdetail.ui \ - tablewindow.ui \ - dialogs/dialogheight.ui \ - dialogs/dialogtriangle.ui \ - dialogs/dialogpointofintersection.ui - -RESOURCES += \ - icon.qrc \ - cursor.qrc +# Precompiled headers (PCH) +PRECOMPILED_HEADER = stable.h # directory for executable file DESTDIR = bin @@ -249,14 +37,38 @@ RCC_DIR = rcc # files created uic UI_DIR = uic -# Use Precompiled headers (PCH) -PRECOMPILED_HEADER = stable.h +include(container/container.pri) +include(dialogs/dialogs.pri) +include(exception/exception.pri) +include(geometry/geometry.pri) +include(tools/tools.pri) +include(widgets/widgets.pri) +include(xml/xml.pri) + +SOURCES += main.cpp\ + mainwindow.cpp \ + tablewindow.cpp \ + +HEADERS += mainwindow.h \ + options.h \ + tablewindow.h \ + stable.h \ + version.h + +FORMS += mainwindow.ui \ + tablewindow.ui + +RESOURCES += \ + icon.qrc \ + cursor.qrc TRANSLATIONS += translations/valentina_ru.ts \ translations/valentina_uk.ts CONFIG(debug, debug|release){ # Debug + TARGET = $$DEBUG_TARGET + QMAKE_CXXFLAGS += -isystem "/usr/include/qt5" -isystem "/usr/include/qt5/QtWidgets" \ -isystem "/usr/include/qt5/QtXml" -isystem "/usr/include/qt5/QtGui" \ -isystem "/usr/include/qt5/QtCore" -isystem "$$OUT_PWD/uic" -isystem "$$OUT_PWD/moc/" \ @@ -265,8 +77,12 @@ CONFIG(debug, debug|release){ -Wunreachable-code }else{ # Release + TARGET = $$RELEASE_TARGET + QMAKE_CXXFLAGS += -O1 + DEFINES += QT_NO_DEBUG_OUTPUT + QMAKE_EXTRA_COMPILERS += lrelease lrelease.input = TRANSLATIONS lrelease.output = ${QMAKE_FILE_BASE}.qm diff --git a/container/container.pri b/container/container.pri new file mode 100644 index 000000000..a6461484b --- /dev/null +++ b/container/container.pri @@ -0,0 +1,13 @@ +SOURCES += \ + container/vpointf.cpp \ + container/vincrementtablerow.cpp \ + container/vcontainer.cpp \ + container/calculator.cpp \ + container/vstandarttablecell.cpp + +HEADERS += \ + container/vstandarttablecell.h \ + container/vpointf.h \ + container/vincrementtablerow.h \ + container/vcontainer.h \ + container/calculator.h diff --git a/dialogs/dialogs.pri b/dialogs/dialogs.pri new file mode 100644 index 000000000..86876c1d2 --- /dev/null +++ b/dialogs/dialogs.pri @@ -0,0 +1,62 @@ +HEADERS += \ + dialogs/dialogtriangle.h \ + dialogs/dialogtool.h \ + dialogs/dialogsplinepath.h \ + dialogs/dialogspline.h \ + dialogs/dialogsinglepoint.h \ + dialogs/dialogshoulderpoint.h \ + dialogs/dialogs.h \ + dialogs/dialogpointofintersection.h \ + dialogs/dialogpointofcontact.h \ + dialogs/dialognormal.h \ + dialogs/dialoglineintersect.h \ + dialogs/dialogline.h \ + dialogs/dialogincrements.h \ + dialogs/dialoghistory.h \ + dialogs/dialogheight.h \ + dialogs/dialogendline.h \ + dialogs/dialogdetail.h \ + dialogs/dialogbisector.h \ + dialogs/dialogarc.h \ + dialogs/dialogalongline.h + +SOURCES += \ + dialogs/dialogtriangle.cpp \ + dialogs/dialogtool.cpp \ + dialogs/dialogsplinepath.cpp \ + dialogs/dialogspline.cpp \ + dialogs/dialogsinglepoint.cpp \ + dialogs/dialogshoulderpoint.cpp \ + dialogs/dialogpointofintersection.cpp \ + dialogs/dialogpointofcontact.cpp \ + dialogs/dialognormal.cpp \ + dialogs/dialoglineintersect.cpp \ + dialogs/dialogline.cpp \ + dialogs/dialogincrements.cpp \ + dialogs/dialoghistory.cpp \ + dialogs/dialogheight.cpp \ + dialogs/dialogendline.cpp \ + dialogs/dialogdetail.cpp \ + dialogs/dialogbisector.cpp \ + dialogs/dialogarc.cpp \ + dialogs/dialogalongline.cpp + +FORMS += \ + dialogs/dialogtriangle.ui \ + dialogs/dialogsplinepath.ui \ + dialogs/dialogspline.ui \ + dialogs/dialogsinglepoint.ui \ + dialogs/dialogshoulderpoint.ui \ + dialogs/dialogpointofintersection.ui \ + dialogs/dialogpointofcontact.ui \ + dialogs/dialognormal.ui \ + dialogs/dialoglineintersect.ui \ + dialogs/dialogline.ui \ + dialogs/dialogincrements.ui \ + dialogs/dialoghistory.ui \ + dialogs/dialogheight.ui \ + dialogs/dialogendline.ui \ + dialogs/dialogdetail.ui \ + dialogs/dialogbisector.ui \ + dialogs/dialogarc.ui \ + dialogs/dialogalongline.ui diff --git a/exception/exception.pri b/exception/exception.pri new file mode 100644 index 000000000..4293f086b --- /dev/null +++ b/exception/exception.pri @@ -0,0 +1,17 @@ +HEADERS += \ + exception/vexceptionwrongparameterid.h \ + exception/vexceptionuniqueid.h \ + exception/vexceptionobjecterror.h \ + exception/vexceptionemptyparameter.h \ + exception/vexceptionconversionerror.h \ + exception/vexceptionbadid.h \ + exception/vexception.h + +SOURCES += \ + exception/vexceptionwrongparameterid.cpp \ + exception/vexceptionuniqueid.cpp \ + exception/vexceptionobjecterror.cpp \ + exception/vexceptionemptyparameter.cpp \ + exception/vexceptionconversionerror.cpp \ + exception/vexceptionbadid.cpp \ + exception/vexception.cpp diff --git a/geometry/geometry.pri b/geometry/geometry.pri new file mode 100644 index 000000000..37d5100cc --- /dev/null +++ b/geometry/geometry.pri @@ -0,0 +1,15 @@ +HEADERS += \ + geometry/vsplinepoint.h \ + geometry/vsplinepath.h \ + geometry/vspline.h \ + geometry/vnodedetail.h \ + geometry/vdetail.h \ + geometry/varc.h + +SOURCES += \ + geometry/vsplinepoint.cpp \ + geometry/vsplinepath.cpp \ + geometry/vspline.cpp \ + geometry/vnodedetail.cpp \ + geometry/vdetail.cpp \ + geometry/varc.cpp diff --git a/tools/drawTools/drawTools.pri b/tools/drawTools/drawTools.pri new file mode 100644 index 000000000..54cf0341c --- /dev/null +++ b/tools/drawTools/drawTools.pri @@ -0,0 +1,40 @@ +HEADERS += \ + tools/drawTools/vtooltriangle.h \ + tools/drawTools/vtoolsplinepath.h \ + tools/drawTools/vtoolspline.h \ + tools/drawTools/vtoolshoulderpoint.h \ + tools/drawTools/vtoolpointofintersection.h \ + tools/drawTools/vtoolpointofcontact.h \ + tools/drawTools/vtoolpoint.h \ + tools/drawTools/vtoolnormal.h \ + tools/drawTools/vtoollinepoint.h \ + tools/drawTools/vtoollineintersect.h \ + tools/drawTools/vtoolline.h \ + tools/drawTools/vtoolheight.h \ + tools/drawTools/vtoolendline.h \ + tools/drawTools/vtoolbisector.h \ + tools/drawTools/vtoolarc.h \ + tools/drawTools/vtoolalongline.h \ + tools/drawTools/vdrawtool.h \ + tools/drawTools/drawtools.h \ + tools/drawTools/vtoolsinglepoint.h + +SOURCES += \ + tools/drawTools/vtooltriangle.cpp \ + tools/drawTools/vtoolsplinepath.cpp \ + tools/drawTools/vtoolspline.cpp \ + tools/drawTools/vtoolshoulderpoint.cpp \ + tools/drawTools/vtoolpointofintersection.cpp \ + tools/drawTools/vtoolpointofcontact.cpp \ + tools/drawTools/vtoolpoint.cpp \ + tools/drawTools/vtoolnormal.cpp \ + tools/drawTools/vtoollinepoint.cpp \ + tools/drawTools/vtoollineintersect.cpp \ + tools/drawTools/vtoolline.cpp \ + tools/drawTools/vtoolheight.cpp \ + tools/drawTools/vtoolendline.cpp \ + tools/drawTools/vtoolbisector.cpp \ + tools/drawTools/vtoolarc.cpp \ + tools/drawTools/vtoolalongline.cpp \ + tools/drawTools/vdrawtool.cpp \ + tools/drawTools/vtoolsinglepoint.cpp diff --git a/tools/modelingTools/modelingTools.pri b/tools/modelingTools/modelingTools.pri new file mode 100644 index 000000000..165b67fe5 --- /dev/null +++ b/tools/modelingTools/modelingTools.pri @@ -0,0 +1,38 @@ +HEADERS += \ + tools/modelingTools/vmodelingtriangle.h \ + tools/modelingTools/vmodelingtool.h \ + tools/modelingTools/vmodelingsplinepath.h \ + tools/modelingTools/vmodelingspline.h \ + tools/modelingTools/vmodelingshoulderpoint.h \ + tools/modelingTools/vmodelingpointofintersection.h \ + tools/modelingTools/vmodelingpointofcontact.h \ + tools/modelingTools/vmodelingpoint.h \ + tools/modelingTools/vmodelingnormal.h \ + tools/modelingTools/vmodelinglinepoint.h \ + tools/modelingTools/vmodelinglineintersect.h \ + tools/modelingTools/vmodelingline.h \ + tools/modelingTools/vmodelingheight.h \ + tools/modelingTools/vmodelingendline.h \ + tools/modelingTools/vmodelingbisector.h \ + tools/modelingTools/vmodelingarc.h \ + tools/modelingTools/vmodelingalongline.h \ + tools/modelingTools/modelingtools.h + +SOURCES += \ + tools/modelingTools/vmodelingtriangle.cpp \ + tools/modelingTools/vmodelingtool.cpp \ + tools/modelingTools/vmodelingsplinepath.cpp \ + tools/modelingTools/vmodelingspline.cpp \ + tools/modelingTools/vmodelingshoulderpoint.cpp \ + tools/modelingTools/vmodelingpointofintersection.cpp \ + tools/modelingTools/vmodelingpointofcontact.cpp \ + tools/modelingTools/vmodelingpoint.cpp \ + tools/modelingTools/vmodelingnormal.cpp \ + tools/modelingTools/vmodelinglinepoint.cpp \ + tools/modelingTools/vmodelinglineintersect.cpp \ + tools/modelingTools/vmodelingline.cpp \ + tools/modelingTools/vmodelingheight.cpp \ + tools/modelingTools/vmodelingendline.cpp \ + tools/modelingTools/vmodelingbisector.cpp \ + tools/modelingTools/vmodelingarc.cpp \ + tools/modelingTools/vmodelingalongline.cpp diff --git a/tools/modelingTools/modelingtools.h b/tools/modelingTools/modelingtools.h index b7c755edc..7a336be62 100644 --- a/tools/modelingTools/modelingtools.h +++ b/tools/modelingTools/modelingtools.h @@ -31,7 +31,6 @@ #include "vmodelingnormal.h" #include "vmodelingpointofcontact.h" #include "vmodelingshoulderpoint.h" -#include "vmodelingsinglepoint.h" #include "vmodelingspline.h" #include "vmodelingsplinepath.h" #include "vmodelingheight.h" diff --git a/tools/modelingTools/vmodelingsinglepoint.cpp b/tools/modelingTools/vmodelingsinglepoint.cpp deleted file mode 100644 index df9b1f0f5..000000000 --- a/tools/modelingTools/vmodelingsinglepoint.cpp +++ /dev/null @@ -1,93 +0,0 @@ -#include "vmodelingsinglepoint.h" -#include -#include -#include -#include -#include -#include -#include -#include "options.h" -#include "container/vpointf.h" - -VModelingSinglePoint::VModelingSinglePoint (VDomDocument *doc, VContainer *data, qint64 id, Tool::Sources typeCreation, - QGraphicsItem * parent ):VModelingPoint(doc, data, id, parent), - dialogSinglePoint(QSharedPointer()){ - this->setFlag(QGraphicsItem::ItemIsMovable, true); - this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); - if(typeCreation == Tool::FromGui){ - AddToFile(); - } -} - -void VModelingSinglePoint::setDialog(){ - Q_ASSERT(!dialogSinglePoint.isNull()); - if(!dialogSinglePoint.isNull()){ - VPointF p = VAbstractTool::data.GetPoint(id); - dialogSinglePoint->setData(p.name(), p.toQPointF()); - } -} - -void VModelingSinglePoint::AddToFile(){ - VPointF point = VAbstractTool::data.GetPoint(id); - QDomElement domElement = doc->createElement("point"); - - AddAttribute(domElement, "id", id); - AddAttribute(domElement, "type", "single"); - AddAttribute(domElement, "name", point.name()); - AddAttribute(domElement, "x", toMM(point.x())); - AddAttribute(domElement, "y", toMM(point.y())); - AddAttribute(domElement, "mx", toMM(point.mx())); - AddAttribute(domElement, "my", toMM(point.my())); - - AddToModeling(domElement); -} - -QVariant VModelingSinglePoint::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value){ - if (change == ItemPositionChange && scene()) { - // value - это новое положение. - QPointF newPos = value.toPointF(); - QRectF rect = scene()->sceneRect(); - if (!rect.contains(newPos)) { - // Сохраняем элемент внутри прямоугольника сцены. - newPos.setX(qMin(rect.right(), qMax(newPos.x(), rect.left()))); - newPos.setY(qMin(rect.bottom(), qMax(newPos.y(), rect.top()))); - return newPos; - } - } - if (change == ItemPositionHasChanged && scene()) { - // value - это новое положение. - QPointF newPos = value.toPointF(); - QDomElement domElement = doc->elementById(QString().setNum(id)); - if(domElement.isElement()){ - domElement.setAttribute("x", QString().setNum(toMM(newPos.x()))); - domElement.setAttribute("y", QString().setNum(toMM(newPos.y()))); - //I don't now why but signal does not work. - doc->FullUpdateTree(); - } - } - return QGraphicsItem::itemChange(change, value); -} - -void VModelingSinglePoint::contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ){ - ContextMenu(dialogSinglePoint, this, event, false); -} - -void VModelingSinglePoint::FullUpdateFromFile(){ - RefreshPointGeometry(VAbstractTool::data.GetPoint(id)); -} - -void VModelingSinglePoint::FullUpdateFromGui(int result){ - if(result == QDialog::Accepted){ - QPointF p = dialogSinglePoint->getPoint(); - QString name = dialogSinglePoint->getName(); - QDomElement domElement = doc->elementById(QString().setNum(id)); - if(domElement.isElement()){ - domElement.setAttribute("name", name); - domElement.setAttribute("x", QString().setNum(toMM(p.x()))); - domElement.setAttribute("y", QString().setNum(toMM(p.y()))); - //I don't now why but signal does not work. - doc->FullUpdateTree(); - } - } - dialogSinglePoint.clear(); -} diff --git a/tools/modelingTools/vmodelingsinglepoint.h b/tools/modelingTools/vmodelingsinglepoint.h deleted file mode 100644 index 0695becb3..000000000 --- a/tools/modelingTools/vmodelingsinglepoint.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef VMODELINGSINGLEPOINT_H -#define VMODELINGSINGLEPOINT_H - -#include "container/vcontainer.h" -#include "xml/vdomdocument.h" -#include "dialogs/dialogsinglepoint.h" -#include "vmodelingpoint.h" - -class VModelingSinglePoint : public VModelingPoint -{ - Q_OBJECT -public: - VModelingSinglePoint (VDomDocument *doc, VContainer *data, qint64 id, - Tool::Sources typeCreation, QGraphicsItem * parent = 0 ); - virtual void setDialog(); -public slots: - virtual void FullUpdateFromFile(); - virtual void FullUpdateFromGui(int result); -signals: - void FullUpdateTree(); -protected: - virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ); - virtual void AddToFile(); - QVariant itemChange ( GraphicsItemChange change, const QVariant &value ); -private: - QSharedPointer dialogSinglePoint; -}; - -#endif // VMODELINGSINGLEPOINT_H diff --git a/tools/nodeDetails/nodeDetails.pri b/tools/nodeDetails/nodeDetails.pri new file mode 100644 index 000000000..c79444f12 --- /dev/null +++ b/tools/nodeDetails/nodeDetails.pri @@ -0,0 +1,14 @@ +HEADERS += \ + tools/nodeDetails/vnodesplinepath.h \ + tools/nodeDetails/vnodespline.h \ + tools/nodeDetails/vnodepoint.h \ + tools/nodeDetails/vnodearc.h \ + tools/nodeDetails/vabstractnode.h \ + tools/nodeDetails/nodedetails.h + +SOURCES += \ + tools/nodeDetails/vnodesplinepath.cpp \ + tools/nodeDetails/vnodespline.cpp \ + tools/nodeDetails/vnodepoint.cpp \ + tools/nodeDetails/vnodearc.cpp \ + tools/nodeDetails/vabstractnode.cpp diff --git a/tools/tools.pri b/tools/tools.pri new file mode 100644 index 000000000..a53c97ba6 --- /dev/null +++ b/tools/tools.pri @@ -0,0 +1,14 @@ +HEADERS += \ + tools/vtooldetail.h \ + tools/vdatatool.h \ + tools/vabstracttool.h \ + tools/tools.h + +SOURCES += \ + tools/vtooldetail.cpp \ + tools/vdatatool.cpp \ + tools/vabstracttool.cpp + +include(drawTools/drawTools.pri) +include(modelingTools/modelingTools.pri) +include(nodeDetails/nodeDetails.pri) diff --git a/tools/vgraphicspoint.cpp b/tools/vgraphicspoint.cpp deleted file mode 100644 index df82f6f1e..000000000 --- a/tools/vgraphicspoint.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include "vgraphicspoint.h" -#include "options.h" - -VGraphicsPoint::VGraphicsPoint(QGraphicsItem *parent): QGraphicsEllipseItem(parent), - radius(toPixel(1.5)), namePoint(0), lineName(0){ - //namePoint = new VGraphicsSimpleTextItem(this); - lineName = new QGraphicsLineItem(this); - this->setPen(QPen(Qt::black, widthHairLine)); - this->setBrush(QBrush(Qt::NoBrush)); - this->setFlag(QGraphicsItem::ItemIsSelectable, true); - this->setAcceptHoverEvents(true); -} - -VGraphicsPoint::~VGraphicsPoint(){ -} - - -void VGraphicsPoint::RefreshLine(){ - QRectF nameRec = namePoint->sceneBoundingRect(); - QPointF p1, p2; - LineIntersectCircle(QPointF(), radius, QLineF(QPointF(), nameRec.center()- scenePos()), p1, p2); - QPointF pRec = LineIntersectRect(nameRec, QLineF(scenePos(), nameRec.center())); - lineName->setLine(QLineF(p1, pRec - scenePos())); - if(QLineF(p1, pRec - scenePos()).length() <= toPixel(4)){ - lineName->setVisible(false); - } else { - lineName->setVisible(true); - } -} - -void VGraphicsPoint::hoverMoveEvent(QGraphicsSceneHoverEvent *event){ - Q_UNUSED(event); - this->setPen(QPen(Qt::black, widthMainLine)); -} - -void VGraphicsPoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event){ - Q_UNUSED(event); - this->setPen(QPen(Qt::black, widthHairLine)); -} diff --git a/tools/vgraphicspoint.h b/tools/vgraphicspoint.h deleted file mode 100644 index 4bd108524..000000000 --- a/tools/vgraphicspoint.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef VGRAPHICSPOINT_H -#define VGRAPHICSPOINT_H - -#include -#include -#include "widgets/vgraphicssimpletextitem.h" -#include "../container/vpointf.h" - -class VGraphicsPoint: public QGraphicsEllipseItem -{ -public: - VGraphicsPoint(QGraphicsItem *parent); - virtual ~VGraphicsPoint(); -public slots: - virtual void NameChangePosition(const QPointF pos)=0; -protected: - qreal radius; - VGraphicsSimpleTextItem *namePoint; - QGraphicsLineItem *lineName; - virtual void UpdateNamePosition(qreal mx, qreal my)=0; - void RefreshLine(); - virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event ); - virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event ); - virtual void RefreshPointGeometry(const VPointF &point)=0; -private: - VGraphicsPoint(const VGraphicsPoint &point); - const VGraphicsPoint &operator=(const VGraphicsPoint &point); - QPointF LineIntersectRect(QRectF rec, QLineF line) const; - qint32 LineIntersectCircle(QPointF center, qreal radius, QLineF line, QPointF &p1, - QPointF &p2) const; - QPointF ClosestPoint(QLineF line, QPointF p) const; - QPointF addVector (QPointF p, QPointF p1, QPointF p2, qreal k) const; -}; - -#endif // VGRAPHICSPOINT_H diff --git a/widgets/delegate.cpp b/widgets/delegate.cpp deleted file mode 100644 index f3b2d0de5..000000000 --- a/widgets/delegate.cpp +++ /dev/null @@ -1,90 +0,0 @@ - /**************************************************************************** - ** - ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). - ** Contact: http://www.qt-project.org/legal - ** - ** This file is part of the examples of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:BSD$ - ** You may use this file under the terms of the BSD license as follows: - ** - ** "Redistribution and use in source and binary forms, with or without - ** modification, are permitted provided that the following conditions are - ** met: - ** * Redistributions of source code must retain the above copyright - ** notice, this list of conditions and the following disclaimer. - ** * Redistributions in binary form must reproduce the above copyright - ** notice, this list of conditions and the following disclaimer in - ** the documentation and/or other materials provided with the - ** distribution. - ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names - ** of its contributors may be used to endorse or promote products derived - ** from this software without specific prior written permission. - ** - ** - ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - - /* - delegate.cpp - - A delegate that allows the user to change integer values from the model - using a spin box widget. - */ - -#include -#include "delegate.h" - - SpinBoxDelegate::SpinBoxDelegate(QObject *parent) - : QItemDelegate(parent) - { - } - - QWidget *SpinBoxDelegate::createEditor(QWidget *parent, - const QStyleOptionViewItem &/* option */, - const QModelIndex &/* index */) const - { - QSpinBox *editor = new QSpinBox(parent); - editor->setMinimum(0); - editor->setMaximum(1000); - - return editor; - } - - void SpinBoxDelegate::setEditorData(QWidget *editor, - const QModelIndex &index) const - { - int value = index.model()->data(index, Qt::EditRole).toInt(); - - QSpinBox *spinBox = static_cast(editor); - spinBox->setValue(value); - } - - void SpinBoxDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, - const QModelIndex &index) const - { - QSpinBox *spinBox = static_cast(editor); - spinBox->interpretText(); - int value = spinBox->value(); - - model->setData(index, value, Qt::EditRole); - } - - void SpinBoxDelegate::updateEditorGeometry(QWidget *editor, - const QStyleOptionViewItem &option, const QModelIndex &/* index */) const - { - editor->setGeometry(option.rect); - } diff --git a/widgets/widgets.pri b/widgets/widgets.pri new file mode 100644 index 000000000..4b908b906 --- /dev/null +++ b/widgets/widgets.pri @@ -0,0 +1,19 @@ +HEADERS += \ + widgets/vtablegraphicsview.h \ + widgets/vmaingraphicsview.h \ + widgets/vmaingraphicsscene.h \ + widgets/vitem.h \ + widgets/vgraphicssimpletextitem.h \ + widgets/vcontrolpointspline.h \ + widgets/vapplication.h \ + widgets/doubledelegate.h + +SOURCES += \ + widgets/vtablegraphicsview.cpp \ + widgets/vmaingraphicsview.cpp \ + widgets/vmaingraphicsscene.cpp \ + widgets/vitem.cpp \ + widgets/vgraphicssimpletextitem.cpp \ + widgets/vcontrolpointspline.cpp \ + widgets/vapplication.cpp \ + widgets/doubledelegate.cpp diff --git a/xml/xml.pri b/xml/xml.pri new file mode 100644 index 000000000..71489d606 --- /dev/null +++ b/xml/xml.pri @@ -0,0 +1,7 @@ +HEADERS += \ + xml/vtoolrecord.h \ + xml/vdomdocument.h + +SOURCES += \ + xml/vtoolrecord.cpp \ + xml/vdomdocument.cpp