-
- // Add a hint for the user saying how to tune precision
- QString userPropName = QObject::tr( QString( "GEOM_PREF_%1" ).arg( quantity ).toLatin1().constData() );
- spinBox->setProperty( "validity_tune_hint",
- QVariant( QObject::tr( "GEOM_PRECISION_HINT" ).arg( userPropName ) ) );
-}
-
-//=================================================================================
-// function : updateAttributes()
-// purpose : Workaround for Translation and Rotation operations with unchecked option "Create a copy".
-// In this case PublishInStudy isn't called, so we need to update object's attributes manually
-//=================================================================================
-void MyGEOMBase_Skeleton::updateAttributes( GEOM::GEOM_Object_ptr theObj,
- const QStringList& theParameters)
-{
- SALOMEDS::Study_var aStudy = GeometryGUI::ClientStudyToStudy(getStudy()->studyDS());
- SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
- SALOMEDS::SObject_var aSObject = aStudy->FindObjectID(theObj->GetStudyEntry());
- SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeString");
- SALOMEDS::AttributeString_var aStringAttrib = SALOMEDS::AttributeString::_narrow(anAttr);
-
- std::string aValue = aStringAttrib->Value();
- if( aValue != "" )
- aValue += "|";
- for( int i = 0, n = theParameters.count(); i < n; i++ ) {
- std::string aParameter = theParameters[i].toStdString();
- if(aStudy->IsVariable(aParameter.c_str()))
- aValue += aParameter;
- if(i != n-1)
- aValue += ":";
- }
- aStringAttrib->SetValue(aValue.c_str());
-}
-
-
-// ========================================================================== close
-// function : close()
-// purpose : close the dockwidget
-//=================================================================================
-void MyGEOMBase_Skeleton::close()
-{
-// _currentObj = NULL;
-
- //Clear VTK selection //no need to test if the graphic view exist
- HEXABLOCKGUI::currentDocGView->clearSelection();
-
- //Clear OCC selection
- if (HEXABLOCKGUI::currentOccGView != NULL)
- HEXABLOCKGUI::currentOccGView->clearSelection();
-
- //Close the dialog box
- if (parentWidget()) parentWidget()->close();
-}
-
-//=================================================================================
-// function : LineEditReturnPressed()
-// purpose :
-//=================================================================================
-void MyGEOMBase_Skeleton::LineEditReturnPressed()
-{
- if (!myEditCurrentArgument)
- return;
-
- /* 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;
-
- SALOME_ListIO aList;
- LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
- if (aSelMgr)
- aSelMgr->selectedObjects(aList);
- if (GEOMBase::SelectionByNameInDialogs(thisWidget, objectUserName, aList))
- myEditCurrentArgument->setText(objectUserName);
-}
-
-//=================================================================================
-// function : DeactivateActiveDialog()
-// purpose :
-//=================================================================================
-void MyGEOMBase_Skeleton::DeactivateActiveDialog()
-{
- this->setEnabled( false );
- globalSelection(HEXABLOCKGUI::currentOccGView->getViewWindow());
- if ( myGeomGUI ) {
- myGeomGUI->SetActiveDialogBox( 0 );
- disconnect( myGeomGUI->getApp()->selectionMgr(), 0, this, 0 );
- }
- erasePreview();
-}
-
-//=================================================================================
-// function : ActivateThisDialog()
-// purpose :
-//=================================================================================
-void MyGEOMBase_Skeleton::ActivateThisDialog()
-{
- /* Emit a signal to deactivate the active dialog */
- if ( myGeomGUI ) myGeomGUI->EmitSignalDeactivateDialog();
- this->setEnabled( true );
- if ( myGeomGUI ) myGeomGUI->SetActiveDialogBox( (QDialog*)this );
- return;