// 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
//
//
//
#include "MeasureGUI_2Sel1LineEdit_QTD.h"
#include "GEOMBase.h"
#include "GEOM_Displayer.h"
-#include "QAD_RightFrame.h"
-#include "QAD_Desktop.h"
-#include "OCCViewer_Viewer3d.h"
-#include "OCCViewer_Prs.h"
-#include "SALOMEGUI_QtCatchCorbaException.hxx"
+
+#include "SUIT_Session.h"
+#include "SUIT_ViewWindow.h"
+#include "SOCC_Prs.h"
+#include "SOCC_ViewModel.h"
+#include "SalomeApp_Tools.h"
#include <Geom_Plane.hxx>
#include <TopoDS_Edge.hxx>
#include "utilities.h"
#include <qlineedit.h>
+#include <qlabel.h>
#include <qlayout.h>
#include <qpushbutton.h>
#include <qradiobutton.h>
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
//=================================================================================
-MeasureGUI_DistanceDlg::MeasureGUI_DistanceDlg( QWidget* parent, SALOME_Selection* Sel )
-: MeasureGUI_Skeleton( parent, "MeasureGUI_DistanceDlg", Sel )
+MeasureGUI_DistanceDlg::MeasureGUI_DistanceDlg( GeometryGUI* GUI, QWidget* parent )
+: MeasureGUI_Skeleton( GUI, parent, "MeasureGUI_DistanceDlg" )
{
- QPixmap image0( QAD_Desktop::getResourceManager()->loadPixmap(
+ QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap(
"GEOM",tr( "ICON_DLG_MINDIST" ) ) );
- QPixmap image1( QAD_Desktop::getResourceManager()->loadPixmap(
+ QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap(
"GEOM",tr( "ICON_SELECT" ) ) );
setCaption( tr( "GEOM_MINDIST_TITLE" ) );
/***************************************************************/
+ myHelpFileName = "files/salome2_sp3_measuregui_functions.htm#Min_distance";
+
/* Initialisation */
- Init( Sel );
+ Init();
}
// function : Init()
// purpose :
//=================================================================================
-void MeasureGUI_DistanceDlg::Init( SALOME_Selection* Sel )
+void MeasureGUI_DistanceDlg::Init()
{
mySelBtn = myGrp->PushButton1;
mySelEdit = myGrp->LineEdit1;
connect( mySelEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
connect( mySelBtn2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
- MeasureGUI_Skeleton::Init( Sel );
+ MeasureGUI_Skeleton::Init();
}
{
Standard_Boolean testResult = Standard_False;
GEOM::GEOM_Object_var aSelectedObject =
- GEOMBase::ConvertIOinGEOMObject( mySelection->firstIObject(), testResult );
+ GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
if ( !testResult )
aSelectedObject = GEOM::GEOM_Object::_nil();
}
catch( const SALOME::SALOME_Exception& e )
{
- QtCatchCorbaException( e );
+ SalomeApp_Tools::QtCatchCorbaException( e );
return false;
}
else
myEditCurrentArgument = mySelEdit2;
- if ( GEOMBase::SelectionByNameInDialogs( this, mySelEdit->text(), mySelection ) )
+ if ( GEOMBase::SelectionByNameInDialogs( this, mySelEdit->text(), selectedIO() ) )
mySelEdit->setText( mySelEdit->text() );
}
gp_Pnt aPnt1( 0, 0, 0 ), aPnt2( 0, 0, 0 );
if ( myObj->_is_nil() || myObj2->_is_nil() || !getParameters( aDist, aPnt1, aPnt2 ) ||
- QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() != VIEW_OCC )
+ SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager()->getType()
+ != OCCViewer_Viewer::Type() )
return 0;
try
Handle( AIS_LengthDimension ) anIO = new AIS_LengthDimension(
aVert1, aVert2, P, aDist, TCollection_ExtendedString( (Standard_CString)aLabel.latin1() ) );
- QAD_ViewFrame* vf = GEOM_Displayer::GetActiveView();
- OCCViewer_Prs* aPrs = dynamic_cast<OCCViewer_Prs*>( vf->CreatePrs( 0 ) );
+ SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
+ SOCC_Prs* aPrs = dynamic_cast<SOCC_Prs*>( ((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs( 0 ) );
+
+ //QAD_ViewFrame* vf = GEOM_Displayer::GetActiveView();
+ //OCCViewer_Prs* aPrs = dynamic_cast<OCCViewer_Prs*>( vf->CreatePrs( 0 ) );
if ( aPrs )
aPrs->AddObject( anIO );