* operations, where only the first argument has to be considered.
* If theObject has only one argument shape, this flag is automatically
* considered as True, not regarding really passed value.
+ * \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
+ * and prefix "from_subshapes_of_" to names of partially restored subshapes.
* \return list of published sub-shapes
*/
ListOfGO RestoreSubShapesO (in SALOMEDS::Study theStudy,
in GEOM_Object theObject,
in ListOfGO theArgs,
in find_shape_method theFindMethod,
- in boolean theInheritFirstArg);
+ in boolean theInheritFirstArg,
+ in boolean theAddPrefix);
/*!
* Publish sub-shapes, standing for arguments and sub-shapes of arguments
in SALOMEDS::SObject theSObject,
in ListOfGO theArgs,
in find_shape_method theFindMethod,
- in boolean theInheritFirstArg);
+ in boolean theInheritFirstArg,
+ in boolean theAddPrefix);
/*!
* Methods to access interfaces for objects creation and transformation
// empty list of arguments means that all arguments should be restored
getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_GetInPlace, // ? GEOM::FSM_GetSame
- /*theInheritFirstArg=*/myOperation == BooleanGUI::CUT); // ? false
+ /*theInheritFirstArg=*/myOperation == BooleanGUI::CUT,
+ mainFrame()->CheckBoxAddPrefix->isChecked()); // ? false
}
}
// empty list of arguments means that all arguments should be restored
getGeomEngine()->RestoreSubShapesSO( theStudy, theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_GetInPlace, // ? GEOM::FSM_GetSame
- /*theInheritFirstArg=*/false );
+ /*theInheritFirstArg=*/false,
+ mainFrame()->CheckBoxAddPrefix->isChecked() );
}
}
<property name="title" >
<string/>
</property>
- <layout class="QHBoxLayout" >
+ <layout class="QVBoxLayout" >
<item>
<widget class="QCheckBox" name="CheckBoxRestoreSS" >
<property name="text" >
</property>
</widget>
</item>
+ <item>
+ <widget class="QCheckBox" name="CheckBoxAddPrefix" >
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
</widget>
<tabstops>
<tabstop>CheckBoxRestoreSS</tabstop>
+ <tabstop>CheckBoxAddPrefix</tabstop>
<tabstop>buttonOk</tabstop>
<tabstop>buttonApply</tabstop>
<tabstop>buttonCancel</tabstop>
myMainFrame->GroupBoxPublish->setTitle( tr( "GEOM_PUBLISH_RESULT_GRP" ) );
myMainFrame->CheckBoxRestoreSS->setText( tr( "GEOM_RESTORE_SUB_SHAPES" ) );
+ myMainFrame->CheckBoxAddPrefix->setText( tr( "GEOM_RSS_ADD_FREFIX" ) );
buttonCancel()->setText( tr( "GEOM_BUT_CLOSE" ) );
buttonOk()->setText( tr( "GEOM_BUT_APPLY_AND_CLOSE" ) );
myMainFrame->RadioButton5->hide();
myMainFrame->CheckBoxRestoreSS->setChecked( false );
+ myMainFrame->CheckBoxAddPrefix->setChecked( true );
myMainFrame->GroupBoxPublish->hide();
}
<source>GEOM_RESTORE_SUB_SHAPES</source>
<translation>Set presentation parameters and subshapes from arguments</translation>
</message>
+ <message>
+ <source>GEOM_RSS_ADD_FREFIX</source>
+ <translation>Add prefix to names of restored subshapes</translation>
+ </message>
<message>
<source>GEOM_ALL_IMPORT_FILES</source>
<translation>All supported formats ( %1 )</translation>
GEOM::GEOM_Object_ptr theObject,
const GEOM::ListOfGO& theArgs,
GEOM::find_shape_method theFindMethod,
- CORBA::Boolean theInheritFirstArg)
+ CORBA::Boolean theInheritFirstArg,
+ CORBA::Boolean theAddPrefix)
{
GEOM::ListOfGO_var aParts = new GEOM::ListOfGO;
if (CORBA::is_nil(theStudy) || CORBA::is_nil(theObject))
// if (CORBA::is_nil(aSO))
// return aParts._retn();
- aParts = RestoreSubShapes(theStudy, theObject, aSO, theArgs, theFindMethod, theInheritFirstArg);
+ aParts = RestoreSubShapes(theStudy, theObject, aSO, theArgs,
+ theFindMethod, theInheritFirstArg, theAddPrefix);
aSO->Destroy();
return aParts._retn();
}
// purpose : Publish sub-shapes, standing for arguments and sub-shapes of arguments.
// To be used from GUI and from geompy.addToStudy
//============================================================================
-GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesSO (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject,
- const GEOM::ListOfGO& theArgs,
- GEOM::find_shape_method theFindMethod,
- CORBA::Boolean theInheritFirstArg)
+GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesSO (SALOMEDS::Study_ptr theStudy,
+ SALOMEDS::SObject_ptr theSObject,
+ const GEOM::ListOfGO& theArgs,
+ GEOM::find_shape_method theFindMethod,
+ CORBA::Boolean theInheritFirstArg,
+ CORBA::Boolean theAddPrefix)
{
GEOM::ListOfGO_var aParts = new GEOM::ListOfGO;
if (CORBA::is_nil(theStudy) || CORBA::is_nil(theSObject))
if (CORBA::is_nil(anO))
return aParts._retn();
- aParts = RestoreSubShapes(theStudy, anO, theSObject, theArgs, theFindMethod, theInheritFirstArg);
+ aParts = RestoreSubShapes(theStudy, anO, theSObject, theArgs,
+ theFindMethod, theInheritFirstArg, theAddPrefix);
return aParts._retn();
}
SALOMEDS::SObject_ptr theSObject,
const GEOM::ListOfGO& theArgs,
GEOM::find_shape_method theFindMethod,
- CORBA::Boolean theInheritFirstArg)
+ CORBA::Boolean theInheritFirstArg,
+ CORBA::Boolean theAddPrefix)
{
GEOM::ListOfGO_var aParts = new GEOM::ListOfGO;
//PTv, IMP 0020001, The salome object <theSObject>
CORBA::String_var anIOR = _orb->object_to_string(aList[0]);
SALOMEDS::SObject_var anArgSO = theStudy->FindObjectIOR(anIOR.in());
- aParts = RestoreSubShapesOneLevel(theStudy, anArgSO, theSObject, theObject, theFindMethod);
+ aParts = RestoreSubShapesOneLevel(theStudy, anArgSO, theSObject, theObject, theFindMethod, theAddPrefix);
// set the color of the transformed shape to the color of initial shape
theObject->SetColor(aList[0]->GetColor());
// Publish the sub-shape
SALOMEDS::SObject_var aSubSO;
if (!CORBA::is_nil(theSObject)) {
- TCollection_AsciiString aSubName ("from_");
+ TCollection_AsciiString aSubName;
+ if (theAddPrefix) {
+ aSubName = "from_";
+ }
aSubName += anArgName;
aSubSO = aStudyBuilder->NewObject(theSObject);
aSubSO = PublishInStudy(theStudy, aSubSO, aSubO, aSubName.ToCString());
GEOM::ListOfGO_var aSubParts;
if (theFindMethod == GEOM::FSM_GetInPlaceByHistory)
// pass theObject, because only it has the history
- aSubParts = RestoreSubShapesOneLevel(theStudy, anArgSO, aSubSO, theObject, theFindMethod);
+ aSubParts = RestoreSubShapesOneLevel(theStudy, anArgSO, aSubSO,
+ theObject, theFindMethod, theAddPrefix);
else
- aSubParts = RestoreSubShapesOneLevel(theStudy, anArgSO, aSubSO, aSubO, theFindMethod);
+ aSubParts = RestoreSubShapesOneLevel(theStudy, anArgSO, aSubSO,
+ aSubO, theFindMethod, theAddPrefix);
// add to parts list
addToListOfGO( aSubParts, aParts );
}
// Restore published sub-shapes of the argument
GEOM::ListOfGO_var aSubParts =
- RestoreSubShapesOneLevel(theStudy, anArgSO, aSubSO, theObject, theFindMethod);
+ RestoreSubShapesOneLevel(theStudy, anArgSO, aSubSO,
+ theObject, theFindMethod, theAddPrefix);
// add to parts list
addToListOfGO( aSubParts, aParts );
}
if (!CORBA::is_nil(aSubO) && !CORBA::is_nil(aSubSO)) {
// Publish the sub-shape
- TCollection_AsciiString aSubName ("from_parts_of_");
+ TCollection_AsciiString aSubName;
+ if (theAddPrefix) {
+ aSubName = "from_parts_of_";
+ }
aSubName += anArgName;
aSubSO = PublishInStudy(theStudy, aSubSO, aSubO, aSubName.ToCString());
// Restore color
}
} // process arguments
}
- set<string> anObjEntryMap;
- GEOM::ListOfGO_var aResParts = new GEOM::ListOfGO;
- int nbRes = 0;
- int nb = aParts->length();
- aResParts->length(nb);
- if (nb > 0)
- {
+ set<string> anObjEntryMap;
+ GEOM::ListOfGO_var aResParts = new GEOM::ListOfGO;
+ int nbRes = 0;
+ int nb = aParts->length();
+ aResParts->length(nb);
+ if (nb > 0)
+ {
Handle(GEOM_Object) aMainObj = _impl->GetObject(theObject->GetStudyID(), theObject->GetEntry());
Handle(GEOM_Function) aFunction = aMainObj->GetLastFunction();
GEOM::TPythonDump pd (aFunction, true);
default:
pd << "FSM_GetInPlaceByHistory"; break;
}
- pd << ", " << theInheritFirstArg << ")";
+ pd << ", " << theInheritFirstArg << ", " << theAddPrefix << ")";
}
aResParts->length(nbRes);
return aResParts._retn();
SALOMEDS::SObject_ptr theOldSO,
SALOMEDS::SObject_ptr theNewSO,
GEOM::GEOM_Object_ptr theNewO,
- GEOM::find_shape_method theFindMethod)
+ GEOM::find_shape_method theFindMethod,
+ CORBA::Boolean theAddPrefix)
{
int i = 0;
GEOM::ListOfGO_var aParts = new GEOM::ListOfGO;
SALOMEDS::SObject_var aNewSubSO;
if (!CORBA::is_nil(theNewSO)) {
// Publish the sub-shape
- TCollection_AsciiString aSubName ("from_");
+ TCollection_AsciiString aSubName;
+ if (theAddPrefix) {
+ aSubName = "from_";
+ }
aSubName += anArgName;
aNewSubSO = aStudyBuilder->NewObject(theNewSO);
aNewSubSO = PublishInStudy(theStudy, aNewSubSO, aNewSubO, aSubName.ToCString());
GEOM::ListOfGO_var aSubParts;
if (theFindMethod == GEOM::FSM_GetInPlaceByHistory)
// pass the main shape as Object, because only it has the history
- aSubParts = RestoreSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO, theNewO, theFindMethod);
+ aSubParts = RestoreSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO,
+ theNewO, theFindMethod, theAddPrefix);
else
- aSubParts = RestoreSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO, aNewSubO, theFindMethod);
+ aSubParts = RestoreSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO,
+ aNewSubO, theFindMethod, theAddPrefix);
// add to parts list
addToListOfGO( aSubParts, aNewParts );
}
// Restore published sub-shapes of the argument
GEOM::ListOfGO_var aSubParts =
- RestoreSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO, theNewO, theFindMethod);
+ RestoreSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO,
+ theNewO, theFindMethod, theAddPrefix);
// add to parts list
addToListOfGO( aSubParts, aNewParts );
// Publish the sub-shape
if (!CORBA::is_nil(aNewSubSO)) {
- TCollection_AsciiString aSubName = "from_parts_of_";
+ TCollection_AsciiString aSubName;
+ if (theAddPrefix) {
+ aSubName = "from_parts_of_";
+ }
aSubName += anArgName;
aNewSubSO = PublishInStudy(theStudy, aNewSubSO, aNewSubO, aSubName.ToCString());
// Restore color
GEOM::GEOM_Object_ptr theObject,
const GEOM::ListOfGO& theArgs,
GEOM::find_shape_method theFindMethod,
- CORBA::Boolean theInheritFirstArg);
+ CORBA::Boolean theInheritFirstArg,
+ CORBA::Boolean theAddPrefix);
/*! \brief Publish sub-shapes, standing for arguments and sub-shapes of arguments.
* To be used from GUI and from geompy.addToStudy
SALOMEDS::SObject_ptr theSObject,
const GEOM::ListOfGO& theArgs,
GEOM::find_shape_method theFindMethod,
- CORBA::Boolean theInheritFirstArg);
+ CORBA::Boolean theInheritFirstArg,
+ CORBA::Boolean theAddPrefix);
//-----------------------------------------------------------------------//
// Transaction methods //
SALOMEDS::SObject_ptr theOldSO,
SALOMEDS::SObject_ptr theNewSO,
GEOM::GEOM_Object_ptr theNewO,
- GEOM::find_shape_method theFindMethod);
+ GEOM::find_shape_method theFindMethod,
+ CORBA::Boolean theAddPrefix);
GEOM::ListOfGO* RestoreSubShapes (SALOMEDS::Study_ptr theStudy,
GEOM::GEOM_Object_ptr theObject,
SALOMEDS::SObject_ptr theSObject,
const GEOM::ListOfGO& theArgs,
GEOM::find_shape_method theFindMethod,
- CORBA::Boolean theInheritFirstArg);
+ CORBA::Boolean theInheritFirstArg,
+ CORBA::Boolean theAddPrefix);
// auxilary for PublishNamedShapesInStudy
void CreateAndPublishGroup(SALOMEDS::Study_ptr theStudy,
# operations, where only the first argument has to be considered.
# If theObject has only one argument shape, this flag is automatically
# considered as True, not regarding really passed value.
+ # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
+ # and prefix "from_subshapes_of_" to names of partially restored subshapes.
# \return list of published sub-shapes
#
# @ref tui_restore_prs_params "Example"
- def RestoreSubShapes (self, theObject, theArgs=[],
- theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
+ def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
+ theInheritFirstArg=False, theAddPrefix=True):
# Example: see GEOM_TestAll.py
return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
- theFindMethod, theInheritFirstArg)
+ theFindMethod, theInheritFirstArg, theAddPrefix)
# end of l3_restore_ss
## @}
// empty list of arguments means that all arguments should be restored
getGeomEngine()->RestoreSubShapesSO( theStudy, theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_GetInPlaceByHistory,
- /*theInheritFirstArg=*/myListShapes.length() == 1 ); // ? false
+ /*theInheritFirstArg=*/myListShapes.length() == 1,
+ mainFrame()->CheckBoxAddPrefix->isChecked() ); // ? false
}
}
// empty list of arguments means that all arguments should be restored
getGeomEngine()->RestoreSubShapesSO( theStudy, theSObject, GEOM::ListOfGO(),
- aFindMethod, /*theInheritFirstArg=*/true );
+ aFindMethod, /*theInheritFirstArg=*/true,
+ mainFrame()->CheckBoxAddPrefix->isChecked() );
}
}
// empty list of arguments means that all arguments should be restored
getGeomEngine()->RestoreSubShapesSO( theStudy, theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_GetInPlace, // ? GetInPlaceByHistory
- /*theInheritFirstArg=*/true );
+ /*theInheritFirstArg=*/true,
+ mainFrame()->CheckBoxAddPrefix->isChecked() );
}
}
// empty list of arguments means that all arguments should be restored
getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_GetInPlace,
- /*theInheritFirstArg=*/true);
+ /*theInheritFirstArg=*/true,
+ mainFrame()->CheckBoxAddPrefix->isChecked());
}
}
// empty list of arguments means that all arguments should be restored
getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_Transformed,
- /*theInheritFirstArg=*/true);
+ /*theInheritFirstArg=*/true,
+ mainFrame()->CheckBoxAddPrefix->isChecked());
}
}
// empty list of arguments means that all arguments should be restored
getGeomEngine()->RestoreSubShapesSO( theStudy, theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_Transformed,
- /*theInheritFirstArg=*/true );
+ /*theInheritFirstArg=*/true,
+ mainFrame()->CheckBoxAddPrefix->isChecked() );
}
}
// empty list of arguments means that all arguments should be restored
getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_Transformed,
- /*theInheritFirstArg=*/true);
+ /*theInheritFirstArg=*/true,
+ mainFrame()->CheckBoxAddPrefix->isChecked());
}
}
anArgs[0] = myCurrObject;
getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs,
/*theFindMethod=*/GEOM::FSM_Transformed,
- /*theInheritFirstArg=*/true);
+ /*theInheritFirstArg=*/true,
+ mainFrame()->CheckBoxAddPrefix->isChecked());
}
}
// empty list of arguments means that all arguments should be restored
getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_Transformed,
- /*theInheritFirstArg=*/true);
+ /*theInheritFirstArg=*/true,
+ mainFrame()->CheckBoxAddPrefix->isChecked());
}
}
anArgs[0] = myCurrObject;
getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs,
/*theFindMethod=*/GEOM::FSM_Transformed,
- /*theInheritFirstArg=*/true);
+ /*theInheritFirstArg=*/true,
+ mainFrame()->CheckBoxAddPrefix->isChecked());
}
}