-// GEOM GEOMGUI : GUI for Geometry component
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// Copyright (C) 2003-2007 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
// 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
-//
-//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+// GEOM GEOMGUI : GUI for Geometry component
// File : MeasureGUI_CenterMassDlg.cxx
// Author : Lucien PIGNOLONI
// Module : GEOM
// $Header$
-
+//
#include "MeasureGUI_CenterMassDlg.h"
#include "MeasureGUI_1Sel3LineEdit_QTD.h"
-#include "SALOMEGUI_QtCatchCorbaException.hxx"
+
+#include "DlgRef_SpinBox.h"
+
#include "utilities.h"
-#include "QAD_Desktop.h"
+#include "SUIT_Session.h"
+#include "SalomeApp_Application.h"
+#include "LightApp_SelectionMgr.h"
+#include "SalomeApp_Tools.h"
#include <BRep_Tool.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS.hxx>
#include <gp_Pnt.hxx>
+#include <qlabel.h>
+
//=================================================================================
// class : MeasureGUI_CenterMassDlg()
// purpose : Constructs a MeasureGUI_CenterMassDlg which is a child of 'parent', with the
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
//=================================================================================
-MeasureGUI_CenterMassDlg::MeasureGUI_CenterMassDlg( QWidget* parent, SALOME_Selection* Sel )
-: GEOMBase_Skeleton( parent, "MeasureGUI_CenterMassDlg", Sel, false,
- WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+MeasureGUI_CenterMassDlg::MeasureGUI_CenterMassDlg( GeometryGUI* theGeometryGUI, QWidget* parent )
+ : GEOMBase_Skeleton(theGeometryGUI, parent, "MeasureGUI_CenterMassDlg", false,
+ 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" ) ) );
+ QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_CENTERMASS")));
+ QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT")));
setCaption( tr( "GEOM_CMASS_TITLE" ) );
/***************************************************************/
-
GroupConstructors->setTitle( tr( "GEOM_CMASS" ) );
RadioButton1->setPixmap( image0 );
RadioButton2->close( TRUE );
Layout1->addWidget( myGrp, 2, 0 );
/***************************************************************/
+ myHelpFileName = "using_measurement_tools_page.html#center_mass_anchor";
+
/* Initialisation */
- Init( Sel );
+ Init();
}
// function : Init()
// purpose :
//=================================================================================
-void MeasureGUI_CenterMassDlg::Init( SALOME_Selection* Sel )
+void MeasureGUI_CenterMassDlg::Init()
{
/* init variables */
- mySelection = Sel;
myEditCurrentArgument = myGrp->LineEdit1;
/* signals and slots connections */
connect( myGrp->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
connect( myGrp->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
- connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
initName( tr( "GEOM_POINT") );
globalSelection();
erasePreview();
myObj = GEOM::GEOM_Object::_nil();
- if ( mySelection->IObjectCount() != 1 )
+ if ( IObjectCount() != 1 )
{
processObject();
return;
Standard_Boolean testResult = Standard_False;
GEOM::GEOM_Object_var aSelectedObject =
- GEOMBase::ConvertIOinGEOMObject( mySelection->firstIObject(), testResult );
+ GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
if ( !testResult || aSelectedObject->_is_nil() )
{
{
GEOMBase_Skeleton::ActivateThisDialog();
- connect( mySelection, SIGNAL( currentSelectionChanged() ),
- this, SLOT ( SelectionIntoArgument() ) );
+ connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
globalSelection();
displayPreview();
getParameters( x, y, z );
myGrp->LineEdit1->setText( GEOMBase::GetName( myObj ) );
- myGrp->LineEdit2->setText( QString( "%1" ).arg( x ) );
- myGrp->LineEdit3->setText( QString( "%1" ).arg( y ) );
- myGrp->LineEdit4->setText( QString( "%1" ).arg( z ) );
+ myGrp->LineEdit2->setText( DlgRef_SpinBox::PrintDoubleValue( x ) );
+ myGrp->LineEdit3->setText( DlgRef_SpinBox::PrintDoubleValue( y ) );
+ myGrp->LineEdit4->setText( DlgRef_SpinBox::PrintDoubleValue( z ) );
displayPreview();
}
}
catch( const SALOME::SALOME_Exception& e )
{
- QtCatchCorbaException( e );
+ SalomeApp_Tools::QtCatchCorbaException( e );
return false;
}
}
return true;
}
-
-