// purpose :
//=================================================================================
void AdvancedGUI_PipeTShapeDlg::ClickOnOk() {
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
//=================================================================================
void BasicGUI_ArcDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if ( ClickOnApply() )
ClickOnCancel();
}
//=================================================================================
void BasicGUI_CircleDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if ( ClickOnApply() )
ClickOnCancel();
}
//=================================================================================
void BasicGUI_CurveDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if ( ClickOnApply() )
ClickOnCancel();
}
//=================================================================================
void BasicGUI_EllipseDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if ( ClickOnApply() )
ClickOnCancel();
}
//=================================================================================
void BasicGUI_LineDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if ( ClickOnApply() )
ClickOnCancel();
}
//=================================================================================
void BasicGUI_MarkerDlg::onOk()
{
+ setIsApplyAndClose( true );
if ( onApply() )
ClickOnCancel();
}
//=================================================================================
void BasicGUI_PlaneDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if ( ClickOnApply() )
ClickOnCancel();
}
//=================================================================================
void BasicGUI_PointDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if ( onAccept() )
ClickOnCancel();
}
//=================================================================================
void BasicGUI_VectorDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if ( ClickOnApply() )
ClickOnCancel();
}
//=================================================================================
void BasicGUI_WorkingPlaneDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if ( ClickOnApply() )
ClickOnCancel();
}
//=================================================================================
void BlocksGUI_BlockDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
//=================================================================================
void BlocksGUI_ExplodeDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if ( ClickOnApply() )
ClickOnCancel();
}
//=================================================================================
void BlocksGUI_PropagateDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if ( ClickOnApply() )
ClickOnCancel();
}
//=================================================================================
void BlocksGUI_QuadFaceDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
//=================================================================================
void BlocksGUI_TrsfDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
//=================================================================================
void BooleanGUI_Dialog::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
//=================================================================================
void BuildGUI_CompoundDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if ( ClickOnApply() )
ClickOnCancel();
}
//=================================================================================
void BuildGUI_EdgeDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
//=================================================================================
void BuildGUI_FaceDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if ( ClickOnApply() )
ClickOnCancel();
}
//=================================================================================
void BuildGUI_ShellDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if ( ClickOnApply() )
ClickOnCancel();
}
//=================================================================================
void BuildGUI_SolidDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if ( ClickOnApply() )
ClickOnCancel();
}
//=================================================================================
void BuildGUI_WireDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if ( ClickOnApply() )
ClickOnCancel();
}
layout->addWidget( GroupPoints );
/***************************************************************/
+ setIsOptimizedBrowsing( true );
+
setHelpFileName( "create_explode_page.html" );
mainFrame()->GroupBoxName->hide();
//=================================================================================
void EntityGUI_SubShapeDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if ( ClickOnApply() )
ClickOnCancel();
}
// Purpose :
//================================================================
GEOMBase_Helper::GEOMBase_Helper( SUIT_Desktop* desktop )
- : myDesktop( desktop ), myViewWindow( 0 ), myDisplayer( 0 ), myCommand( 0 ), isPreview( false )
+ : myDesktop( desktop ), myViewWindow( 0 ), myDisplayer( 0 ), myCommand( 0 ), isPreview( false ),
+ myIsApplyAndClose( false ), myIsOptimizedBrowsing( false )
{
}
// Function : addInStudy
// Purpose : Add object in study
//================================================================
-void GEOMBase_Helper::addInStudy( GEOM::GEOM_Object_ptr theObj, const char* theName )
+QString GEOMBase_Helper::addInStudy( GEOM::GEOM_Object_ptr theObj, const char* theName )
{
if ( !hasCommand() )
- return;
+ return QString();
_PTR(Study) aStudy = getStudy()->studyDS();
if ( !aStudy || theObj->_is_nil() )
- return;
+ return QString();
SALOMEDS::Study_var aStudyDS = GeometryGUI::ClientStudyToStudy(aStudy);
SALOMEDS::SObject_var aSO =
getGeomEngine()->AddInStudy(aStudyDS, theObj, theName, aFatherObj);
+ QString anEntry;
+ if ( !aSO->_is_nil() )
+ anEntry = aSO->GetID();
+
// Each dialog is responsible for this method implementation,
// default implementation does nothing
restoreSubShapes(aStudyDS, aSO);
aSO->UnRegister();
+
+ return anEntry;
}
//================================================================
else {
addSubshapesToStudy(); // add Subshapes if local selection
const int nbObjs = objects.size();
+ QStringList anEntryList;
int aNumber = 1;
for ( ObjectList::iterator it = objects.begin(); it != objects.end(); ++it ) {
GEOM::GEOM_Object_var obj=*it;
if ( aName.isEmpty() )
aName = GEOMBase::GetDefaultName( getPrefix( obj ) );
}
- addInStudy( obj, aName.toLatin1().constData() );
+ anEntryList << addInStudy( obj, aName.toLatin1().constData() );
// updateView=false
display( obj, false );
#ifdef WITHGENERICOBJ
if ( nbObjs ) {
commitCommand();
updateObjBrowser();
- SUIT_Session::session()->activeApplication()->putInfo( QObject::tr("GEOM_PRP_DONE") );
+ if( SUIT_Application* anApp = SUIT_Session::session()->activeApplication() ) {
+ if( LightApp_Application* aLightApp = dynamic_cast<LightApp_Application*>( anApp ) )
+ aLightApp->browseObjects( anEntryList, isApplyAndClose(), isOptimizedBrowsing() );
+ anApp->putInfo( QObject::tr("GEOM_PRP_DONE") );
+ }
result = true;
}
else
}
return result;
}
+
+//================================================================
+// Function : setIsApplyAndClose
+// Purpose : Set value of the flag indicating that the dialog is
+// accepted by Apply & Close button
+//================================================================
+void GEOMBase_Helper::setIsApplyAndClose( const bool theFlag )
+{
+ myIsApplyAndClose = theFlag;
+}
+
+//================================================================
+// Function : isApplyAndClose
+// Purpose : Get value of the flag indicating that the dialog is
+// accepted by Apply & Close button
+//================================================================
+bool GEOMBase_Helper::isApplyAndClose() const
+{
+ return myIsApplyAndClose;
+}
+
+//================================================================
+// Function : setIsOptimizedBrowsing
+// Purpose : Set value of the flag switching to optimized
+// browsing mode (to select the first published
+// object only)
+//================================================================
+void GEOMBase_Helper::setIsOptimizedBrowsing( const bool theFlag )
+{
+ myIsOptimizedBrowsing = theFlag;
+}
+
+//================================================================
+// Function : isOptimizedBrowsing
+// Purpose : Get value of the flag switching to optimized
+// browsing mode (to select the first published
+// object only)
+//================================================================
+bool GEOMBase_Helper::isOptimizedBrowsing() const
+{
+ return myIsOptimizedBrowsing;
+}
void prepareSelection( const ObjectList&, const int );
void prepareSelection( GEOM::GEOM_Object_ptr, const int );
- void addInStudy ( GEOM::GEOM_Object_ptr, const char* theName );
+ QString addInStudy ( GEOM::GEOM_Object_ptr, const char* theName );
bool openCommand ();
bool abortCommand ();
GEOM_Displayer* getDisplayer();
SUIT_Desktop* getDesktop() const;
+ virtual void setIsApplyAndClose( const bool theFlag );
+ virtual bool isApplyAndClose() const;
+
+ virtual void setIsOptimizedBrowsing( const bool theFlag );
+ virtual bool isOptimizedBrowsing() const;
+
private:
QString getEntry( GEOM::GEOM_Object_ptr ) const;
void clearShapeBuffer( GEOM::GEOM_Object_ptr );
bool isPreview;
SALOME_ListIO mySelected;
SUIT_Desktop* myDesktop;
+ bool myIsApplyAndClose;
+ bool myIsOptimizedBrowsing;
};
QList< GEOM::GEOM_Object_var > objsForDisplay;
-
+ QStringList anEntryList;
+
// iterate through all selected files
SUIT_MessageBox::StandardButton igesAnswer = SUIT_MessageBox::NoButton;
GEOMBase::GetDefaultName( SUIT_Tools::file( fileName, /*withExten=*/true ) );
SALOMEDS::Study_var aDSStudy = GeometryGUI::ClientStudyToStudy( aStudy );
- GeometryGUI::GetGeomGen()->PublishInStudy( aDSStudy,
- SALOMEDS::SObject::_nil(),
- anObj,
- aPublishObjName.toLatin1().constData() );
+ SALOMEDS::SObject_var aSO = GeometryGUI::GetGeomGen()->PublishInStudy( aDSStudy,
+ SALOMEDS::SObject::_nil(),
+ anObj,
+ aPublishObjName.toLatin1().constData() );
+ if( ( !aSO->_is_nil() ) )
+ anEntryList.append( aSO->GetID() );
objsForDisplay.append( anObj );
// update object browser
getGeometryGUI()->updateObjBrowser( true );
+ // browse published objects
+ app->browseObjects( anEntryList );
+
// display imported model (if only one file is selected)
if ( objsForDisplay.count() == 1 )
GEOM_Displayer( stud ).Display( objsForDisplay[0].in() );
//=================================================================================
void GenerationGUI_FillingDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if ( ClickOnApply() )
ClickOnCancel();
}
//=================================================================================
void GenerationGUI_PipeDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
//=================================================================================
void GenerationGUI_PrismDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
//=================================================================================
void GenerationGUI_RevolDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
//=================================================================================
void GroupGUI_GroupDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
//=================================================================================
void OperationGUI_ArchimedeDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if ( ClickOnApply() )
ClickOnCancel();
}
//=================================================================================
void OperationGUI_ChamferDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
//=================================================================================
void OperationGUI_ClippingDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if ( ClickOnApply() )
ClickOnCancel();
}
//=================================================================================
void OperationGUI_Fillet1d2dDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
//=================================================================================
void OperationGUI_FilletDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
//=================================================================================
void OperationGUI_GetShapesOnShapeDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
//=================================================================================
void OperationGUI_GetSharedShapesDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
//=================================================================================
void OperationGUI_PartitionDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if ( ClickOnApply() )
ClickOnCancel();
}
//=================================================================================
void PrimitiveGUI_BoxDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
//=================================================================================
void PrimitiveGUI_ConeDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
//=================================================================================
void PrimitiveGUI_CylinderDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
//=================================================================================
void PrimitiveGUI_DiskDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
//=================================================================================
void PrimitiveGUI_FaceDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if ( ClickOnApply() )
ClickOnCancel();
}
//=================================================================================
void PrimitiveGUI_SphereDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if ( ClickOnApply() )
ClickOnCancel();
}
//=================================================================================
void PrimitiveGUI_TorusDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
//=================================================================================
void RepairGUI_ChangeOrientationDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if ( ClickOnApply() )
ClickOnCancel();
}
//=================================================================================
void RepairGUI_CloseContourDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
//=================================================================================
void RepairGUI_DivideEdgeDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if ( ClickOnApply() )
ClickOnCancel();
}
//=================================================================================
void RepairGUI_GlueDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if ( ClickOnApply() )
ClickOnCancel();
}
//=================================================================================
void RepairGUI_LimitToleranceDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
//=================================================================================
void RepairGUI_RemoveExtraEdgesDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if ( ClickOnApply() )
ClickOnCancel();
}
//=================================================================================
void RepairGUI_RemoveHolesDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
//=================================================================================
void RepairGUI_RemoveIntWiresDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
//=================================================================================
void RepairGUI_SewingDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if ( ClickOnApply() )
ClickOnCancel();
}
//=================================================================================
void RepairGUI_ShapeProcessDlg::onOk()
{
+ setIsApplyAndClose( true );
if ( onApply() )
ClickOnCancel();
}
//=================================================================================
void RepairGUI_SuppressFacesDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
//=================================================================================
void TransformationGUI_MirrorDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
initName();
- myObjects.clear();
- myEditCurrentArgument = GroupPoints->LineEdit1;
- myEditCurrentArgument->setText("");
- myGeomGUI->getApp()->selectionMgr()->clearSelected();
-
// activate selection and connect selection manager
ConstructorsClicked(getConstructorId());
+ SelectionIntoArgument();
+
return true;
}
//=================================================================================
void TransformationGUI_MultiRotationDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
//=================================================================================
void TransformationGUI_MultiTranslationDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
//=================================================================================
void TransformationGUI_OffsetDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if ( ClickOnApply() )
ClickOnCancel();
}
//=================================================================================
void TransformationGUI_PositionDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
initName();
- myObjects.clear();
- myEditCurrentArgument = Group1->LineEdit1;
- myEditCurrentArgument->setText("");
- myGeomGUI->getApp()->selectionMgr()->clearSelected();
-
// activate selection and connect selection manager
ConstructorsClicked(getConstructorId());
+ SelectionIntoArgument();
+
return true;
}
//=================================================================================
void TransformationGUI_RotationDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
initName();
- myObjects.clear();
- myEditCurrentArgument = GroupPoints->LineEdit1;
- myEditCurrentArgument->setText("");
- myGeomGUI->getApp()->selectionMgr()->clearSelected();
-
// activate selection and connect selection manager
ConstructorsClicked(getConstructorId());
+ SelectionIntoArgument();
+
return true;
}
//=================================================================================
void TransformationGUI_ScaleDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
initName(tr("GEOM_SCALE"));
- myObjects.clear();
- myEditCurrentArgument = LineEdit1;
- myEditCurrentArgument->setText("");
- myGeomGUI->getApp()->selectionMgr()->clearSelected();
-
// activate selection and connect selection manager
ConstructorsClicked(getConstructorId());
+ SelectionIntoArgument();
+
return true;
}
//=================================================================================
void TransformationGUI_TranslationDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
initName();
- myObjects.clear();
- myEditCurrentArgument = GroupPoints->LineEdit1;
- myEditCurrentArgument->setText("");
- myGeomGUI->getApp()->selectionMgr()->clearSelected();
-
// activate selection and connect selection manager
ConstructorsClicked(getConstructorId());
+ SelectionIntoArgument();
+
return true;
}