diff --git a/src/SketcherGUI/Makefile.in b/src/SketcherGUI/Makefile.in new file mode 100644 index 000000000..40983995b --- /dev/null +++ b/src/SketcherGUI/Makefile.in @@ -0,0 +1,88 @@ +# GEOM GEOMBASE : +# +# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library 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 +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# +# +# +# File : Makefile.in +# Author : Damien COQUERET (OCC) +# Module : GEOM +# $Header: + +top_srcdir=@top_srcdir@ +top_builddir=../.. +srcdir=@srcdir@ +VPATH=.:@srcdir@:@top_srcdir@/idl + + +@COMMENCE@ + +# Libraries targets +LIB = libSketcherGUI.la + +# header files +EXPORT_HEADERS= + +LIB_SRC = SketcherGUI.cxx \ + SketcherGUI_Profile.cxx \ + SketcherGUI_Skeleton_QTD.cxx \ + SketcherGUI_Point_QTD.cxx \ + SketcherGUI_Dir1_QTD.cxx \ + SketcherGUI_Dir2_QTD.cxx \ + SketcherGUI_1Sel_QTD.cxx \ + SketcherGUI_1Spin_QTD.cxx \ + SketcherGUI_2Spin_QTD.cxx \ + SketcherGUI_3Spin_QTD.cxx \ + SketcherGUI_4Spin_QTD.cxx \ + SketcherGUI_1Spin.cxx \ + SketcherGUI_2Spin.cxx \ + SketcherGUI_3Spin.cxx \ + SketcherGUI_4Spin.cxx \ + SketcherGUI_Dlg.cxx + +LIB_MOC = \ + SketcherGUI.h \ + SketcherGUI_Skeleton_QTD.h \ + SketcherGUI_Point_QTD.h \ + SketcherGUI_Dir1_QTD.h \ + SketcherGUI_Dir2_QTD.h \ + SketcherGUI_1Sel_QTD.h \ + SketcherGUI_1Spin_QTD.h \ + SketcherGUI_2Spin_QTD.h \ + SketcherGUI_3Spin_QTD.h \ + SketcherGUI_4Spin_QTD.h \ + SketcherGUI_1Spin.h \ + SketcherGUI_2Spin.h \ + SketcherGUI_3Spin.h \ + SketcherGUI_4Spin.h \ + SketcherGUI_Dlg.h + +LIB_CLIENT_IDL = + +LIB_SERVER_IDL = + +# additionnal information to compil and link file + +CPPFLAGS += $(QT_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome +CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome + +LDFLAGS += -lGEOMFiltersSelection -lGEOMBase + +@CONCLUDE@ diff --git a/src/SketcherGUI/SketcherGUI.cxx b/src/SketcherGUI/SketcherGUI.cxx new file mode 100644 index 000000000..ffd50e30f --- /dev/null +++ b/src/SketcherGUI/SketcherGUI.cxx @@ -0,0 +1,262 @@ +// GEOM GEOMGUI : GUI for Geometry component +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SketcherGUI.cxx +// Author : Damien COQUERET +// Module : GEOM +// $Header: + +using namespace std; +#include "SketcherGUI.h" + +#include "QAD_RightFrame.h" +#include "OCCViewer_Viewer3d.h" +#include "SALOMEGUI_QtCatchCorbaException.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "SketcherGUI_Dlg.h" // Sketcher + +//======================================================================= +// function : SketcherGUI() +// purpose : Constructor +//======================================================================= +SketcherGUI::SketcherGUI() : + QObject() +{ + myGeomBase = new GEOMBase(); + myGeomGUI = GEOMContext::GetGeomGUI(); + myGeom = myGeomGUI->myComponentGeom; + + mySimulationShape1 = new AIS_Shape(TopoDS_Shape()); + mySimulationShape2 = new AIS_Shape(TopoDS_Shape()); +} + + +//======================================================================= +// function : ~SketcherGUI() +// purpose : Destructor +//======================================================================= +SketcherGUI::~SketcherGUI() +{ +} + + +//======================================================================= +// function : OnGUIEvent() +// purpose : +//======================================================================= +bool SketcherGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent) +{ + SketcherGUI* mySketcherGUI = new SketcherGUI(); + mySketcherGUI->myGeomGUI->EmitSignalDeactivateDialog(); + SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection()); + + if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC) + return false; + + QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar(); + + switch (theCommandID) + { + case 404: // SKETCHER + { + ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->onViewTop(); // DCQ : 28/02/2002 + SketcherGUI_Dlg* aDlg = new SketcherGUI_Dlg(parent, "", mySketcherGUI, Sel); + break; + } + default: + { + parent->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); + break; + } + } + return true; +} + + +//======================================================================= +// function : OnSketchEnd() +// purpose : +//======================================================================= +void SketcherGUI::OnSketchEnd(TopoDS_Shape myShape) +{ + TopoDS_Wire W = TopoDS::Wire(myShape); + + if(!W.IsNull()) { + GEOM::GEOM_Gen::ListOfIOR_var listShapes = new GEOM::GEOM_Gen::ListOfIOR; + listShapes->length(0); + unsigned int i = 0; + + BRepTools_WireExplorer Ex(W); + while(Ex.More()) { + TopoDS_Edge E = TopoDS::Edge(Ex.Current()); + + gp_Pnt pt1, pt2; + pt1 = BRep_Tool::Pnt(TopExp::FirstVertex(E)); + pt2 = BRep_Tool::Pnt(TopExp::LastVertex(E)); + + gp_Pnt CenterPoint; + Handle(Geom_Curve) Curve; + Handle(Geom_Circle) Circle; + gp_Circ Circ; + Standard_Real First,Last; + + Curve = BRep_Tool::Curve(E,First,Last); + if(Curve->IsKind(STANDARD_TYPE(Geom_Circle))) { + Circle = Handle(Geom_Circle)::DownCast(Curve); // pointer on geom_circ + Circ = Circle->Circ(); // gp_Circ + + Curve->D0((First + Last) / 2., CenterPoint); + + GEOM::PointStruct pI = myGeom->MakePointStruct(pt1.X(), pt1.Y(), pt1.Z()); + GEOM::PointStruct pC = myGeom->MakePointStruct(CenterPoint.X(), CenterPoint.Y(), CenterPoint.Z()); + GEOM::PointStruct pE = myGeom->MakePointStruct(pt2.X(), pt2.Y(), pt2.Z()); + + GEOM::GEOM_Shape_var arc; + + try { + arc = myGeom->MakeArc(pI, pC, pE); + } + catch (const SALOME::SALOME_Exception& S_ex) { + QtCatchCorbaException(S_ex); + } + + listShapes->length(i+1); + listShapes[i] = strdup(arc->Name()); + i++; + } else { + GEOM::PointStruct pI = myGeom->MakePointStruct(pt1.X(), pt1.Y(), pt1.Z()); + GEOM::PointStruct pE = myGeom->MakePointStruct(pt2.X(), pt2.Y(), pt2.Z()); + GEOM::GEOM_Shape_var segment; + + try { + segment = myGeom->MakeEdge(pI,pE); + } + catch (const SALOME::SALOME_Exception& S_ex) { + QtCatchCorbaException(S_ex); + } + + listShapes->length(i+1); + listShapes[i] = strdup(segment->Name()); + i++; + } + Ex.Next(); + } + + GEOM::GEOM_Shape_var Wire = myGeom->MakeWire(listShapes); + TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, Wire); + Standard_CString type; + myGeomBase->GetShapeTypeString(S,type); + Wire->NameType(type); + + if(myGeomBase->Display(Wire)) + QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE")); + } + return; +} + + +//===================================================================================== +// function : DisplaySimulationShape() +// purpose : Displays 'this->mySimulationShape' a pure graphical shape from a TopoDS_Shape +//===================================================================================== +void SketcherGUI::DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shape& S2) +{ + //NRI DEBUG : 14/02/2002 + if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC) + return; + + OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer(); + Handle(AIS_InteractiveContext) ic = v3d->getAISContext(); + try { + if(!S1.IsNull()) { + /* erase any previous */ + ic->Erase(mySimulationShape1, Standard_True, Standard_False); + ic->ClearPrs(mySimulationShape1); + + mySimulationShape1 = new AIS_Shape(TopoDS_Shape()); + mySimulationShape1->Set(S1); + mySimulationShape1->SetColor(Quantity_NOC_RED); + + ic->Deactivate(mySimulationShape1); + ic->Display(mySimulationShape1, Standard_False); + mySimulationShape1->UnsetColor(); + } + if(!S2.IsNull()) { + ic->Erase(mySimulationShape2, Standard_True, Standard_False); + ic->ClearPrs(mySimulationShape2); + + mySimulationShape2 = new AIS_Shape(TopoDS_Shape()); + mySimulationShape2->Set(S2); + mySimulationShape2->SetColor(Quantity_NOC_VIOLET); + + ic->Deactivate(mySimulationShape2); + ic->Display(mySimulationShape2, Standard_False); + mySimulationShape2->UnsetColor(); + } + ic->UpdateCurrentViewer(); + } + catch(Standard_Failure) { + MESSAGE("Exception catched in SketcherGUI::DisplaySimulationShape "); + } + return; +} + + +//================================================================================== +// function : EraseSimulationShape() +// purpose : Clears the display of 'mySimulationShape' a pure graphical shape +//================================================================================== +void SketcherGUI::EraseSimulationShape() +{ + int count = QAD_Application::getDesktop()->getActiveStudy()->getStudyFramesCount(); + for(int i = 0; i < count; i++) { + if(QAD_Application::getDesktop()->getActiveStudy()->getStudyFrame(i)->getTypeView() == VIEW_OCC) { + OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getStudyFrame(i)->getRightFrame()->getViewFrame())->getViewer(); + Handle(AIS_InteractiveContext) ic = v3d->getAISContext(); + ic->Erase(mySimulationShape1, Standard_True, Standard_False); + ic->ClearPrs(mySimulationShape1); + ic->Erase(mySimulationShape2, Standard_True, Standard_False); + ic->ClearPrs(mySimulationShape2); + ic->UpdateCurrentViewer(); + } + } +} + + +//===================================================================================== +// EXPORTED METHODS +//===================================================================================== +extern "C" +{ + bool OnGUIEvent(int theCommandID, QAD_Desktop* parent) + {return SketcherGUI::OnGUIEvent(theCommandID, parent);} +} diff --git a/src/SketcherGUI/SketcherGUI.h b/src/SketcherGUI/SketcherGUI.h new file mode 100644 index 000000000..2f89da8be --- /dev/null +++ b/src/SketcherGUI/SketcherGUI.h @@ -0,0 +1,63 @@ +// GEOM GEOMGUI : GUI for Geometry component +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SketcherGUI.h +// Author : Damien COQUERET +// Module : GEOM +// $Header: + +#ifndef SKETCHERGUI_H +#define SKETCHERGUI_H + +#include "GEOMBase.h" + +//================================================================================= +// class : SketcherGUI +// purpose : +//================================================================================= +class SketcherGUI : public QObject +{ + Q_OBJECT /* for QT compatibility */ + +public : + SketcherGUI(); + ~SketcherGUI(); + + static bool OnGUIEvent(int theCommandID, QAD_Desktop* parent); + + void OnSketchEnd(TopoDS_Shape myShape); + + void DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shape& S2); + void EraseSimulationShape(); + + /* AIS shape used only during topo/geom simulations */ + Handle(AIS_Shape) mySimulationShape1; + Handle(AIS_Shape) mySimulationShape2; + + GEOMBase* myGeomBase; + GEOMContext* myGeomGUI; + GEOM::GEOM_Gen_var myGeom; /* Current Geom Component */ + +}; + +#endif diff --git a/src/SketcherGUI/SketcherGUI_1Sel_QTD.cxx b/src/SketcherGUI/SketcherGUI_1Sel_QTD.cxx new file mode 100644 index 000000000..8b039567c --- /dev/null +++ b/src/SketcherGUI/SketcherGUI_1Sel_QTD.cxx @@ -0,0 +1,93 @@ +/**************************************************************************** +** Form implementation generated from reading ui file 'SketcherGUI_1Sel_QTD.ui' +** +** Created: dim nov 2 17:13:01 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#include "SketcherGUI_1Sel_QTD.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Constructs a SketcherGUI_1Sel_QTD which is a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +SketcherGUI_1Sel_QTD::SketcherGUI_1Sel_QTD( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + if ( !name ) + setName( "SketcherGUI_1Sel_QTD" ); + resize( 186, 96 ); + setCaption( trUtf8( "SketcherGUI_1Sel_QTD" ) ); + SketcherGUI_1Sel_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "SketcherGUI_1Sel_QTDLayout"); + + GroupBox1 = new QGroupBox( this, "GroupBox1" ); + GroupBox1->setTitle( trUtf8( "Values" ) ); + GroupBox1->setColumnLayout(0, Qt::Vertical ); + GroupBox1->layout()->setSpacing( 6 ); + GroupBox1->layout()->setMargin( 11 ); + GroupBox1Layout = new QGridLayout( GroupBox1->layout() ); + GroupBox1Layout->setAlignment( Qt::AlignTop ); + + Layout3 = new QGridLayout( 0, 1, 1, 0, 6, "Layout3"); + + Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2"); + + buttonUndo = new QPushButton( GroupBox1, "buttonUndo" ); + buttonUndo->setText( trUtf8( "Undo" ) ); + + Layout2->addWidget( buttonUndo, 1, 0 ); + + buttonApply = new QPushButton( GroupBox1, "buttonApply" ); + buttonApply->setText( trUtf8( "Create" ) ); + + Layout2->addWidget( buttonApply, 0, 0 ); + QSpacerItem* spacer = new QSpacerItem( 0, 51, QSizePolicy::Minimum, QSizePolicy::Expanding ); + Layout2->addItem( spacer, 2, 0 ); + + Layout3->addLayout( Layout2, 0, 1 ); + + Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1"); + + TextLabel1 = new QLabel( GroupBox1, "TextLabel1" ); + TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) ); + TextLabel1->setText( trUtf8( "TL1" ) ); + + Layout1->addWidget( TextLabel1, 0, 0 ); + QSpacerItem* spacer_2 = new QSpacerItem( 0, 180, QSizePolicy::Minimum, QSizePolicy::Expanding ); + Layout1->addItem( spacer_2, 1, 2 ); + + PushButton1 = new QPushButton( GroupBox1, "PushButton1" ); + PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) ); + PushButton1->setText( trUtf8( "" ) ); + + Layout1->addWidget( PushButton1, 0, 1 ); + + LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" ); + + Layout1->addWidget( LineEdit1, 0, 2 ); + + Layout3->addLayout( Layout1, 0, 0 ); + + GroupBox1Layout->addLayout( Layout3, 0, 0 ); + + SketcherGUI_1Sel_QTDLayout->addWidget( GroupBox1, 0, 0 ); +} + +/* + * Destroys the object and frees any allocated resources + */ +SketcherGUI_1Sel_QTD::~SketcherGUI_1Sel_QTD() +{ + // no need to delete child widgets, Qt does it all for us +} + diff --git a/src/SketcherGUI/SketcherGUI_1Sel_QTD.h b/src/SketcherGUI/SketcherGUI_1Sel_QTD.h new file mode 100644 index 000000000..543156a16 --- /dev/null +++ b/src/SketcherGUI/SketcherGUI_1Sel_QTD.h @@ -0,0 +1,46 @@ +/**************************************************************************** +** Form interface generated from reading ui file 'SketcherGUI_1Sel_QTD.ui' +** +** Created: dim nov 2 17:13:01 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#ifndef SKETCHERGUI_1SEL_QTD_H +#define SKETCHERGUI_1SEL_QTD_H + +#include +#include +class QVBoxLayout; +class QHBoxLayout; +class QGridLayout; +class QGroupBox; +class QLabel; +class QLineEdit; +class QPushButton; + +class SketcherGUI_1Sel_QTD : public QWidget +{ + Q_OBJECT + +public: + SketcherGUI_1Sel_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~SketcherGUI_1Sel_QTD(); + + QGroupBox* GroupBox1; + QPushButton* buttonUndo; + QPushButton* buttonApply; + QLabel* TextLabel1; + QPushButton* PushButton1; + QLineEdit* LineEdit1; + + +protected: + QGridLayout* SketcherGUI_1Sel_QTDLayout; + QGridLayout* GroupBox1Layout; + QGridLayout* Layout3; + QGridLayout* Layout2; + QGridLayout* Layout1; +}; + +#endif // SKETCHERGUI_1SEL_QTD_H diff --git a/src/SketcherGUI/SketcherGUI_1Spin.cxx b/src/SketcherGUI/SketcherGUI_1Spin.cxx new file mode 100644 index 000000000..4cfd25ddc --- /dev/null +++ b/src/SketcherGUI/SketcherGUI_1Spin.cxx @@ -0,0 +1,56 @@ +// GEOM GEOMGUI : GUI for Geometry component +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SketcherGUI_1Spin.cxx +// Author : Damien COQUERET +// Module : GEOM +// $Header: + +#include "SketcherGUI_1Spin.h" + +#include +#include +#include + +/* + * Constructs a SketcherGUI_1Spin which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' + */ +SketcherGUI_1Spin::SketcherGUI_1Spin(QWidget* parent, const char* name, WFlags fl) + :SketcherGUI_1Spin_QTD(parent, name, fl) +{ + SpinBox1->close(TRUE); + + SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX"); + Layout1->addWidget(SpinBox_DX, 0, 1); + +} + + +/* + * Destroys the object and frees any allocated resources + */ +SketcherGUI_1Spin::~SketcherGUI_1Spin() +{ + // no need to delete child widgets, Qt does it all for us +} diff --git a/src/SketcherGUI/SketcherGUI_1Spin.h b/src/SketcherGUI/SketcherGUI_1Spin.h new file mode 100644 index 000000000..c0237fb6b --- /dev/null +++ b/src/SketcherGUI/SketcherGUI_1Spin.h @@ -0,0 +1,47 @@ +// GEOM GEOMGUI : GUI for Geometry component +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SketcherGUI_1Spin.h +// Author : Damien COQUERET +// Module : GEOM +// $Header: + +#ifndef SKETCHERGUI_1SPIN_H +#define SKETCHERGUI_1SPIN_H + +#include "SketcherGUI_1Spin_QTD.h" +#include "DlgRef_SpinBox.h" + +class SketcherGUI_1Spin : public SketcherGUI_1Spin_QTD +{ + Q_OBJECT + +public: + SketcherGUI_1Spin(QWidget* parent = 0, const char* name = 0, WFlags fl = 0); + ~SketcherGUI_1Spin(); + + DlgRef_SpinBox* SpinBox_DX; + +}; + +#endif // SKETCHERGUI_1SPIN_H diff --git a/src/SketcherGUI/SketcherGUI_1Spin_QTD.cxx b/src/SketcherGUI/SketcherGUI_1Spin_QTD.cxx new file mode 100644 index 000000000..d301101ea --- /dev/null +++ b/src/SketcherGUI/SketcherGUI_1Spin_QTD.cxx @@ -0,0 +1,88 @@ +/**************************************************************************** +** Form implementation generated from reading ui file 'SketcherGUI_1Spin_QTD.ui' +** +** Created: jeu oct 30 18:28:53 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#include "SketcherGUI_1Spin_QTD.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Constructs a SketcherGUI_1Spin_QTD which is a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +SketcherGUI_1Spin_QTD::SketcherGUI_1Spin_QTD( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + if ( !name ) + setName( "SketcherGUI_1Spin_QTD" ); + resize( 154, 89 ); + setCaption( trUtf8( "SketcherGUI_1Spin_QTD" ) ); + SketcherGUI_1Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "SketcherGUI_1Spin_QTDLayout"); + + GroupBox1 = new QGroupBox( this, "GroupBox1" ); + GroupBox1->setTitle( trUtf8( "Values" ) ); + GroupBox1->setColumnLayout(0, Qt::Vertical ); + GroupBox1->layout()->setSpacing( 6 ); + GroupBox1->layout()->setMargin( 11 ); + GroupBox1Layout = new QGridLayout( GroupBox1->layout() ); + GroupBox1Layout->setAlignment( Qt::AlignTop ); + + Layout3 = new QGridLayout( 0, 1, 1, 0, 6, "Layout3"); + + Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2"); + + buttonUndo = new QPushButton( GroupBox1, "buttonUndo" ); + buttonUndo->setText( trUtf8( "Undo" ) ); + + Layout2->addWidget( buttonUndo, 1, 0 ); + + buttonApply = new QPushButton( GroupBox1, "buttonApply" ); + buttonApply->setText( trUtf8( "Create" ) ); + + Layout2->addWidget( buttonApply, 0, 0 ); + QSpacerItem* spacer = new QSpacerItem( 0, 51, QSizePolicy::Minimum, QSizePolicy::Expanding ); + Layout2->addItem( spacer, 2, 0 ); + + Layout3->addLayout( Layout2, 0, 1 ); + + Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1"); + + TextLabel1 = new QLabel( GroupBox1, "TextLabel1" ); + TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) ); + TextLabel1->setText( trUtf8( "TL1" ) ); + + Layout1->addWidget( TextLabel1, 0, 0 ); + + SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" ); + SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) ); + + Layout1->addWidget( SpinBox1, 0, 1 ); + QSpacerItem* spacer_2 = new QSpacerItem( 0, 82, QSizePolicy::Minimum, QSizePolicy::Expanding ); + Layout1->addItem( spacer_2, 3, 1 ); + + Layout3->addLayout( Layout1, 0, 0 ); + + GroupBox1Layout->addLayout( Layout3, 0, 0 ); + + SketcherGUI_1Spin_QTDLayout->addWidget( GroupBox1, 0, 0 ); +} + +/* + * Destroys the object and frees any allocated resources + */ +SketcherGUI_1Spin_QTD::~SketcherGUI_1Spin_QTD() +{ + // no need to delete child widgets, Qt does it all for us +} + diff --git a/src/SketcherGUI/SketcherGUI_1Spin_QTD.h b/src/SketcherGUI/SketcherGUI_1Spin_QTD.h new file mode 100644 index 000000000..5a3906a35 --- /dev/null +++ b/src/SketcherGUI/SketcherGUI_1Spin_QTD.h @@ -0,0 +1,45 @@ +/**************************************************************************** +** Form interface generated from reading ui file 'SketcherGUI_1Spin_QTD.ui' +** +** Created: jeu oct 30 18:28:53 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#ifndef SKETCHERGUI_1SPIN_QTD_H +#define SKETCHERGUI_1SPIN_QTD_H + +#include +#include +class QVBoxLayout; +class QHBoxLayout; +class QGridLayout; +class QGroupBox; +class QLabel; +class QPushButton; +class QSpinBox; + +class SketcherGUI_1Spin_QTD : public QWidget +{ + Q_OBJECT + +public: + SketcherGUI_1Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~SketcherGUI_1Spin_QTD(); + + QGroupBox* GroupBox1; + QPushButton* buttonUndo; + QPushButton* buttonApply; + QLabel* TextLabel1; + QSpinBox* SpinBox1; + + +protected: + QGridLayout* SketcherGUI_1Spin_QTDLayout; + QGridLayout* GroupBox1Layout; + QGridLayout* Layout3; + QGridLayout* Layout2; + QGridLayout* Layout1; +}; + +#endif // SKETCHERGUI_1SPIN_QTD_H diff --git a/src/SketcherGUI/SketcherGUI_2Spin.cxx b/src/SketcherGUI/SketcherGUI_2Spin.cxx new file mode 100644 index 000000000..1bd1d1826 --- /dev/null +++ b/src/SketcherGUI/SketcherGUI_2Spin.cxx @@ -0,0 +1,60 @@ +// GEOM GEOMGUI : GUI for Geometry component +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SketcherGUI_2Spin.cxx +// Author : Damien COQUERET +// Module : GEOM +// $Header: + +#include "SketcherGUI_2Spin.h" + +#include +#include +#include + +/* + * Constructs a SketcherGUI_2Spin which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' + */ +SketcherGUI_2Spin::SketcherGUI_2Spin(QWidget* parent, const char* name, WFlags fl) + :SketcherGUI_2Spin_QTD(parent, name, fl) +{ + SpinBox1->close(TRUE); + SpinBox2->close(TRUE); + + SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX"); + Layout1->addWidget(SpinBox_DX, 0, 1); + + SpinBox_DY = new DlgRef_SpinBox(GroupBox1, "SpinBox_DY"); + Layout1->addWidget(SpinBox_DY, 1, 1); + +} + + +/* + * Destroys the object and frees any allocated resources + */ +SketcherGUI_2Spin::~SketcherGUI_2Spin() +{ + // no need to delete child widgets, Qt does it all for us +} diff --git a/src/SketcherGUI/SketcherGUI_2Spin.h b/src/SketcherGUI/SketcherGUI_2Spin.h new file mode 100644 index 000000000..395b80ab1 --- /dev/null +++ b/src/SketcherGUI/SketcherGUI_2Spin.h @@ -0,0 +1,48 @@ +// GEOM GEOMGUI : GUI for Geometry component +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SketcherGUI_2Spin.h +// Author : Damien COQUERET +// Module : GEOM +// $Header: + +#ifndef SKETCHERGUI_2SPIN_H +#define SKETCHERGUI_2SPIN_H + +#include "SketcherGUI_2Spin_QTD.h" +#include "DlgRef_SpinBox.h" + +class SketcherGUI_2Spin : public SketcherGUI_2Spin_QTD +{ + Q_OBJECT + +public: + SketcherGUI_2Spin(QWidget* parent = 0, const char* name = 0, WFlags fl = 0); + ~SketcherGUI_2Spin(); + + DlgRef_SpinBox* SpinBox_DX; + DlgRef_SpinBox* SpinBox_DY; + +}; + +#endif // SKETCHERGUI_2SPIN_H diff --git a/src/SketcherGUI/SketcherGUI_2Spin_QTD.cxx b/src/SketcherGUI/SketcherGUI_2Spin_QTD.cxx new file mode 100644 index 000000000..9646a2963 --- /dev/null +++ b/src/SketcherGUI/SketcherGUI_2Spin_QTD.cxx @@ -0,0 +1,99 @@ +/**************************************************************************** +** Form implementation generated from reading ui file 'SketcherGUI_2Spin_QTD.ui' +** +** Created: jeu oct 30 18:28:54 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#include "SketcherGUI_2Spin_QTD.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Constructs a SketcherGUI_2Spin_QTD which is a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +SketcherGUI_2Spin_QTD::SketcherGUI_2Spin_QTD( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + if ( !name ) + setName( "SketcherGUI_2Spin_QTD" ); + resize( 154, 89 ); + setCaption( trUtf8( "SketcherGUI_2Spin_QTD" ) ); + SketcherGUI_2Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "SketcherGUI_2Spin_QTDLayout"); + + GroupBox1 = new QGroupBox( this, "GroupBox1" ); + GroupBox1->setTitle( trUtf8( "Values" ) ); + GroupBox1->setColumnLayout(0, Qt::Vertical ); + GroupBox1->layout()->setSpacing( 6 ); + GroupBox1->layout()->setMargin( 11 ); + GroupBox1Layout = new QGridLayout( GroupBox1->layout() ); + GroupBox1Layout->setAlignment( Qt::AlignTop ); + + Layout3 = new QGridLayout( 0, 1, 1, 0, 6, "Layout3"); + + Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2"); + + buttonUndo = new QPushButton( GroupBox1, "buttonUndo" ); + buttonUndo->setText( trUtf8( "Undo" ) ); + + Layout2->addWidget( buttonUndo, 1, 0 ); + + buttonApply = new QPushButton( GroupBox1, "buttonApply" ); + buttonApply->setText( trUtf8( "Create" ) ); + + Layout2->addWidget( buttonApply, 0, 0 ); + QSpacerItem* spacer = new QSpacerItem( 0, 51, QSizePolicy::Minimum, QSizePolicy::Expanding ); + Layout2->addItem( spacer, 2, 0 ); + + Layout3->addLayout( Layout2, 0, 1 ); + + Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1"); + + TextLabel2 = new QLabel( GroupBox1, "TextLabel2" ); + TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) ); + TextLabel2->setText( trUtf8( "TL2" ) ); + + Layout1->addWidget( TextLabel2, 1, 0 ); + + TextLabel1 = new QLabel( GroupBox1, "TextLabel1" ); + TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) ); + TextLabel1->setText( trUtf8( "TL1" ) ); + + Layout1->addWidget( TextLabel1, 0, 0 ); + + SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" ); + SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) ); + + Layout1->addWidget( SpinBox1, 0, 1 ); + + SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" ); + SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) ); + + Layout1->addWidget( SpinBox2, 1, 1 ); + QSpacerItem* spacer_2 = new QSpacerItem( 0, 82, QSizePolicy::Minimum, QSizePolicy::Expanding ); + Layout1->addItem( spacer_2, 3, 1 ); + + Layout3->addLayout( Layout1, 0, 0 ); + + GroupBox1Layout->addLayout( Layout3, 0, 0 ); + + SketcherGUI_2Spin_QTDLayout->addWidget( GroupBox1, 0, 0 ); +} + +/* + * Destroys the object and frees any allocated resources + */ +SketcherGUI_2Spin_QTD::~SketcherGUI_2Spin_QTD() +{ + // no need to delete child widgets, Qt does it all for us +} + diff --git a/src/SketcherGUI/SketcherGUI_2Spin_QTD.h b/src/SketcherGUI/SketcherGUI_2Spin_QTD.h new file mode 100644 index 000000000..4dfefe1a7 --- /dev/null +++ b/src/SketcherGUI/SketcherGUI_2Spin_QTD.h @@ -0,0 +1,47 @@ +/**************************************************************************** +** Form interface generated from reading ui file 'SketcherGUI_2Spin_QTD.ui' +** +** Created: jeu oct 30 18:28:53 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#ifndef SKETCHERGUI_2SPIN_QTD_H +#define SKETCHERGUI_2SPIN_QTD_H + +#include +#include +class QVBoxLayout; +class QHBoxLayout; +class QGridLayout; +class QGroupBox; +class QLabel; +class QPushButton; +class QSpinBox; + +class SketcherGUI_2Spin_QTD : public QWidget +{ + Q_OBJECT + +public: + SketcherGUI_2Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~SketcherGUI_2Spin_QTD(); + + QGroupBox* GroupBox1; + QPushButton* buttonUndo; + QPushButton* buttonApply; + QLabel* TextLabel2; + QLabel* TextLabel1; + QSpinBox* SpinBox1; + QSpinBox* SpinBox2; + + +protected: + QGridLayout* SketcherGUI_2Spin_QTDLayout; + QGridLayout* GroupBox1Layout; + QGridLayout* Layout3; + QGridLayout* Layout2; + QGridLayout* Layout1; +}; + +#endif // SKETCHERGUI_2SPIN_QTD_H diff --git a/src/SketcherGUI/SketcherGUI_3Spin.cxx b/src/SketcherGUI/SketcherGUI_3Spin.cxx new file mode 100644 index 000000000..d6d6c88b0 --- /dev/null +++ b/src/SketcherGUI/SketcherGUI_3Spin.cxx @@ -0,0 +1,63 @@ +// GEOM GEOMGUI : GUI for Geometry component +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SketcherGUI_3Spin.cxx +// Author : Damien COQUERET +// Module : GEOM +// $Header: + +#include "SketcherGUI_3Spin.h" + +#include +#include +#include + +/* + * Constructs a SketcherGUI_3Spin which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' + */ +SketcherGUI_3Spin::SketcherGUI_3Spin(QWidget* parent, const char* name, WFlags fl) + :SketcherGUI_3Spin_QTD(parent, name, fl) +{ + SpinBox1->close(TRUE); + SpinBox2->close(TRUE); + SpinBox3->close(TRUE); + + SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX"); + Layout1->addWidget(SpinBox_DX, 0, 1); + + SpinBox_DY = new DlgRef_SpinBox(GroupBox1, "SpinBox_DY"); + Layout1->addWidget(SpinBox_DY, 1, 1); + + SpinBox_DZ = new DlgRef_SpinBox(GroupBox1, "SpinBox_DZ"); + Layout1->addWidget(SpinBox_DZ, 2, 1); +} + + +/* + * Destroys the object and frees any allocated resources + */ +SketcherGUI_3Spin::~SketcherGUI_3Spin() +{ + // no need to delete child widgets, Qt does it all for us +} diff --git a/src/SketcherGUI/SketcherGUI_3Spin.h b/src/SketcherGUI/SketcherGUI_3Spin.h new file mode 100644 index 000000000..763471926 --- /dev/null +++ b/src/SketcherGUI/SketcherGUI_3Spin.h @@ -0,0 +1,49 @@ +// GEOM GEOMGUI : GUI for Geometry component +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SketcherGUI_3Spin.h +// Author : Damien COQUERET +// Module : GEOM +// $Header: + +#ifndef SKETCHERGUI_3SPIN_H +#define SKETCHERGUI_3SPIN_H + +#include "SketcherGUI_3Spin_QTD.h" +#include "DlgRef_SpinBox.h" + +class SketcherGUI_3Spin : public SketcherGUI_3Spin_QTD +{ + Q_OBJECT + +public: + SketcherGUI_3Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~SketcherGUI_3Spin(); + + DlgRef_SpinBox* SpinBox_DX; + DlgRef_SpinBox* SpinBox_DY; + DlgRef_SpinBox* SpinBox_DZ; + +}; + +#endif // SKETCHERGUI_3SPIN_H diff --git a/src/SketcherGUI/SketcherGUI_3Spin_QTD.cxx b/src/SketcherGUI/SketcherGUI_3Spin_QTD.cxx new file mode 100644 index 000000000..a3576b05e --- /dev/null +++ b/src/SketcherGUI/SketcherGUI_3Spin_QTD.cxx @@ -0,0 +1,110 @@ +/**************************************************************************** +** Form implementation generated from reading ui file 'SketcherGUI_3Spin_QTD.ui' +** +** Created: jeu oct 30 18:28:54 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#include "SketcherGUI_3Spin_QTD.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Constructs a SketcherGUI_3Spin_QTD which is a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +SketcherGUI_3Spin_QTD::SketcherGUI_3Spin_QTD( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + if ( !name ) + setName( "SketcherGUI_3Spin_QTD" ); + resize( 154, 113 ); + setCaption( trUtf8( "SketcherGUI_3Spin_QTD" ) ); + SketcherGUI_3Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "SketcherGUI_3Spin_QTDLayout"); + + GroupBox1 = new QGroupBox( this, "GroupBox1" ); + GroupBox1->setTitle( trUtf8( "Values" ) ); + GroupBox1->setColumnLayout(0, Qt::Vertical ); + GroupBox1->layout()->setSpacing( 6 ); + GroupBox1->layout()->setMargin( 11 ); + GroupBox1Layout = new QGridLayout( GroupBox1->layout() ); + GroupBox1Layout->setAlignment( Qt::AlignTop ); + + Layout3 = new QGridLayout( 0, 1, 1, 0, 6, "Layout3"); + + Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2"); + + buttonUndo = new QPushButton( GroupBox1, "buttonUndo" ); + buttonUndo->setText( trUtf8( "Undo" ) ); + + Layout2->addWidget( buttonUndo, 1, 0 ); + + buttonApply = new QPushButton( GroupBox1, "buttonApply" ); + buttonApply->setText( trUtf8( "Create" ) ); + + Layout2->addWidget( buttonApply, 0, 0 ); + QSpacerItem* spacer = new QSpacerItem( 0, 51, QSizePolicy::Minimum, QSizePolicy::Expanding ); + Layout2->addItem( spacer, 2, 0 ); + + Layout3->addLayout( Layout2, 0, 1 ); + + Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1"); + + TextLabel2 = new QLabel( GroupBox1, "TextLabel2" ); + TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) ); + TextLabel2->setText( trUtf8( "TL2" ) ); + + Layout1->addWidget( TextLabel2, 1, 0 ); + + TextLabel1 = new QLabel( GroupBox1, "TextLabel1" ); + TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) ); + TextLabel1->setText( trUtf8( "TL1" ) ); + + Layout1->addWidget( TextLabel1, 0, 0 ); + + SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" ); + SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) ); + + Layout1->addWidget( SpinBox1, 0, 1 ); + + SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" ); + SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) ); + + Layout1->addWidget( SpinBox2, 1, 1 ); + + TextLabel3 = new QLabel( GroupBox1, "TextLabel3" ); + TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) ); + TextLabel3->setText( trUtf8( "TL3" ) ); + + Layout1->addWidget( TextLabel3, 2, 0 ); + QSpacerItem* spacer_2 = new QSpacerItem( 0, 82, QSizePolicy::Minimum, QSizePolicy::Expanding ); + Layout1->addItem( spacer_2, 3, 1 ); + + SpinBox3 = new QSpinBox( GroupBox1, "SpinBox3" ); + SpinBox3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox3->sizePolicy().hasHeightForWidth() ) ); + + Layout1->addWidget( SpinBox3, 2, 1 ); + + Layout3->addLayout( Layout1, 0, 0 ); + + GroupBox1Layout->addLayout( Layout3, 0, 0 ); + + SketcherGUI_3Spin_QTDLayout->addWidget( GroupBox1, 0, 0 ); +} + +/* + * Destroys the object and frees any allocated resources + */ +SketcherGUI_3Spin_QTD::~SketcherGUI_3Spin_QTD() +{ + // no need to delete child widgets, Qt does it all for us +} + diff --git a/src/SketcherGUI/SketcherGUI_3Spin_QTD.h b/src/SketcherGUI/SketcherGUI_3Spin_QTD.h new file mode 100644 index 000000000..702e1fb87 --- /dev/null +++ b/src/SketcherGUI/SketcherGUI_3Spin_QTD.h @@ -0,0 +1,49 @@ +/**************************************************************************** +** Form interface generated from reading ui file 'SketcherGUI_3Spin_QTD.ui' +** +** Created: jeu oct 30 18:28:54 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#ifndef SKETCHERGUI_3SPIN_QTD_H +#define SKETCHERGUI_3SPIN_QTD_H + +#include +#include +class QVBoxLayout; +class QHBoxLayout; +class QGridLayout; +class QGroupBox; +class QLabel; +class QPushButton; +class QSpinBox; + +class SketcherGUI_3Spin_QTD : public QWidget +{ + Q_OBJECT + +public: + SketcherGUI_3Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~SketcherGUI_3Spin_QTD(); + + QGroupBox* GroupBox1; + QPushButton* buttonUndo; + QPushButton* buttonApply; + QLabel* TextLabel2; + QLabel* TextLabel1; + QSpinBox* SpinBox1; + QSpinBox* SpinBox2; + QLabel* TextLabel3; + QSpinBox* SpinBox3; + + +protected: + QGridLayout* SketcherGUI_3Spin_QTDLayout; + QGridLayout* GroupBox1Layout; + QGridLayout* Layout3; + QGridLayout* Layout2; + QGridLayout* Layout1; +}; + +#endif // SKETCHERGUI_3SPIN_QTD_H diff --git a/src/SketcherGUI/SketcherGUI_4Spin.cxx b/src/SketcherGUI/SketcherGUI_4Spin.cxx new file mode 100644 index 000000000..afbe71c71 --- /dev/null +++ b/src/SketcherGUI/SketcherGUI_4Spin.cxx @@ -0,0 +1,67 @@ +// GEOM GEOMGUI : GUI for Geometry component +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SketcherGUI_4Spin.cxx +// Author : Damien COQUERET +// Module : GEOM +// $Header: + +#include "SketcherGUI_4Spin.h" + +#include +#include +#include + +/* + * Constructs a SketcherGUI_4Spin which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' + */ +SketcherGUI_4Spin::SketcherGUI_4Spin(QWidget* parent, const char* name, WFlags fl) + :SketcherGUI_4Spin_QTD(parent, name, fl) +{ + SpinBox1->close(TRUE); + SpinBox2->close(TRUE); + SpinBox3->close(TRUE); + SpinBox4->close(TRUE); + + SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX"); + Layout1->addWidget(SpinBox_DX, 0, 1); + + SpinBox_DY = new DlgRef_SpinBox(GroupBox1, "SpinBox_DY"); + Layout1->addWidget(SpinBox_DY, 1, 1); + + SpinBox_DZ = new DlgRef_SpinBox(GroupBox1, "SpinBox_DZ"); + Layout1->addWidget(SpinBox_DZ, 2, 1); + + SpinBox_DS = new DlgRef_SpinBox(GroupBox1, "SpinBox_DS"); + Layout1->addWidget(SpinBox_DS, 3, 1); +} + + +/* + * Destroys the object and frees any allocated resources + */ +SketcherGUI_4Spin::~SketcherGUI_4Spin() +{ + // no need to delete child widgets, Qt does it all for us +} diff --git a/src/SketcherGUI/SketcherGUI_4Spin.h b/src/SketcherGUI/SketcherGUI_4Spin.h new file mode 100644 index 000000000..8816e961f --- /dev/null +++ b/src/SketcherGUI/SketcherGUI_4Spin.h @@ -0,0 +1,50 @@ +// GEOM GEOMGUI : GUI for Geometry component +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SketcherGUI_4Spin.h +// Author : Damien COQUERET +// Module : GEOM +// $Header: + +#ifndef SKETCHERGUI_4SPIN_H +#define SKETCHERGUI_4SPIN_H + +#include "SketcherGUI_4Spin_QTD.h" +#include "DlgRef_SpinBox.h" + +class SketcherGUI_4Spin : public SketcherGUI_4Spin_QTD +{ + Q_OBJECT + +public: + SketcherGUI_4Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~SketcherGUI_4Spin(); + + DlgRef_SpinBox* SpinBox_DX; + DlgRef_SpinBox* SpinBox_DY; + DlgRef_SpinBox* SpinBox_DZ; + DlgRef_SpinBox* SpinBox_DS; + +}; + +#endif // SKETCHERGUI_4SPIN_H diff --git a/src/SketcherGUI/SketcherGUI_4Spin_QTD.cxx b/src/SketcherGUI/SketcherGUI_4Spin_QTD.cxx new file mode 100644 index 000000000..d80d46331 --- /dev/null +++ b/src/SketcherGUI/SketcherGUI_4Spin_QTD.cxx @@ -0,0 +1,121 @@ +/**************************************************************************** +** Form implementation generated from reading ui file 'SketcherGUI_4Spin_QTD.ui' +** +** Created: lun nov 3 17:39:03 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#include "SketcherGUI_4Spin_QTD.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Constructs a SketcherGUI_4Spin_QTD which is a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +SketcherGUI_4Spin_QTD::SketcherGUI_4Spin_QTD( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + if ( !name ) + setName( "SketcherGUI_4Spin_QTD" ); + resize( 143, 148 ); + setCaption( trUtf8( "SketcherGUI_4Spin_QTD" ) ); + SketcherGUI_4Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "SketcherGUI_4Spin_QTDLayout"); + + GroupBox1 = new QGroupBox( this, "GroupBox1" ); + GroupBox1->setTitle( trUtf8( "Values" ) ); + GroupBox1->setColumnLayout(0, Qt::Vertical ); + GroupBox1->layout()->setSpacing( 6 ); + GroupBox1->layout()->setMargin( 11 ); + GroupBox1Layout = new QGridLayout( GroupBox1->layout() ); + GroupBox1Layout->setAlignment( Qt::AlignTop ); + + Layout3 = new QGridLayout( 0, 1, 1, 0, 6, "Layout3"); + + Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2"); + + buttonUndo = new QPushButton( GroupBox1, "buttonUndo" ); + buttonUndo->setText( trUtf8( "Undo" ) ); + + Layout2->addWidget( buttonUndo, 1, 0 ); + + buttonApply = new QPushButton( GroupBox1, "buttonApply" ); + buttonApply->setText( trUtf8( "Create" ) ); + + Layout2->addWidget( buttonApply, 0, 0 ); + QSpacerItem* spacer = new QSpacerItem( 0, 51, QSizePolicy::Minimum, QSizePolicy::Expanding ); + Layout2->addItem( spacer, 2, 0 ); + + Layout3->addLayout( Layout2, 0, 1 ); + + Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1"); + + SpinBox3 = new QSpinBox( GroupBox1, "SpinBox3" ); + SpinBox3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox3->sizePolicy().hasHeightForWidth() ) ); + + Layout1->addWidget( SpinBox3, 2, 1 ); + + SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" ); + SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) ); + + Layout1->addWidget( SpinBox2, 1, 1 ); + + TextLabel2 = new QLabel( GroupBox1, "TextLabel2" ); + TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) ); + TextLabel2->setText( trUtf8( "TL2" ) ); + + Layout1->addWidget( TextLabel2, 1, 0 ); + QSpacerItem* spacer_2 = new QSpacerItem( 0, 70, QSizePolicy::Minimum, QSizePolicy::Expanding ); + Layout1->addItem( spacer_2, 4, 1 ); + + SpinBox4 = new QSpinBox( GroupBox1, "SpinBox4" ); + SpinBox4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox4->sizePolicy().hasHeightForWidth() ) ); + + Layout1->addWidget( SpinBox4, 3, 1 ); + + TextLabel3 = new QLabel( GroupBox1, "TextLabel3" ); + TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) ); + TextLabel3->setText( trUtf8( "TL3" ) ); + + Layout1->addWidget( TextLabel3, 2, 0 ); + + SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" ); + SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) ); + + Layout1->addWidget( SpinBox1, 0, 1 ); + + TextLabel1 = new QLabel( GroupBox1, "TextLabel1" ); + TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) ); + TextLabel1->setText( trUtf8( "TL1" ) ); + + Layout1->addWidget( TextLabel1, 0, 0 ); + + TextLabel4 = new QLabel( GroupBox1, "TextLabel4" ); + TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) ); + TextLabel4->setText( trUtf8( "TL4" ) ); + + Layout1->addWidget( TextLabel4, 3, 0 ); + + Layout3->addLayout( Layout1, 0, 0 ); + + GroupBox1Layout->addLayout( Layout3, 0, 0 ); + + SketcherGUI_4Spin_QTDLayout->addWidget( GroupBox1, 0, 0 ); +} + +/* + * Destroys the object and frees any allocated resources + */ +SketcherGUI_4Spin_QTD::~SketcherGUI_4Spin_QTD() +{ + // no need to delete child widgets, Qt does it all for us +} + diff --git a/src/SketcherGUI/SketcherGUI_4Spin_QTD.h b/src/SketcherGUI/SketcherGUI_4Spin_QTD.h new file mode 100644 index 000000000..6b9a320ef --- /dev/null +++ b/src/SketcherGUI/SketcherGUI_4Spin_QTD.h @@ -0,0 +1,51 @@ +/**************************************************************************** +** Form interface generated from reading ui file 'SketcherGUI_4Spin_QTD.ui' +** +** Created: lun nov 3 17:39:03 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#ifndef SKETCHERGUI_4SPIN_QTD_H +#define SKETCHERGUI_4SPIN_QTD_H + +#include +#include +class QVBoxLayout; +class QHBoxLayout; +class QGridLayout; +class QGroupBox; +class QLabel; +class QPushButton; +class QSpinBox; + +class SketcherGUI_4Spin_QTD : public QWidget +{ + Q_OBJECT + +public: + SketcherGUI_4Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~SketcherGUI_4Spin_QTD(); + + QGroupBox* GroupBox1; + QPushButton* buttonUndo; + QPushButton* buttonApply; + QSpinBox* SpinBox3; + QSpinBox* SpinBox2; + QLabel* TextLabel2; + QSpinBox* SpinBox4; + QLabel* TextLabel3; + QSpinBox* SpinBox1; + QLabel* TextLabel1; + QLabel* TextLabel4; + + +protected: + QGridLayout* SketcherGUI_4Spin_QTDLayout; + QGridLayout* GroupBox1Layout; + QGridLayout* Layout3; + QGridLayout* Layout2; + QGridLayout* Layout1; +}; + +#endif // SKETCHERGUI_4SPIN_QTD_H diff --git a/src/SketcherGUI/SketcherGUI_Dir1_QTD.cxx b/src/SketcherGUI/SketcherGUI_Dir1_QTD.cxx new file mode 100644 index 000000000..75026eb77 --- /dev/null +++ b/src/SketcherGUI/SketcherGUI_Dir1_QTD.cxx @@ -0,0 +1,80 @@ +/**************************************************************************** +** Form implementation generated from reading ui file 'SketcherGUI_Dir1_QTD.ui' +** +** Created: lun nov 3 17:27:54 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#include "SketcherGUI_Dir1_QTD.h" + +#include +#include +#include +#include +#include +#include +#include + +/* + * Constructs a SketcherGUI_Dir1_QTD which is a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +SketcherGUI_Dir1_QTD::SketcherGUI_Dir1_QTD( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + if ( !name ) + setName( "SketcherGUI_Dir1_QTD" ); + resize( 131, 123 ); + setCaption( trUtf8( "SketcherGUI_Dir1_QTD" ) ); + SketcherGUI_Dir1_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "SketcherGUI_Dir1_QTDLayout"); + + GroupDir1 = new QButtonGroup( this, "GroupDir1" ); + GroupDir1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupDir1->sizePolicy().hasHeightForWidth() ) ); + GroupDir1->setTitle( trUtf8( "Direction" ) ); + GroupDir1->setColumnLayout(0, Qt::Vertical ); + GroupDir1->layout()->setSpacing( 6 ); + GroupDir1->layout()->setMargin( 11 ); + GroupDir1Layout = new QGridLayout( GroupDir1->layout() ); + GroupDir1Layout->setAlignment( Qt::AlignTop ); + + Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1"); + + RB_Dir12 = new QRadioButton( GroupDir1, "RB_Dir12" ); + RB_Dir12->setText( trUtf8( "Perpendicular" ) ); + + Layout1->addWidget( RB_Dir12, 1, 0 ); + + RB_Dir13 = new QRadioButton( GroupDir1, "RB_Dir13" ); + RB_Dir13->setText( trUtf8( "Tangent" ) ); + + Layout1->addWidget( RB_Dir13, 2, 0 ); + + RB_Dir11 = new QRadioButton( GroupDir1, "RB_Dir11" ); + RB_Dir11->setText( trUtf8( "Angle" ) ); + + Layout1->addWidget( RB_Dir11, 0, 0 ); + + RB_Dir14 = new QRadioButton( GroupDir1, "RB_Dir14" ); + RB_Dir14->setText( trUtf8( "VX-VY" ) ); + + Layout1->addWidget( RB_Dir14, 3, 0 ); + + GroupDir1Layout->addLayout( Layout1, 0, 0 ); + + SketcherGUI_Dir1_QTDLayout->addWidget( GroupDir1, 0, 0 ); + + // tab order + setTabOrder( RB_Dir11, RB_Dir12 ); + setTabOrder( RB_Dir12, RB_Dir13 ); + setTabOrder( RB_Dir13, RB_Dir14 ); +} + +/* + * Destroys the object and frees any allocated resources + */ +SketcherGUI_Dir1_QTD::~SketcherGUI_Dir1_QTD() +{ + // no need to delete child widgets, Qt does it all for us +} + diff --git a/src/SketcherGUI/SketcherGUI_Dir1_QTD.h b/src/SketcherGUI/SketcherGUI_Dir1_QTD.h new file mode 100644 index 000000000..8521a9a08 --- /dev/null +++ b/src/SketcherGUI/SketcherGUI_Dir1_QTD.h @@ -0,0 +1,41 @@ +/**************************************************************************** +** Form interface generated from reading ui file 'SketcherGUI_Dir1_QTD.ui' +** +** Created: lun nov 3 17:27:54 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#ifndef SKETCHERGUI_DIR1_QTD_H +#define SKETCHERGUI_DIR1_QTD_H + +#include +#include +class QVBoxLayout; +class QHBoxLayout; +class QGridLayout; +class QButtonGroup; +class QRadioButton; + +class SketcherGUI_Dir1_QTD : public QWidget +{ + Q_OBJECT + +public: + SketcherGUI_Dir1_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~SketcherGUI_Dir1_QTD(); + + QButtonGroup* GroupDir1; + QRadioButton* RB_Dir12; + QRadioButton* RB_Dir13; + QRadioButton* RB_Dir11; + QRadioButton* RB_Dir14; + + +protected: + QGridLayout* SketcherGUI_Dir1_QTDLayout; + QGridLayout* GroupDir1Layout; + QGridLayout* Layout1; +}; + +#endif // SKETCHERGUI_DIR1_QTD_H diff --git a/src/SketcherGUI/SketcherGUI_Dir2_QTD.cxx b/src/SketcherGUI/SketcherGUI_Dir2_QTD.cxx new file mode 100644 index 000000000..6ba086998 --- /dev/null +++ b/src/SketcherGUI/SketcherGUI_Dir2_QTD.cxx @@ -0,0 +1,76 @@ +/**************************************************************************** +** Form implementation generated from reading ui file 'SketcherGUI_Dir2_QTD.ui' +** +** Created: lun nov 3 17:27:54 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#include "SketcherGUI_Dir2_QTD.h" + +#include +#include +#include +#include +#include +#include +#include + +/* + * Constructs a SketcherGUI_Dir2_QTD which is a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +SketcherGUI_Dir2_QTD::SketcherGUI_Dir2_QTD( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + if ( !name ) + setName( "SketcherGUI_Dir2_QTD" ); + resize( 124, 106 ); + setCaption( trUtf8( "SketcherGUI_Dir2_QTD" ) ); + SketcherGUI_Dir2_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "SketcherGUI_Dir2_QTDLayout"); + + GroupDir2 = new QButtonGroup( this, "GroupDir2" ); + GroupDir2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupDir2->sizePolicy().hasHeightForWidth() ) ); + GroupDir2->setTitle( trUtf8( "Direction" ) ); + GroupDir2->setColumnLayout(0, Qt::Vertical ); + GroupDir2->layout()->setSpacing( 6 ); + GroupDir2->layout()->setMargin( 11 ); + GroupDir2Layout = new QGridLayout( GroupDir2->layout() ); + GroupDir2Layout->setAlignment( Qt::AlignTop ); + + Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1"); + + RB_Dir22 = new QRadioButton( GroupDir2, "RB_Dir22" ); + RB_Dir22->setText( trUtf8( "X" ) ); + + Layout1->addWidget( RB_Dir22, 1, 0 ); + + RB_Dir23 = new QRadioButton( GroupDir2, "RB_Dir23" ); + RB_Dir23->setText( trUtf8( "Y" ) ); + + Layout1->addWidget( RB_Dir23, 2, 0 ); + QSpacerItem* spacer = new QSpacerItem( 0, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); + Layout1->addItem( spacer, 3, 0 ); + + RB_Dir21 = new QRadioButton( GroupDir2, "RB_Dir21" ); + RB_Dir21->setText( trUtf8( "Length" ) ); + + Layout1->addWidget( RB_Dir21, 0, 0 ); + + GroupDir2Layout->addLayout( Layout1, 0, 0 ); + + SketcherGUI_Dir2_QTDLayout->addWidget( GroupDir2, 0, 0 ); + + // tab order + setTabOrder( RB_Dir21, RB_Dir22 ); + setTabOrder( RB_Dir22, RB_Dir23 ); +} + +/* + * Destroys the object and frees any allocated resources + */ +SketcherGUI_Dir2_QTD::~SketcherGUI_Dir2_QTD() +{ + // no need to delete child widgets, Qt does it all for us +} + diff --git a/src/SketcherGUI/SketcherGUI_Dir2_QTD.h b/src/SketcherGUI/SketcherGUI_Dir2_QTD.h new file mode 100644 index 000000000..46ed91004 --- /dev/null +++ b/src/SketcherGUI/SketcherGUI_Dir2_QTD.h @@ -0,0 +1,40 @@ +/**************************************************************************** +** Form interface generated from reading ui file 'SketcherGUI_Dir2_QTD.ui' +** +** Created: lun nov 3 17:27:54 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#ifndef SKETCHERGUI_DIR2_QTD_H +#define SKETCHERGUI_DIR2_QTD_H + +#include +#include +class QVBoxLayout; +class QHBoxLayout; +class QGridLayout; +class QButtonGroup; +class QRadioButton; + +class SketcherGUI_Dir2_QTD : public QWidget +{ + Q_OBJECT + +public: + SketcherGUI_Dir2_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~SketcherGUI_Dir2_QTD(); + + QButtonGroup* GroupDir2; + QRadioButton* RB_Dir22; + QRadioButton* RB_Dir23; + QRadioButton* RB_Dir21; + + +protected: + QGridLayout* SketcherGUI_Dir2_QTDLayout; + QGridLayout* GroupDir2Layout; + QGridLayout* Layout1; +}; + +#endif // SKETCHERGUI_DIR2_QTD_H diff --git a/src/SketcherGUI/SketcherGUI_Dlg.cxx b/src/SketcherGUI/SketcherGUI_Dlg.cxx new file mode 100644 index 000000000..47cc5c96f --- /dev/null +++ b/src/SketcherGUI/SketcherGUI_Dlg.cxx @@ -0,0 +1,1058 @@ +// GEOM GEOMGUI : GUI for Geometry component +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SketcherGUI_Dlg.cxx +// Author : Damien COQUERET +// Module : GEOM +// $Header: + +using namespace std; +#include "SketcherGUI_Dlg.h" +#include "SketcherGUI_Profile.h" + +#include +#include +#include + +//================================================================================= +// class : SketcherGUI_Dlg() +// purpose : Constructs a SketcherGUI_Dlg which is a child of 'parent', with the +// name 'name' and widget flags set to 'f'. +// The dialog will by default be modeless, unless you set 'modal' to +// TRUE to construct a modal dialog. +//================================================================================= +SketcherGUI_Dlg::SketcherGUI_Dlg(QWidget* parent, const char* name, SketcherGUI* theSketcherGUI, SALOME_Selection* Sel, bool modal, WFlags fl) + :SketcherGUI_Skeleton_QTD(parent, name, modal, fl) +{ + if (!name) + setName("SketcherGUI_Dlg"); + + buttonCancel->setText(tr("GEOM_BUT_CLOSE")); + GroupVal->close(TRUE); + GroupDest2->close(TRUE); + GroupDest3->close(TRUE); + resize(0, 0); + + QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT"))); + + setCaption(tr("Sketcher Construction")); + + /***************************************************************/ + GroupPt = new SketcherGUI_Point_QTD(GroupDest, "GroupPt"); + GroupD1 = new SketcherGUI_Dir1_QTD(GroupDest, "GroupD1"); + GroupD2 = new SketcherGUI_Dir2_QTD(GroupDest, "GroupD2"); + + Group1Sel = new SketcherGUI_1Sel_QTD(this, "Group1Sel"); + Group1Sel->TextLabel1->setText(tr("Point :")); + Group1Sel->PushButton1->setPixmap(image0); + + Group1Spin = new SketcherGUI_1Spin(this, "Group1Spin"); + Group2Spin = new SketcherGUI_2Spin(this, "Group2Spin"); + Group3Spin = new SketcherGUI_3Spin(this, "Group3Spin"); + Group4Spin = new SketcherGUI_4Spin(this, "Group4Spin"); + + Layout5->addMultiCellWidget(GroupPt, 1, 1, 0, 1); + Layout5->addWidget(GroupD1, 1, 0); + Layout5->addWidget(GroupD2, 1, 1); + + Layout1->addWidget(Group1Sel, 2, 0); + Layout1->addWidget(Group1Spin, 2, 0); + Layout1->addWidget(Group2Spin, 2, 0); + Layout1->addWidget(Group3Spin, 2, 0); + Layout1->addWidget(Group4Spin, 2, 0); + /***************************************************************/ + + mySelection = Sel; + mySimulationTopoDs1.Nullify(); + mySimulationTopoDs2.Nullify(); + mySketcherGUI = theSketcherGUI; + + /* Get setting of step value from file configuration */ + QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep"); + step = St.toDouble(); + + myGeomBase = new GEOMBase(); + myGeomGUI = GEOMContext::GetGeomGUI(); + myGeomGUI->SetActiveDialogBox((QDialog*)this); + myGeom = myGeomGUI->myComponentGeom; + + myVertexFilter = new GEOM_ShapeTypeFilter(TopAbs_VERTEX, myGeom); + mySelection->AddFilter(myVertexFilter); + + /* signals and slots connections */ + connect(buttonEnd, SIGNAL(clicked()), this, SLOT(ClickOnEnd())); + connect(buttonClose, SIGNAL(clicked()), this, SLOT(ClickOnClose())); + connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); + + connect(Group1Sel->buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); + connect(Group1Sel->buttonUndo, SIGNAL(clicked()), this, SLOT(ClickOnUndo())); + connect(Group1Spin->buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); + connect(Group1Spin->buttonUndo, SIGNAL(clicked()), this, SLOT(ClickOnUndo())); + connect(Group2Spin->buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); + connect(Group2Spin->buttonUndo, SIGNAL(clicked()), this, SLOT(ClickOnUndo())); + connect(Group3Spin->buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); + connect(Group3Spin->buttonUndo, SIGNAL(clicked()), this, SLOT(ClickOnUndo())); + connect(Group4Spin->buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); + connect(Group4Spin->buttonUndo, SIGNAL(clicked()), this, SLOT(ClickOnUndo())); + + connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(TypeClicked(int))); + connect(GroupDest1, SIGNAL(clicked(int)), this, SLOT(DestClicked(int))); + connect(GroupPt->GroupPoint, SIGNAL(clicked(int)), this, SLOT(PointClicked(int))); + connect(GroupD1->GroupDir1, SIGNAL(clicked(int)), this, SLOT(Dir1Clicked(int))); + connect(GroupD2->GroupDir2, SIGNAL(clicked(int)), this, SLOT(Dir2Clicked(int))); + + connect(Group1Sel->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); + connect(Group1Sel->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); + + connect(Group1Spin->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); + connect(Group2Spin->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); + connect(Group2Spin->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); + connect(Group3Spin->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); + connect(Group3Spin->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); + connect(Group3Spin->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); + connect(Group4Spin->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); + connect(Group4Spin->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); + connect(Group4Spin->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); + connect(Group4Spin->SpinBox_DS, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); + + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group1Spin->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group2Spin->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group2Spin->SpinBox_DY, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group3Spin->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group3Spin->SpinBox_DY, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group3Spin->SpinBox_DZ, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group4Spin->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group4Spin->SpinBox_DY, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group4Spin->SpinBox_DZ, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group4Spin->SpinBox_DS, SLOT(SetStep(double))); + + connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); + connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); + + /* Move widget on the botton right corner of main widget */ +// int x, y; +// myGeomBase->DefineDlgPosition( this, x, y ); + + mySketcherGUI = theSketcherGUI; + this->Init(); + this->show(); +} + + +//================================================================================= +// function : ~SketcherGUI_Dlg() +// purpose : Destroys the object and frees any allocated resources +//================================================================================= +SketcherGUI_Dlg::~SketcherGUI_Dlg() +{ + // no need to delete child widgets, Qt does it all for us + this->destroy(TRUE, TRUE); +} + + +//================================================================================= +// function : Init() +// purpose : +//================================================================================= +void SketcherGUI_Dlg::Init() +{ + /* init variables */ + myEditCurrentArgument = Group1Sel->LineEdit1; + + /* min, max, step and decimals for spin boxes */ + Group1Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3); + Group2Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3); + Group2Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3); + Group3Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3); + Group3Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3); + Group3Spin->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3); + Group4Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, 0.1, 3); + Group4Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, 0.1, 3); + Group4Spin->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3); + Group4Spin->SpinBox_DS->RangeStepAndValidator(-999.999, 999.999, 5., 3); + + Group1Spin->SpinBox_DX->SetValue(0.0); + Group2Spin->SpinBox_DX->SetValue(0.0); + Group2Spin->SpinBox_DY->SetValue(0.0); + Group3Spin->SpinBox_DX->SetValue(0.0); + Group3Spin->SpinBox_DY->SetValue(0.0); + Group3Spin->SpinBox_DZ->SetValue(0.0); + Group4Spin->SpinBox_DX->SetValue(0.0); + Group4Spin->SpinBox_DY->SetValue(0.0); + Group4Spin->SpinBox_DZ->SetValue(0.0); + Group4Spin->SpinBox_DS->SetValue(0.0); + + /* displays Dialog */ + Group1Sel->buttonUndo->setEnabled(false); + Group1Spin->buttonUndo->setEnabled(false); + Group2Spin->buttonUndo->setEnabled(false); + Group3Spin->buttonUndo->setEnabled(false); + Group4Spin->buttonUndo->setEnabled(false); + + buttonEnd->setFocus(); + RadioButton1->setChecked(true); + //RadioButton2->setEnabled(false); + + myLastOp = 0; + myLastX1 = 0.0; + myLastY1 = 0.0; + myLastX2 = 0.0; + myLastY2 = 0.0; + + mySketchState = FIRST_POINT; + this->TypeClicked(0); + + return; +} + + +//================================================================================= +// function : InitClick() +// purpose : +//================================================================================= +void SketcherGUI_Dlg::InitClick() +{ + disconnect(mySelection, 0, this, 0); + + Group2Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3); + Group2Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3); + Group3Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3); + Group3Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3); + Group3Spin->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3); + + Group1Sel->hide(); + Group1Spin->hide(); + Group2Spin->hide(); + Group3Spin->hide(); + Group4Spin->hide(); + + resize(0, 0); + + return; +} + + +//================================================================================= +// function : TypeClicked() +// purpose : Radio button management +//================================================================================= +void SketcherGUI_Dlg::TypeClicked(int constructorId) +{ + myConstructorId = constructorId; + if(myConstructorId == 0) { // SEGMENT + GroupD2->setEnabled(true); + RB_Dest1->setEnabled(true); + RB_Dest1->setChecked(true); + this->DestClicked(1); + } + else if(myConstructorId == 1) { // ARC + GroupD2->setEnabled(false); + RB_Dest1->setEnabled(false); + RB_Dest2->setChecked(true); + this->DestClicked(0); + } + return; +} + + +//================================================================================= +// function : DestClicked() +// purpose : Radio button management +//================================================================================= +void SketcherGUI_Dlg::DestClicked(int constructorId) +{ + GroupPt->hide(); + GroupD1->hide(); + GroupD2->hide(); + + if(constructorId == 1) { // Point + GroupPt->RB_Point1->setChecked(true); + GroupPt->show(); + this->PointClicked(1); // XY + } + else if(constructorId == 0) { // Direction + GroupD1->RB_Dir11->setChecked(true); + GroupD1->show(); + GroupD2->show(); + this->Dir1Clicked(2); // Angle + } + return; +} + + +//================================================================================= +// function : PointClicked() +// purpose : Radio button management +//================================================================================= +void SketcherGUI_Dlg::PointClicked(int constructorId) +{ + this->InitClick(); + + if(myConstructorId == 0) { // SEGMENT + if(constructorId == 1) { // XY + mySketchType = PT_ABS; + Group2Spin->TextLabel1->setText(tr("X :")); + Group2Spin->TextLabel2->setText(tr("Y :")); + myX = 0.0; + Group2Spin->SpinBox_DX->SetValue(myX); + myY = 0.0; + Group2Spin->SpinBox_DY->SetValue(myY); + Group2Spin->show(); + this->MakeSimulationAndDisplay(); + } + else if(constructorId == 0) { // DXDY + mySketchType = PT_RELATIVE; + Group2Spin->TextLabel1->setText(tr("DX :")); + Group2Spin->TextLabel2->setText(tr("DY :")); + myDX = 0.0; + Group2Spin->SpinBox_DX->SetValue(myDX); + myDY = 0.0; + Group2Spin->SpinBox_DY->SetValue(myDY); + Group2Spin->show(); + this->MakeSimulationAndDisplay(); + } + else if(constructorId == 2) { // Selection + mySketchType = PT_SEL; + myEditCurrentArgument = Group1Sel->LineEdit1; + connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + Group1Sel->show(); + this->SelectionIntoArgument(); + } + } + + return; +} + + +//================================================================================= +// function : Dir1Clicked() +// purpose : Radio button management +//================================================================================= +void SketcherGUI_Dlg::Dir1Clicked(int constructorId) +{ + myConstructorDirId = constructorId; + GroupD2->RB_Dir21->setChecked(true); + this->Dir2Clicked(2); + return; +} + + +//================================================================================= +// function : Dir2Clicked() +// purpose : Radio button management +//================================================================================= +void SketcherGUI_Dlg::Dir2Clicked(int constructorId) +{ + this->InitClick(); + myAngle = 0.0; + + if(myConstructorId == 0) { // SEGMENT + myX = 0.0; + myY = 0.0; + myLength = 100.0; + if(myConstructorDirId == 2) { // Angle + Group2Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, 5., 3); + Group2Spin->TextLabel1->setText(tr("Angle :")); + Group2Spin->SpinBox_DX->SetValue(myAngle); + Group2Spin->show(); + + if(constructorId == 2) { // Length + mySketchType = DIR_ANGLE_LENGTH; + Group2Spin->TextLabel2->setText(tr("Length :")); + Group2Spin->SpinBox_DY->SetValue(myLength); + } + else if(constructorId == 0) { // X + mySketchType = DIR_ANGLE_X; + Group2Spin->TextLabel2->setText(tr("Abs. X :")); + Group2Spin->SpinBox_DY->SetValue(myX); + } + else if(constructorId == 1) { // Y + mySketchType = DIR_ANGLE_Y; + Group2Spin->TextLabel2->setText(tr("Abs. Y :")); + Group2Spin->SpinBox_DY->SetValue(myY); + } + } + else if(myConstructorDirId == 0) { // Perpendicular + Group1Spin->show(); + + if(constructorId == 2) { // Length + mySketchType = DIR_PER_LENGTH; + Group1Spin->TextLabel1->setText(tr("Length :")); + Group1Spin->SpinBox_DX->SetValue(myLength); + } + else if(constructorId == 0) { // X + mySketchType = DIR_PER_X; + Group1Spin->TextLabel1->setText(tr("Abs. X :")); + Group1Spin->SpinBox_DX->SetValue(myX); + } + else if(constructorId == 1) { // Y + mySketchType = DIR_PER_Y; + Group1Spin->TextLabel1->setText(tr("Abs. Y :")); + Group1Spin->SpinBox_DX->SetValue(myY); + } + } + else if(myConstructorDirId == 1) { // Tangent + Group1Spin->show(); + + if(constructorId == 2) { // Length + mySketchType = DIR_TAN_LENGTH; + Group1Spin->TextLabel1->setText(tr("Length :")); + Group1Spin->SpinBox_DX->SetValue(myLength); + } + else if(constructorId == 0) { // X + mySketchType = DIR_TAN_X; + Group1Spin->TextLabel1->setText(tr("Abs. X :")); + Group1Spin->SpinBox_DX->SetValue(myX); + } + else if(constructorId == 1) { // Y + mySketchType = DIR_TAN_Y; + Group1Spin->TextLabel1->setText(tr("Abs. Y :")); + Group1Spin->SpinBox_DX->SetValue(myY); + } + } + else if(myConstructorDirId == 3) { // DXDY + Group3Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, 0.1, 3); + Group3Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, 0.1, 3); + Group3Spin->TextLabel1->setText(tr("VX :")); + Group3Spin->TextLabel2->setText(tr("VY :")); + myDX = 0.0; + Group3Spin->SpinBox_DX->SetValue(myDX); + myDY = 0.0; + Group3Spin->SpinBox_DY->SetValue(myDY); + Group3Spin->show(); + + if(constructorId == 2) { // Length + mySketchType = DIR_DXDY_LENGTH; + Group3Spin->TextLabel3->setText(tr("Length :")); + Group3Spin->SpinBox_DZ->SetValue(myLength); + } + else if(constructorId == 0) { // X + mySketchType = DIR_DXDY_X; + Group3Spin->TextLabel3->setText(tr("X :")); + Group3Spin->SpinBox_DZ->SetValue(myX); + } + else if(constructorId == 1) { // Y + mySketchType = DIR_DXDY_Y; + Group3Spin->TextLabel3->setText(tr("Y :")); + Group3Spin->SpinBox_DZ->SetValue(myY); + } + } + } + else if(myConstructorId == 1) { // ARC + if(myConstructorDirId == 2) { // Angle + if(constructorId == 2) { // Length + mySketchType = DIR_ANGLE_LENGTH; + Group3Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, 5., 3); + Group3Spin->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, 5., 3); + Group3Spin->TextLabel1->setText(tr("Angle :")); + Group3Spin->TextLabel2->setText(tr("Radius :")); + Group3Spin->TextLabel3->setText(tr("Angle :")); + Group3Spin->SpinBox_DX->SetValue(myAngle); + myRadius = 100.0; + Group3Spin->SpinBox_DY->SetValue(myRadius); + myLength = 30.0; + Group3Spin->SpinBox_DZ->SetValue(myLength); + Group3Spin->show(); + } + } + else if(myConstructorDirId == 0) { // Perpendicular + if(constructorId == 2) { // Length + mySketchType = DIR_PER_LENGTH; + Group2Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, 5., 3); + Group2Spin->TextLabel1->setText(tr("Radius :")); + Group2Spin->TextLabel2->setText(tr("Angle :")); + myRadius = 100.0; + Group2Spin->SpinBox_DX->SetValue(myRadius); + myLength = 30.0; + Group2Spin->SpinBox_DY->SetValue(myLength); + Group2Spin->show(); + } + } + else if(myConstructorDirId == 1) { // Tangent + if(constructorId == 2) { // Length + mySketchType = DIR_TAN_LENGTH; + Group2Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, 5., 3); + Group2Spin->TextLabel1->setText(tr("Radius :")); + Group2Spin->TextLabel2->setText(tr("Angle :")); + myRadius = 100.0; + Group2Spin->SpinBox_DX->SetValue(myRadius); + myLength = 30.0; + Group2Spin->SpinBox_DY->SetValue(myLength); + Group2Spin->show(); + } + } + else if(myConstructorDirId == 3) { // DXDY + if(constructorId == 2) { // Length + mySketchType = DIR_DXDY_LENGTH; + Group4Spin->TextLabel1->setText(tr("VX :")); + Group4Spin->TextLabel2->setText(tr("VY :")); + Group4Spin->TextLabel3->setText(tr("Radius :")); + Group4Spin->TextLabel4->setText(tr("Angle :")); + myDX = 0.0; + Group4Spin->SpinBox_DX->SetValue(myDX); + myDY = 0.0; + Group4Spin->SpinBox_DY->SetValue(myDY); + myRadius = 100.0; + Group4Spin->SpinBox_DZ->SetValue(myRadius); + myLength = 30.0; + Group4Spin->SpinBox_DS->SetValue(myLength); + Group4Spin->show(); + } + } + } + + this->MakeSimulationAndDisplay(); + return; +} + + +//================================================================================= +// function : ClickOnCancel() +// purpose : +//================================================================================= +void SketcherGUI_Dlg::ClickOnCancel() +{ + QAD_Application::getDesktop()->putInfo(tr("")); + mySketcherGUI->EraseSimulationShape(); + mySimulationTopoDs1.Nullify(); + mySimulationTopoDs2.Nullify(); + + mySelection->ClearFilters(); + disconnect(mySelection, 0, this, 0); + + reject(); + return; +} + + +//================================================================================= +// function : ClickOnEnd() +// purpose : +//================================================================================= +void SketcherGUI_Dlg::ClickOnEnd() +{ + if(mySketchState != FIRST_POINT && mySketchState != SECOND_POINT) { + mySketcherGUI->OnSketchEnd(myShape); +// myCommand = myCommand + ":W"; + +// QStringList myCommandList = QStringList::split(":", myCommand); +// SketcherGUI_Profile aProfile (myCommandList); + +// if(aProfile.IsDone()) { +// myShape = aProfile.GetShape(); +// mySketcherGUI->OnSketchEnd(myShape); +// } + } + + this->ClickOnCancel(); + return; +} + + +//================================================================================= +// function : ClickOnClose() +// purpose : +//================================================================================= +void SketcherGUI_Dlg::ClickOnClose() +{ + if(mySketchState != FIRST_POINT && mySketchState != SECOND_POINT) { + myCommand = myCommand + ":WW"; + + QStringList myCommandList = QStringList::split(":", myCommand); + SketcherGUI_Profile aProfile (myCommandList); + + if(aProfile.IsDone()) { + myShape = aProfile.GetShape(); + mySketcherGUI->OnSketchEnd(myShape); + } + } + + this->ClickOnCancel(); + return; +} + + +//================================================================================= +// function : ClickOnApply() +// purpose : +//================================================================================= +void SketcherGUI_Dlg::ClickOnApply() +{ + if(mySketchState == FIRST_POINT) { + mySketchState = SECOND_POINT; + myLastX2 = myLastX1; + myLastY2 = myLastY1; + } + else { + QString myNewCommand = this->GetNewCommand(); + QString myCommandTemp = myCommand + myNewCommand; + + QStringList myCommandList = QStringList::split(":", myCommandTemp); + SketcherGUI_Profile aProfile (myCommandList); + + if(aProfile.IsDone()) { + myCommand = myCommand + myNewCommand; + myLastX2 = myLastX1; + myLastY2 = myLastY1; + mySketchState = NEXT_POINT; + } + } + + myLastOp = myConstructorId; + this->MakeSimulationAndDisplay(); + return; +} + + +//================================================================================= +// function : ClickOnUndo() +// purpose : +//================================================================================= +void SketcherGUI_Dlg::ClickOnUndo() +{ + return; +} + + +//================================================================================= +// function : SelectionIntoArgument() +// purpose : Called when selection as changed +//================================================================================= +void SketcherGUI_Dlg::SelectionIntoArgument() +{ + myEditCurrentArgument->setText(""); + QString aString = ""; + + myX = 0.0; + myY = 0.0; + + int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString); + if(nbSel != 1) { + this->MakeSimulationAndDisplay(); + return; + } + + /* nbSel == 1 */ + TopoDS_Shape S; + gp_Pnt myPoint1; + Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject(); + + if(!myGeomBase->GetTopoFromSelection(mySelection, S)) { + this->MakeSimulationAndDisplay(); + return; + } + + if(myEditCurrentArgument == Group1Sel->LineEdit1 && myGeomBase->VertexToPoint(S, myPoint1)) { + myX = myPoint1.X(); + myY = myPoint1.Y(); + Group1Sel->LineEdit1->setText(aString); + } + + this->MakeSimulationAndDisplay(); + + return; +} + + +//================================================================================= +// function : SetEditCurrentArgument() +// purpose : +//================================================================================= +void SketcherGUI_Dlg::SetEditCurrentArgument() +{ + QPushButton* send = (QPushButton*)sender(); + + mySelection->ClearFilters(); + if(send == Group1Sel->PushButton1) { + Group1Sel->LineEdit1->setFocus(); + myEditCurrentArgument = Group1Sel->LineEdit1; + } + mySelection->AddFilter(myVertexFilter); + this->SelectionIntoArgument(); + return; +} + + +//================================================================================= +// function : LineEditReturnPressed() +// purpose : +//================================================================================= +void SketcherGUI_Dlg::LineEditReturnPressed() +{ + /* User name of object input management */ + /* If successfull the selection is changed and signal emitted... */ + /* so SelectionIntoArgument() is automatically called. */ + const QString objectUserName = myEditCurrentArgument->text(); + QWidget* thisWidget = (QWidget*)this; + if(myGeomBase->SelectionByNameInDialogs(thisWidget, objectUserName, mySelection)) + myEditCurrentArgument->setText(objectUserName); + + return; +} + + +//================================================================================= +// function : DeactivateActiveDialog() +// purpose : +//================================================================================= +void SketcherGUI_Dlg::DeactivateActiveDialog() +{ + this->setEnabled(false); + mySelection->ClearFilters(); + disconnect(mySelection, 0, this, 0); + mySketcherGUI->EraseSimulationShape(); + myGeomGUI->SetActiveDialogBox(0); + return; +} + + +//================================================================================= +// function : ActivateThisDialog() +// purpose : +//================================================================================= +void SketcherGUI_Dlg::ActivateThisDialog() +{ + /* Emit a signal to deactivate the active dialog */ + myGeomGUI->EmitSignalDeactivateDialog(); + this->setEnabled(true); + myGeomGUI->SetActiveDialogBox((QDialog*)this); + connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + mySelection->AddFilter(myVertexFilter); + mySketcherGUI->DisplaySimulationShape(mySimulationTopoDs1, mySimulationTopoDs2); + + return; +} + + +//================================================================================= +// function : enterEvent [REDEFINED] +// purpose : +//================================================================================= +void SketcherGUI_Dlg::enterEvent(QEvent* e) +{ + if(GroupConstructors->isEnabled()) + return; + this->ActivateThisDialog(); + return; +} + + +//================================================================================= +// function : closeEvent() +// purpose : +//================================================================================= +void SketcherGUI_Dlg::closeEvent(QCloseEvent* e) +{ + /* same than click on cancel button */ + this->ClickOnCancel(); + return; +} + + +//================================================================================= +// function : ValueChangedInSpinBox() +// purpose : +//================================================================================= +void SketcherGUI_Dlg::ValueChangedInSpinBox(double newValue) +{ + QObject* send = (QObject*)sender(); + Standard_Real vx, vy, vz, vs; + vx = vy = vz = vs = 0.0; + + if(send == Group1Spin->SpinBox_DX) { + vx = newValue; + } + else if(send == Group2Spin->SpinBox_DX) { + vx = newValue; + vy = Group2Spin->SpinBox_DY->GetValue(); + } + else if(send == Group2Spin->SpinBox_DY) { + vx = Group2Spin->SpinBox_DX->GetValue(); + vy = newValue; + } + else if(send == Group3Spin->SpinBox_DX) { + vx = newValue; + vy = Group3Spin->SpinBox_DY->GetValue(); + vz = Group3Spin->SpinBox_DZ->GetValue(); + } + else if(send == Group3Spin->SpinBox_DY) { + vx = Group3Spin->SpinBox_DX->GetValue(); + vy = newValue; + vz = Group3Spin->SpinBox_DZ->GetValue(); + } + else if(send == Group3Spin->SpinBox_DZ) { + vx = Group3Spin->SpinBox_DX->GetValue(); + vy = Group3Spin->SpinBox_DY->GetValue(); + vz = newValue; + } + else if(send == Group4Spin->SpinBox_DX) { + vx = newValue; + vy = Group4Spin->SpinBox_DY->GetValue(); + vz = Group4Spin->SpinBox_DZ->GetValue(); + vs = Group4Spin->SpinBox_DS->GetValue(); + } + else if(send == Group4Spin->SpinBox_DY) { + vx = Group4Spin->SpinBox_DX->GetValue(); + vy = newValue; + vz = Group4Spin->SpinBox_DZ->GetValue(); + vs = Group4Spin->SpinBox_DS->GetValue(); + } + else if(send == Group4Spin->SpinBox_DZ) { + vx = Group4Spin->SpinBox_DX->GetValue(); + vy = Group4Spin->SpinBox_DY->GetValue(); + vz = newValue; + vs = Group4Spin->SpinBox_DS->GetValue(); + } + else if(send == Group4Spin->SpinBox_DS) { + vx = Group4Spin->SpinBox_DX->GetValue(); + vy = Group4Spin->SpinBox_DY->GetValue(); + vz = Group4Spin->SpinBox_DZ->GetValue(); + vs = newValue; + } + + if(myConstructorId == 0) { // SEGMENT + if(mySketchType == PT_ABS) { + myX = vx; + myY = vy; + } + else if(mySketchType == PT_RELATIVE) { + myDX = vx; + myDY = vy; + } + else if(mySketchType == DIR_ANGLE_LENGTH) { + myAngle = vx; + myLength = vy; + } + else if(mySketchType == DIR_ANGLE_X) { + myAngle = vx; + myX = vy; + } + else if(mySketchType == DIR_ANGLE_Y) { + myAngle = vx; + myY = vy; + } + else if(mySketchType == DIR_PER_LENGTH) { + myLength = vx; + } + else if(mySketchType == DIR_PER_X) { + myX = vx; + } + else if(mySketchType == DIR_PER_Y) { + myY = vx; + } + else if(mySketchType == DIR_TAN_LENGTH) { + myLength = vx; + } + else if(mySketchType == DIR_TAN_X) { + myX = vx; + } + else if(mySketchType == DIR_TAN_Y) { + myY = vx; + } + else if(mySketchType == DIR_DXDY_LENGTH) { + myDX = vx; + myDY = vy; + myLength = vz; + } + else if(mySketchType == DIR_DXDY_X) { + myDX = vx; + myDY = vy; + myX = vz; + } + else if(mySketchType == DIR_DXDY_Y) { + myDX = vx; + myDY = vy; + myY = vz; + } + } + else if(myConstructorId == 1) { // ARC + if(mySketchType == DIR_ANGLE_LENGTH) { + myAngle = vx; + myRadius = vy; + myLength = vz; + } + else if(mySketchType == DIR_PER_LENGTH) { + myRadius = vx; + myLength = vy; + } + else if(mySketchType == DIR_TAN_LENGTH) { + myRadius = vx; + myLength = vy; + } + else if(mySketchType == DIR_DXDY_LENGTH) { + myDX = vx; + myDY = vy; + myRadius = vz; + myLength = vs; + } + } + + this->MakeSimulationAndDisplay(); + return; +} + + +//================================================================================= +// function : MakeSimulationAndDisplay() +// purpose : +//================================================================================= +QString SketcherGUI_Dlg::GetNewCommand() +{ + QString myNewCommand = ""; + if(mySketchState == FIRST_POINT) + return myNewCommand; + + myNewCommand = ":"; + if(myConstructorId == 0) { // SEGMENT + if(mySketchType == PT_ABS || mySketchType == PT_SEL) + myNewCommand = myNewCommand + "TT " + QString::number(myX) + " " + QString::number(myY); + if(mySketchType == PT_RELATIVE) + myNewCommand = myNewCommand + "T " + QString::number(myDX) + " " + QString::number(myDY); + if(mySketchType == DIR_ANGLE_LENGTH) { + myNewCommand = myNewCommand + "R " + QString::number(myAngle); + myNewCommand = myNewCommand + ":" + "L " + QString::number(myLength); + } + if(mySketchType == DIR_ANGLE_X) { + myNewCommand = myNewCommand + "R " + QString::number(myAngle); + myNewCommand = myNewCommand + ":" + "IX " + QString::number(myX); + } + if(mySketchType == DIR_ANGLE_Y) { + myNewCommand = myNewCommand + "R " + QString::number(myAngle); + myNewCommand = myNewCommand + ":" + "IY " + QString::number(myY); + } + if(mySketchType == DIR_PER_LENGTH) { + myNewCommand = myNewCommand + "R " + QString::number(90.0); + myNewCommand = myNewCommand + ":" + "L " + QString::number(myLength); + } + if(mySketchType == DIR_PER_X) { + myNewCommand = myNewCommand + "R " + QString::number(90.0); + myNewCommand = myNewCommand + ":" + "IX " + QString::number(myX); + } + if(mySketchType == DIR_PER_Y) { + myNewCommand = myNewCommand + "R " + QString::number(90.0); + myNewCommand = myNewCommand + ":" + "IY " + QString::number(myY); + } + if(mySketchType == DIR_TAN_LENGTH) + myNewCommand = myNewCommand + "L " + QString::number(myLength); + if(mySketchType == DIR_TAN_X) + myNewCommand = myNewCommand + "IX " + QString::number(myX); + if(mySketchType == DIR_TAN_Y) + myNewCommand = myNewCommand + "IY " + QString::number(myY); + if(mySketchType == DIR_DXDY_LENGTH) { + myNewCommand = myNewCommand + "D " + QString::number(myDX) + " " + QString::number(myDY); + myNewCommand = myNewCommand + ":" + "L " + QString::number(myLength); + } + if(mySketchType == DIR_DXDY_X) { + myNewCommand = myNewCommand + "D " + QString::number(myDX) + " " + QString::number(myDY); + myNewCommand = myNewCommand + ":" + "IX " + QString::number(myX); + } + if(mySketchType == DIR_DXDY_Y) { + myNewCommand = myNewCommand + "D " + QString::number(myDX) + " " + QString::number(myDY); + myNewCommand = myNewCommand + ":" + "IY " + QString::number(myY); + } + } + else if(myConstructorId == 1) { // ARC + if(mySketchType == DIR_ANGLE_LENGTH) { + myNewCommand = myNewCommand + "R " + QString::number(myAngle); + myNewCommand = myNewCommand + ":" + "C " + QString::number(myRadius) + " " + QString::number(myLength); + } + if(mySketchType == DIR_PER_LENGTH) { + myNewCommand = myNewCommand + "R " + QString::number(90.0); + myNewCommand = myNewCommand + ":" + "C " + QString::number(myRadius) + " " + QString::number(myLength); + } + if(mySketchType == DIR_TAN_LENGTH) { + myNewCommand = myNewCommand + "C " + QString::number(myRadius) + " " + QString::number(myLength); + } + if(mySketchType == DIR_DXDY_LENGTH) { + myNewCommand = myNewCommand + "D " + QString::number(myDX) + " " + QString::number(myDY); + myNewCommand = myNewCommand + ":" + "C " + QString::number(myRadius) + " " + QString::number(myLength); + } + } + return myNewCommand; +} + + +//================================================================================= +// function : MakeSimulationAndDisplay() +// purpose : +//================================================================================= +void SketcherGUI_Dlg::MakeSimulationAndDisplay() +{ + mySketcherGUI->EraseSimulationShape(); + mySimulationTopoDs1.Nullify(); + mySimulationTopoDs2.Nullify(); + + try { + if(mySketchState == FIRST_POINT) { + myCommand = "Sketch "; + myCommand = myCommand + ":" + "F " + QString::number(myX) + " " + QString::number(myY); + + myLastX1 = myX; + myLastY1 = myY; + } + + QStringList myCommandList1 = QStringList::split(":", myCommand); + SketcherGUI_Profile aProfile1 (myCommandList1); + + if(aProfile1.IsDone()) { + myShape = aProfile1.GetShape(); + mySimulationTopoDs1 = myShape; + } + + if(mySketchState != FIRST_POINT) { + if(mySketchState == SECOND_POINT) { + gp_Pnt pt = BRep_Tool::Pnt(TopoDS::Vertex(myShape)); + myLastX1 = pt.X(); + myLastY1 = pt.Y(); + } + else { + TopoDS_Vertex V1, V2; + TopExp::Vertices(TopoDS::Wire(myShape), V1, V2); + gp_Pnt pt = BRep_Tool::Pnt(V2); + myLastX1 = pt.X(); + myLastY1 = pt.Y(); + if(myLastOp == 1) { // ARC + myLastDir = aProfile1.GetLastDir(); + myLastX2 = myLastX1 - myLastDir.X(); + myLastY2 = myLastY1 - myLastDir.Y(); + } + } + QString myNewCommand = "Sketch "; + myNewCommand = myNewCommand + ":" + "F " + QString::number(myLastX1) + " " + QString::number(myLastY1); + if(mySketchState != SECOND_POINT && !((myLastX1 - myLastX2) == 0 && (myLastY1 - myLastY2) == 0)) + myNewCommand = myNewCommand + ":" + "D " + QString::number(myLastX1 - myLastX2) + " " + QString::number(myLastY1 - myLastY2); + myNewCommand = myNewCommand + this->GetNewCommand(); + QStringList myCommandList2 = QStringList::split(":", myNewCommand); + SketcherGUI_Profile aProfile2 (myCommandList2); + if(aProfile2.IsDone()) + mySimulationTopoDs2 = aProfile2.GetShape(); + } + + mySketcherGUI->DisplaySimulationShape(mySimulationTopoDs1, mySimulationTopoDs2); + } + catch(Standard_Failure) { + MESSAGE("Exception catched in MakSimulationAndDisplay"); + return; + } + return; +} diff --git a/src/SketcherGUI/SketcherGUI_Dlg.h b/src/SketcherGUI/SketcherGUI_Dlg.h new file mode 100644 index 000000000..43abb8cdb --- /dev/null +++ b/src/SketcherGUI/SketcherGUI_Dlg.h @@ -0,0 +1,148 @@ +// GEOM GEOMGUI : GUI for Geometry component +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SketcherGUI_Dlg.h +// Author : Damine COQUERET +// Module : GEOM +// $Header: + +#ifndef SKETCHERGUI_DLG_H +#define SKETCHERGUI_DLG_H + +#include "SketcherGUI_Skeleton_QTD.h" +#include "SketcherGUI_Point_QTD.h" +#include "SketcherGUI_Dir1_QTD.h" +#include "SketcherGUI_Dir2_QTD.h" + +#include "SketcherGUI_1Sel_QTD.h" +#include "SketcherGUI_1Spin.h" +#include "SketcherGUI_2Spin.h" +#include "SketcherGUI_3Spin.h" +#include "SketcherGUI_4Spin.h" + +#include "SketcherGUI.h" + +#include "GEOM_ShapeTypeFilter.hxx" + +#include + +#include +#include +#include +#include +#include +#include + +//================================================================================= +// class : SketcherGUI_Dlg +// purpose : +//================================================================================= +class SketcherGUI_Dlg : public SketcherGUI_Skeleton_QTD +{ + Q_OBJECT + +public: + SketcherGUI_Dlg(QWidget* parent = 0, const char* name = 0, SketcherGUI* theSketcherGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0); + ~SketcherGUI_Dlg(); + +private : + void Init(); + void enterEvent(QEvent* e); + void closeEvent(QCloseEvent* e); + void InitClick(); + void MakeSimulationAndDisplay(); + QString GetNewCommand(); + + SketcherGUI* mySketcherGUI; + + double step; + int myConstructorId; + int myConstructorDirId; + int mySketchType; + int mySketchState; + Handle(GEOM_ShapeTypeFilter) myVertexFilter; + + TopoDS_Shape mySimulationTopoDs1; /* Shape used for simulation display */ + TopoDS_Shape mySimulationTopoDs2; /* Shape used for simulation display */ + QLineEdit* myEditCurrentArgument; /* Current LineEdit */ + SALOME_Selection* mySelection; /* User shape selection */ + GEOM::GEOM_Gen_var myGeom; /* Current GeomI object */ + GEOMBase* myGeomBase; + GEOMContext* myGeomGUI; /* Current GeomGUI object */ + + int myLastOp; + QString myCommand; + TopoDS_Shape myShape; + gp_Dir myLastDir; + + Standard_Real myX; + Standard_Real myY; + Standard_Real myDX; + Standard_Real myDY; + Standard_Real myLastX1; + Standard_Real myLastY1; + Standard_Real myLastX2; + Standard_Real myLastY2; + Standard_Real myLength; + Standard_Real myAngle; + Standard_Real myRadius; + + SketcherGUI_Point_QTD* GroupPt; + SketcherGUI_Dir1_QTD* GroupD1; + SketcherGUI_Dir2_QTD* GroupD2; + + SketcherGUI_1Sel_QTD* Group1Sel; + SketcherGUI_1Spin* Group1Spin; + SketcherGUI_2Spin* Group2Spin; + SketcherGUI_3Spin* Group3Spin; + SketcherGUI_4Spin* Group4Spin; + + enum SketchState {FIRST_POINT, SECOND_POINT, NEXT_POINT}; + + enum SketchType {PT_ABS, PT_RELATIVE, PT_SEL, + DIR_ANGLE_LENGTH, DIR_ANGLE_X, DIR_ANGLE_Y, + DIR_PER_LENGTH, DIR_PER_X, DIR_PER_Y, + DIR_TAN_LENGTH, DIR_TAN_X, DIR_TAN_Y, + DIR_DXDY_LENGTH, DIR_DXDY_X, DIR_DXDY_Y}; + +private slots: + void ClickOnEnd(); + void ClickOnClose(); + void ClickOnCancel(); + void ClickOnApply(); + void ClickOnUndo(); + void LineEditReturnPressed(); + void SelectionIntoArgument(); + void SetEditCurrentArgument(); + void DeactivateActiveDialog(); + void ActivateThisDialog(); + void TypeClicked(int constructorId); + void DestClicked(int constructorId); + void PointClicked(int constructorId); + void Dir1Clicked(int constructorId); + void Dir2Clicked(int constructorId); + void ValueChangedInSpinBox(double newValue); + +}; + +#endif // SKETCHERGUI_DLG_H diff --git a/src/SketcherGUI/SketcherGUI_Point_QTD.cxx b/src/SketcherGUI/SketcherGUI_Point_QTD.cxx new file mode 100644 index 000000000..56fdd5841 --- /dev/null +++ b/src/SketcherGUI/SketcherGUI_Point_QTD.cxx @@ -0,0 +1,74 @@ +/**************************************************************************** +** Form implementation generated from reading ui file 'SketcherGUI_Point_QTD.ui' +** +** Created: lun nov 3 17:27:54 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#include "SketcherGUI_Point_QTD.h" + +#include +#include +#include +#include +#include +#include +#include + +/* + * Constructs a SketcherGUI_Point_QTD which is a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +SketcherGUI_Point_QTD::SketcherGUI_Point_QTD( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + if ( !name ) + setName( "SketcherGUI_Point_QTD" ); + resize( 124, 106 ); + setCaption( trUtf8( "SketcherGUI_Point_QTD" ) ); + SketcherGUI_Point_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "SketcherGUI_Point_QTDLayout"); + + GroupPoint = new QButtonGroup( this, "GroupPoint" ); + GroupPoint->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupPoint->sizePolicy().hasHeightForWidth() ) ); + GroupPoint->setTitle( trUtf8( "Point" ) ); + GroupPoint->setColumnLayout(0, Qt::Vertical ); + GroupPoint->layout()->setSpacing( 6 ); + GroupPoint->layout()->setMargin( 11 ); + GroupPointLayout = new QGridLayout( GroupPoint->layout() ); + GroupPointLayout->setAlignment( Qt::AlignTop ); + + Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1"); + + RB_Point2 = new QRadioButton( GroupPoint, "RB_Point2" ); + RB_Point2->setText( trUtf8( "Relative" ) ); + + Layout1->addWidget( RB_Point2, 1, 0 ); + + RB_Point1 = new QRadioButton( GroupPoint, "RB_Point1" ); + RB_Point1->setText( trUtf8( "Absolute" ) ); + + Layout1->addWidget( RB_Point1, 0, 0 ); + + RB_Point3 = new QRadioButton( GroupPoint, "RB_Point3" ); + RB_Point3->setText( trUtf8( "Selection" ) ); + + Layout1->addWidget( RB_Point3, 2, 0 ); + + GroupPointLayout->addLayout( Layout1, 0, 0 ); + + SketcherGUI_Point_QTDLayout->addWidget( GroupPoint, 0, 0 ); + + // tab order + setTabOrder( RB_Point1, RB_Point2 ); + setTabOrder( RB_Point2, RB_Point3 ); +} + +/* + * Destroys the object and frees any allocated resources + */ +SketcherGUI_Point_QTD::~SketcherGUI_Point_QTD() +{ + // no need to delete child widgets, Qt does it all for us +} + diff --git a/src/SketcherGUI/SketcherGUI_Point_QTD.h b/src/SketcherGUI/SketcherGUI_Point_QTD.h new file mode 100644 index 000000000..8b1e4f9ea --- /dev/null +++ b/src/SketcherGUI/SketcherGUI_Point_QTD.h @@ -0,0 +1,40 @@ +/**************************************************************************** +** Form interface generated from reading ui file 'SketcherGUI_Point_QTD.ui' +** +** Created: lun nov 3 17:27:53 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#ifndef SKETCHERGUI_POINT_QTD_H +#define SKETCHERGUI_POINT_QTD_H + +#include +#include +class QVBoxLayout; +class QHBoxLayout; +class QGridLayout; +class QButtonGroup; +class QRadioButton; + +class SketcherGUI_Point_QTD : public QWidget +{ + Q_OBJECT + +public: + SketcherGUI_Point_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~SketcherGUI_Point_QTD(); + + QButtonGroup* GroupPoint; + QRadioButton* RB_Point2; + QRadioButton* RB_Point1; + QRadioButton* RB_Point3; + + +protected: + QGridLayout* SketcherGUI_Point_QTDLayout; + QGridLayout* GroupPointLayout; + QGridLayout* Layout1; +}; + +#endif // SKETCHERGUI_POINT_QTD_H diff --git a/src/SketcherGUI/SketcherGUI_Profile.cxx b/src/SketcherGUI/SketcherGUI_Profile.cxx new file mode 100644 index 000000000..0abf7e87c --- /dev/null +++ b/src/SketcherGUI/SketcherGUI_Profile.cxx @@ -0,0 +1,382 @@ +// GEOM SKETCHER : basic sketcher +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SketcherGUI_Profile.cxx +// Author : Damien COQUERET +// Module : GEOM +// $Header: + +using namespace std; +#include "SketcherGUI_Profile.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//======================================================================= +// profile +// command to build a profile +//======================================================================= +SketcherGUI_Profile::SketcherGUI_Profile() +{ + +} + + +//======================================================================= +// profile +// command to build a profile +//======================================================================= +SketcherGUI_Profile::SketcherGUI_Profile(QStringList aCommand) +{ + // this command build a profile + // from a moving point + + myOK = false; + Standard_Integer n = aCommand.count(); + + Standard_Integer i = 1; + Standard_Real x0 = 0, y0 = 0, x = 0, y = 0, dx = 1, dy = 0; + TopoDS_Vertex MP; + BRepBuilderAPI_MakeWire MW; + gp_Ax3 DummyHP(gp::XOY()); + gp_Pln P(DummyHP); + enum {line , circle, point, none} move; + Standard_Boolean face = Standard_False; + Standard_Boolean close = Standard_False; + Standard_Boolean first = Standard_True; + Standard_Boolean stayfirst = Standard_False; + TopoDS_Shape S; + TopLoc_Location TheLocation; + Handle(Geom_Surface) Surface; + + while (i < n) { + + Standard_Real length=0,radius=0,angle=0; + move = point; + + QStringList a = QStringList::split(" ", aCommand[i]); + Standard_Integer n1 = a.count(); + + switch ((a[0].ref(0)).latin1()) { + + case 'F': + { + if (n1 != 3) goto badargs; + if (!first) { + cout<<"profile : The F instruction must precede all moves"< Precision::Confusion()) + move = line; + else + move = none; + break; + } + + case 'T': + { + if (n1 != 3) goto badargs; + Standard_Real vx = a[1].toFloat(); + Standard_Real vy = a[2].toFloat(); + if ((a[0].ref(1)).latin1() == 'T') { + vx -= x; + vy -= y; + } + length = Sqrt(vx * vx + vy * vy); + if (length > Precision::Confusion()) { + move = line; + dx = vx / length; + dy = vy / length; + } + else + move = none; + break; + } + + case 'R': + { + if (n1 != 2) goto badargs; + angle = a[1].toFloat() * PI180; + if ((a[0].ref(1)).latin1() == 'R') { + dx = Cos(angle); + dy = Sin(angle); + } + else { + Standard_Real c = Cos(angle); + Standard_Real s = Sin(angle); + Standard_Real t = c * dx - s * dy; + dy = s * dx + c * dy; + dx = t; + } + break; + } + + case 'D': + { + if (n1 != 3) goto badargs; + Standard_Real vx = a[1].toFloat(); + Standard_Real vy = a[2].toFloat(); + length = Sqrt(vx * vx + vy * vy); + if (length > Precision::Confusion()) { + dx = vx / length; + dy = vy / length; + } + else + move = none; + break; + } + + case 'C': + { + if (n1 != 3) goto badargs; + radius = a[1].toFloat(); + if (Abs(radius) > Precision::Confusion()) { + angle = a[2].toFloat() * PI180; + move = circle; + } + else + move = none; + break; + } + + case 'I': + { + if (n1 != 2) goto badargs; + length = a[1].toFloat(); + if ((a[0].ref(1)).latin1() == 'X') { + if (Abs(dx) < Precision::Confusion()) { + cout<<"profile : cannot intersect, arg "< Precision::Confusion()) + move = line; + else + move = none; + break; + } + + case 'W': + { + if ((a[0].ref(1)).latin1() == 'W') + close = Standard_True; + else if((a[0].ref(1)).latin1() == 'F') { + close = Standard_True; + face = Standard_True; + } + i = n - 1; + break; + } + + default: + { + cout<<"profile : unknown code "<D1(angle,p,v); + x = p.X(); + y = p.Y(); + dx = v.X() / radius; + dy = v.Y() / radius; + break; + } + + case point: + { + MP = BRepBuilderAPI_MakeVertex(gp_Pnt(x, y, 0.0)); + break; + } + + case none: + { + i = n - 1; + break; + } + } + + // update first + first = stayfirst; + stayfirst = Standard_False; + + if(!(dx == 0 && dy == 0)) { + myLastDir.SetCoord(dx, dy, 0.0); + } + else + return; + myLastPoint.SetX(x); + myLastPoint.SetY(y); + + // next segment.... + i++; + if ((i == n) && close) { + // the closing segment + dx = x0 - x; + dy = y0 - y; + length = Sqrt(dx * dx + dy * dy); + if (length > Precision::Confusion()) { + move = line; + dx = dx / length; + dy = dy / length; + goto again; + } + } + } + + + // get the result, face or wire + if (move == none) { + return; + } + else if (move == point) + S = MP; + else if(face) + S = BRepBuilderAPI_MakeFace(P, MW.Wire()); + else + S = MW; + + if(!TheLocation.IsIdentity()) + S.Move(TheLocation); + + myShape = S; + myOK = true; + return; + + badargs : + cout<<"profile : bad number of arguments"< +#include +#include + +#include + +class SketcherGUI_Profile +{ + +public: + SketcherGUI_Profile(); + SketcherGUI_Profile(QStringList aCommand); + +private: + gp_Pnt myLastPoint; + gp_Dir myLastDir; + + TopoDS_Shape myShape; + bool myOK; + +public: + gp_Pnt GetLastPoint(){return myLastPoint;}; + gp_Dir GetLastDir(){return myLastDir;}; + + const TopoDS_Shape& GetShape(){return myShape;}; + bool IsDone(){return myOK;}; + +}; diff --git a/src/SketcherGUI/SketcherGUI_Skeleton_QTD.cxx b/src/SketcherGUI/SketcherGUI_Skeleton_QTD.cxx new file mode 100644 index 000000000..24bf94e47 --- /dev/null +++ b/src/SketcherGUI/SketcherGUI_Skeleton_QTD.cxx @@ -0,0 +1,176 @@ +/**************************************************************************** +** Form implementation generated from reading ui file 'SketcherGUI_Skeleton_QTD.ui' +** +** Created: lun nov 3 17:27:53 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#include "SketcherGUI_Skeleton_QTD.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Constructs a SketcherGUI_Skeleton_QTD which is a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + * + * The dialog will by default be modeless, unless you set 'modal' to + * TRUE to construct a modal dialog. + */ +SketcherGUI_Skeleton_QTD::SketcherGUI_Skeleton_QTD( QWidget* parent, const char* name, bool modal, WFlags fl ) + : QDialog( parent, name, modal, fl ) +{ + if ( !name ) + setName( "SketcherGUI_Skeleton_QTD" ); + resize( 317, 276 ); + setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0, sizePolicy().hasHeightForWidth() ) ); + setCaption( trUtf8( "SketcherGUI_Skeleton_QTD" ) ); + SketcherGUI_Skeleton_QTDLayout = new QGridLayout( this, 1, 1, 11, 6, "SketcherGUI_Skeleton_QTDLayout"); + + Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1"); + + GroupVal = new QGroupBox( this, "GroupVal" ); + GroupVal->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupVal->sizePolicy().hasHeightForWidth() ) ); + GroupVal->setTitle( trUtf8( "" ) ); + + Layout1->addWidget( GroupVal, 2, 0 ); + + GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); + GroupConstructors->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, GroupConstructors->sizePolicy().hasHeightForWidth() ) ); + GroupConstructors->setTitle( trUtf8( "Element Type" ) ); + GroupConstructors->setColumnLayout(0, Qt::Vertical ); + GroupConstructors->layout()->setSpacing( 6 ); + GroupConstructors->layout()->setMargin( 11 ); + GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() ); + GroupConstructorsLayout->setAlignment( Qt::AlignTop ); + + Layout2 = new QHBoxLayout( 0, 0, 6, "Layout2"); + + RadioButton1 = new QRadioButton( GroupConstructors, "RadioButton1" ); + RadioButton1->setText( trUtf8( "Segment" ) ); + Layout2->addWidget( RadioButton1 ); + + RadioButton2 = new QRadioButton( GroupConstructors, "RadioButton2" ); + RadioButton2->setText( trUtf8( "Arc" ) ); + Layout2->addWidget( RadioButton2 ); + + GroupConstructorsLayout->addLayout( Layout2, 0, 0 ); + + Layout1->addWidget( GroupConstructors, 0, 0 ); + + GroupDest = new QGroupBox( this, "GroupDest" ); + GroupDest->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupDest->sizePolicy().hasHeightForWidth() ) ); + GroupDest->setTitle( trUtf8( "Destination" ) ); + GroupDest->setColumnLayout(0, Qt::Vertical ); + GroupDest->layout()->setSpacing( 6 ); + GroupDest->layout()->setMargin( 11 ); + GroupDestLayout = new QGridLayout( GroupDest->layout() ); + GroupDestLayout->setAlignment( Qt::AlignTop ); + + Layout5 = new QGridLayout( 0, 1, 1, 0, 6, "Layout5"); + + GroupDest1 = new QButtonGroup( GroupDest, "GroupDest1" ); + GroupDest1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupDest1->sizePolicy().hasHeightForWidth() ) ); + GroupDest1->setTitle( trUtf8( "Type" ) ); + GroupDest1->setColumnLayout(0, Qt::Vertical ); + GroupDest1->layout()->setSpacing( 6 ); + GroupDest1->layout()->setMargin( 11 ); + GroupDest1Layout = new QGridLayout( GroupDest1->layout() ); + GroupDest1Layout->setAlignment( Qt::AlignTop ); + + Layout4 = new QGridLayout( 0, 1, 1, 0, 6, "Layout4"); + + RB_Dest2 = new QRadioButton( GroupDest1, "RB_Dest2" ); + RB_Dest2->setText( trUtf8( "Direction" ) ); + + Layout4->addWidget( RB_Dest2, 0, 1 ); + + RB_Dest1 = new QRadioButton( GroupDest1, "RB_Dest1" ); + RB_Dest1->setText( trUtf8( "Point" ) ); + + Layout4->addWidget( RB_Dest1, 0, 0 ); + + GroupDest1Layout->addLayout( Layout4, 0, 0 ); + + Layout5->addMultiCellWidget( GroupDest1, 0, 0, 0, 1 ); + + GroupDest2 = new QButtonGroup( GroupDest, "GroupDest2" ); + GroupDest2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupDest2->sizePolicy().hasHeightForWidth() ) ); + GroupDest2->setTitle( trUtf8( "" ) ); + GroupDest2->setColumnLayout(0, Qt::Vertical ); + GroupDest2->layout()->setSpacing( 6 ); + GroupDest2->layout()->setMargin( 11 ); + GroupDest2Layout = new QGridLayout( GroupDest2->layout() ); + GroupDest2Layout->setAlignment( Qt::AlignTop ); + + Layout5->addWidget( GroupDest2, 1, 0 ); + + GroupDest3 = new QButtonGroup( GroupDest, "GroupDest3" ); + GroupDest3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupDest3->sizePolicy().hasHeightForWidth() ) ); + GroupDest3->setTitle( trUtf8( "" ) ); + GroupDest3->setColumnLayout(0, Qt::Vertical ); + GroupDest3->layout()->setSpacing( 6 ); + GroupDest3->layout()->setMargin( 11 ); + GroupDest3Layout = new QGridLayout( GroupDest3->layout() ); + GroupDest3Layout->setAlignment( Qt::AlignTop ); + + Layout5->addWidget( GroupDest3, 1, 1 ); + + GroupDestLayout->addLayout( Layout5, 0, 0 ); + + Layout1->addWidget( GroupDest, 1, 0 ); + + GroupButtons = new QGroupBox( this, "GroupButtons" ); + GroupButtons->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupButtons->sizePolicy().hasHeightForWidth() ) ); + GroupButtons->setTitle( trUtf8( "" ) ); + GroupButtons->setColumnLayout(0, Qt::Vertical ); + GroupButtons->layout()->setSpacing( 6 ); + GroupButtons->layout()->setMargin( 11 ); + GroupButtonsLayout = new QHBoxLayout( GroupButtons->layout() ); + GroupButtonsLayout->setAlignment( Qt::AlignTop ); + + Layout3 = new QHBoxLayout( 0, 0, 6, "Layout3"); + + buttonEnd = new QPushButton( GroupButtons, "buttonEnd" ); + buttonEnd->setText( trUtf8( "End Sketch" ) ); + Layout3->addWidget( buttonEnd ); + + buttonClose = new QPushButton( GroupButtons, "buttonClose" ); + buttonClose->setText( trUtf8( "Close Sketch" ) ); + Layout3->addWidget( buttonClose ); + QSpacerItem* spacer = new QSpacerItem( 91, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); + Layout3->addItem( spacer ); + + buttonCancel = new QPushButton( GroupButtons, "buttonCancel" ); + buttonCancel->setText( trUtf8( "&Cancel" ) ); + Layout3->addWidget( buttonCancel ); + GroupButtonsLayout->addLayout( Layout3 ); + + Layout1->addWidget( GroupButtons, 3, 0 ); + + SketcherGUI_Skeleton_QTDLayout->addLayout( Layout1, 0, 0 ); + + // tab order + setTabOrder( RadioButton1, RadioButton2 ); + setTabOrder( RadioButton2, RB_Dest1 ); + setTabOrder( RB_Dest1, RB_Dest2 ); + setTabOrder( RB_Dest2, buttonEnd ); + setTabOrder( buttonEnd, buttonClose ); + setTabOrder( buttonClose, buttonCancel ); +} + +/* + * Destroys the object and frees any allocated resources + */ +SketcherGUI_Skeleton_QTD::~SketcherGUI_Skeleton_QTD() +{ + // no need to delete child widgets, Qt does it all for us +} + diff --git a/src/SketcherGUI/SketcherGUI_Skeleton_QTD.h b/src/SketcherGUI/SketcherGUI_Skeleton_QTD.h new file mode 100644 index 000000000..d869caf49 --- /dev/null +++ b/src/SketcherGUI/SketcherGUI_Skeleton_QTD.h @@ -0,0 +1,61 @@ +/**************************************************************************** +** Form interface generated from reading ui file 'SketcherGUI_Skeleton_QTD.ui' +** +** Created: lun nov 3 17:27:53 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#ifndef SKETCHERGUI_SKELETON_QTD_H +#define SKETCHERGUI_SKELETON_QTD_H + +#include +#include +class QVBoxLayout; +class QHBoxLayout; +class QGridLayout; +class QButtonGroup; +class QGroupBox; +class QPushButton; +class QRadioButton; + +class SketcherGUI_Skeleton_QTD : public QDialog +{ + Q_OBJECT + +public: + SketcherGUI_Skeleton_QTD( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + ~SketcherGUI_Skeleton_QTD(); + + QGroupBox* GroupVal; + QButtonGroup* GroupConstructors; + QRadioButton* RadioButton1; + QRadioButton* RadioButton2; + QGroupBox* GroupDest; + QButtonGroup* GroupDest1; + QRadioButton* RB_Dest2; + QRadioButton* RB_Dest1; + QButtonGroup* GroupDest2; + QButtonGroup* GroupDest3; + QGroupBox* GroupButtons; + QPushButton* buttonEnd; + QPushButton* buttonClose; + QPushButton* buttonCancel; + + +protected: + QGridLayout* SketcherGUI_Skeleton_QTDLayout; + QGridLayout* Layout1; + QGridLayout* GroupConstructorsLayout; + QHBoxLayout* Layout2; + QGridLayout* GroupDestLayout; + QGridLayout* Layout5; + QGridLayout* GroupDest1Layout; + QGridLayout* Layout4; + QGridLayout* GroupDest2Layout; + QGridLayout* GroupDest3Layout; + QHBoxLayout* GroupButtonsLayout; + QHBoxLayout* Layout3; +}; + +#endif // SKETCHERGUI_SKELETON_QTD_H