class ColoredPrs3d_i;
class CutLines_i;
- //---------------------------------------------------------------
- inline
- void
- RestoreSelection(VisuGUI* theModule)
- {
- SALOME_ListIO aList;
- theModule->selectedObjects(aList);
- LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(theModule);
- aSelectionMgr->setSelectedObjects(aList);
- }
-
//---------------------------------------------------------------
inline
int
aDlg,
false ); // in edition mode
QApplication::restoreOverrideCursor();
-
- RestoreSelection(theModule);
-
}
+ RestoreSelection(theModule, thePrs3d);
delete aDlg;
}
}
//---------------------------------------------------------------
template<class TPrs3d_i, class TViewer, class TDlg, int IsDlgModal>
inline
- bool
+ TPrs3d_i*
CreateAndEditPrs3d(VisuGUI* theModule,
_PTR(SObject) theTimeStamp,
- const Handle(SALOME_InteractiveObject)& theIO,
ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode)
{
Storable::TRestoringMap aMap = getMapOfValue(theTimeStamp);
bool isExist;
QString aType = Storable::FindValue(aMap,"myType",&isExist);
if (!isExist || aType.toInt() != TTIMESTAMP )
- return false;
+ return NULL;
QString aMeshName = Storable::FindValue(aMap,"myMeshName",&isExist).latin1();
QString anEntity = Storable::FindValue(aMap,"myEntityId",&isExist).latin1();
QApplication::restoreOverrideCursor();
delete aDlg;
} else {
- DeletePrs3d(theModule,aPrs3d,theIO);
+ DeletePrs3d(theModule,aPrs3d);
QApplication::restoreOverrideCursor();
delete aDlg;
- return false;
+ return NULL;
}
}
}
AddScalarBarPosition(theModule, aViewWindow, aPrs3d, aPos);
}
- return true;
+ return aPrs3d;
}
- return false;
+ return NULL;
}
void
CreatePrs3dInViewer(VisuGUI* theModule,
_PTR(SObject) theTimeStampSObj,
- const Handle(SALOME_InteractiveObject)& theIO,
ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode)
{
// Create new TViewWindow instance, if it does not exist.
if (!GetViewWindow<TViewer>(theModule))
return;
- if (!CreateAndEditPrs3d<TPrs3d_i,TViewer,TDlg,IsDlgModal>(theModule,theTimeStampSObj,theIO,thePublishInStudyMode))
- return;
+ TPrs3d_i* aPrs3d = CreateAndEditPrs3d<TPrs3d_i,TViewer,TDlg,IsDlgModal>
+ (theModule,theTimeStampSObj,thePublishInStudyMode);
- RestoreSelection(theModule);
+ RestoreSelection(theModule, aPrs3d);
theModule->application()->putInfo(QObject::tr("INF_DONE"));
}
if(aPublishInStudyMode == VISU::ColoredPrs3d_i::EPublishIndependently){
CreatePrs3dInViewer<TPrs3d_i,VVTK_Viewer,TDlg,0>
- (theModule,aTimeStampSObj,anIO,aPublishInStudyMode);
+ (theModule,aTimeStampSObj,aPublishInStudyMode);
return;
}else{
if(theDesiredViewerType.isNull()){
if (SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager())
if (aViewManager->getType() == VVTK_Viewer::Type()){
CreatePrs3dInViewer<TPrs3d_i,VVTK_Viewer,TDlg,IsDlgModal>
- (theModule,aTimeStampSObj,anIO,aPublishInStudyMode);
+ (theModule,aTimeStampSObj,aPublishInStudyMode);
return;
}
CreatePrs3dInViewer<TPrs3d_i,SVTK_Viewer,TDlg,IsDlgModal>
- (theModule,aTimeStampSObj,anIO,aPublishInStudyMode);
+ (theModule,aTimeStampSObj,aPublishInStudyMode);
}else{
if(theDesiredViewerType == VVTK_Viewer::Type())
CreatePrs3dInViewer<TPrs3d_i,VVTK_Viewer,TDlg,IsDlgModal>
- (theModule,aTimeStampSObj,anIO,aPublishInStudyMode);
+ (theModule,aTimeStampSObj,aPublishInStudyMode);
else
CreatePrs3dInViewer<TPrs3d_i,SVTK_Viewer,TDlg,IsDlgModal>
- (theModule,aTimeStampSObj,anIO,aPublishInStudyMode);
+ (theModule,aTimeStampSObj,aPublishInStudyMode);
}
}
}
theSelectionMgr->setSelectedObjects(aNewListIO);
}
+ /*!
+ * Restores selection after presentation creating and editing
+ */
+ void
+ RestoreSelection(VisuGUI* theModule, VISU::Prs3d_i* thePrs3d)
+ {
+ SALOME_ListIO aList;
+ theModule->selectedObjects(aList);
+
+ if( thePrs3d )
+ {
+ Handle(SALOME_InteractiveObject) anIO = thePrs3d->GetIO();
+ aList.Append(anIO);
+ }
+
+ LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(theModule);
+ aSelectionMgr->setSelectedObjects(aList);
+ }
+
/*!
* \brief Check, if "Delete" popup-menu can be put on current selection
*
void
DeletePrs3d(VisuGUI* theModule,
- VISU::Prs3d_i* thePrs,
- const Handle(SALOME_InteractiveObject)& theIO)
+ VISU::Prs3d_i* thePrs)
{
if (!thePrs)
return;
bool
CheckTimeStamp(const SalomeApp_Module* theModule,
_PTR(SObject)& theSObject,
- const Handle(SALOME_InteractiveObject)& theIO,
+ Handle(SALOME_InteractiveObject)& theIO,
ColoredPrs3d_i::EPublishInStudyMode& thePublishInStudyMode)
{
- Handle(SALOME_InteractiveObject) anIO = theIO;
- CORBA::Object_var anObject = GetSelectedObj(theModule, &anIO);
- if (!anIO.IsNull() && anIO->hasEntry()){
+ CORBA::Object_var anObject = GetSelectedObj(theModule, &theIO);
+ if (!theIO.IsNull() && theIO->hasEntry()){
_PTR(Study) aStudy = GetCStudy(GetAppStudy(theModule));
- theSObject = aStudy->FindObjectID(anIO->getEntry());
+ theSObject = aStudy->FindObjectID(theIO->getEntry());
QString aValue = getValue(theSObject,"myType");
if (aValue.toInt() == int(VISU::TTIMESTAMP)){
thePublishInStudyMode = ColoredPrs3d_i::EPublishUnderTimeStamp;
void Remove(LightApp_SelectionMgr* theSelectionMgr,
const Handle(SALOME_InteractiveObject)& theIO);
+ void RestoreSelection(VisuGUI* theModule, VISU::Prs3d_i* thePrs3d);
+
bool IsRemovableSelected(const SalomeApp_Module* theModule);
void DeleteSObject(VisuGUI* theModule,
_PTR(Study) theStudy,
_PTR(SObject) theSObject);
void DeletePrs3d(VisuGUI* theModule,
- VISU::Prs3d_i* thePrs,
- const Handle(SALOME_InteractiveObject)& theIO);
+ VISU::Prs3d_i* thePrs);
// Presentation management
void ChangeRepresentation (const SalomeApp_Module* theModule,
// SObject type
bool CheckTimeStamp(const SalomeApp_Module* theModule,
_PTR(SObject)& theSObject,
- const Handle(SALOME_InteractiveObject)& theIO,
+ Handle(SALOME_InteractiveObject)& theIO,
ColoredPrs3d_i::EPublishInStudyMode& thePublishInStudyMode);
VISU::Result_i* CheckResult(const SalomeApp_Module* theModule,
_PTR(SObject) theSource,