From f81b4bfbe8f3635d0b1876a52d5b4f9568469c17 Mon Sep 17 00:00:00 2001 From: dcq Date: Tue, 6 Jan 2004 16:37:35 +0000 Subject: [PATCH] DCQ : New Archi --- src/MeasureGUI/Makefile.in | 89 +++++ src/MeasureGUI/MeasureGUI.cxx | 157 ++++++++ src/MeasureGUI/MeasureGUI.h | 56 +++ .../MeasureGUI_1Sel12LineEdit_QTD.cxx | 150 +++++++ .../MeasureGUI_1Sel12LineEdit_QTD.h | 59 +++ .../MeasureGUI_1Sel1TextView_QTD.cxx | 77 ++++ src/MeasureGUI/MeasureGUI_1Sel1TextView_QTD.h | 44 +++ .../MeasureGUI_1Sel3LineEdit_QTD.cxx | 104 +++++ src/MeasureGUI/MeasureGUI_1Sel3LineEdit_QTD.h | 48 +++ .../MeasureGUI_1Sel6LineEdit_QTD.cxx | 132 +++++++ src/MeasureGUI/MeasureGUI_1Sel6LineEdit_QTD.h | 54 +++ .../MeasureGUI_2Sel1LineEdit_QTD.cxx | 100 +++++ src/MeasureGUI/MeasureGUI_2Sel1LineEdit_QTD.h | 47 +++ src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx | 243 ++++++++++++ src/MeasureGUI/MeasureGUI_BndBoxDlg.h | 64 +++ src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx | 297 ++++++++++++++ src/MeasureGUI/MeasureGUI_CenterMassDlg.h | 74 ++++ src/MeasureGUI/MeasureGUI_CheckShapeDlg.cxx | 211 ++++++++++ src/MeasureGUI/MeasureGUI_CheckShapeDlg.h | 65 ++++ src/MeasureGUI/MeasureGUI_DistanceDlg.cxx | 368 ++++++++++++++++++ src/MeasureGUI/MeasureGUI_DistanceDlg.h | 74 ++++ src/MeasureGUI/MeasureGUI_InertiaDlg.cxx | 286 ++++++++++++++ src/MeasureGUI/MeasureGUI_InertiaDlg.h | 64 +++ src/MeasureGUI/MeasureGUI_MaxToleranceDlg.cxx | 284 ++++++++++++++ src/MeasureGUI/MeasureGUI_MaxToleranceDlg.h | 64 +++ src/MeasureGUI/MeasureGUI_PropertiesDlg.cxx | 258 ++++++++++++ src/MeasureGUI/MeasureGUI_PropertiesDlg.h | 63 +++ src/MeasureGUI/MeasureGUI_Skeleton.cxx | 169 ++++++++ src/MeasureGUI/MeasureGUI_Skeleton.h | 72 ++++ src/MeasureGUI/MeasureGUI_Skeleton_QTD.cxx | 99 +++++ src/MeasureGUI/MeasureGUI_Skeleton_QTD.h | 46 +++ src/MeasureGUI/MeasureGUI_WhatisDlg.cxx | 255 ++++++++++++ src/MeasureGUI/MeasureGUI_WhatisDlg.h | 65 ++++ .../UIFiles/MeasureGUI_1Sel12LineEdit_QTD.ui | 268 +++++++++++++ .../UIFiles/MeasureGUI_1Sel1TextView_QTD.ui | 116 ++++++ .../UIFiles/MeasureGUI_1Sel3LineEdit_QTD.ui | 191 +++++++++ .../UIFiles/MeasureGUI_1Sel6LineEdit_QTD.ui | 254 ++++++++++++ .../UIFiles/MeasureGUI_2Sel1LineEdit_QTD.ui | 186 +++++++++ .../UIFiles/MeasureGUI_Skeleton_QTD.ui | 210 ++++++++++ src/MeasureGUI/UIFiles/ui_to_cxx | 19 + 40 files changed, 5482 insertions(+) create mode 100644 src/MeasureGUI/Makefile.in create mode 100644 src/MeasureGUI/MeasureGUI.cxx create mode 100644 src/MeasureGUI/MeasureGUI.h create mode 100644 src/MeasureGUI/MeasureGUI_1Sel12LineEdit_QTD.cxx create mode 100644 src/MeasureGUI/MeasureGUI_1Sel12LineEdit_QTD.h create mode 100644 src/MeasureGUI/MeasureGUI_1Sel1TextView_QTD.cxx create mode 100644 src/MeasureGUI/MeasureGUI_1Sel1TextView_QTD.h create mode 100644 src/MeasureGUI/MeasureGUI_1Sel3LineEdit_QTD.cxx create mode 100644 src/MeasureGUI/MeasureGUI_1Sel3LineEdit_QTD.h create mode 100644 src/MeasureGUI/MeasureGUI_1Sel6LineEdit_QTD.cxx create mode 100644 src/MeasureGUI/MeasureGUI_1Sel6LineEdit_QTD.h create mode 100644 src/MeasureGUI/MeasureGUI_2Sel1LineEdit_QTD.cxx create mode 100644 src/MeasureGUI/MeasureGUI_2Sel1LineEdit_QTD.h create mode 100644 src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx create mode 100644 src/MeasureGUI/MeasureGUI_BndBoxDlg.h create mode 100644 src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx create mode 100644 src/MeasureGUI/MeasureGUI_CenterMassDlg.h create mode 100644 src/MeasureGUI/MeasureGUI_CheckShapeDlg.cxx create mode 100644 src/MeasureGUI/MeasureGUI_CheckShapeDlg.h create mode 100644 src/MeasureGUI/MeasureGUI_DistanceDlg.cxx create mode 100644 src/MeasureGUI/MeasureGUI_DistanceDlg.h create mode 100644 src/MeasureGUI/MeasureGUI_InertiaDlg.cxx create mode 100644 src/MeasureGUI/MeasureGUI_InertiaDlg.h create mode 100644 src/MeasureGUI/MeasureGUI_MaxToleranceDlg.cxx create mode 100644 src/MeasureGUI/MeasureGUI_MaxToleranceDlg.h create mode 100644 src/MeasureGUI/MeasureGUI_PropertiesDlg.cxx create mode 100644 src/MeasureGUI/MeasureGUI_PropertiesDlg.h create mode 100644 src/MeasureGUI/MeasureGUI_Skeleton.cxx create mode 100644 src/MeasureGUI/MeasureGUI_Skeleton.h create mode 100644 src/MeasureGUI/MeasureGUI_Skeleton_QTD.cxx create mode 100644 src/MeasureGUI/MeasureGUI_Skeleton_QTD.h create mode 100644 src/MeasureGUI/MeasureGUI_WhatisDlg.cxx create mode 100644 src/MeasureGUI/MeasureGUI_WhatisDlg.h create mode 100644 src/MeasureGUI/UIFiles/MeasureGUI_1Sel12LineEdit_QTD.ui create mode 100644 src/MeasureGUI/UIFiles/MeasureGUI_1Sel1TextView_QTD.ui create mode 100644 src/MeasureGUI/UIFiles/MeasureGUI_1Sel3LineEdit_QTD.ui create mode 100644 src/MeasureGUI/UIFiles/MeasureGUI_1Sel6LineEdit_QTD.ui create mode 100644 src/MeasureGUI/UIFiles/MeasureGUI_2Sel1LineEdit_QTD.ui create mode 100644 src/MeasureGUI/UIFiles/MeasureGUI_Skeleton_QTD.ui create mode 100755 src/MeasureGUI/UIFiles/ui_to_cxx diff --git a/src/MeasureGUI/Makefile.in b/src/MeasureGUI/Makefile.in new file mode 100644 index 000000000..2b983be0d --- /dev/null +++ b/src/MeasureGUI/Makefile.in @@ -0,0 +1,89 @@ +# GEOM MEASUREGUI : +# +# 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@ + +# header files +EXPORT_HEADERS= + +# Libraries targets +LIB = libMeasureGUI.la + +LIB_SRC = MeasureGUI.cxx \ + MeasureGUI_Skeleton_QTD.cxx \ + MeasureGUI_1Sel3LineEdit_QTD.cxx \ + MeasureGUI_1Sel6LineEdit_QTD.cxx \ + MeasureGUI_1Sel12LineEdit_QTD.cxx \ + MeasureGUI_1Sel1TextView_QTD.cxx \ + MeasureGUI_2Sel1LineEdit_QTD.cxx \ + MeasureGUI_Skeleton.cxx \ + MeasureGUI_PropertiesDlg.cxx \ + MeasureGUI_CenterMassDlg.cxx \ + MeasureGUI_InertiaDlg.cxx \ + MeasureGUI_BndBoxDlg.cxx \ + MeasureGUI_DistanceDlg.cxx \ + MeasureGUI_MaxToleranceDlg.cxx \ + MeasureGUI_WhatisDlg.cxx \ + MeasureGUI_CheckShapeDlg.cxx + +LIB_MOC = \ + MeasureGUI.h \ + MeasureGUI_Skeleton_QTD.h \ + MeasureGUI_1Sel3LineEdit_QTD.h \ + MeasureGUI_1Sel6LineEdit_QTD.h \ + MeasureGUI_1Sel12LineEdit_QTD.h \ + MeasureGUI_1Sel1TextView_QTD.h \ + MeasureGUI_2Sel1LineEdit_QTD.h \ + MeasureGUI_Skeleton.h \ + MeasureGUI_PropertiesDlg.h \ + MeasureGUI_CenterMassDlg.h \ + MeasureGUI_InertiaDlg.h \ + MeasureGUI_BndBoxDlg.h \ + MeasureGUI_DistanceDlg.h \ + MeasureGUI_MaxToleranceDlg.h \ + MeasureGUI_WhatisDlg.h \ + MeasureGUI_CheckShapeDlg.h + +LIB_CLIENT_IDL = + +LIB_SERVER_IDL = + +# additionnal information to compil and link file + +CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome +CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome + +LDFLAGS += -lGEOMBase + +@CONCLUDE@ diff --git a/src/MeasureGUI/MeasureGUI.cxx b/src/MeasureGUI/MeasureGUI.cxx new file mode 100644 index 000000000..d2a67dac4 --- /dev/null +++ b/src/MeasureGUI/MeasureGUI.cxx @@ -0,0 +1,157 @@ +// 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 : MeasureGUI.cxx +// Author : Damien COQUERET +// Module : GEOM +// $Header: + +using namespace std; +#include "MeasureGUI.h" + +#include "SALOMEGUI_QtCatchCorbaException.hxx" + +#include "MeasureGUI_PropertiesDlg.h" // Method PROPERTIES +#include "MeasureGUI_CenterMassDlg.h" // Method CENTER MASS +#include "MeasureGUI_InertiaDlg.h" // Method INERTIA +#include "MeasureGUI_BndBoxDlg.h" // Method BNDBOX +#include "MeasureGUI_DistanceDlg.h" // Method DISTANCE +#include "MeasureGUI_MaxToleranceDlg.h" // Method MAXTOLERANCE +#include "MeasureGUI_WhatisDlg.h" // Method WHATIS +#include "MeasureGUI_CheckShapeDlg.h" // Method CHECKSHAPE + +//======================================================================= +// function : MeasureGUI() +// purpose : Constructor +//======================================================================= +MeasureGUI::MeasureGUI() : + QObject() +{ + myGeomBase = new GEOMBase(); + myGeomGUI = GEOMContext::GetGeomGUI(); + myGeom = myGeomGUI->myComponentGeom; +} + + +//======================================================================= +// function : ~MeasureGUI() +// purpose : Destructor +//======================================================================= +MeasureGUI::~MeasureGUI() +{ +} + + +//======================================================================= +// function : OnGUIEvent() +// purpose : +//======================================================================= +bool MeasureGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent) +{ + MeasureGUI* myMeasureGUI = new MeasureGUI(); + myMeasureGUI->myGeomGUI->EmitSignalDeactivateDialog(); + SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection()); + + switch (theCommandID) + { + case 701: // PROPERTIES (Length, surface, volume) + { + MeasureGUI_PropertiesDlg *aDlg = new MeasureGUI_PropertiesDlg(parent, "", Sel); + break; + } + case 702: // CDG : Center of mass + { + MeasureGUI_CenterMassDlg *aDlg = new MeasureGUI_CenterMassDlg(parent, "", myMeasureGUI, Sel); + break; + } + case 703: // INERTIA + { + MeasureGUI_InertiaDlg *aDlg = new MeasureGUI_InertiaDlg(parent, "", Sel); + break; + } + case 7041: // BOUNDING BOX + { + MeasureGUI_BndBoxDlg *aDlg = new MeasureGUI_BndBoxDlg(parent, "", Sel); + break; + } + case 7042: // MIN DISTANCE + { + MeasureGUI_DistanceDlg *aDlg = new MeasureGUI_DistanceDlg(parent, "", Sel); + break; + } + case 705: // MAXTOLERANCE + { + MeasureGUI_MaxToleranceDlg *aDlg = new MeasureGUI_MaxToleranceDlg(parent, "", Sel); + break; + } + case 706: // WHATIS + { + MeasureGUI_WhatisDlg *aDlg = new MeasureGUI_WhatisDlg(parent, "", Sel); + break; + } + case 707: // CHECKSHAPE + { + MeasureGUI_CheckShapeDlg *aDlg = new MeasureGUI_CheckShapeDlg(parent, "", Sel); + break; + } + default: + { + parent->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); + break; + } + } + return true; +} + + +//===================================================================================== +// function : MakeCDGAndDisplay() +// purpose : +//===================================================================================== +void MeasureGUI::MakeCDGAndDisplay(GEOM::GEOM_Shape_ptr Shape) +{ + try { + GEOM::GEOM_Shape_var result = myGeom->MakeCDG(Shape); + if(result->_is_nil()) { + QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT")); + return; + } + result->NameType(tr("GEOM_POINT")); + if(myGeomBase->Display(result)) + QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE")); + } + catch(const SALOME::SALOME_Exception& S_ex) { + QtCatchCorbaException(S_ex); + } + return; +} + + +//===================================================================================== +// EXPORTED METHODS +//===================================================================================== +extern "C" +{ + bool OnGUIEvent(int theCommandID, QAD_Desktop* parent) + {return MeasureGUI::OnGUIEvent(theCommandID, parent);} +} diff --git a/src/MeasureGUI/MeasureGUI.h b/src/MeasureGUI/MeasureGUI.h new file mode 100644 index 000000000..751574e47 --- /dev/null +++ b/src/MeasureGUI/MeasureGUI.h @@ -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 : MeasureGUI.h +// Author : Damien COQUERET +// Module : GEOM +// $Header: + +#ifndef MEASUREGUI_H +#define MEASUREGUI_H + +#include "GEOMBase.h" + +//================================================================================= +// class : MeasureGUI +// purpose : +//================================================================================= +class MeasureGUI : public QObject +{ + Q_OBJECT /* for QT compatibility */ + +public : + MeasureGUI(); + ~MeasureGUI(); + + static bool OnGUIEvent(int theCommandID, QAD_Desktop* parent); + + void MakeCDGAndDisplay(GEOM::GEOM_Shape_ptr Shape); + + GEOMBase* myGeomBase; + GEOMContext* myGeomGUI; + GEOM::GEOM_Gen_var myGeom; /* Current Geom Component */ + +}; + +#endif diff --git a/src/MeasureGUI/MeasureGUI_1Sel12LineEdit_QTD.cxx b/src/MeasureGUI/MeasureGUI_1Sel12LineEdit_QTD.cxx new file mode 100644 index 000000000..a83fbe4a5 --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_1Sel12LineEdit_QTD.cxx @@ -0,0 +1,150 @@ +/**************************************************************************** +** Form implementation generated from reading ui file 'MeasureGUI_1Sel12LineEdit_QTD.ui' +** +** Created: mar oct 28 16:11:14 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#include "MeasureGUI_1Sel12LineEdit_QTD.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Constructs a MeasureGUI_1Sel12LineEdit_QTD which is a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +MeasureGUI_1Sel12LineEdit_QTD::MeasureGUI_1Sel12LineEdit_QTD( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + if ( !name ) + setName( "MeasureGUI_1Sel12LineEdit_QTD" ); + resize( 131, 171 ); + setCaption( trUtf8( "MeasureGUI_1Sel12LineEdit_QTD" ) ); + MeasureGUI_1Sel12LineEdit_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "MeasureGUI_1Sel12LineEdit_QTDLayout"); + + GroupBox1 = new QGroupBox( this, "GroupBox1" ); + GroupBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupBox1->sizePolicy().hasHeightForWidth() ) ); + GroupBox1->setTitle( trUtf8( "" ) ); + GroupBox1->setColumnLayout(0, Qt::Vertical ); + GroupBox1->layout()->setSpacing( 6 ); + GroupBox1->layout()->setMargin( 11 ); + GroupBox1Layout = new QGridLayout( GroupBox1->layout() ); + GroupBox1Layout->setAlignment( Qt::AlignTop ); + + Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1"); + + Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2"); + + LineEdit12 = new QLineEdit( GroupBox1, "LineEdit12" ); + + Layout2->addWidget( LineEdit12, 0, 2 ); + + LineEdit11 = new QLineEdit( GroupBox1, "LineEdit11" ); + + Layout2->addWidget( LineEdit11, 0, 1 ); + + LineEdit42 = new QLineEdit( GroupBox1, "LineEdit42" ); + + Layout2->addWidget( LineEdit42, 3, 2 ); + + TextLabel5 = new QLabel( GroupBox1, "TextLabel5" ); + TextLabel5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel5->sizePolicy().hasHeightForWidth() ) ); + TextLabel5->setText( trUtf8( "TL5" ) ); + + Layout2->addWidget( TextLabel5, 3, 0 ); + + LineEdit31 = new QLineEdit( GroupBox1, "LineEdit31" ); + + Layout2->addWidget( LineEdit31, 2, 1 ); + + LineEdit41 = new QLineEdit( GroupBox1, "LineEdit41" ); + + Layout2->addWidget( LineEdit41, 3, 1 ); + + LineEdit23 = new QLineEdit( GroupBox1, "LineEdit23" ); + + Layout2->addWidget( LineEdit23, 1, 3 ); + + LineEdit33 = new QLineEdit( GroupBox1, "LineEdit33" ); + + Layout2->addWidget( LineEdit33, 2, 3 ); + + LineEdit43 = new QLineEdit( GroupBox1, "LineEdit43" ); + + Layout2->addWidget( LineEdit43, 3, 3 ); + + LineEdit22 = new QLineEdit( GroupBox1, "LineEdit22" ); + + Layout2->addWidget( LineEdit22, 1, 2 ); + + TextLabel2 = new QLabel( GroupBox1, "TextLabel2" ); + TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) ); + TextLabel2->setText( trUtf8( "TL2" ) ); + + Layout2->addWidget( TextLabel2, 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" ) ); + + Layout2->addWidget( TextLabel4, 2, 0 ); + + LineEdit13 = new QLineEdit( GroupBox1, "LineEdit13" ); + + Layout2->addWidget( LineEdit13, 0, 3 ); + + LineEdit32 = new QLineEdit( GroupBox1, "LineEdit32" ); + + Layout2->addWidget( LineEdit32, 2, 2 ); + + LineEdit21 = new QLineEdit( GroupBox1, "LineEdit21" ); + + Layout2->addWidget( LineEdit21, 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" ) ); + + Layout2->addWidget( TextLabel3, 1, 0 ); + + Layout1->addMultiCellLayout( Layout2, 1, 1, 0, 2 ); + + LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" ); + + Layout1->addWidget( LineEdit1, 0, 2 ); + QSpacerItem* spacer = new QSpacerItem( 0, 40, QSizePolicy::Minimum, QSizePolicy::Expanding ); + Layout1->addItem( spacer, 2, 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 ); + + 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 ); + + GroupBox1Layout->addLayout( Layout1, 0, 0 ); + + MeasureGUI_1Sel12LineEdit_QTDLayout->addWidget( GroupBox1, 0, 0 ); +} + +/* + * Destroys the object and frees any allocated resources + */ +MeasureGUI_1Sel12LineEdit_QTD::~MeasureGUI_1Sel12LineEdit_QTD() +{ + // no need to delete child widgets, Qt does it all for us +} + diff --git a/src/MeasureGUI/MeasureGUI_1Sel12LineEdit_QTD.h b/src/MeasureGUI/MeasureGUI_1Sel12LineEdit_QTD.h new file mode 100644 index 000000000..6d63c89e9 --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_1Sel12LineEdit_QTD.h @@ -0,0 +1,59 @@ +/**************************************************************************** +** Form interface generated from reading ui file 'MeasureGUI_1Sel12LineEdit_QTD.ui' +** +** Created: mar oct 28 16:11:14 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#ifndef MEASUREGUI_1SEL12LINEEDIT_QTD_H +#define MEASUREGUI_1SEL12LINEEDIT_QTD_H + +#include +#include +class QVBoxLayout; +class QHBoxLayout; +class QGridLayout; +class QGroupBox; +class QLabel; +class QLineEdit; +class QPushButton; + +class MeasureGUI_1Sel12LineEdit_QTD : public QWidget +{ + Q_OBJECT + +public: + MeasureGUI_1Sel12LineEdit_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~MeasureGUI_1Sel12LineEdit_QTD(); + + QGroupBox* GroupBox1; + QLineEdit* LineEdit12; + QLineEdit* LineEdit11; + QLineEdit* LineEdit42; + QLabel* TextLabel5; + QLineEdit* LineEdit31; + QLineEdit* LineEdit41; + QLineEdit* LineEdit23; + QLineEdit* LineEdit33; + QLineEdit* LineEdit43; + QLineEdit* LineEdit22; + QLabel* TextLabel2; + QLabel* TextLabel4; + QLineEdit* LineEdit13; + QLineEdit* LineEdit32; + QLineEdit* LineEdit21; + QLabel* TextLabel3; + QLineEdit* LineEdit1; + QPushButton* PushButton1; + QLabel* TextLabel1; + + +protected: + QGridLayout* MeasureGUI_1Sel12LineEdit_QTDLayout; + QGridLayout* GroupBox1Layout; + QGridLayout* Layout1; + QGridLayout* Layout2; +}; + +#endif // MEASUREGUI_1SEL12LINEEDIT_QTD_H diff --git a/src/MeasureGUI/MeasureGUI_1Sel1TextView_QTD.cxx b/src/MeasureGUI/MeasureGUI_1Sel1TextView_QTD.cxx new file mode 100644 index 000000000..c5c2263da --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_1Sel1TextView_QTD.cxx @@ -0,0 +1,77 @@ +/**************************************************************************** +** Form implementation generated from reading ui file 'MeasureGUI_1Sel1TextView_QTD.ui' +** +** Created: mar oct 28 14:01:15 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#include "MeasureGUI_1Sel1TextView_QTD.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Constructs a MeasureGUI_1Sel1TextView_QTD which is a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +MeasureGUI_1Sel1TextView_QTD::MeasureGUI_1Sel1TextView_QTD( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + if ( !name ) + setName( "MeasureGUI_1Sel1TextView_QTD" ); + resize( 130, 160 ); + setCaption( trUtf8( "MeasureGUI_1Sel1TextView_QTD" ) ); + MeasureGUI_1Sel1TextView_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "MeasureGUI_1Sel1TextView_QTDLayout"); + + GroupBox1 = new QGroupBox( this, "GroupBox1" ); + GroupBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupBox1->sizePolicy().hasHeightForWidth() ) ); + GroupBox1->setTitle( trUtf8( "" ) ); + GroupBox1->setColumnLayout(0, Qt::Vertical ); + GroupBox1->layout()->setSpacing( 6 ); + GroupBox1->layout()->setMargin( 11 ); + GroupBox1Layout = new QGridLayout( GroupBox1->layout() ); + GroupBox1Layout->setAlignment( Qt::AlignTop ); + + 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 ); + + TextEdit1 = new QTextEdit( GroupBox1, "TextEdit1" ); + + Layout1->addMultiCellWidget( TextEdit1, 1, 1, 0, 2 ); + + LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" ); + + Layout1->addWidget( LineEdit1, 0, 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 ); + + GroupBox1Layout->addLayout( Layout1, 0, 0 ); + + MeasureGUI_1Sel1TextView_QTDLayout->addWidget( GroupBox1, 0, 0 ); +} + +/* + * Destroys the object and frees any allocated resources + */ +MeasureGUI_1Sel1TextView_QTD::~MeasureGUI_1Sel1TextView_QTD() +{ + // no need to delete child widgets, Qt does it all for us +} + diff --git a/src/MeasureGUI/MeasureGUI_1Sel1TextView_QTD.h b/src/MeasureGUI/MeasureGUI_1Sel1TextView_QTD.h new file mode 100644 index 000000000..baa5b7872 --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_1Sel1TextView_QTD.h @@ -0,0 +1,44 @@ +/**************************************************************************** +** Form interface generated from reading ui file 'MeasureGUI_1Sel1TextView_QTD.ui' +** +** Created: mar oct 28 14:01:14 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#ifndef MEASUREGUI_1SEL1TEXTVIEW_QTD_H +#define MEASUREGUI_1SEL1TEXTVIEW_QTD_H + +#include +#include +class QVBoxLayout; +class QHBoxLayout; +class QGridLayout; +class QGroupBox; +class QLabel; +class QLineEdit; +class QPushButton; +class QTextEdit; + +class MeasureGUI_1Sel1TextView_QTD : public QWidget +{ + Q_OBJECT + +public: + MeasureGUI_1Sel1TextView_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~MeasureGUI_1Sel1TextView_QTD(); + + QGroupBox* GroupBox1; + QLabel* TextLabel1; + QTextEdit* TextEdit1; + QLineEdit* LineEdit1; + QPushButton* PushButton1; + + +protected: + QGridLayout* MeasureGUI_1Sel1TextView_QTDLayout; + QGridLayout* GroupBox1Layout; + QGridLayout* Layout1; +}; + +#endif // MEASUREGUI_1SEL1TEXTVIEW_QTD_H diff --git a/src/MeasureGUI/MeasureGUI_1Sel3LineEdit_QTD.cxx b/src/MeasureGUI/MeasureGUI_1Sel3LineEdit_QTD.cxx new file mode 100644 index 000000000..af0be4fe4 --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_1Sel3LineEdit_QTD.cxx @@ -0,0 +1,104 @@ +/**************************************************************************** +** Form implementation generated from reading ui file 'MeasureGUI_1Sel3LineEdit_QTD.ui' +** +** Created: mar oct 28 16:11:13 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#include "MeasureGUI_1Sel3LineEdit_QTD.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Constructs a MeasureGUI_1Sel3LineEdit_QTD which is a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +MeasureGUI_1Sel3LineEdit_QTD::MeasureGUI_1Sel3LineEdit_QTD( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + if ( !name ) + setName( "MeasureGUI_1Sel3LineEdit_QTD" ); + resize( 129, 141 ); + setCaption( trUtf8( "MeasureGUI_1Sel3LineEdit_QTD" ) ); + MeasureGUI_1Sel3LineEdit_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "MeasureGUI_1Sel3LineEdit_QTDLayout"); + + GroupBox1 = new QGroupBox( this, "GroupBox1" ); + GroupBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupBox1->sizePolicy().hasHeightForWidth() ) ); + GroupBox1->setTitle( trUtf8( "" ) ); + GroupBox1->setColumnLayout(0, Qt::Vertical ); + GroupBox1->layout()->setSpacing( 6 ); + GroupBox1->layout()->setMargin( 11 ); + GroupBox1Layout = new QGridLayout( GroupBox1->layout() ); + GroupBox1Layout->setAlignment( Qt::AlignTop ); + + Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2"); + + TextLabel1 = new QLabel( GroupBox1, "TextLabel1" ); + TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) ); + TextLabel1->setText( trUtf8( "TL1" ) ); + + Layout2->addWidget( TextLabel1, 0, 0 ); + + LineEdit4 = new QLineEdit( GroupBox1, "LineEdit4" ); + + Layout2->addMultiCellWidget( LineEdit4, 3, 3, 1, 2 ); + + TextLabel3 = new QLabel( GroupBox1, "TextLabel3" ); + TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) ); + TextLabel3->setText( trUtf8( "TL3" ) ); + + Layout2->addWidget( TextLabel3, 2, 0 ); + + LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" ); + + Layout2->addMultiCellWidget( LineEdit2, 1, 1, 1, 2 ); + QSpacerItem* spacer = new QSpacerItem( 0, 80, QSizePolicy::Minimum, QSizePolicy::Expanding ); + Layout2->addItem( spacer, 4, 2 ); + + LineEdit3 = new QLineEdit( GroupBox1, "LineEdit3" ); + + Layout2->addMultiCellWidget( LineEdit3, 2, 2, 1, 2 ); + + LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" ); + + Layout2->addWidget( LineEdit1, 0, 2 ); + + TextLabel4 = new QLabel( GroupBox1, "TextLabel4" ); + TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) ); + TextLabel4->setText( trUtf8( "TL4" ) ); + + Layout2->addWidget( TextLabel4, 3, 0 ); + + TextLabel2 = new QLabel( GroupBox1, "TextLabel2" ); + TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) ); + TextLabel2->setText( trUtf8( "TL2" ) ); + + Layout2->addWidget( TextLabel2, 1, 0 ); + + PushButton1 = new QPushButton( GroupBox1, "PushButton1" ); + PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) ); + PushButton1->setText( trUtf8( "" ) ); + + Layout2->addWidget( PushButton1, 0, 1 ); + + GroupBox1Layout->addLayout( Layout2, 0, 0 ); + + MeasureGUI_1Sel3LineEdit_QTDLayout->addWidget( GroupBox1, 0, 0 ); +} + +/* + * Destroys the object and frees any allocated resources + */ +MeasureGUI_1Sel3LineEdit_QTD::~MeasureGUI_1Sel3LineEdit_QTD() +{ + // no need to delete child widgets, Qt does it all for us +} + diff --git a/src/MeasureGUI/MeasureGUI_1Sel3LineEdit_QTD.h b/src/MeasureGUI/MeasureGUI_1Sel3LineEdit_QTD.h new file mode 100644 index 000000000..1312639c7 --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_1Sel3LineEdit_QTD.h @@ -0,0 +1,48 @@ +/**************************************************************************** +** Form interface generated from reading ui file 'MeasureGUI_1Sel3LineEdit_QTD.ui' +** +** Created: mar oct 28 16:11:13 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#ifndef MEASUREGUI_1SEL3LINEEDIT_QTD_H +#define MEASUREGUI_1SEL3LINEEDIT_QTD_H + +#include +#include +class QVBoxLayout; +class QHBoxLayout; +class QGridLayout; +class QGroupBox; +class QLabel; +class QLineEdit; +class QPushButton; + +class MeasureGUI_1Sel3LineEdit_QTD : public QWidget +{ + Q_OBJECT + +public: + MeasureGUI_1Sel3LineEdit_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~MeasureGUI_1Sel3LineEdit_QTD(); + + QGroupBox* GroupBox1; + QLabel* TextLabel1; + QLineEdit* LineEdit4; + QLabel* TextLabel3; + QLineEdit* LineEdit2; + QLineEdit* LineEdit3; + QLineEdit* LineEdit1; + QLabel* TextLabel4; + QLabel* TextLabel2; + QPushButton* PushButton1; + + +protected: + QGridLayout* MeasureGUI_1Sel3LineEdit_QTDLayout; + QGridLayout* GroupBox1Layout; + QGridLayout* Layout2; +}; + +#endif // MEASUREGUI_1SEL3LINEEDIT_QTD_H diff --git a/src/MeasureGUI/MeasureGUI_1Sel6LineEdit_QTD.cxx b/src/MeasureGUI/MeasureGUI_1Sel6LineEdit_QTD.cxx new file mode 100644 index 000000000..9883295a2 --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_1Sel6LineEdit_QTD.cxx @@ -0,0 +1,132 @@ +/**************************************************************************** +** Form implementation generated from reading ui file 'MeasureGUI_1Sel6LineEdit_QTD.ui' +** +** Created: mar oct 28 16:11:14 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#include "MeasureGUI_1Sel6LineEdit_QTD.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Constructs a MeasureGUI_1Sel6LineEdit_QTD which is a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +MeasureGUI_1Sel6LineEdit_QTD::MeasureGUI_1Sel6LineEdit_QTD( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + if ( !name ) + setName( "MeasureGUI_1Sel6LineEdit_QTD" ); + resize( 129, 163 ); + setCaption( trUtf8( "MeasureGUI_1Sel6LineEdit_QTD" ) ); + MeasureGUI_1Sel6LineEdit_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "MeasureGUI_1Sel6LineEdit_QTDLayout"); + + GroupBox1 = new QGroupBox( this, "GroupBox1" ); + GroupBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupBox1->sizePolicy().hasHeightForWidth() ) ); + GroupBox1->setTitle( trUtf8( "" ) ); + GroupBox1->setColumnLayout(0, Qt::Vertical ); + GroupBox1->layout()->setSpacing( 6 ); + GroupBox1->layout()->setMargin( 11 ); + GroupBox1Layout = new QGridLayout( GroupBox1->layout() ); + GroupBox1Layout->setAlignment( Qt::AlignTop ); + + Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1"); + QSpacerItem* spacer = new QSpacerItem( 0, 50, QSizePolicy::Minimum, QSizePolicy::Expanding ); + Layout1->addItem( spacer, 2, 2 ); + + 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 ); + + Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2"); + + LineEdit22 = new QLineEdit( GroupBox1, "LineEdit22" ); + + Layout2->addWidget( LineEdit22, 2, 2 ); + + LineEdit32 = new QLineEdit( GroupBox1, "LineEdit32" ); + + Layout2->addWidget( LineEdit32, 3, 2 ); + + TextLabel4 = new QLabel( GroupBox1, "TextLabel4" ); + TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) ); + TextLabel4->setText( trUtf8( "TL4" ) ); + + Layout2->addWidget( TextLabel4, 1, 0 ); + + LineEdit31 = new QLineEdit( GroupBox1, "LineEdit31" ); + + Layout2->addWidget( LineEdit31, 3, 1 ); + + TextLabel5 = new QLabel( GroupBox1, "TextLabel5" ); + TextLabel5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel5->sizePolicy().hasHeightForWidth() ) ); + TextLabel5->setText( trUtf8( "TL5" ) ); + + Layout2->addWidget( TextLabel5, 2, 0 ); + + LineEdit11 = new QLineEdit( GroupBox1, "LineEdit11" ); + + Layout2->addWidget( LineEdit11, 1, 1 ); + + TextLabel6 = new QLabel( GroupBox1, "TextLabel6" ); + TextLabel6->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel6->sizePolicy().hasHeightForWidth() ) ); + TextLabel6->setText( trUtf8( "TL6" ) ); + + Layout2->addWidget( TextLabel6, 3, 0 ); + + LineEdit12 = new QLineEdit( GroupBox1, "LineEdit12" ); + + Layout2->addWidget( LineEdit12, 1, 2 ); + + TextLabel2 = new QLabel( GroupBox1, "TextLabel2" ); + TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) ); + TextLabel2->setText( trUtf8( "TL2" ) ); + + Layout2->addWidget( TextLabel2, 0, 1 ); + + LineEdit21 = new QLineEdit( GroupBox1, "LineEdit21" ); + + Layout2->addWidget( LineEdit21, 2, 1 ); + + TextLabel3 = new QLabel( GroupBox1, "TextLabel3" ); + TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) ); + TextLabel3->setText( trUtf8( "TL3" ) ); + + Layout2->addWidget( TextLabel3, 0, 2 ); + + Layout1->addMultiCellLayout( Layout2, 1, 1, 0, 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 ); + + GroupBox1Layout->addLayout( Layout1, 0, 0 ); + + MeasureGUI_1Sel6LineEdit_QTDLayout->addWidget( GroupBox1, 0, 0 ); +} + +/* + * Destroys the object and frees any allocated resources + */ +MeasureGUI_1Sel6LineEdit_QTD::~MeasureGUI_1Sel6LineEdit_QTD() +{ + // no need to delete child widgets, Qt does it all for us +} + diff --git a/src/MeasureGUI/MeasureGUI_1Sel6LineEdit_QTD.h b/src/MeasureGUI/MeasureGUI_1Sel6LineEdit_QTD.h new file mode 100644 index 000000000..cc8157a84 --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_1Sel6LineEdit_QTD.h @@ -0,0 +1,54 @@ +/**************************************************************************** +** Form interface generated from reading ui file 'MeasureGUI_1Sel6LineEdit_QTD.ui' +** +** Created: mar oct 28 16:11:13 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#ifndef MEASUREGUI_1SEL6LINEEDIT_QTD_H +#define MEASUREGUI_1SEL6LINEEDIT_QTD_H + +#include +#include +class QVBoxLayout; +class QHBoxLayout; +class QGridLayout; +class QGroupBox; +class QLabel; +class QLineEdit; +class QPushButton; + +class MeasureGUI_1Sel6LineEdit_QTD : public QWidget +{ + Q_OBJECT + +public: + MeasureGUI_1Sel6LineEdit_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~MeasureGUI_1Sel6LineEdit_QTD(); + + QGroupBox* GroupBox1; + QLabel* TextLabel1; + QLineEdit* LineEdit22; + QLineEdit* LineEdit32; + QLabel* TextLabel4; + QLineEdit* LineEdit31; + QLabel* TextLabel5; + QLineEdit* LineEdit11; + QLabel* TextLabel6; + QLineEdit* LineEdit12; + QLabel* TextLabel2; + QLineEdit* LineEdit21; + QLabel* TextLabel3; + QPushButton* PushButton1; + QLineEdit* LineEdit1; + + +protected: + QGridLayout* MeasureGUI_1Sel6LineEdit_QTDLayout; + QGridLayout* GroupBox1Layout; + QGridLayout* Layout1; + QGridLayout* Layout2; +}; + +#endif // MEASUREGUI_1SEL6LINEEDIT_QTD_H diff --git a/src/MeasureGUI/MeasureGUI_2Sel1LineEdit_QTD.cxx b/src/MeasureGUI/MeasureGUI_2Sel1LineEdit_QTD.cxx new file mode 100644 index 000000000..0efb7a261 --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_2Sel1LineEdit_QTD.cxx @@ -0,0 +1,100 @@ +/**************************************************************************** +** Form implementation generated from reading ui file 'MeasureGUI_2Sel1LineEdit_QTD.ui' +** +** Created: mar oct 28 16:11:14 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#include "MeasureGUI_2Sel1LineEdit_QTD.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Constructs a MeasureGUI_2Sel1LineEdit_QTD which is a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +MeasureGUI_2Sel1LineEdit_QTD::MeasureGUI_2Sel1LineEdit_QTD( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + if ( !name ) + setName( "MeasureGUI_2Sel1LineEdit_QTD" ); + resize( 129, 115 ); + setCaption( trUtf8( "MeasureGUI_2Sel1LineEdit_QTD" ) ); + MeasureGUI_2Sel1LineEdit_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "MeasureGUI_2Sel1LineEdit_QTDLayout"); + + GroupBox1 = new QGroupBox( this, "GroupBox1" ); + GroupBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupBox1->sizePolicy().hasHeightForWidth() ) ); + GroupBox1->setTitle( trUtf8( "" ) ); + GroupBox1->setColumnLayout(0, Qt::Vertical ); + GroupBox1->layout()->setSpacing( 6 ); + GroupBox1->layout()->setMargin( 11 ); + GroupBox1Layout = new QGridLayout( GroupBox1->layout() ); + GroupBox1Layout->setAlignment( Qt::AlignTop ); + + Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1"); + QSpacerItem* spacer = new QSpacerItem( 0, 60, QSizePolicy::Minimum, QSizePolicy::Expanding ); + Layout1->addItem( spacer, 3, 2 ); + + 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 ); + + LineEdit3 = new QLineEdit( GroupBox1, "LineEdit3" ); + + Layout1->addMultiCellWidget( LineEdit3, 2, 2, 1, 2 ); + + LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" ); + + Layout1->addWidget( LineEdit2, 1, 2 ); + + 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 ); + + 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 ); + + PushButton2 = new QPushButton( GroupBox1, "PushButton2" ); + PushButton2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton2->sizePolicy().hasHeightForWidth() ) ); + PushButton2->setText( trUtf8( "" ) ); + + Layout1->addWidget( PushButton2, 1, 1 ); + + GroupBox1Layout->addLayout( Layout1, 0, 0 ); + + MeasureGUI_2Sel1LineEdit_QTDLayout->addWidget( GroupBox1, 0, 0 ); +} + +/* + * Destroys the object and frees any allocated resources + */ +MeasureGUI_2Sel1LineEdit_QTD::~MeasureGUI_2Sel1LineEdit_QTD() +{ + // no need to delete child widgets, Qt does it all for us +} + diff --git a/src/MeasureGUI/MeasureGUI_2Sel1LineEdit_QTD.h b/src/MeasureGUI/MeasureGUI_2Sel1LineEdit_QTD.h new file mode 100644 index 000000000..192f6ef33 --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_2Sel1LineEdit_QTD.h @@ -0,0 +1,47 @@ +/**************************************************************************** +** Form interface generated from reading ui file 'MeasureGUI_2Sel1LineEdit_QTD.ui' +** +** Created: mar oct 28 16:11:14 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#ifndef MEASUREGUI_2SEL1LINEEDIT_QTD_H +#define MEASUREGUI_2SEL1LINEEDIT_QTD_H + +#include +#include +class QVBoxLayout; +class QHBoxLayout; +class QGridLayout; +class QGroupBox; +class QLabel; +class QLineEdit; +class QPushButton; + +class MeasureGUI_2Sel1LineEdit_QTD : public QWidget +{ + Q_OBJECT + +public: + MeasureGUI_2Sel1LineEdit_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~MeasureGUI_2Sel1LineEdit_QTD(); + + QGroupBox* GroupBox1; + QLabel* TextLabel3; + QLineEdit* LineEdit3; + QLineEdit* LineEdit2; + QLabel* TextLabel2; + QLabel* TextLabel1; + QPushButton* PushButton1; + QLineEdit* LineEdit1; + QPushButton* PushButton2; + + +protected: + QGridLayout* MeasureGUI_2Sel1LineEdit_QTDLayout; + QGridLayout* GroupBox1Layout; + QGridLayout* Layout1; +}; + +#endif // MEASUREGUI_2SEL1LINEEDIT_QTD_H diff --git a/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx b/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx new file mode 100644 index 000000000..fc9feffb6 --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx @@ -0,0 +1,243 @@ +// 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 : MeasureGUI_BndBoxDlg.cxx +// Author : Nicolas REJNERI +// Module : GEOM +// $Header$ + +using namespace std; +#include "MeasureGUI_BndBoxDlg.h" + +#include +#include + +//================================================================================= +// class : MeasureGUI_BndBoxDlg() +// purpose : Constructs a MeasureGUI_BndBoxDlg 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. +//================================================================================= +MeasureGUI_BndBoxDlg::MeasureGUI_BndBoxDlg(QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl) + :MeasureGUI_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +{ + QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_BOUNDING_BOX"))); + QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT"))); + + setCaption(tr("GEOM_BNDBOX_TITLE")); + + /***************************************************************/ + GroupConstructors->setTitle(tr("GEOM_BNDBOX")); + RadioButton1->setPixmap(image0); + + GroupC1 = new MeasureGUI_1Sel6LineEdit_QTD(this, "GroupC1"); + GroupC1->GroupBox1->setTitle(tr("GEOM_BNDBOX_OBJDIM")); + GroupC1->TextLabel1->setText(tr("GEOM_OBJECT")); + GroupC1->TextLabel2->setText(tr("GEOM_MIN")); + GroupC1->TextLabel3->setText(tr("GEOM_MAX")); + GroupC1->TextLabel4->setText(tr("GEOM_X")); + GroupC1->TextLabel5->setText(tr("GEOM_Y")); + GroupC1->TextLabel6->setText(tr("GEOM_Z")); + GroupC1->LineEdit11->setReadOnly(TRUE); + GroupC1->LineEdit12->setReadOnly(TRUE); + GroupC1->LineEdit21->setReadOnly(TRUE); + GroupC1->LineEdit22->setReadOnly(TRUE); + GroupC1->LineEdit31->setReadOnly(TRUE); + GroupC1->LineEdit32->setReadOnly(TRUE); + GroupC1->PushButton1->setPixmap(image1); + + Layout1->addWidget(GroupC1, 1, 0); + /***************************************************************/ + + /* Initialisation */ + Init(); +} + + +//================================================================================= +// function : ~MeasureGUI_BndBoxDlg() +// purpose : Destroys the object and frees any allocated resources +//================================================================================= +MeasureGUI_BndBoxDlg::~MeasureGUI_BndBoxDlg() +{ + // no need to delete child widgets, Qt does it all for us +} + + +//================================================================================= +// function : Init() +// purpose : +//================================================================================= +void MeasureGUI_BndBoxDlg::Init() +{ + /* init variables */ + myEditCurrentArgument = GroupC1->LineEdit1; + + /* signals and slots connections */ + connect(GroupC1->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); + connect(GroupC1->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); + + connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + + /* displays Dialog */ + GroupC1->show(); + this->show(); + + return; +} + + +//================================================================================= +// function : SelectionIntoArgument() +// purpose : Called when selection as changed or other case +//================================================================================= +void MeasureGUI_BndBoxDlg::SelectionIntoArgument() +{ + myGeomBase->EraseSimulationShape(); + mySimulationTopoDs.Nullify(); + myEditCurrentArgument->setText(""); + QString aString = ""; + + GroupC1->LineEdit11->setText(""); + GroupC1->LineEdit12->setText(""); + GroupC1->LineEdit21->setText(""); + GroupC1->LineEdit22->setText(""); + GroupC1->LineEdit31->setText(""); + GroupC1->LineEdit32->setText(""); + + int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString); + if(nbSel != 1) + return; + + /* nbSel == 1 */ + TopoDS_Shape S; + if(!myGeomBase->GetTopoFromSelection(mySelection, S) || S.IsNull()) + return; + + GroupC1->LineEdit1->setText(aString); + + this->CalculateAndDisplayBndBox(S); + return; +} + + +//================================================================================= +// function : SetEditCurrentArgument() +// purpose : +//================================================================================= +void MeasureGUI_BndBoxDlg::SetEditCurrentArgument() +{ + QPushButton* send = (QPushButton*)sender(); + + if(send == GroupC1->PushButton1) { + GroupC1->LineEdit1->setFocus(); + myEditCurrentArgument = GroupC1->LineEdit1; + } + + this->SelectionIntoArgument(); + return; +} + + +//================================================================================= +// function : LineEditReturnPressed() +// purpose : +//================================================================================= +void MeasureGUI_BndBoxDlg::LineEditReturnPressed() +{ + QLineEdit* send = (QLineEdit*)sender(); + if(send == GroupC1->LineEdit1) + myEditCurrentArgument = GroupC1->LineEdit1; + else + return; + + MeasureGUI_Skeleton::LineEditReturnPressed(); + return; +} + + +//================================================================================= +// function : ActivateThisDialog() +// purpose : +//================================================================================= +void MeasureGUI_BndBoxDlg::ActivateThisDialog() +{ + MeasureGUI_Skeleton::ActivateThisDialog(); + connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + if(!mySimulationTopoDs.IsNull()) + myGeomBase->DisplaySimulationShape(mySimulationTopoDs); + return; +} + + +//================================================================================= +// function : enterEvent() +// purpose : +//================================================================================= +void MeasureGUI_BndBoxDlg::enterEvent(QEvent* e) +{ + if(GroupConstructors->isEnabled()) + return; + this->ActivateThisDialog(); + return; +} + + +//================================================================================= +// function : CalculateAndDisplayBndBox() +// purpose : +//================================================================================= +void MeasureGUI_BndBoxDlg::CalculateAndDisplayBndBox(const TopoDS_Shape& S) +{ + GroupC1->LineEdit11->setText(""); + GroupC1->LineEdit12->setText(""); + GroupC1->LineEdit21->setText(""); + GroupC1->LineEdit22->setText(""); + GroupC1->LineEdit31->setText(""); + GroupC1->LineEdit32->setText(""); + + if(S.IsNull()) + return; + + Standard_Real axmin, aymin, azmin, axmax, aymax, azmax; + Bnd_Box B; + + try { + BRepBndLib::Add(S,B); + B.Get(axmin, aymin, azmin, axmax, aymax, azmax); + GroupC1->LineEdit11->setText(tr("%1").arg(axmin, 12, 'f', 6)); + GroupC1->LineEdit12->setText(tr("%1").arg(axmax, 12, 'f', 6)); + GroupC1->LineEdit21->setText(tr("%1").arg(aymin, 12, 'f', 6)); + GroupC1->LineEdit22->setText(tr("%1").arg(aymax, 12, 'f', 6)); + GroupC1->LineEdit31->setText(tr("%1").arg(azmin, 12, 'f', 6)); + GroupC1->LineEdit32->setText(tr("%1").arg(azmax, 12, 'f', 6)); + + mySimulationTopoDs = BRepPrimAPI_MakeBox(gp_Pnt(axmin, aymin, azmin), gp_Pnt(axmax, aymax, azmax)).Shape(); + myGeomBase->DisplaySimulationShape(mySimulationTopoDs); + } + catch(Standard_Failure) { + MESSAGE("Catch intercepted in CalculateAndDisplayBndBox()"); + } + return; +} diff --git a/src/MeasureGUI/MeasureGUI_BndBoxDlg.h b/src/MeasureGUI/MeasureGUI_BndBoxDlg.h new file mode 100644 index 000000000..ee17c7008 --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_BndBoxDlg.h @@ -0,0 +1,64 @@ +// 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 : MeasureGUI_BndBoxDlg.h +// Author : Nicolas REJNERI +// Module : GEOM +// $Header$ + +#ifndef DIALOGBOX_BNDBOX_H +#define DIALOGBOX_BNDBOX_H + +#include "MeasureGUI_Skeleton.h" +#include "MeasureGUI_1Sel6LineEdit_QTD.h" + +#include "MeasureGUI.h" + +//================================================================================= +// class : DialogBox_PROPERTIES +// purpose : +//================================================================================= +class MeasureGUI_BndBoxDlg : public MeasureGUI_Skeleton +{ + Q_OBJECT + +public: + MeasureGUI_BndBoxDlg(QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0); + ~MeasureGUI_BndBoxDlg(); + +private: + void Init(); + void enterEvent(QEvent* e); + void CalculateAndDisplayBndBox(const TopoDS_Shape& S); + + MeasureGUI_1Sel6LineEdit_QTD* GroupC1; + +private slots: + void SetEditCurrentArgument(); + void SelectionIntoArgument(); + void LineEditReturnPressed(); + void ActivateThisDialog(); + +}; + +#endif // DIALOGBOX_BNDBOX_H diff --git a/src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx b/src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx new file mode 100644 index 000000000..691fd8694 --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx @@ -0,0 +1,297 @@ +// 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 : MeasureGUI_CenterMassDlg.cxx +// Author : Lucien PIGNOLONI +// Module : GEOM +// $Header$ + +using namespace std; +#include "MeasureGUI_CenterMassDlg.h" + +#include +#include +#include +#include + +//================================================================================= +// class : MeasureGUI_CenterMassDlg() +// purpose : Constructs a MeasureGUI_CenterMassDlg 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. +//================================================================================= +MeasureGUI_CenterMassDlg::MeasureGUI_CenterMassDlg(QWidget* parent, const char* name, MeasureGUI* theMeasureGUI, SALOME_Selection* Sel, bool modal, WFlags fl) + :GEOMBase_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +{ + QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_CENTERMASS"))); + QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT"))); + + setCaption(tr("GEOM_CMASS_TITLE")); + + /***************************************************************/ + GroupConstructors->setTitle(tr("GEOM_CMASS")); + RadioButton1->setPixmap(image0); + RadioButton2->close(TRUE); + RadioButton3->close(TRUE); + + GroupC1 = new MeasureGUI_1Sel3LineEdit_QTD(this, "GroupC1"); + GroupC1->GroupBox1->setTitle(tr("GEOM_CENTER")); + GroupC1->TextLabel1->setText(tr("GEOM_OBJECT")); + GroupC1->TextLabel2->setText(tr("GEOM_X")); + GroupC1->TextLabel3->setText(tr("GEOM_Y")); + GroupC1->TextLabel4->setText(tr("GEOM_Z")); + GroupC1->LineEdit2->setReadOnly(TRUE); + GroupC1->LineEdit3->setReadOnly(TRUE); + GroupC1->LineEdit4->setReadOnly(TRUE); + GroupC1->PushButton1->setPixmap(image1); + + Layout1->addWidget(GroupC1, 1, 0); + /***************************************************************/ + + /* Initialisation */ + myMeasureGUI = theMeasureGUI; + Init(); +} + + +//================================================================================= +// function : ~MeasureGUI_CenterMassDlg() +// purpose : Destroys the object and frees any allocated resources +//================================================================================= +MeasureGUI_CenterMassDlg::~MeasureGUI_CenterMassDlg() +{ + // no need to delete child widgets, Qt does it all for us +} + + +//================================================================================= +// function : Init() +// purpose : +//================================================================================= +void MeasureGUI_CenterMassDlg::Init() +{ + /* init variables */ + myEditCurrentArgument = GroupC1->LineEdit1; + + myOkCenterMass = false; + + /* signals and slots connections */ + connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); + connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); + + connect(GroupC1->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); + connect(GroupC1->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); + + connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + + /* displays Dialog */ + GroupC1->show(); + this->show(); + + return; +} + + +//================================================================================= +// function : ClickOnOk() +// purpose : +//================================================================================= +void MeasureGUI_CenterMassDlg::ClickOnOk() +{ + this->ClickOnApply(); + ClickOnCancel(); + return; +} + + +//================================================================================= +// function : ClickOnApply() +// purpose : +//================================================================================= +void MeasureGUI_CenterMassDlg::ClickOnApply() +{ + QAD_Application::getDesktop()->putInfo(tr("")); + if (mySimulationTopoDs.IsNull()) + return; + myGeomBase->EraseSimulationShape(); + mySimulationTopoDs.Nullify(); + + if(myOkCenterMass) + myMeasureGUI->MakeCDGAndDisplay(myGeomShape); + return; +} + + +//================================================================================= +// function : SelectionIntoArgument() +// purpose : Called when selection as changed or other case +//================================================================================= +void MeasureGUI_CenterMassDlg::SelectionIntoArgument() +{ + myGeomBase->EraseSimulationShape(); + myEditCurrentArgument->setText(""); + QString aString = ""; + + myOkCenterMass = false; + GroupC1->LineEdit2->setText(""); + GroupC1->LineEdit3->setText(""); + GroupC1->LineEdit4->setText(""); + + int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString); + if(nbSel != 1) + return; + + /* nbSel == 1 */ + Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject(); + if(!myGeomBase->GetTopoFromSelection(mySelection, this->myShape)) + return; + + Standard_Boolean testResult; + myGeomShape = myGeomBase->ConvertIOinGEOMShape(IO, testResult); + if(!testResult) + return; + + myEditCurrentArgument->setText(aString); + + if(this->CalculateAndDisplayCenterMass()) + myOkCenterMass = true; + return; +} + + +//================================================================================= +// function : SetEditCurrentArgument() +// purpose : +//================================================================================= +void MeasureGUI_CenterMassDlg::SetEditCurrentArgument() +{ + QPushButton* send = (QPushButton*)sender(); + + if(send == GroupC1->PushButton1) { + GroupC1->LineEdit1->setFocus(); + myEditCurrentArgument = GroupC1->LineEdit1; + } + + this->SelectionIntoArgument(); + return; +} + + +//================================================================================= +// function : LineEditReturnPressed() +// purpose : +//================================================================================= +void MeasureGUI_CenterMassDlg::LineEditReturnPressed() +{ + QLineEdit* send = (QLineEdit*)sender(); + if(send == GroupC1->LineEdit1) + myEditCurrentArgument = GroupC1->LineEdit1; + else + return; + + GEOMBase_Skeleton::LineEditReturnPressed(); + return; +} + + +//================================================================================= +// function : ActivateThisDialog() +// purpose : +//================================================================================= +void MeasureGUI_CenterMassDlg::ActivateThisDialog() +{ + GEOMBase_Skeleton::ActivateThisDialog(); + connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + if(!mySimulationTopoDs.IsNull()) + myGeomBase->DisplaySimulationShape(mySimulationTopoDs); + return; +} + + +//================================================================================= +// function : enterEvent() +// purpose : +//================================================================================= +void MeasureGUI_CenterMassDlg::enterEvent(QEvent* e) +{ + if(GroupConstructors->isEnabled()) + return; + this->ActivateThisDialog(); + return; +} + + +//================================================================================= +// function : CalculateAndDisplayCenterMass() +// purpose : +//================================================================================= +bool MeasureGUI_CenterMassDlg::CalculateAndDisplayCenterMass() +{ + myGeomBase->EraseSimulationShape(); + mySimulationTopoDs.Nullify(); + + try { + QString resString; + GProp_GProps System; + + if(myShape.ShapeType() == TopAbs_VERTEX) + myGeomBase->VertexToPoint(myShape, myCenterMass); + else if(myShape.ShapeType() == TopAbs_EDGE || myShape.ShapeType() == TopAbs_WIRE) { + BRepGProp::LinearProperties(myShape, System); + myCenterMass = System.CentreOfMass(); + } + else if(myShape.ShapeType() == TopAbs_FACE || myShape.ShapeType() == TopAbs_SHELL) { + BRepGProp::SurfaceProperties(myShape, System); + myCenterMass = System.CentreOfMass(); + } + else { + BRepGProp::VolumeProperties(myShape, System); + myCenterMass = System.CentreOfMass(); + } + + BRepBuilderAPI_MakeVertex V(myCenterMass); + mySimulationTopoDs = V.Shape(); + + resString = tr("%1").arg(myCenterMass.X(), 12, 'f', 6); + GroupC1->LineEdit2->setText(resString); + + resString = tr("%1").arg(myCenterMass.Y(), 12, 'f', 6); + GroupC1->LineEdit3->setText(resString); + + resString = tr("%1").arg(myCenterMass.Z(), 12, 'f', 6); + GroupC1->LineEdit4->setText(resString); + + + if(!mySimulationTopoDs.IsNull()) { + myGeomBase->DisplaySimulationShape(mySimulationTopoDs); + return true; + } + } + catch(Standard_Failure) { + MESSAGE("Catch intercepted in CalculateAndDisplayCenterMass()"); + } + return false; +} + + diff --git a/src/MeasureGUI/MeasureGUI_CenterMassDlg.h b/src/MeasureGUI/MeasureGUI_CenterMassDlg.h new file mode 100644 index 000000000..e67a67ccf --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_CenterMassDlg.h @@ -0,0 +1,74 @@ +// 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 : MeasureGUI_CenterMassDlg.h +// Author : Lucien PIGNOLONI +// Module : GEOM + +#ifndef DIALOGBOX_CMASS_H +#define DIALOGBOX_CMASS_H + +#include "GEOMBase_Skeleton.h" +#include "MeasureGUI_1Sel3LineEdit_QTD.h" + +#include "MeasureGUI.h" + +#include + +//================================================================================= +// class : MeasureGUI_CenterMassDlg +// purpose : +//================================================================================= +class MeasureGUI_CenterMassDlg : public GEOMBase_Skeleton +{ + Q_OBJECT + +public: + MeasureGUI_CenterMassDlg(QWidget* parent = 0, const char* name = 0, MeasureGUI* theMeasureGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0); + ~MeasureGUI_CenterMassDlg(); + +private: + void Init(); + void enterEvent(QEvent* e); + bool CalculateAndDisplayCenterMass(); + + MeasureGUI* myMeasureGUI; + + GEOM::GEOM_Shape_var myGeomShape; /* is myBase */ + TopoDS_Shape myShape; /* Shape argument */ + gp_Pnt myCenterMass; + bool myOkCenterMass; /* true after center of mass simulation calculation */ + + MeasureGUI_1Sel3LineEdit_QTD* GroupC1; + +private slots: + void ClickOnOk(); + void ClickOnApply(); + void SetEditCurrentArgument(); + void SelectionIntoArgument(); + void LineEditReturnPressed(); + void ActivateThisDialog(); + +}; + +#endif // DIALOGBOX_CMASS_H diff --git a/src/MeasureGUI/MeasureGUI_CheckShapeDlg.cxx b/src/MeasureGUI/MeasureGUI_CheckShapeDlg.cxx new file mode 100644 index 000000000..fa6d776ca --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_CheckShapeDlg.cxx @@ -0,0 +1,211 @@ +// 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 : MeasureGUI_CheckShapeDlg.cxx +// Author : Nicolas REJNERI +// Module : GEOM +// $Header$ + +using namespace std; +#include "MeasureGUI_CheckShapeDlg.h" + +#include + +#include + +//================================================================================= +// class : MeasureGUI_CheckShapeDlg() +// purpose : Constructs a MeasureGUI_CheckShapeDlg 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. +//================================================================================= +MeasureGUI_CheckShapeDlg::MeasureGUI_CheckShapeDlg(QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl) + :MeasureGUI_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +{ + QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_CHECKSHAPE"))); + QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT"))); + + setCaption(tr("GEOM_CHECK_TITLE")); + + /***************************************************************/ + GroupConstructors->setTitle(tr("GEOM_CHECK_SHAPE")); + RadioButton1->setPixmap(image0); + + GroupC1 = new MeasureGUI_1Sel1TextView_QTD(this, "GroupC1"); + GroupC1->GroupBox1->setTitle(tr("GEOM_CHECK_INFOS")); + GroupC1->TextLabel1->setText(tr("GEOM_OBJECT")); + GroupC1->TextEdit1->setReadOnly(TRUE); + GroupC1->PushButton1->setPixmap(image1); + + Layout1->addWidget(GroupC1, 1, 0); + /***************************************************************/ + + /* Initialisation */ + Init(); +} + + +//================================================================================= +// function : ~MeasureGUI_CheckShapeDlg() +// purpose : Destroys the object and frees any allocated resources +//================================================================================= +MeasureGUI_CheckShapeDlg::~MeasureGUI_CheckShapeDlg() +{ + // no need to delete child widgets, Qt does it all for us +} + + +//================================================================================= +// function : Init() +// purpose : +//================================================================================= +void MeasureGUI_CheckShapeDlg::Init() +{ + /* init variables */ + myEditCurrentArgument = GroupC1->LineEdit1; + + /* signals and slots connections */ + connect(GroupC1->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); + connect(GroupC1->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); + + connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + + /* displays Dialog */ + GroupC1->show(); + this->show(); + + return; +} + + +//================================================================================= +// function : SelectionIntoArgument() +// purpose : Called when selection as changed or other case +//================================================================================= +void MeasureGUI_CheckShapeDlg::SelectionIntoArgument() +{ + myEditCurrentArgument->setText(""); + SelectedName = ""; /* future the name of selection */ + GroupC1->TextEdit1->setText(""); + + int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, SelectedName); + if(nbSel != 1) + return; + + /* nbSel == 1 */ + TopoDS_Shape S; + if(!myGeomBase->GetTopoFromSelection(mySelection, S)) + return; + + if(S.IsNull()) + return; + + myEditCurrentArgument->setText(SelectedName); + this->Check(S); + + return; +} + + +//================================================================================= +// function : SetEditCurrentArgument() +// purpose : +//================================================================================= +void MeasureGUI_CheckShapeDlg::SetEditCurrentArgument() +{ + QPushButton* send = (QPushButton*)sender(); + + if(send == GroupC1->PushButton1) { + GroupC1->LineEdit1->setFocus(); + myEditCurrentArgument = GroupC1->LineEdit1; + } + + this->SelectionIntoArgument(); + return; +} + + +//================================================================================= +// function : LineEditReturnPressed() +// purpose : +//================================================================================= +void MeasureGUI_CheckShapeDlg::LineEditReturnPressed() +{ + QLineEdit* send = (QLineEdit*)sender(); + if(send == GroupC1->LineEdit1) + myEditCurrentArgument = GroupC1->LineEdit1; + else + return; + + MeasureGUI_Skeleton::LineEditReturnPressed(); + return; +} + + +//================================================================================= +// function : ActivateThisDialog() +// purpose : +//================================================================================= +void MeasureGUI_CheckShapeDlg::ActivateThisDialog() +{ + MeasureGUI_Skeleton::ActivateThisDialog(); + connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + return; +} + + +//================================================================================= +// function : enterEvent() +// purpose : +//================================================================================= +void MeasureGUI_CheckShapeDlg::enterEvent(QEvent* e) +{ + if(GroupConstructors->isEnabled()) + return; + this->ActivateThisDialog(); + return; +} + + +//================================================================================= +// function : Check() +// purpose : +//================================================================================= +void MeasureGUI_CheckShapeDlg::Check(const TopoDS_Shape S) +{ + if(S.IsNull()) + return; + + try { + BRepCheck_Analyzer ana(S,false); + if(ana.IsValid()) + GroupC1->TextEdit1->setText("This Shape seems to be valid."); + else + GroupC1->TextEdit1->setText("This Shape is not valid."); + } + catch(Standard_Failure) { + MESSAGE("Catch intercepted in Check()"); + } + return; +} diff --git a/src/MeasureGUI/MeasureGUI_CheckShapeDlg.h b/src/MeasureGUI/MeasureGUI_CheckShapeDlg.h new file mode 100644 index 000000000..1c80efd27 --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_CheckShapeDlg.h @@ -0,0 +1,65 @@ +// 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 : MeasureGUI_CheckShapeDlg.h +// Author : Nicolas REJNERI +// Module : GEOM +// $Header$ + +#ifndef DIALOGBOX_CHECKSHAPEDLG_H +#define DIALOGBOX_CHECKSHAPEDLG_H + +#include "MeasureGUI_Skeleton.h" +#include "MeasureGUI_1Sel1TextView_QTD.h" + +#include "MeasureGUI.h" + +//================================================================================= +// class : MeasureGUI_CheckShapeDlg +// purpose : +//================================================================================= +class MeasureGUI_CheckShapeDlg : public MeasureGUI_Skeleton +{ + Q_OBJECT + +public: + MeasureGUI_CheckShapeDlg(QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0); + ~MeasureGUI_CheckShapeDlg(); + +private: + void Init(); + void enterEvent(QEvent* e); + void Check(const TopoDS_Shape S); + + QString SelectedName; + MeasureGUI_1Sel1TextView_QTD* GroupC1; + +private slots: + void SetEditCurrentArgument(); + void SelectionIntoArgument(); + void LineEditReturnPressed(); + void ActivateThisDialog(); + +}; + +#endif // DIALOGBOX_CHECKSHAPEDLG_H diff --git a/src/MeasureGUI/MeasureGUI_DistanceDlg.cxx b/src/MeasureGUI/MeasureGUI_DistanceDlg.cxx new file mode 100644 index 000000000..d527eee7f --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_DistanceDlg.cxx @@ -0,0 +1,368 @@ +// 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 : MeasureGUI_DistanceDlg.cxx +// Author : Nicolas REJNERI +// Module : GEOM +// $Header$ + +using namespace std; +#include "MeasureGUI_DistanceDlg.h" + +#include "QAD_RightFrame.h" +#include "OCCViewer_Viewer3d.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//================================================================================= +// class : MeasureGUI_DistanceDlg() +// purpose : Constructs a MeasureGUI_DistanceDlg 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. +//================================================================================= +MeasureGUI_DistanceDlg::MeasureGUI_DistanceDlg(QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl) + :MeasureGUI_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +{ + QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_MINDIST"))); + QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT"))); + + setCaption(tr("GEOM_MINDIST_TITLE")); + + /***************************************************************/ + GroupConstructors->setTitle(tr("GEOM_DISTANCE")); + RadioButton1->setPixmap(image0); + + GroupC1 = new MeasureGUI_2Sel1LineEdit_QTD(this, "GroupC1"); + GroupC1->GroupBox1->setTitle(tr("GEOM_MINDIST_OBJ")); + GroupC1->TextLabel1->setText(tr("GEOM_OBJECT_I").arg("1")); + GroupC1->TextLabel2->setText(tr("GEOM_OBJECT_I").arg("2")); + GroupC1->TextLabel3->setText(tr("GEOM_LENGTH")); + GroupC1->LineEdit3->setReadOnly(TRUE); + GroupC1->PushButton1->setPixmap(image1); + GroupC1->PushButton2->setPixmap(image1); + + Layout1->addWidget(GroupC1, 1, 0); + /***************************************************************/ + + /* Initialisation */ + Init(); +} + + +//================================================================================= +// function : ~MeasureGUI_DistanceDlg() +// purpose : Destroys the object and frees any allocated resources +//================================================================================= +MeasureGUI_DistanceDlg::~MeasureGUI_DistanceDlg() +{ + /* no need to delete child widgets, Qt does it all for us */ +} + + +//================================================================================= +// function : Init() +// purpose : +//================================================================================= +void MeasureGUI_DistanceDlg::Init() +{ + /* init variables */ + myEditCurrentArgument = GroupC1->LineEdit1; + + myOkShape1 = myOkShape2 = false; + + /* signals and slots connections */ + connect(buttonClose, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); + connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); + connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); + + connect(GroupC1->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); + connect(GroupC1->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); + + connect(GroupC1->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); + connect(GroupC1->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); + + connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + + /* displays Dialog */ + GroupC1->show(); + this->show(); + + return; +} + + +//================================================================================= +// function : ClickOnCancel() +// purpose : +//================================================================================= +void MeasureGUI_DistanceDlg::ClickOnCancel() +{ + this->EraseDistance(); + MeasureGUI_Skeleton::ClickOnCancel(); + return; +} + + +//================================================================================= +// function : SelectionIntoArgument() +// purpose : Called when selection has changed +//================================================================================= +void MeasureGUI_DistanceDlg::SelectionIntoArgument() +{ + myGeomBase->EraseSimulationShape(); + mySimulationTopoDs.Nullify(); + this->EraseDistance(); + myEditCurrentArgument->setText(""); + QString aString = ""; + + GroupC1->LineEdit3->setText(""); + + int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString); + if(nbSel != 1) { + if(myEditCurrentArgument == GroupC1->LineEdit1) + myOkShape1 = false; + else if(myEditCurrentArgument == GroupC1->LineEdit2) + myOkShape2 = false; + return; + } + + /* nbSel == 1 */ + TopoDS_Shape S; + if(!myGeomBase->GetTopoFromSelection(mySelection, S)) + return; + + Standard_Boolean testResult; + Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject(); + + if(myEditCurrentArgument == GroupC1->LineEdit1) { + myGeomShape1 = myGeomBase->ConvertIOinGEOMShape(IO, testResult); + if(!testResult) + return; + myShape1 = S; + myEditCurrentArgument->setText(aString); + myOkShape1 = true; + } + else if(myEditCurrentArgument == GroupC1->LineEdit2) { + myGeomShape2 = myGeomBase->ConvertIOinGEOMShape(IO, testResult); + if(!testResult) + return; + myShape2 = S; + myEditCurrentArgument->setText(aString); + myOkShape2 = true; + } + + if(myOkShape1 && myOkShape2) + this->MakeDistanceSimulationAndDisplay(myShape1 ,myShape2); + return; +} + + +//================================================================================= +// function : SetEditCurrentArgument() +// purpose : +//================================================================================= +void MeasureGUI_DistanceDlg::SetEditCurrentArgument() +{ + QPushButton* send = (QPushButton*)sender(); + + if(send == GroupC1->PushButton1) { + GroupC1->LineEdit1->setFocus(); + myEditCurrentArgument = GroupC1->LineEdit1; + } + else if(send == GroupC1->PushButton2) { + GroupC1->LineEdit2->setFocus(); + myEditCurrentArgument = GroupC1->LineEdit2; + } + + this->SelectionIntoArgument(); + return; +} + + +//================================================================================= +// function : LineEditReturnPressed() +// purpose : +//================================================================================= +void MeasureGUI_DistanceDlg::LineEditReturnPressed() +{ + QLineEdit* send = (QLineEdit*)sender(); + if(send == GroupC1->LineEdit1) + myEditCurrentArgument = GroupC1->LineEdit1; + else if(send == GroupC1->LineEdit2) + myEditCurrentArgument = GroupC1->LineEdit2; + else + return; + + MeasureGUI_Skeleton::LineEditReturnPressed(); + return; +} + + +//================================================================================= +// function : ActivateThisDialog() +// purpose : +//================================================================================= +void MeasureGUI_DistanceDlg::ActivateThisDialog() +{ + MeasureGUI_Skeleton::ActivateThisDialog(); + connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + if(!mySimulationTopoDs.IsNull()) + myGeomBase->DisplaySimulationShape(mySimulationTopoDs); + return; +} + + +//================================================================================= +// function : enterEvent() +// purpose : when mouse enter onto the QWidget +//================================================================================= +void MeasureGUI_DistanceDlg::enterEvent(QEvent* e) +{ + if(GroupConstructors->isEnabled()) + return; + this->ActivateThisDialog(); + return; +} + + +//================================================================================= +// function : closeEvent() +// purpose : +//================================================================================= +void MeasureGUI_DistanceDlg::closeEvent(QCloseEvent* e) +{ + /* same than click on cancel button */ + this->ClickOnCancel(); + return; +} + + +//================================================================================= +// function : MakeDistanceSimulationAndDisplay() +// purpose : +//================================================================================= +void MeasureGUI_DistanceDlg::MakeDistanceSimulationAndDisplay(const TopoDS_Shape& S1, const TopoDS_Shape& S2) +{ + myGeomBase->EraseSimulationShape(); + mySimulationTopoDs.Nullify(); + GroupC1->LineEdit3->setText(""); + + BRepExtrema_DistShapeShape dst(S1, S2); + + try { + if(dst.IsDone()) { + gp_Pnt P1, P2; + Standard_Real Dist = 1.e9; + for(int i = 1; i <= dst.NbSolution(); i++) { + P1 = (dst.PointOnShape1(i)); + P2 = (dst.PointOnShape2(i)); + + Standard_Real MinDist = P1.Distance(P2); + if(Dist > MinDist) + Dist = MinDist; + } + + if(Dist <= 1.e-9) { + BRepBuilderAPI_MakeVertex MakeVertex(P1); + mySimulationTopoDs = MakeVertex.Vertex(); + myGeomBase->DisplaySimulationShape(mySimulationTopoDs); + + GroupC1->LineEdit3->setText("0.0"); + } + else { + BRepBuilderAPI_MakeEdge MakeEdge(P1, P2); + mySimulationTopoDs = MakeEdge.Edge(); + + TopoDS_Vertex V1 = BRepBuilderAPI_MakeVertex(P1); + TopoDS_Vertex V2 = BRepBuilderAPI_MakeVertex(P2); + + QString S; + S.sprintf("%.1f", Dist); + + gp_Pnt P3; + P3.SetX((P1.X() + P2.X()) / 2); + P3.SetY((P1.Y() + P2.Y()) / 2); + P3.SetZ(((P1.Z() + P2.Z()) / 2) + 100); + gp_Vec va(P3, P1); + gp_Vec vb(P3, P2); + if(va.IsParallel(vb, Precision::Angular())) { + P3.SetY(((P1.Y() + P2.Y()) / 2) + 100); + P3.SetZ(((P1.Z() + P2.Z()) / 2)); + } + gce_MakePln gce_MP(P1, P2, P3); + gp_Pln gp_P = gce_MP.Value(); + Handle(Geom_Plane) P = new Geom_Plane(gp_P); + + Handle(AIS_LengthDimension) Distance = new AIS_LengthDimension(V1, V2, P, Dist, TCollection_ExtendedString(strdup(S))); + + GroupC1->LineEdit3->setText(S); + + if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) { + OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer(); + Handle (AIS_InteractiveContext) ic = v3d->getAISContext(); + ic->Display(Distance); + ic->UpdateCurrentViewer(); + } + } + } + } + catch(Standard_Failure) { + MESSAGE("Catch intercepted in MakeDistanceSimulationAndDisplay()"); + } + return; +} + + +//================================================================================= +// function : EraseDistance() +// purpose : +//================================================================================= +void MeasureGUI_DistanceDlg::EraseDistance() +{ + 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(); + + AIS_ListOfInteractive L; + ic->DisplayedObjects(AIS_KOI_Relation, -1, L); + AIS_ListIteratorOfListOfInteractive ite(L); + while (ite.More()) { + ic->Remove(ite.Value()); + ic->UpdateCurrentViewer(); + ite.Next(); + } + } + } + return; +} diff --git a/src/MeasureGUI/MeasureGUI_DistanceDlg.h b/src/MeasureGUI/MeasureGUI_DistanceDlg.h new file mode 100644 index 000000000..50718dd40 --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_DistanceDlg.h @@ -0,0 +1,74 @@ +// 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 : MeasureGUI_DistanceDlg.h +// Author : Nicolas REJNERI +// Module : GEOM +// $Header$ + +#ifndef DIALOGBOX_DISTANCE_H +#define DIALOGBOX_DISTANCE_H + +#include "MeasureGUI_Skeleton.h" +#include "MeasureGUI_2Sel1LineEdit_QTD.h" + +#include "MeasureGUI.h" + +//================================================================================= +// class : MeasureGUI_DistanceDlg +// purpose : +//================================================================================= +class MeasureGUI_DistanceDlg : public MeasureGUI_Skeleton +{ + Q_OBJECT + +public: + MeasureGUI_DistanceDlg(QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0); + ~MeasureGUI_DistanceDlg(); + +private: + void Init(); + void enterEvent(QEvent* e); + void closeEvent(QCloseEvent* e); + void MakeDistanceSimulationAndDisplay(const TopoDS_Shape& S1, const TopoDS_Shape& S2); + void EraseDistance(); + + TopoDS_Shape myShape1; + TopoDS_Shape myShape2; + GEOM::GEOM_Shape_var myGeomShape1; + GEOM::GEOM_Shape_var myGeomShape2; + bool myOkShape1; + bool myOkShape2; /* to check when arguments are defined */ + + MeasureGUI_2Sel1LineEdit_QTD* GroupC1; + +private slots: + void ClickOnCancel(); + void SetEditCurrentArgument(); + void SelectionIntoArgument(); + void LineEditReturnPressed(); + void ActivateThisDialog(); + +}; + +#endif // DIALOGBOX_DISTANCE_H diff --git a/src/MeasureGUI/MeasureGUI_InertiaDlg.cxx b/src/MeasureGUI/MeasureGUI_InertiaDlg.cxx new file mode 100644 index 000000000..e8c796ad8 --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_InertiaDlg.cxx @@ -0,0 +1,286 @@ +// 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 : MeasureGUI_InertiaDlg.cxx +// Author : Lucien PIGNOLONI +// Module : GEOM + +using namespace std; +#include "MeasureGUI_InertiaDlg.h" + +#include +#include +#include + +//================================================================================= +// class : MeasureGUI_InertiaDlg() +// purpose : Constructs a MeasureGUI_InertiaDlg 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. +//================================================================================= +MeasureGUI_InertiaDlg::MeasureGUI_InertiaDlg(QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl) + :MeasureGUI_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +{ + QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_INERTIA"))); + QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT"))); + + setCaption(tr("GEOM_INERTIA_TITLE")); + + /***************************************************************/ + GroupConstructors->setTitle(tr("GEOM_INERTIA_CONSTR")); + RadioButton1->setPixmap(image0); + + GroupC1 = new MeasureGUI_1Sel12LineEdit_QTD(this, "GroupC1"); + GroupC1->GroupBox1->setTitle(tr("GEOM_MATRIX")); + GroupC1->TextLabel1->setText(tr("GEOM_OBJECT")); + GroupC1->TextLabel2->setText(tr("GEOM_INERTIA_I").arg("1")); + GroupC1->TextLabel3->setText(tr("GEOM_INERTIA_I").arg("2")); + GroupC1->TextLabel4->setText(tr("GEOM_INERTIA_I").arg("3")); + GroupC1->TextLabel5->setText(tr("GEOM_INERTIA_IXYZ")); + GroupC1->LineEdit11->setReadOnly(TRUE); + GroupC1->LineEdit12->setReadOnly(TRUE); + GroupC1->LineEdit13->setReadOnly(TRUE); + GroupC1->LineEdit21->setReadOnly(TRUE); + GroupC1->LineEdit22->setReadOnly(TRUE); + GroupC1->LineEdit23->setReadOnly(TRUE); + GroupC1->LineEdit31->setReadOnly(TRUE); + GroupC1->LineEdit32->setReadOnly(TRUE); + GroupC1->LineEdit33->setReadOnly(TRUE); + GroupC1->LineEdit41->setReadOnly(TRUE); + GroupC1->LineEdit42->setReadOnly(TRUE); + GroupC1->LineEdit43->setReadOnly(TRUE); + GroupC1->PushButton1->setPixmap(image1); + + Layout1->addWidget(GroupC1, 1, 0); + /***************************************************************/ + + /* Initialisation */ + Init(); +} + + +//================================================================================= +// function : ~MeasureGUI_InertiaDlg() +// purpose : Destroys the object and frees any allocated resources +//================================================================================= +MeasureGUI_InertiaDlg::~MeasureGUI_InertiaDlg() +{ + // no need to delete child widgets, Qt does it all for us +} + + +//================================================================================= +// function : Init() +// purpose : +//================================================================================= +void MeasureGUI_InertiaDlg::Init() +{ + /* init variables */ + myEditCurrentArgument = GroupC1->LineEdit1; + + /* signals and slots connections */ + connect(GroupC1->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); + connect(GroupC1->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); + + connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + + /* displays Dialog */ + GroupC1->show(); + this->show(); + + return; +} + + +//================================================================================= +// function : SelectionIntoArgument() +// purpose : Called when selection as changed or other case +//================================================================================= +void MeasureGUI_InertiaDlg::SelectionIntoArgument() +{ + myEditCurrentArgument->setText(""); + QString aString = ""; + + GroupC1->LineEdit11->setText(""); + GroupC1->LineEdit12->setText(""); + GroupC1->LineEdit13->setText(""); + GroupC1->LineEdit21->setText(""); + GroupC1->LineEdit22->setText(""); + GroupC1->LineEdit23->setText(""); + GroupC1->LineEdit31->setText(""); + GroupC1->LineEdit32->setText(""); + GroupC1->LineEdit33->setText(""); + GroupC1->LineEdit41->setText(""); + GroupC1->LineEdit42->setText(""); + GroupC1->LineEdit43->setText(""); + + int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString); + if(nbSel != 1) + return; + + /* nbSel == 1 */ + TopoDS_Shape S; + if(!myGeomBase->GetTopoFromSelection(mySelection, S) || S.IsNull()) + return; + + GroupC1->LineEdit1->setText(aString); + + this->CalculateAndDisplayInertia(S); + return; +} + + +//================================================================================= +// function : SetEditCurrentArgument() +// purpose : +//================================================================================= +void MeasureGUI_InertiaDlg::SetEditCurrentArgument() +{ + QPushButton* send = (QPushButton*)sender(); + + if(send == GroupC1->PushButton1) { + GroupC1->LineEdit1->setFocus(); + myEditCurrentArgument = GroupC1->LineEdit1; + } + + this->SelectionIntoArgument(); + return; +} + + +//================================================================================= +// function : LineEditReturnPressed() +// purpose : +//================================================================================= +void MeasureGUI_InertiaDlg::LineEditReturnPressed() +{ + QLineEdit* send = (QLineEdit*)sender(); + if(send == GroupC1->LineEdit1) + myEditCurrentArgument = GroupC1->LineEdit1; + else + return; + + MeasureGUI_Skeleton::LineEditReturnPressed(); + return; +} + + +//================================================================================= +// function : ActivateThisDialog() +// purpose : +//================================================================================= +void MeasureGUI_InertiaDlg::ActivateThisDialog() +{ + MeasureGUI_Skeleton::ActivateThisDialog(); + connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + return; +} + + +//================================================================================= +// function : enterEvent() +// purpose : +//================================================================================= +void MeasureGUI_InertiaDlg::enterEvent(QEvent* e) +{ + if(GroupConstructors->isEnabled()) + return; + this->ActivateThisDialog(); + return; +} + + +//================================================================================= +// function : CalculateAndDisplayInertia() +// purpose : +//================================================================================= +void MeasureGUI_InertiaDlg::CalculateAndDisplayInertia(const TopoDS_Shape& S) +{ + GroupC1->LineEdit11->setText(""); + GroupC1->LineEdit12->setText(""); + GroupC1->LineEdit13->setText(""); + GroupC1->LineEdit21->setText(""); + GroupC1->LineEdit22->setText(""); + GroupC1->LineEdit23->setText(""); + GroupC1->LineEdit31->setText(""); + GroupC1->LineEdit32->setText(""); + GroupC1->LineEdit33->setText(""); + GroupC1->LineEdit41->setText(""); + GroupC1->LineEdit42->setText(""); + GroupC1->LineEdit43->setText(""); + + if(S.IsNull()) + return; + + QString resString; + GProp_GProps System; + + try { + if(S.ShapeType() == TopAbs_VERTEX || S.ShapeType() == TopAbs_EDGE || S.ShapeType() == TopAbs_WIRE) + BRepGProp::LinearProperties(S, System); + else if(S.ShapeType() == TopAbs_FACE || S.ShapeType() == TopAbs_SHELL) + BRepGProp::SurfaceProperties(S, System); + else + BRepGProp::VolumeProperties(S, System); + + gp_Mat I = System.MatrixOfInertia() ; + GProp_PrincipalProps Pr = System.PrincipalProperties(); + Standard_Real Ix,Iy,Iz; + Pr.Moments(Ix,Iy,Iz); + + /* matrix 3x3 */ + resString = tr("%1").arg(I(1,1), 12, 'f', 6); + GroupC1->LineEdit11->setText(resString); + resString = tr("%1").arg(I(1,2), 12, 'f', 6); + GroupC1->LineEdit12->setText(resString); + resString = tr("%1").arg(I(1,3), 12, 'f', 6); + GroupC1->LineEdit13->setText(resString); + + resString = tr("%1").arg(I(2,1), 12, 'f', 6); + GroupC1->LineEdit21->setText(resString); + resString = tr("%1").arg(I(2,2), 12, 'f', 6); + GroupC1->LineEdit22->setText(resString); + resString = tr("%1").arg(I(2,3), 12, 'f', 6); + GroupC1->LineEdit23->setText(resString); + + resString = tr("%1").arg(I(3,1), 12, 'f', 6); + GroupC1->LineEdit31->setText(resString); + resString = tr("%1").arg(I(3,2), 12, 'f', 6); + GroupC1->LineEdit32->setText(resString); + resString = tr("%1").arg(I(3,3), 12, 'f', 6); + GroupC1->LineEdit33->setText(resString); + + /* moments */ + resString = tr("%1").arg(Ix, 12, 'f', 6); + GroupC1->LineEdit41->setText(resString); + resString = tr("%1").arg(Ix, 12, 'f', 6); + GroupC1->LineEdit42->setText(resString); + resString = tr("%1").arg(Iz, 12, 'f', 6); + GroupC1->LineEdit43->setText(resString); + } + catch(Standard_Failure) { + MESSAGE("Catch intercepted in CalculateAndDisplayInertia()"); + } + return; +} diff --git a/src/MeasureGUI/MeasureGUI_InertiaDlg.h b/src/MeasureGUI/MeasureGUI_InertiaDlg.h new file mode 100644 index 000000000..4e6bc2f02 --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_InertiaDlg.h @@ -0,0 +1,64 @@ +// 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 : MeasureGUI_InertiaDlg.h +// Author : Lucien PIGNOLONI +// Module : GEOM +// $Header$ + +#ifndef DIALOGBOX_INERTIA_H +#define DIALOGBOX_INERTIA_H + +#include "MeasureGUI_Skeleton.h" +#include "MeasureGUI_1Sel12LineEdit_QTD.h" + +#include "MeasureGUI.h" + +//================================================================================= +// class : MeasureGUI_InertiaDlg +// purpose : +//================================================================================= +class MeasureGUI_InertiaDlg : public MeasureGUI_Skeleton +{ + Q_OBJECT + +public: + MeasureGUI_InertiaDlg(QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0); + ~MeasureGUI_InertiaDlg(); + +private: + void Init(); + void enterEvent(QEvent* e); + void CalculateAndDisplayInertia(const TopoDS_Shape& S); + + MeasureGUI_1Sel12LineEdit_QTD* GroupC1; + +private slots: + void SetEditCurrentArgument(); + void SelectionIntoArgument(); + void LineEditReturnPressed(); + void ActivateThisDialog(); + +}; + +#endif // DIALOGBOX_INERTIA_H diff --git a/src/MeasureGUI/MeasureGUI_MaxToleranceDlg.cxx b/src/MeasureGUI/MeasureGUI_MaxToleranceDlg.cxx new file mode 100644 index 000000000..93f2da25f --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_MaxToleranceDlg.cxx @@ -0,0 +1,284 @@ +// 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 : MeasureGUI_MaxToleranceDlg.cxx +// Author : Nicolas REJNERI +// Module : GEOM +// $Header$ + +using namespace std; +#include "MeasureGUI_MaxToleranceDlg.h" + +#include +#include +#include +#include +#include + +//================================================================================= +// class : MeasureGUI_MaxToleranceDlg() +// purpose : Constructs a MeasureGUI_MaxToleranceDlg 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. +//================================================================================= +MeasureGUI_MaxToleranceDlg::MeasureGUI_MaxToleranceDlg(QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl) + :MeasureGUI_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +{ + QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_TOLERANCE"))); + QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT"))); + + setCaption(tr("GEOM_TOLERANCE_TITLE")); + + /***************************************************************/ + GroupConstructors->setTitle(tr("GEOM_TOLERANCE")); + RadioButton1->setPixmap(image0); + + GroupC1 = new MeasureGUI_1Sel6LineEdit_QTD(this, "GroupC1"); + GroupC1->GroupBox1->setTitle(tr("GEOM_TOLERANCE_CONSTR")); + GroupC1->TextLabel1->setText(tr("GEOM_OBJECT")); + GroupC1->TextLabel2->setText(tr("GEOM_MIN")); + GroupC1->TextLabel3->setText(tr("GEOM_MAX")); + GroupC1->TextLabel4->setText(tr("GEOM_TOLERANCE_FACE")); + GroupC1->TextLabel5->setText(tr("GEOM_TOLERANCE_EDGE")); + GroupC1->TextLabel6->setText(tr("GEOM_TOLERANCE_VERTEX")); + GroupC1->LineEdit11->setReadOnly(TRUE); + GroupC1->LineEdit12->setReadOnly(TRUE); + GroupC1->LineEdit21->setReadOnly(TRUE); + GroupC1->LineEdit22->setReadOnly(TRUE); + GroupC1->LineEdit31->setReadOnly(TRUE); + GroupC1->LineEdit32->setReadOnly(TRUE); + GroupC1->PushButton1->setPixmap(image1); + + Layout1->addWidget(GroupC1, 1, 0); + /***************************************************************/ + + /* Initialisation */ + Init(); +} + + +//================================================================================= +// function : ~MeasureGUI_MaxToleranceDlg() +// purpose : Destroys the object and frees any allocated resources +//================================================================================= +MeasureGUI_MaxToleranceDlg::~MeasureGUI_MaxToleranceDlg() +{ + // no need to delete child widgets, Qt does it all for us +} + + +//================================================================================= +// function : Init() +// purpose : +//================================================================================= +void MeasureGUI_MaxToleranceDlg::Init() +{ + /* init variables */ + myEditCurrentArgument = GroupC1->LineEdit1; + + /* signals and slots connections */ + connect(GroupC1->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); + connect(GroupC1->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); + + connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + + /* displays Dialog */ + GroupC1->show(); + this->show(); + + return; +} + + +//================================================================================= +// function : SelectionIntoArgument() +// purpose : Called when selection as changed or other case +//================================================================================= +void MeasureGUI_MaxToleranceDlg::SelectionIntoArgument() +{ + myEditCurrentArgument->setText(""); + QString aString = ""; + + GroupC1->LineEdit11->setText(""); + GroupC1->LineEdit12->setText(""); + GroupC1->LineEdit21->setText(""); + GroupC1->LineEdit22->setText(""); + GroupC1->LineEdit31->setText(""); + GroupC1->LineEdit32->setText(""); + + int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString); + if(nbSel != 1) + return; + + /* nbSel == 1 */ + TopoDS_Shape S; + if(!myGeomBase->GetTopoFromSelection(mySelection, S) || S.IsNull()) + return; + + if(S.IsNull()) + return; + + GroupC1->LineEdit1->setText(aString); + + this->CalculateMaxTolerance(S); + return; +} + + +//================================================================================= +// function : SetEditCurrentArgument() +// purpose : +//================================================================================= +void MeasureGUI_MaxToleranceDlg::SetEditCurrentArgument() +{ + QPushButton* send = (QPushButton*)sender(); + + if(send == GroupC1->PushButton1) { + GroupC1->LineEdit1->setFocus(); + myEditCurrentArgument = GroupC1->LineEdit1; + } + + this->SelectionIntoArgument(); + return; +} + + +//================================================================================= +// function : LineEditReturnPressed() +// purpose : +//================================================================================= +void MeasureGUI_MaxToleranceDlg::LineEditReturnPressed() +{ + QLineEdit* send = (QLineEdit*)sender(); + if(send == GroupC1->LineEdit1) + myEditCurrentArgument = GroupC1->LineEdit1; + else + return; + + MeasureGUI_Skeleton::LineEditReturnPressed(); + return; +} + + +//================================================================================= +// function : ActivateThisDialog() +// purpose : +//================================================================================= +void MeasureGUI_MaxToleranceDlg::ActivateThisDialog() +{ + MeasureGUI_Skeleton::ActivateThisDialog(); + connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + return; +} + + +//================================================================================= +// function : enterEvent() +// purpose : +//================================================================================= +void MeasureGUI_MaxToleranceDlg::enterEvent(QEvent* e) +{ + if(GroupConstructors->isEnabled()) + return; + this->ActivateThisDialog(); + return; +} + + +//================================================================================= +// function : CalculateMaxTolerance() +// purpose : +//================================================================================= +void MeasureGUI_MaxToleranceDlg::CalculateMaxTolerance(const TopoDS_Shape& S) +{ + GroupC1->LineEdit11->setText(""); + GroupC1->LineEdit12->setText(""); + GroupC1->LineEdit21->setText(""); + GroupC1->LineEdit22->setText(""); + GroupC1->LineEdit31->setText(""); + GroupC1->LineEdit32->setText(""); + + if(S.IsNull()) + return; + + Standard_Real T, TMF, TME, TMV, TmF, TmE, TmV; + Standard_Integer nbF, nbE, nbV; + bool m_isFace, m_isEdge, m_isVertex; + + TMF = TME = TMV = -RealLast(); + TmF = TmE = TmV = RealLast(); + nbF = nbE = nbV = 0; + m_isFace = m_isEdge = m_isVertex = false; + + try { + for(TopExp_Explorer ExF(S,TopAbs_FACE); ExF.More(); ExF.Next()) { + m_isFace = true; + TopoDS_Face Face=TopoDS::Face(ExF.Current()); + T=BRep_Tool::Tolerance(Face); + if(T>TMF) + TMF=T; + if(TTME) + TME=T; + if(TTMV) + TMV=T; + if(TLineEdit11->setText(tr("%1").arg(TmF, 5, 'e', 8)); + GroupC1->LineEdit12->setText(tr("%1").arg(TMF, 5, 'e', 8)); + } + if(m_isEdge) { + GroupC1->LineEdit21->setText(tr("%1").arg(TmE, 5, 'e', 8)); + GroupC1->LineEdit22->setText(tr("%1").arg(TME, 5, 'e', 8)); + } + if(m_isVertex) { + GroupC1->LineEdit31->setText(tr("%1").arg(TmV, 5, 'e', 8)); + GroupC1->LineEdit32->setText(tr("%1").arg(TMV, 5, 'e', 8)); + } + } + catch(Standard_Failure) + { + MESSAGE("Catch intercepted in CalculateMaxTolerance()"); + } + return; +} diff --git a/src/MeasureGUI/MeasureGUI_MaxToleranceDlg.h b/src/MeasureGUI/MeasureGUI_MaxToleranceDlg.h new file mode 100644 index 000000000..5513582b7 --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_MaxToleranceDlg.h @@ -0,0 +1,64 @@ +// 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 : MeasureGUI_MaxToleranceDlg.h +// Author : Nicolas REJNERI +// Module : GEOM +// $Header$ + +#ifndef DIALOGBOX_MAXTOLERANCE_H +#define DIALOGBOX_MAXTOLERANCE_H + +#include "MeasureGUI_Skeleton.h" +#include "MeasureGUI_1Sel6LineEdit_QTD.h" + +#include "MeasureGUI.h" + +//================================================================================= +// class : DialogBox_PROPERTIES +// purpose : +//================================================================================= +class MeasureGUI_MaxToleranceDlg : public MeasureGUI_Skeleton +{ + Q_OBJECT + +public: + MeasureGUI_MaxToleranceDlg(QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0); + ~MeasureGUI_MaxToleranceDlg(); + +private: + void Init(); + void enterEvent(QEvent* e); + void CalculateMaxTolerance(const TopoDS_Shape& S); + + MeasureGUI_1Sel6LineEdit_QTD* GroupC1; + +private slots: + void SetEditCurrentArgument(); + void SelectionIntoArgument(); + void LineEditReturnPressed(); + void ActivateThisDialog(); + +}; + +#endif // DIALOGBOX_MAXTOLERANCE_H diff --git a/src/MeasureGUI/MeasureGUI_PropertiesDlg.cxx b/src/MeasureGUI/MeasureGUI_PropertiesDlg.cxx new file mode 100644 index 000000000..934551b84 --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_PropertiesDlg.cxx @@ -0,0 +1,258 @@ +// 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 : MeasureGUI_PropertiesDlg.cxx +// Author : Lucien PIGNOLONI +// Module : GEOM +// $Header$ + +using namespace std; +#include "MeasureGUI_PropertiesDlg.h" + +#include +#include +#include +#include + +//================================================================================= +// class : MeasureGUI_PropertiesDlg() +// purpose : Constructs a MeasureGUI_PropertiesDlg 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. +//================================================================================= +MeasureGUI_PropertiesDlg::MeasureGUI_PropertiesDlg(QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl) + :MeasureGUI_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +{ + QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_BASICPROPERTIES"))); + QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT"))); + + setCaption(tr("GEOM_PROPERTIES_TITLE")); + + /***************************************************************/ + GroupConstructors->setTitle(tr("GEOM_PROPERTIES")); + RadioButton1->setPixmap(image0); + + GroupC1 = new MeasureGUI_1Sel3LineEdit_QTD(this, "GroupC1"); + GroupC1->GroupBox1->setTitle(tr("GEOM_PROPERTIES_CONSTR")); + GroupC1->TextLabel1->setText(tr("GEOM_OBJECT")); + GroupC1->TextLabel2->setText(tr("GEOM_LENGTH")); + GroupC1->TextLabel3->setText(tr("GEOM_PROPERTIES_SURFACE")); + GroupC1->TextLabel4->setText(tr("GEOM_PROPERTIES_VOLUME")); + GroupC1->LineEdit2->setReadOnly(TRUE); + GroupC1->LineEdit3->setReadOnly(TRUE); + GroupC1->LineEdit4->setReadOnly(TRUE); + GroupC1->PushButton1->setPixmap(image1); + + Layout1->addWidget(GroupC1, 1, 0); + /***************************************************************/ + + /* Initialisation */ + Init(); +} + + +//================================================================================= +// function : ~MeasureGUI_PropertiesDlg() +// purpose : Destroys the object and frees any allocated resources +//================================================================================= +MeasureGUI_PropertiesDlg::~MeasureGUI_PropertiesDlg() +{ + // no need to delete child widgets, Qt does it all for us +} + + +//================================================================================= +// function : Init() +// purpose : +//================================================================================= +void MeasureGUI_PropertiesDlg::Init() +{ + /* init variables */ + myEditCurrentArgument = GroupC1->LineEdit1; + + /* signals and slots connections */ + connect(GroupC1->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); + connect(GroupC1->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); + + connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + + /* displays Dialog */ + GroupC1->show(); + this->show(); + + return; +} + + +//================================================================================= +// function : SelectionIntoArgument() +// purpose : Called when selection as changed or other case +//================================================================================= +void MeasureGUI_PropertiesDlg::SelectionIntoArgument() +{ + myGeomBase->EraseSimulationShape(); + mySimulationTopoDs.Nullify(); + myEditCurrentArgument->setText(""); + QString aString = ""; + + GroupC1->LineEdit2->setText(""); + GroupC1->LineEdit3->setText(""); + GroupC1->LineEdit4->setText(""); + + int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString); + if(nbSel != 1) + return; + + /* nbSel == 1 */ + TopoDS_Shape S; + if(!myGeomBase->GetTopoFromSelection(mySelection, S)) + return; + + + if(S.IsNull() || S.ShapeType() == TopAbs_VERTEX) + return; + + GroupC1->LineEdit1->setText(aString); + + /* Try to display of a cone simulation shape to show direction of a linear edge only in OCC viewer */ + if(myGeomBase->CreateArrowForLinearEdge(S, mySimulationTopoDs)) + myGeomBase->DisplaySimulationShape(mySimulationTopoDs); + + this->CalculateAndDisplayProperties(S); + return; +} + + +//================================================================================= +// function : SetEditCurrentArgument() +// purpose : +//================================================================================= +void MeasureGUI_PropertiesDlg::SetEditCurrentArgument() +{ + QPushButton* send = (QPushButton*)sender(); + + if(send == GroupC1->PushButton1) { + GroupC1->LineEdit1->setFocus(); + myEditCurrentArgument = GroupC1->LineEdit1; + } + + this->SelectionIntoArgument(); + return; +} + + +//================================================================================= +// function : LineEditReturnPressed() +// purpose : +//================================================================================= +void MeasureGUI_PropertiesDlg::LineEditReturnPressed() +{ + QLineEdit* send = (QLineEdit*)sender(); + if(send == GroupC1->LineEdit1) + myEditCurrentArgument = GroupC1->LineEdit1; + else + return; + + MeasureGUI_Skeleton::LineEditReturnPressed(); + return; +} + + +//================================================================================= +// function : ActivateThisDialog() +// purpose : +//================================================================================= +void MeasureGUI_PropertiesDlg::ActivateThisDialog() +{ + MeasureGUI_Skeleton::ActivateThisDialog(); + connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + if(!mySimulationTopoDs.IsNull()) + myGeomBase->DisplaySimulationShape(mySimulationTopoDs); + return; +} + + +//================================================================================= +// function : enterEvent() +// purpose : +//================================================================================= +void MeasureGUI_PropertiesDlg::enterEvent(QEvent* e) +{ + if(GroupConstructors->isEnabled()) + return; + this->ActivateThisDialog(); + return; +} + + +//================================================================================= +// function : CalculateAndDisplayProperties() +// purpose : +//================================================================================= +void MeasureGUI_PropertiesDlg::CalculateAndDisplayProperties(const TopoDS_Shape& S) +{ + GroupC1->LineEdit2->setText(""); + GroupC1->LineEdit3->setText(""); + GroupC1->LineEdit4->setText(""); + + if(S.IsNull()) + return; + + Standard_Real result; + GProp_GProps LProps, SProps; + QString resString; + + try { + BRepGProp::LinearProperties(S,LProps); + result = LProps.Mass(); + if(!IsEqual(result, 0.0)) { + resString = tr("%1").arg(result, 12, 'f', 6); + GroupC1->LineEdit2->setText(resString); + } + + BRepGProp::SurfaceProperties(S, SProps); + result = SProps.Mass(); + if(!IsEqual(result, 0.0)) { + resString = tr("%1").arg(result, 12, 'f', 6); + GroupC1->LineEdit3->setText(resString); + } + + result = 0.0; + if(S.ShapeType() < TopAbs_SHELL) { + for(TopExp_Explorer Exp(S,TopAbs_SOLID); Exp.More(); Exp.Next()) { + GProp_GProps VProps; + BRepGProp::VolumeProperties(Exp.Current(), VProps); + result += VProps.Mass(); + } + } + if (!IsEqual(result, 0.0)) { + resString = tr("%1").arg(result, 12, 'f', 6); + GroupC1->LineEdit4->setText(resString); + } + } + catch(Standard_Failure) { + MESSAGE("Catch intercepted in CalculateAndDisplayProperties()"); + } + return; +} diff --git a/src/MeasureGUI/MeasureGUI_PropertiesDlg.h b/src/MeasureGUI/MeasureGUI_PropertiesDlg.h new file mode 100644 index 000000000..d2402393d --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_PropertiesDlg.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 : MeasureGUI_PropertiesDlg.h +// Author : Lucien PIGNOLONI +// Module : GEOM + +#ifndef DIALOGBOX_PROPERTIES_H +#define DIALOGBOX_PROPERTIES_H + +#include "MeasureGUI_Skeleton.h" +#include "MeasureGUI_1Sel3LineEdit_QTD.h" + +#include "MeasureGUI.h" + +//================================================================================= +// class : MeasureGUI_PropertiesDlg +// purpose : +//================================================================================= +class MeasureGUI_PropertiesDlg : public MeasureGUI_Skeleton +{ + Q_OBJECT + +public: + MeasureGUI_PropertiesDlg(QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0); + ~MeasureGUI_PropertiesDlg(); + +private: + void Init(); + void enterEvent(QEvent* e); + void CalculateAndDisplayProperties(const TopoDS_Shape& S); + + MeasureGUI_1Sel3LineEdit_QTD* GroupC1; + +private slots: + void SetEditCurrentArgument(); + void SelectionIntoArgument(); + void LineEditReturnPressed(); + void ActivateThisDialog(); + +}; + +#endif // DIALOGBOX_PROPERTIES_H diff --git a/src/MeasureGUI/MeasureGUI_Skeleton.cxx b/src/MeasureGUI/MeasureGUI_Skeleton.cxx new file mode 100644 index 000000000..39498d509 --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_Skeleton.cxx @@ -0,0 +1,169 @@ +// 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 : MeasureGUI_Skeleton.cxx +// Author : Damien COQUERET +// Module : GEOM +// $Header: + +using namespace std; +#include "MeasureGUI_Skeleton.h" + +//================================================================================= +// class : MeasureGUI_Skeleton() +// purpose : Constructs a MeasureGUI_Skeleton 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. +//================================================================================= +MeasureGUI_Skeleton::MeasureGUI_Skeleton(QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl) + :MeasureGUI_Skeleton_QTD(parent, name, modal, fl) +{ + if (!name) + setName("MeasureGUI_Skeleton"); + + buttonClose->setText(tr("GEOM_BUT_CLOSE")); + + GroupMedium->close(TRUE); + resize(350, 0); + + Init(Sel); +} + + +//================================================================================= +// function : ~MeasureGUI_Skeleton() +// purpose : Destroys the object and frees any allocated resources +//================================================================================= +MeasureGUI_Skeleton::~MeasureGUI_Skeleton() +{ + // no need to delete child widgets, Qt does it all for us + this->destroy(TRUE, TRUE); +} + + +//================================================================================= +// function : Init() +// purpose : +//================================================================================= +void MeasureGUI_Skeleton::Init(SALOME_Selection* Sel) +{ + /* init variables */ + mySelection = Sel; + mySimulationTopoDs.Nullify(); + + myGeomBase = new GEOMBase(); + myGeomGUI = GEOMContext::GetGeomGUI(); + myGeomGUI->SetActiveDialogBox((QDialog*)this); + myGeom = myGeomGUI->myComponentGeom; + + /* signals and slots connections */ + connect(buttonClose, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); + 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 ); + + /* displays Dialog */ + RadioButton1->setChecked(TRUE); + + return; +} + + +//================================================================================= +// function : ClickOnCancel() +// purpose : +//================================================================================= +void MeasureGUI_Skeleton::ClickOnCancel() +{ + myGeomBase->EraseSimulationShape(); + mySimulationTopoDs.Nullify(); + + disconnect(mySelection, 0, this, 0); + //myGeomGUI->ResetState(); + reject(); + + return; +} + + +//================================================================================= +// function : LineEditReturnPressed() +// purpose : +//================================================================================= +void MeasureGUI_Skeleton::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 MeasureGUI_Skeleton::DeactivateActiveDialog() +{ + this->setEnabled(false); + //myGeomGUI->ResetState(); + disconnect(mySelection, 0, this, 0); + myGeomBase->EraseSimulationShape(); + myGeomGUI->SetActiveDialogBox(0); + return; +} + + +//================================================================================= +// function : ActivateThisDialog() +// purpose : +//================================================================================= +void MeasureGUI_Skeleton::ActivateThisDialog() +{ + /* Emit a signal to deactivate the active dialog */ + myGeomGUI->EmitSignalDeactivateDialog(); + this->setEnabled(true); + myGeomGUI->SetActiveDialogBox((QDialog*)this); + return; +} + + +//================================================================================= +// function : closeEvent() +// purpose : +//================================================================================= +void MeasureGUI_Skeleton::closeEvent(QCloseEvent* e) +{ + /* same than click on cancel button */ + this->ClickOnCancel(); + return; +} diff --git a/src/MeasureGUI/MeasureGUI_Skeleton.h b/src/MeasureGUI/MeasureGUI_Skeleton.h new file mode 100644 index 000000000..015951864 --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_Skeleton.h @@ -0,0 +1,72 @@ +// 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 : MeasureGUI_Skeleton.h +// Author : Damine COQUERET +// Module : GEOM +// $Header: + +#ifndef MEASUREGUI_SKELETON_H +#define MEASUREGUI_SKELETON_H + +#include "MeasureGUI_Skeleton_QTD.h" + +#include "GEOMBase.h" + +#include +#include +#include +#include +#include +#include + +class MeasureGUI_Skeleton : public MeasureGUI_Skeleton_QTD +{ + Q_OBJECT + +public: + MeasureGUI_Skeleton(QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0); + ~MeasureGUI_Skeleton(); + +private : + void Init(SALOME_Selection* Sel); + +protected: + void closeEvent(QCloseEvent* e); + + TopoDS_Shape mySimulationTopoDs; /* 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 */ + +protected slots: + void ClickOnCancel(); + void LineEditReturnPressed(); + void DeactivateActiveDialog(); + void ActivateThisDialog(); + +}; + +#endif // MEASUREGUI_SKELETON_H diff --git a/src/MeasureGUI/MeasureGUI_Skeleton_QTD.cxx b/src/MeasureGUI/MeasureGUI_Skeleton_QTD.cxx new file mode 100644 index 000000000..5022ad561 --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_Skeleton_QTD.cxx @@ -0,0 +1,99 @@ +/**************************************************************************** +** Form implementation generated from reading ui file 'MeasureGUI_Skeleton_QTD.ui' +** +** Created: lun oct 27 11:23:09 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#include "MeasureGUI_Skeleton_QTD.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Constructs a MeasureGUI_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. + */ +MeasureGUI_Skeleton_QTD::MeasureGUI_Skeleton_QTD( QWidget* parent, const char* name, bool modal, WFlags fl ) + : QDialog( parent, name, modal, fl ) +{ + if ( !name ) + setName( "MeasureGUI_Skeleton_QTD" ); + resize( 228, 266 ); + setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0, sizePolicy().hasHeightForWidth() ) ); + setCaption( trUtf8( "MeasureGUI_Skeleton_QTD" ) ); + setSizeGripEnabled( TRUE ); + MeasureGUI_Skeleton_QTDLayout = new QGridLayout( this, 1, 1, 11, 6, "MeasureGUI_Skeleton_QTDLayout"); + + Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1"); + + 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 QGridLayout( GroupButtons->layout() ); + GroupButtonsLayout->setAlignment( Qt::AlignTop ); + + Layout3 = new QGridLayout( 0, 1, 1, 0, 6, "Layout3"); + QSpacerItem* spacer = new QSpacerItem( 120, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); + Layout3->addItem( spacer, 0, 2 ); + QSpacerItem* spacer_2 = new QSpacerItem( 120, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); + Layout3->addItem( spacer_2, 0, 0 ); + + buttonClose = new QPushButton( GroupButtons, "buttonClose" ); + buttonClose->setText( trUtf8( "&Close" ) ); + + Layout3->addWidget( buttonClose, 0, 1 ); + + GroupButtonsLayout->addLayout( Layout3, 0, 0 ); + + Layout1->addWidget( GroupButtons, 2, 0 ); + + GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); + GroupConstructors->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, GroupConstructors->sizePolicy().hasHeightForWidth() ) ); + GroupConstructors->setTitle( trUtf8( "" ) ); + 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( "" ) ); + Layout2->addWidget( RadioButton1 ); + + GroupConstructorsLayout->addLayout( Layout2, 0, 0 ); + + Layout1->addWidget( GroupConstructors, 0, 0 ); + + GroupMedium = new QGroupBox( this, "GroupMedium" ); + GroupMedium->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupMedium->sizePolicy().hasHeightForWidth() ) ); + GroupMedium->setTitle( trUtf8( "" ) ); + + Layout1->addWidget( GroupMedium, 1, 0 ); + + MeasureGUI_Skeleton_QTDLayout->addLayout( Layout1, 0, 0 ); +} + +/* + * Destroys the object and frees any allocated resources + */ +MeasureGUI_Skeleton_QTD::~MeasureGUI_Skeleton_QTD() +{ + // no need to delete child widgets, Qt does it all for us +} + diff --git a/src/MeasureGUI/MeasureGUI_Skeleton_QTD.h b/src/MeasureGUI/MeasureGUI_Skeleton_QTD.h new file mode 100644 index 000000000..39564b036 --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_Skeleton_QTD.h @@ -0,0 +1,46 @@ +/**************************************************************************** +** Form interface generated from reading ui file 'MeasureGUI_Skeleton_QTD.ui' +** +** Created: lun oct 27 11:23:09 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#ifndef MEASUREGUI_SKELETON_QTD_H +#define MEASUREGUI_SKELETON_QTD_H + +#include +#include +class QVBoxLayout; +class QHBoxLayout; +class QGridLayout; +class QButtonGroup; +class QGroupBox; +class QPushButton; +class QRadioButton; + +class MeasureGUI_Skeleton_QTD : public QDialog +{ + Q_OBJECT + +public: + MeasureGUI_Skeleton_QTD( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + ~MeasureGUI_Skeleton_QTD(); + + QGroupBox* GroupButtons; + QPushButton* buttonClose; + QButtonGroup* GroupConstructors; + QRadioButton* RadioButton1; + QGroupBox* GroupMedium; + + +protected: + QGridLayout* MeasureGUI_Skeleton_QTDLayout; + QGridLayout* Layout1; + QGridLayout* GroupButtonsLayout; + QGridLayout* Layout3; + QGridLayout* GroupConstructorsLayout; + QHBoxLayout* Layout2; +}; + +#endif // MEASUREGUI_SKELETON_QTD_H diff --git a/src/MeasureGUI/MeasureGUI_WhatisDlg.cxx b/src/MeasureGUI/MeasureGUI_WhatisDlg.cxx new file mode 100644 index 000000000..23c2895c3 --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_WhatisDlg.cxx @@ -0,0 +1,255 @@ +// 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 : MeasureGUI_WhatisDlg.cxx +// Author : Nicolas REJNERI +// Module : GEOM +// $Header$ + +using namespace std; +#include "MeasureGUI_WhatisDlg.h" + +#include +#include +#include +#include +#include + +#include + +//================================================================================= +// class : MeasureGUI_WhatisDlg() +// purpose : Constructs a MeasureGUI_WhatisDlg 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. +//================================================================================= +MeasureGUI_WhatisDlg::MeasureGUI_WhatisDlg(QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl) + :MeasureGUI_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +{ + QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_WHATIS"))); + QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT"))); + + setCaption(tr("GEOM_WHATIS_TITLE")); + + /***************************************************************/ + GroupConstructors->setTitle(tr("GEOM_WHATIS")); + RadioButton1->setPixmap(image0); + + GroupC1 = new MeasureGUI_1Sel1TextView_QTD(this, "GroupC1"); + GroupC1->GroupBox1->setTitle(tr("GEOM_WHATIS_OBJECT")); + GroupC1->TextLabel1->setText(tr("GEOM_OBJECT")); + GroupC1->TextEdit1->setReadOnly(TRUE); + GroupC1->PushButton1->setPixmap(image1); + + Layout1->addWidget(GroupC1, 1, 0); + /***************************************************************/ + + /* Initialisation */ + Init(); +} + + +//================================================================================= +// function : ~MeasureGUI_WhatisDlg() +// purpose : Destroys the object and frees any allocated resources +//================================================================================= +MeasureGUI_WhatisDlg::~MeasureGUI_WhatisDlg() +{ + // no need to delete child widgets, Qt does it all for us +} + + +//================================================================================= +// function : Init() +// purpose : +//================================================================================= +void MeasureGUI_WhatisDlg::Init() +{ + /* init variables */ + myEditCurrentArgument = GroupC1->LineEdit1; + + /* signals and slots connections */ + connect(GroupC1->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); + connect(GroupC1->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); + + connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + + /* displays Dialog */ + GroupC1->show(); + this->show(); + + return; +} + + +//================================================================================= +// function : SelectionIntoArgument() +// purpose : Called when selection as changed or other case +//================================================================================= +void MeasureGUI_WhatisDlg::SelectionIntoArgument() +{ + myGeomBase->EraseSimulationShape(); + mySimulationTopoDs.Nullify(); + + myEditCurrentArgument->setText(""); + SelectedName = ""; /* future the name of selection */ + GroupC1->TextEdit1->setText(""); + + int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, SelectedName); + if(nbSel != 1) + return; + + /* nbSel == 1 */ + TopoDS_Shape S; + if(!myGeomBase->GetTopoFromSelection(mySelection, S)) + return; + + if(S.IsNull()) + return; + + /* Try to display of a cone simulation shape to show direction of a linear edge only in OCC viewer */ + if(myGeomBase->CreateArrowForLinearEdge(S, mySimulationTopoDs)) + myGeomBase->DisplaySimulationShape(mySimulationTopoDs); + + GroupC1->LineEdit1->setText(SelectedName); + this->CalculateWhatis(S); + + return; +} + + +//================================================================================= +// function : SetEditCurrentArgument() +// purpose : +//================================================================================= +void MeasureGUI_WhatisDlg::SetEditCurrentArgument() +{ + QPushButton* send = (QPushButton*)sender(); + + if(send == GroupC1->PushButton1) { + GroupC1->LineEdit1->setFocus(); + myEditCurrentArgument = GroupC1->LineEdit1; + } + + this->SelectionIntoArgument(); + return; +} + + +//================================================================================= +// function : LineEditReturnPressed() +// purpose : +//================================================================================= +void MeasureGUI_WhatisDlg::LineEditReturnPressed() +{ + QLineEdit* send = (QLineEdit*)sender(); + if(send == GroupC1->LineEdit1) + myEditCurrentArgument = GroupC1->LineEdit1; + else + return; + + MeasureGUI_Skeleton::LineEditReturnPressed(); + return; +} + + +//================================================================================= +// function : ActivateThisDialog() +// purpose : +//================================================================================= +void MeasureGUI_WhatisDlg::ActivateThisDialog() +{ + MeasureGUI_Skeleton::ActivateThisDialog(); + connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + if(!mySimulationTopoDs.IsNull()) + myGeomBase->DisplaySimulationShape(mySimulationTopoDs); + return; +} + + +//================================================================================= +// function : enterEvent() +// purpose : +//================================================================================= +void MeasureGUI_WhatisDlg::enterEvent(QEvent* e) +{ + if(GroupConstructors->isEnabled()) + return; + this->ActivateThisDialog(); + return; +} + + +//================================================================================= +// function : CalculateWhatis() +// purpose : +//================================================================================= +void MeasureGUI_WhatisDlg::CalculateWhatis(const TopoDS_Shape& S) +{ + if(S.IsNull()) + return; + + TCollection_AsciiString Astr; + Astr = Astr + " Number of shapes in " + strdup(SelectedName.latin1()) + " : \n"; + + try { + int iType, nbTypes [TopAbs_SHAPE]; + for(iType = 0; iType < TopAbs_SHAPE; ++iType) + nbTypes[iType] = 0; + nbTypes[S.ShapeType()]++; + + TopTools_MapOfShape aMapOfShape; + aMapOfShape.Add(S); + TopTools_ListOfShape aListOfShape; + aListOfShape.Append(S); + + TopTools_ListIteratorOfListOfShape itL(aListOfShape); + for(; itL.More(); itL.Next()) { + TopoDS_Iterator it(itL.Value()); + for(; it.More(); it.Next()) { + TopoDS_Shape s = it.Value(); + if(aMapOfShape.Add(s)) { + aListOfShape.Append(s); + nbTypes[s.ShapeType()]++; + } + } + } + + Astr = Astr + " VERTEX : " + TCollection_AsciiString(nbTypes[TopAbs_VERTEX]) + "\n"; + Astr = Astr + " EDGE : " + TCollection_AsciiString(nbTypes[TopAbs_EDGE]) + "\n"; + Astr = Astr + " WIRE : " + TCollection_AsciiString(nbTypes[TopAbs_WIRE]) + "\n"; + Astr = Astr + " FACE : " + TCollection_AsciiString(nbTypes[TopAbs_FACE]) + "\n"; + Astr = Astr + " SHELL : " + TCollection_AsciiString(nbTypes[TopAbs_SHELL]) + "\n"; + Astr = Astr + " SOLID : " + TCollection_AsciiString(nbTypes[TopAbs_SOLID]) + "\n"; + Astr = Astr + " COMPSOLID : " + TCollection_AsciiString(nbTypes[TopAbs_COMPSOLID]) + "\n"; + Astr = Astr + " COMPOUND : " + TCollection_AsciiString(nbTypes[TopAbs_COMPOUND]) + "\n"; + Astr = Astr + " SHAPE : " + TCollection_AsciiString(aMapOfShape.Extent()); + + GroupC1->TextEdit1->setText(Astr.ToCString()); + } + catch(Standard_Failure) { + MESSAGE("Catch intercepted in CalculateWhatis()"); + } + return; +} diff --git a/src/MeasureGUI/MeasureGUI_WhatisDlg.h b/src/MeasureGUI/MeasureGUI_WhatisDlg.h new file mode 100644 index 000000000..2714f0b26 --- /dev/null +++ b/src/MeasureGUI/MeasureGUI_WhatisDlg.h @@ -0,0 +1,65 @@ +// 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 : MeasureGUI_WhatisDlg.h +// Author : Nicolas REJNERI +// Module : GEOM +// $Header$ + +#ifndef DIALOGBOX_WHATIS_H +#define DIALOGBOX_WHATIS_H + +#include "MeasureGUI_Skeleton.h" +#include "MeasureGUI_1Sel1TextView_QTD.h" + +#include "MeasureGUI.h" + +//================================================================================= +// class : DialogBox_PROPERTIES +// purpose : +//================================================================================= +class MeasureGUI_WhatisDlg : public MeasureGUI_Skeleton +{ + Q_OBJECT + +public: + MeasureGUI_WhatisDlg(QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0); + ~MeasureGUI_WhatisDlg(); + +private: + void Init(); + void enterEvent(QEvent* e); + void CalculateWhatis(const TopoDS_Shape& S); + + QString SelectedName; + MeasureGUI_1Sel1TextView_QTD* GroupC1; + +private slots: + void SetEditCurrentArgument(); + void SelectionIntoArgument(); + void LineEditReturnPressed(); + void ActivateThisDialog(); + +}; + +#endif // DIALOGBOX_WHATIS_H diff --git a/src/MeasureGUI/UIFiles/MeasureGUI_1Sel12LineEdit_QTD.ui b/src/MeasureGUI/UIFiles/MeasureGUI_1Sel12LineEdit_QTD.ui new file mode 100644 index 000000000..505b87b68 --- /dev/null +++ b/src/MeasureGUI/UIFiles/MeasureGUI_1Sel12LineEdit_QTD.ui @@ -0,0 +1,268 @@ + +MeasureGUI_1Sel12LineEdit_QTD + + + MeasureGUI_1Sel12LineEdit_QTD + + + + 0 + 0 + 131 + 171 + + + + MeasureGUI_1Sel12LineEdit_QTD + + + + unnamed + + + 0 + + + 6 + + + + GroupBox1 + + + + 7 + 7 + 0 + 0 + + + + + + + + unnamed + + + 11 + + + 6 + + + + Layout1 + + + + unnamed + + + 0 + + + 6 + + + + Layout2 + + + + unnamed + + + 0 + + + 6 + + + + LineEdit12 + + + + + LineEdit11 + + + + + LineEdit42 + + + + + TextLabel5 + + + + 0 + 0 + 0 + 0 + + + + TL5 + + + + + LineEdit31 + + + + + LineEdit41 + + + + + LineEdit23 + + + + + LineEdit33 + + + + + LineEdit43 + + + + + LineEdit22 + + + + + TextLabel2 + + + + 0 + 0 + 0 + 0 + + + + TL2 + + + + + TextLabel4 + + + + 0 + 0 + 0 + 0 + + + + TL4 + + + + + LineEdit13 + + + + + LineEdit32 + + + + + LineEdit21 + + + + + TextLabel3 + + + + 0 + 0 + 0 + 0 + + + + TL3 + + + + + + + LineEdit1 + + + + + Spacer8 + + + Vertical + + + Expanding + + + + 0 + 40 + + + + + + PushButton1 + + + + 0 + 0 + 0 + 0 + + + + + + + + + TextLabel1 + + + + 0 + 0 + 0 + 0 + + + + TL1 + + + + + + + + + + diff --git a/src/MeasureGUI/UIFiles/MeasureGUI_1Sel1TextView_QTD.ui b/src/MeasureGUI/UIFiles/MeasureGUI_1Sel1TextView_QTD.ui new file mode 100644 index 000000000..d8e24583e --- /dev/null +++ b/src/MeasureGUI/UIFiles/MeasureGUI_1Sel1TextView_QTD.ui @@ -0,0 +1,116 @@ + +MeasureGUI_1Sel1TextView_QTD + + + MeasureGUI_1Sel1TextView_QTD + + + + 0 + 0 + 130 + 160 + + + + MeasureGUI_1Sel1TextView_QTD + + + + unnamed + + + 0 + + + 6 + + + + GroupBox1 + + + + 7 + 7 + 0 + 0 + + + + + + + + unnamed + + + 11 + + + 6 + + + + Layout1 + + + + unnamed + + + 0 + + + 6 + + + + TextLabel1 + + + + 0 + 0 + 0 + 0 + + + + TL1 + + + + + TextEdit1 + + + + + LineEdit1 + + + + + PushButton1 + + + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + + diff --git a/src/MeasureGUI/UIFiles/MeasureGUI_1Sel3LineEdit_QTD.ui b/src/MeasureGUI/UIFiles/MeasureGUI_1Sel3LineEdit_QTD.ui new file mode 100644 index 000000000..07db7bfb0 --- /dev/null +++ b/src/MeasureGUI/UIFiles/MeasureGUI_1Sel3LineEdit_QTD.ui @@ -0,0 +1,191 @@ + +MeasureGUI_1Sel3LineEdit_QTD + + + MeasureGUI_1Sel3LineEdit_QTD + + + + 0 + 0 + 129 + 141 + + + + MeasureGUI_1Sel3LineEdit_QTD + + + + unnamed + + + 0 + + + 6 + + + + GroupBox1 + + + + 7 + 7 + 0 + 0 + + + + + + + + unnamed + + + 11 + + + 6 + + + + Layout2 + + + + unnamed + + + 0 + + + 6 + + + + TextLabel1 + + + + 0 + 0 + 0 + 0 + + + + TL1 + + + + + LineEdit4 + + + + + TextLabel3 + + + + 0 + 0 + 0 + 0 + + + + TL3 + + + + + LineEdit2 + + + + + Spacer8 + + + Vertical + + + Expanding + + + + 0 + 80 + + + + + + LineEdit3 + + + + + LineEdit1 + + + + + TextLabel4 + + + + 0 + 0 + 0 + 0 + + + + TL4 + + + + + TextLabel2 + + + + 0 + 0 + 0 + 0 + + + + TL2 + + + + + PushButton1 + + + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + + diff --git a/src/MeasureGUI/UIFiles/MeasureGUI_1Sel6LineEdit_QTD.ui b/src/MeasureGUI/UIFiles/MeasureGUI_1Sel6LineEdit_QTD.ui new file mode 100644 index 000000000..b439a76de --- /dev/null +++ b/src/MeasureGUI/UIFiles/MeasureGUI_1Sel6LineEdit_QTD.ui @@ -0,0 +1,254 @@ + +MeasureGUI_1Sel6LineEdit_QTD + + + MeasureGUI_1Sel6LineEdit_QTD + + + + 0 + 0 + 129 + 163 + + + + MeasureGUI_1Sel6LineEdit_QTD + + + + unnamed + + + 0 + + + 6 + + + + GroupBox1 + + + + 7 + 7 + 0 + 0 + + + + + + + + unnamed + + + 11 + + + 6 + + + + Layout1 + + + + unnamed + + + 0 + + + 6 + + + + Spacer8 + + + Vertical + + + Expanding + + + + 0 + 50 + + + + + + TextLabel1 + + + + 0 + 0 + 0 + 0 + + + + TL1 + + + + + Layout2 + + + + unnamed + + + 0 + + + 6 + + + + LineEdit22 + + + + + LineEdit32 + + + + + TextLabel4 + + + + 0 + 0 + 0 + 0 + + + + TL4 + + + + + LineEdit31 + + + + + TextLabel5 + + + + 0 + 0 + 0 + 0 + + + + TL5 + + + + + LineEdit11 + + + + + TextLabel6 + + + + 0 + 0 + 0 + 0 + + + + TL6 + + + + + LineEdit12 + + + + + TextLabel2 + + + + 0 + 0 + 0 + 0 + + + + TL2 + + + + + LineEdit21 + + + + + TextLabel3 + + + + 0 + 0 + 0 + 0 + + + + TL3 + + + + + + + PushButton1 + + + + 0 + 0 + 0 + 0 + + + + + + + + + LineEdit1 + + + + + + + + + + diff --git a/src/MeasureGUI/UIFiles/MeasureGUI_2Sel1LineEdit_QTD.ui b/src/MeasureGUI/UIFiles/MeasureGUI_2Sel1LineEdit_QTD.ui new file mode 100644 index 000000000..e68cca900 --- /dev/null +++ b/src/MeasureGUI/UIFiles/MeasureGUI_2Sel1LineEdit_QTD.ui @@ -0,0 +1,186 @@ + +MeasureGUI_2Sel1LineEdit_QTD + + + MeasureGUI_2Sel1LineEdit_QTD + + + + 0 + 0 + 129 + 115 + + + + MeasureGUI_2Sel1LineEdit_QTD + + + + unnamed + + + 0 + + + 6 + + + + GroupBox1 + + + + 7 + 7 + 0 + 0 + + + + + + + + unnamed + + + 11 + + + 6 + + + + Layout1 + + + + unnamed + + + 0 + + + 6 + + + + Spacer8 + + + Vertical + + + Expanding + + + + 0 + 60 + + + + + + TextLabel3 + + + + 0 + 0 + 0 + 0 + + + + TL3 + + + + + LineEdit3 + + + + + LineEdit2 + + + + + TextLabel2 + + + + 0 + 0 + 0 + 0 + + + + TL2 + + + + + TextLabel1 + + + + 0 + 0 + 0 + 0 + + + + TL1 + + + + + PushButton1 + + + + 0 + 0 + 0 + 0 + + + + + + + + + LineEdit1 + + + + + PushButton2 + + + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + + diff --git a/src/MeasureGUI/UIFiles/MeasureGUI_Skeleton_QTD.ui b/src/MeasureGUI/UIFiles/MeasureGUI_Skeleton_QTD.ui new file mode 100644 index 000000000..d759fb401 --- /dev/null +++ b/src/MeasureGUI/UIFiles/MeasureGUI_Skeleton_QTD.ui @@ -0,0 +1,210 @@ + +MeasureGUI_Skeleton_QTD + + + MeasureGUI_Skeleton_QTD + + + + 0 + 0 + 228 + 266 + + + + + 5 + 7 + 0 + 0 + + + + MeasureGUI_Skeleton_QTD + + + true + + + + unnamed + + + 11 + + + 6 + + + + Layout1 + + + + unnamed + + + 0 + + + 6 + + + + GroupButtons + + + + 7 + 0 + 0 + 0 + + + + + + + + unnamed + + + 11 + + + 6 + + + + Layout3 + + + + unnamed + + + 0 + + + 6 + + + + Spacer2 + + + Horizontal + + + Expanding + + + + 120 + 0 + + + + + + Spacer1 + + + Horizontal + + + Expanding + + + + 120 + 0 + + + + + + buttonClose + + + &Close + + + + + + + + + GroupConstructors + + + + 5 + 0 + 0 + 0 + + + + + + + + unnamed + + + 11 + + + 6 + + + + Layout2 + + + + unnamed + + + 0 + + + 6 + + + + RadioButton1 + + + + + + + + + + + + GroupMedium + + + + 7 + 7 + 0 + 0 + + + + + + + + + + + + diff --git a/src/MeasureGUI/UIFiles/ui_to_cxx b/src/MeasureGUI/UIFiles/ui_to_cxx new file mode 100755 index 000000000..a0a350391 --- /dev/null +++ b/src/MeasureGUI/UIFiles/ui_to_cxx @@ -0,0 +1,19 @@ +#!/bin/sh + +#uic -o MeasureGUI_Skeleton_QTD.h MeasureGUI_Skeleton_QTD.ui +#uic -o MeasureGUI_Skeleton_QTD.cxx -impl MeasureGUI_Skeleton_QTD.h MeasureGUI_Skeleton_QTD.ui + +uic -o MeasureGUI_1Sel3LineEdit_QTD.h MeasureGUI_1Sel3LineEdit_QTD.ui +uic -o MeasureGUI_1Sel3LineEdit_QTD.cxx -impl MeasureGUI_1Sel3LineEdit_QTD.h MeasureGUI_1Sel3LineEdit_QTD.ui + +uic -o MeasureGUI_1Sel6LineEdit_QTD.h MeasureGUI_1Sel6LineEdit_QTD.ui +uic -o MeasureGUI_1Sel6LineEdit_QTD.cxx -impl MeasureGUI_1Sel6LineEdit_QTD.h MeasureGUI_1Sel6LineEdit_QTD.ui + +uic -o MeasureGUI_1Sel12LineEdit_QTD.h MeasureGUI_1Sel12LineEdit_QTD.ui +uic -o MeasureGUI_1Sel12LineEdit_QTD.cxx -impl MeasureGUI_1Sel12LineEdit_QTD.h MeasureGUI_1Sel12LineEdit_QTD.ui + +uic -o MeasureGUI_2Sel1LineEdit_QTD.h MeasureGUI_2Sel1LineEdit_QTD.ui +uic -o MeasureGUI_2Sel1LineEdit_QTD.cxx -impl MeasureGUI_2Sel1LineEdit_QTD.h MeasureGUI_2Sel1LineEdit_QTD.ui + +#uic -o MeasureGUI_1Sel1TextView_QTD.h MeasureGUI_1Sel1TextView_QTD.ui +#uic -o MeasureGUI_1Sel1TextView_QTD.cxx -impl MeasureGUI_1Sel1TextView_QTD.h MeasureGUI_1Sel1TextView_QTD.ui -- 2.30.2