myParamsDlg->adjustSize();
}
+//=================================================================================
+// function : activateSelection()
+// purpose :
+//=================================================================================
+void MeasureGUI_WhatisDlg::activateSelection()
+{
+ MeasureGUI_Skeleton::activateSelection();
+ std::list<int> needTypes;
+ needTypes.push_back( TopAbs_VERTEX ), needTypes.push_back( TopAbs_EDGE ), needTypes.push_back( TopAbs_WIRE ), needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL ), needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPOUND );
+ localSelection(GEOM::GEOM_Object::_nil(), needTypes );
+}
+
//=================================================================================
// function : ClickOnProperties()
// purpose :
//=================================================================================
bool MeasureGUI_WhatisDlg::getParameters( QString& theText )
{
- if ( myObj->_is_nil() )
+ if ( !myObj )
return false;
GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
try
{
- theText = anOper->WhatIs( myObj );
+ theText = anOper->WhatIs( myObj.get() );
}
catch( const SALOME::SALOME_Exception& e )
{
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
int aLenPrecision = resMgr->integerValue( "Geometry", "length_precision", 6 );
- if ( myObj->_is_nil() )
+ if ( !myObj )
return aKindStr;
GEOM::GEOM_IKindOfShape::shape_kind aKind;
try
{
- aKind = anOper->KindOfShape( myObj, anInts, aDbls );
+ aKind = anOper->KindOfShape( myObj.get(), anInts, aDbls );
}
catch( const SALOME::SALOME_Exception& e ) {
SalomeApp_Tools::QtCatchCorbaException( e );
return aKindStr;
}
+
+void MeasureGUI_WhatisDlg::SelectionIntoArgument()
+{
+ myObj.nullify();
+ myObj = getSelected( TopAbs_SHAPE );
+
+ if (!myObj) {
+ mySelEdit->setText("");
+ processObject();
+ erasePreview();
+ return;
+ }
+
+ mySelEdit->setText(GEOMBase::GetName(myObj.get()));
+ processObject();
+ redisplayPreview();
+}
\ No newline at end of file