From: jfa Date: Fri, 21 Dec 2012 08:29:02 +0000 (+0000) Subject: Mantis issue 0021716: EDF 1679 : Create the bounding box in the GUI X-Git-Tag: V6_main_FINAL~84 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e39ee4040b8fcca425f5ede16069932338c7afa6;p=modules%2Fgeom.git Mantis issue 0021716: EDF 1679 : Create the bounding box in the GUI --- diff --git a/doc/salome/gui/GEOM/images/measures5.png b/doc/salome/gui/GEOM/images/measures5.png index 13af1afdf..d2180be63 100755 Binary files a/doc/salome/gui/GEOM/images/measures5.png and b/doc/salome/gui/GEOM/images/measures5.png differ diff --git a/doc/salome/gui/GEOM/input/bounding_box.doc b/doc/salome/gui/GEOM/input/bounding_box.doc index eeb16c4ff..75b7c7eaf 100644 --- a/doc/salome/gui/GEOM/input/bounding_box.doc +++ b/doc/salome/gui/GEOM/input/bounding_box.doc @@ -2,8 +2,10 @@ \page bounding_box_page Bounding Box -Returns the dimensions of the bounding box for the selected -geometrical object. +Shows the dimensions of the bounding box for the selected +geometrical object. Creates corresponding shape (box) on "Apply". + +\image html measures5.png \note To take into account any possible shape distortion that affects the resulting bounding box, the algorithm enlarges @@ -12,14 +14,10 @@ faces (by iterating through all faces of a shape). This functionallity is implemented in such a way to have a satisfactory performance. -Result: Displays the bounding box dimensions of a -geometrical object in form of a Python Tuple (Xmin, Xmax, Ymin, -Ymax, Zmin, Zmax). -\n TUI Command: geompy.BoundingBox(Shape), where \em Shape +\n TUI Commands: [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax] = geompy.BoundingBox(Shape), +BBox = geompy.MakeBoundingBox(Shape), where \em Shape is the shape for which a bounding box is computed. See also a \ref tui_bounding_box_page "TUI example". -\image html measures5.png - */ diff --git a/doc/salome/gui/GEOM/input/tui_bounding_box.doc b/doc/salome/gui/GEOM/input/tui_bounding_box.doc index 232ab13b4..022795cbb 100644 --- a/doc/salome/gui/GEOM/input/tui_bounding_box.doc +++ b/doc/salome/gui/GEOM/input/tui_bounding_box.doc @@ -7,11 +7,17 @@ import geompy # create a box box = geompy.MakeBoxDXDYDZ(100,30,100) + bb = geompy.BoundingBox(box) print "\nBounding Box of box 100x30x100:" print " Xmin = ", bb[0], ", Xmax = ", bb[1] print " Ymin = ", bb[2], ", Ymax = ", bb[3] print " Zmin = ", bb[4], ", Zmax = ", bb[5] + +aBB = geompy.MakeBoundingBox(box) + +geompy.addToStudy(box, "box 100x30x100") +geompy.addToStudy(aBB, "Bounding box of box 100x30x100") \endcode */ diff --git a/idl/GEOM_Gen.idl b/idl/GEOM_Gen.idl index de18e7ee1..24a7f1946 100644 --- a/idl/GEOM_Gen.idl +++ b/idl/GEOM_Gen.idl @@ -3558,6 +3558,13 @@ module GEOM out double Ymin, out double Ymax, out double Zmin, out double Zmax); + /*! + * \brief Get bounding box of the given shape + * \param theShape Shape to obtain bounding box of. + * \return New GEOM_Object, containing the created bounding box. + */ + GEOM_Object MakeBoundingBox (in GEOM_Object theShape); + /*! * \brief Get min and max tolerances of sub-shapes of theShape * \param theShape Shape, to get tolerances of. diff --git a/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx b/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx index 0d08e6dcd..6f4194500 100644 --- a/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx @@ -1166,6 +1166,59 @@ void GEOMImpl_IMeasureOperations::GetBoundingBox SetErrorCode(OK); } +//============================================================================= +/*! + * GetBoundingBox + */ +//============================================================================= +Handle(GEOM_Object) GEOMImpl_IMeasureOperations::GetBoundingBox + (Handle(GEOM_Object) theShape) +{ + SetErrorCode(KO); + + if (theShape.IsNull()) return NULL; + + //Add a new BoundingBox object + Handle(GEOM_Object) aBnd = GetEngine()->AddObject(GetDocID(), GEOM_BOX); + + //Add a new BoundingBox function + Handle(GEOM_Function) aFunction = + aBnd->AddFunction(GEOMImpl_MeasureDriver::GetID(), BND_BOX_MEASURE); + if (aFunction.IsNull()) return NULL; + + //Check if the function is set correctly + if (aFunction->GetDriverGUID() != GEOMImpl_MeasureDriver::GetID()) return NULL; + + GEOMImpl_IMeasure aCI (aFunction); + + Handle(GEOM_Function) aRefShape = theShape->GetLastFunction(); + if (aRefShape.IsNull()) return NULL; + + aCI.SetBase(aRefShape); + + //Compute the BoundingBox value + try { +#if OCC_VERSION_LARGE > 0x06010000 + OCC_CATCH_SIGNALS; +#endif + if (!GetSolver()->ComputeFunction(aFunction)) { + SetErrorCode("Measure driver failed to compute a bounding box"); + return NULL; + } + } + catch (Standard_Failure) { + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); + SetErrorCode(aFail->GetMessageString()); + return NULL; + } + + //Make a Python command + GEOM::TPythonDump(aFunction) << aBnd << " = geompy.MakeBoundingBox(" << theShape << ")"; + + SetErrorCode(OK); + return aBnd; +} + //============================================================================= /*! * GetTolerance diff --git a/src/GEOMImpl/GEOMImpl_IMeasureOperations.hxx b/src/GEOMImpl/GEOMImpl_IMeasureOperations.hxx index fbcdcfa9e..eff6fdaca 100644 --- a/src/GEOMImpl/GEOMImpl_IMeasureOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IMeasureOperations.hxx @@ -117,6 +117,8 @@ class GEOMImpl_IMeasureOperations : public GEOM_IOperations { Standard_Real& Ymin, Standard_Real& Ymax, Standard_Real& Zmin, Standard_Real& Zmax); + Standard_EXPORT Handle(GEOM_Object) GetBoundingBox (Handle(GEOM_Object) theShape); + Standard_EXPORT void GetTolerance (Handle(GEOM_Object) theShape, Standard_Real& FaceMin, Standard_Real& FaceMax, Standard_Real& EdgeMin, Standard_Real& EdgeMax, diff --git a/src/GEOMImpl/GEOMImpl_MeasureDriver.cxx b/src/GEOMImpl/GEOMImpl_MeasureDriver.cxx index 7aa6fb5f8..33ead5986 100644 --- a/src/GEOMImpl/GEOMImpl_MeasureDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_MeasureDriver.cxx @@ -30,9 +30,12 @@ #include #include +#include #include -#include +#include #include +#include +#include #include #include @@ -55,6 +58,7 @@ #include #include #include +#include //======================================================================= //function : GetID @@ -93,14 +97,47 @@ Standard_Integer GEOMImpl_MeasureDriver::Execute(TFunction_Logbook& log) const { Handle(GEOM_Function) aRefBase = aCI.GetBase(); TopoDS_Shape aShapeBase = aRefBase->GetValue(); - if (aShapeBase.IsNull()) { + if (aShapeBase.IsNull()) Standard_NullObject::Raise("Shape for centre of mass calculation is null"); - } gp_Ax3 aPos = GEOMUtils::GetPosition(aShapeBase); gp_Pnt aCenterMass = aPos.Location(); aShape = BRepBuilderAPI_MakeVertex(aCenterMass).Shape(); } + else if (aType == BND_BOX_MEASURE) + { + Handle(GEOM_Function) aRefBase = aCI.GetBase(); + TopoDS_Shape aShapeBase = aRefBase->GetValue(); + if (aShapeBase.IsNull()) + Standard_NullObject::Raise("Shape for bounding box calculation is null"); + + BRepBuilderAPI_Copy aCopyTool (aShapeBase); + if (!aCopyTool.IsDone()) + Standard_NullObject::Raise("Shape for bounding box calculation is bad"); + + aShapeBase = aCopyTool.Shape(); + + // remove triangulation to obtain more exact boundaries + BRepTools::Clean(aShapeBase); + + Bnd_Box B; + BRepBndLib::Add(aShapeBase, B); + + Standard_Real Xmin, Ymin, Zmin, Xmax, Ymax, Zmax; + B.Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax); + + if (Xmax - Xmin < Precision::Confusion()) Xmax += Precision::Confusion(); + if (Ymax - Ymin < Precision::Confusion()) Ymax += Precision::Confusion(); + if (Zmax - Zmin < Precision::Confusion()) Zmax += Precision::Confusion(); + + gp_Pnt P1 (Xmin, Ymin, Zmin); + gp_Pnt P2 (Xmax, Ymax, Zmax); + + BRepPrimAPI_MakeBox MB (P1, P2); + MB.Build(); + if (!MB.IsDone()) StdFail_NotDone::Raise("Bounding box cannot be computed from the given shape"); + aShape = MB.Shape(); + } else if (aType == VERTEX_BY_INDEX) { Handle(GEOM_Function) aRefBase = aCI.GetBase(); diff --git a/src/GEOMImpl/GEOMImpl_Types.hxx b/src/GEOMImpl/GEOMImpl_Types.hxx index 659158e28..687eb7f15 100755 --- a/src/GEOMImpl/GEOMImpl_Types.hxx +++ b/src/GEOMImpl/GEOMImpl_Types.hxx @@ -309,6 +309,7 @@ // Measures #define CDG_MEASURE 1 +#define BND_BOX_MEASURE 2 #define VECTOR_FACE_NORMALE 4 #define VERTEX_BY_INDEX 5 diff --git a/src/GEOM_I/GEOM_IMeasureOperations_i.cc b/src/GEOM_I/GEOM_IMeasureOperations_i.cc index ffbdcd5d4..66bcb5288 100644 --- a/src/GEOM_I/GEOM_IMeasureOperations_i.cc +++ b/src/GEOM_I/GEOM_IMeasureOperations_i.cc @@ -18,7 +18,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #include @@ -273,6 +272,31 @@ void GEOM_IMeasureOperations_i::GetBoundingBox (GEOM::GEOM_Object_ptr theShape, GetOperations()->GetBoundingBox(aShape, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax); } +//============================================================================= +/*! + * MakeBoundingBox + */ +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_IMeasureOperations_i::MakeBoundingBox + (GEOM::GEOM_Object_ptr theShape) +{ + GEOM::GEOM_Object_var aGEOMObject; + + //Set a not done flag + GetOperations()->SetNotDone(); + + //Get the reference shape + Handle(GEOM_Object) aShape = GetObjectImpl(theShape); + if (aShape.IsNull()) return aGEOMObject._retn(); + + // Make Box - bounding box of theShape + Handle(GEOM_Object) anObject = GetOperations()->GetBoundingBox(aShape); + if (!GetOperations()->IsDone() || anObject.IsNull()) + return aGEOMObject._retn(); + + return GetObject(anObject); +} + //============================================================================= /*! * GetTolerance diff --git a/src/GEOM_I/GEOM_IMeasureOperations_i.hh b/src/GEOM_I/GEOM_IMeasureOperations_i.hh index 4534dc45e..0f68c3510 100644 --- a/src/GEOM_I/GEOM_IMeasureOperations_i.hh +++ b/src/GEOM_I/GEOM_IMeasureOperations_i.hh @@ -18,7 +18,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #ifndef _GEOM_IMeasureOperations_i_HeaderFile #define _GEOM_IMeasureOperations_i_HeaderFile @@ -75,6 +74,8 @@ class GEOM_I_EXPORT GEOM_IMeasureOperations_i : CORBA::Double& Ymin, CORBA::Double& Ymax, CORBA::Double& Zmin, CORBA::Double& Zmax); + GEOM::GEOM_Object_ptr MakeBoundingBox (GEOM::GEOM_Object_ptr theShape); + void GetTolerance (GEOM::GEOM_Object_ptr theShape, CORBA::Double& FaceMin, CORBA::Double& FaceMax, CORBA::Double& EdgeMin, CORBA::Double& EdgeMax, diff --git a/src/GEOM_SWIG/GEOM_TestMeasures.py b/src/GEOM_SWIG/GEOM_TestMeasures.py index 1621f2bf4..ea9e31c86 100644 --- a/src/GEOM_SWIG/GEOM_TestMeasures.py +++ b/src/GEOM_SWIG/GEOM_TestMeasures.py @@ -19,7 +19,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# def TestMeasureOperations (geompy, math): @@ -98,6 +97,8 @@ def TestMeasureOperations (geompy, math): print " Xmin = ", BB[0], ", Xmax = ", BB[1] print " Ymin = ", BB[2], ", Ymax = ", BB[3] print " Zmin = ", BB[4], ", Zmax = ", BB[5] + BB = geompy.MakeBoundingBox(box) + geompy.addToStudy(BB, "BoundingBox") ####### Inertia ####### diff --git a/src/GEOM_SWIG/geompyDC.py b/src/GEOM_SWIG/geompyDC.py index ef8415920..e72c6538e 100644 --- a/src/GEOM_SWIG/geompyDC.py +++ b/src/GEOM_SWIG/geompyDC.py @@ -6644,7 +6644,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): # Zmin,Zmax: Limits of shape along OZ axis. # # @ref tui_measurement_tools_page "Example" - def BoundingBox(self,theShape): + def BoundingBox (self, theShape): """ Get parameters of bounding box of the given shape @@ -6662,6 +6662,26 @@ class geompyDC(GEOM._objref_GEOM_Gen): RaiseIfFailed("GetBoundingBox", self.MeasuOp) return aTuple + ## Get bounding box of the given shape + # @param theShape Shape to obtain bounding box of. + # @return New GEOM.GEOM_Object, containing the created box. + # + # @ref tui_measurement_tools_page "Example" + def MakeBoundingBox (self, theShape): + """ + Get bounding box of the given shape + + Parameters: + theShape Shape to obtain bounding box of. + + Returns: + New GEOM.GEOM_Object, containing the created box. + """ + # Example: see GEOM_TestMeasures.py + anObj = self.MeasuOp.MakeBoundingBox(theShape) + RaiseIfFailed("MakeBoundingBox", self.MeasuOp) + return anObj + ## Get inertia matrix and moments of inertia of theShape. # @param theShape Shape to calculate inertia of. # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz] diff --git a/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx b/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx index d3eb0603a..5460c7e4f 100644 --- a/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx @@ -35,6 +35,10 @@ #include #include +#include +#include +#include +#include //================================================================================= // class : MeasureGUI_BndBoxDlg() @@ -44,21 +48,23 @@ // true to construct a modal dialog. //================================================================================= MeasureGUI_BndBoxDlg::MeasureGUI_BndBoxDlg (GeometryGUI* GUI, QWidget* parent) - : MeasureGUI_Skeleton(GUI, parent) + : GEOMBase_Skeleton(GUI, parent) { - QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( - "GEOM", tr( "ICON_DLG_BOUNDING_BOX" ) ) ); - QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( - "GEOM", tr( "ICON_SELECT" ) ) ); + QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BOUNDING_BOX"))); + QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT"))); - setWindowTitle( tr( "GEOM_BNDBOX_TITLE" ) ); + setWindowTitle(tr("GEOM_BNDBOX_TITLE")); /***************************************************************/ - mainFrame()->GroupConstructors->setTitle( tr( "GEOM_BNDBOX" ) ); - mainFrame()->RadioButton1->setIcon( image0 ); + mainFrame()->GroupConstructors->setTitle(tr("GEOM_BNDBOX")); + mainFrame()->RadioButton1->setIcon(image0); + mainFrame()->RadioButton2->setAttribute( Qt::WA_DeleteOnClose ); + mainFrame()->RadioButton2->close(); + mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose ); + mainFrame()->RadioButton3->close(); - myGrp = new MeasureGUI_1Sel6LineEdit( centralWidget() ); + myGrp = new MeasureGUI_1Sel6LineEdit (centralWidget()); myGrp->GroupBox1->setTitle( tr( "GEOM_BNDBOX_OBJDIM" ) ); myGrp->TextLabel1->setText( tr( "GEOM_OBJECT" ) ); myGrp->TextLabel2->setText( tr( "GEOM_MIN" ) ); @@ -87,7 +93,7 @@ MeasureGUI_BndBoxDlg::MeasureGUI_BndBoxDlg (GeometryGUI* GUI, QWidget* parent) /***************************************************************/ - myHelpFileName = "using_measurement_tools_page.html#bounding_box_anchor"; + myHelpFileName = "bounding_box_page.html"; /* Initialisation */ Init(); @@ -107,9 +113,41 @@ MeasureGUI_BndBoxDlg::~MeasureGUI_BndBoxDlg() //================================================================================= void MeasureGUI_BndBoxDlg::Init() { - mySelBtn = myGrp->PushButton1; - mySelEdit = myGrp->LineEdit1; - MeasureGUI_Skeleton::Init(); + myEditCurrentArgument = myGrp->LineEdit1; + + connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk())); + connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply())); + connect(myGrp->PushButton1, SIGNAL(clicked()), this, SLOT(SelectionIntoArgument())); + + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), + this, SLOT(SelectionIntoArgument())); + + initName(tr("GEOM_BNDBOX")); + globalSelection(); + SelectionIntoArgument(); +} + +//================================================================================= +// function : ClickOnOk() +// purpose : +//================================================================================= +void MeasureGUI_BndBoxDlg::ClickOnOk() +{ + if (ClickOnApply()) + ClickOnCancel(); +} + +//================================================================================= +// function : ClickOnApply() +// purpose : +//================================================================================= +bool MeasureGUI_BndBoxDlg::ClickOnApply() +{ + if (!onAccept()) + return false; + + initName(); + return true; } //================================================================================= @@ -121,7 +159,7 @@ void MeasureGUI_BndBoxDlg::processObject() double aXMin, aXMax, aYMin, aYMax, aZMin, aZMax; if (!getParameters(aXMin, aXMax, aYMin, aYMax, aZMin, aZMax)) { - mySelEdit->setText(""); + myEditCurrentArgument->setText(""); myGrp->LineEdit11->setText(""); myGrp->LineEdit12->setText(""); myGrp->LineEdit21->setText(""); @@ -177,3 +215,97 @@ SALOME_Prs* MeasureGUI_BndBoxDlg::buildPrs() return !aShape.IsNull() ? getDisplayer()->BuildPrs(aShape) : 0; } + +//================================================================================= +// function : SelectionIntoArgument() +// purpose : Called when selection as changed or other case +//================================================================================= +void MeasureGUI_BndBoxDlg::SelectionIntoArgument() +{ + myEditCurrentArgument->setText(""); + myObj = GEOM::GEOM_Object::_nil(); + + LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr(); + SALOME_ListIO aSelList; + aSelMgr->selectedObjects(aSelList); + + if (aSelList.Extent() != 1) { + processObject(); + erasePreview(); + return; + } + + GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First()); + + if (aSelectedObject->_is_nil()) { + processObject(); + erasePreview(); + return; + } + + myObj = aSelectedObject; + myEditCurrentArgument->setText(GEOMBase::GetName(myObj)); + processObject(); + redisplayPreview(); +} + +//================================================================================= +// function : createOperation +// purpose : +//================================================================================= +GEOM::GEOM_IOperations_ptr MeasureGUI_BndBoxDlg::createOperation() +{ + return getGeomEngine()->GetIMeasureOperations(getStudyId()); +} + +//================================================================================= +// function : isValid +// purpose : +//================================================================================= +bool MeasureGUI_BndBoxDlg::isValid (QString&) +{ + return !myObj->_is_nil(); +} + +//================================================================================= +// function : execute +// purpose : +//================================================================================= +bool MeasureGUI_BndBoxDlg::execute (ObjectList& objects) +{ + GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow(getOperation()); + GEOM::GEOM_Object_var anObj = anOper->MakeBoundingBox(myObj); + + if (!anObj->_is_nil()) + objects.push_back(anObj._retn()); + + return true; +} + +//================================================================================= +// function : redisplayPreview() +// purpose : +//================================================================================= +void MeasureGUI_BndBoxDlg::redisplayPreview() +{ + QString aMess; + if (!isValid(aMess)) { + erasePreview(true); + return; + } + + erasePreview(false); + + try { + SUIT_OverrideCursor(); + + getDisplayer()->SetColor(Quantity_NOC_VIOLET); + getDisplayer()->SetToActivate(false); + + if (SALOME_Prs* aPrs = buildPrs()) + displayPreview(aPrs); + } + catch (const SALOME::SALOME_Exception& e) { + SalomeApp_Tools::QtCatchCorbaException(e); + } +} diff --git a/src/MeasureGUI/MeasureGUI_BndBoxDlg.h b/src/MeasureGUI/MeasureGUI_BndBoxDlg.h index 8fd3af034..bb1e8971e 100644 --- a/src/MeasureGUI/MeasureGUI_BndBoxDlg.h +++ b/src/MeasureGUI/MeasureGUI_BndBoxDlg.h @@ -18,16 +18,15 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // GEOM GEOMGUI : GUI for Geometry component // File : MeasureGUI_BndBoxDlg.h // Author : Nicolas REJNERI, Open CASCADE S.A.S. -// + #ifndef MEASUREGUI_BNDBOXDLG_H #define MEASUREGUI_BNDBOXDLG_H -#include "MeasureGUI_Skeleton.h" +#include "GEOMBase_Skeleton.h" class MeasureGUI_1Sel6LineEdit; @@ -35,27 +34,36 @@ class MeasureGUI_1Sel6LineEdit; // class : DialogBox_PROPERTIES // purpose : //================================================================================= -class MeasureGUI_BndBoxDlg : public MeasureGUI_Skeleton +class MeasureGUI_BndBoxDlg : public GEOMBase_Skeleton { Q_OBJECT public: - MeasureGUI_BndBoxDlg( GeometryGUI*, QWidget* ); + MeasureGUI_BndBoxDlg (GeometryGUI*, QWidget*); ~MeasureGUI_BndBoxDlg(); protected: - // redefined from GEOMBase_Helper and MeasureGUI_Skeleton - virtual void processObject(); - virtual SALOME_Prs* buildPrs(); + // redefined from GEOMBase_Helper + virtual GEOM::GEOM_IOperations_ptr createOperation(); + virtual bool isValid (QString&); + virtual bool execute (ObjectList&); + + void redisplayPreview(); + virtual void processObject(); + virtual SALOME_Prs* buildPrs(); private: - void Init(); - bool getParameters( double&, double&, - double&, double&, - double&, double& ); + void Init(); + bool getParameters (double&, double&, double&, double&, double&, double&); private: - MeasureGUI_1Sel6LineEdit* myGrp; + GEOM::GEOM_Object_var myObj; + MeasureGUI_1Sel6LineEdit* myGrp; + +private slots: + void ClickOnOk(); + bool ClickOnApply(); + void SelectionIntoArgument(); }; #endif // MEASUREGUI_BNDBOXDLG_H