template<class TPrs3d_i>
inline
TPrs3d_i*
- CreatePrs3d(VisuGUI* theModule,
- _PTR(SObject) theTimeStamp,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- int theTimeId,
- ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode)
+ CreatePrs3dFromFactory(VisuGUI* theModule,
+ _PTR(SObject) theTimeStamp,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeId,
+ ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode)
{
VISU::Result_var aResult;
if (CheckResult(theModule,theTimeStamp,aResult)){
template<class TPrs3d_i, class TViewer, class TDlg, int IsDlgModal>
inline
bool
- CreatePrs3d(VisuGUI* theModule,
- _PTR(SObject) theTimeStamp,
- const Handle(SALOME_InteractiveObject)& theIO,
- ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode)
+ CreateAndEditPrs3d(VisuGUI* theModule,
+ _PTR(SObject) theTimeStamp,
+ const Handle(SALOME_InteractiveObject)& theIO,
+ ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode)
{
Storable::TRestoringMap aMap = getMapOfValue(theTimeStamp);
QApplication::setOverrideCursor(Qt::waitCursor);
TPrs3d_i* aPrs3d =
- CreatePrs3d<TPrs3d_i>(theModule,
- theTimeStamp,
- aMeshName.latin1(),
- (Entity)anEntity.toInt(),
- aFieldName.latin1(),
- aTimeStampId.toInt(),
- thePublishInStudyMode);
-
+ CreatePrs3dFromFactory<TPrs3d_i>(theModule,
+ theTimeStamp,
+ aMeshName.latin1(),
+ (Entity)anEntity.toInt(),
+ aFieldName.latin1(),
+ aTimeStampId.toInt(),
+ thePublishInStudyMode);
+
QApplication::restoreOverrideCursor();
if (aPrs3d) {
SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
template<class TPrs3d_i, class TViewer, class TDlg, int IsDlgModal>
inline
void
- CreatePrs3d(VisuGUI* theModule)
+ CreatePrs3dInViewer(VisuGUI* theModule,
+ _PTR(SObject) theTimeStampSObj,
+ const Handle(SALOME_InteractiveObject)& theIO,
+ ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode)
{
- if (CheckLock(GetCStudy(GetAppStudy(theModule)),GetDesktop(theModule)))
- return;
-
- _PTR(SObject) aTimeStampSObj;
- Handle(SALOME_InteractiveObject) anIO;
- ColoredPrs3d_i::EPublishInStudyMode aPublishInStudyMode;
- if (!CheckTimeStamp(theModule,aTimeStampSObj,anIO,aPublishInStudyMode))
- return;
-
// Create new TViewWindow instance, if it does not exist.
typedef typename TViewer::TViewWindow TViewWindow;
if (!GetViewWindow<TViewer>(theModule))
return;
- if (!CreatePrs3d<TPrs3d_i,TViewer,TDlg,IsDlgModal>(theModule,aTimeStampSObj,anIO,aPublishInStudyMode))
+ if (!CreateAndEditPrs3d<TPrs3d_i,TViewer,TDlg,IsDlgModal>(theModule,theTimeStampSObj,theIO,thePublishInStudyMode))
return;
theModule->application()->putInfo(QObject::tr("INF_DONE"));
template<class TPrs3d_i, class TDlg, int IsDlgModal>
inline
void
- CreatePrs3d(VisuGUI* theModule)
+ CreatePrs3d(VisuGUI* theModule,
+ const QString& theDesiredViewerType = QString())
{
- if (SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager())
- if (aViewManager->getType() == VVTK_Viewer::Type())
- return CreatePrs3d<TPrs3d_i,VVTK_Viewer,TDlg,IsDlgModal>(theModule);
+ if (CheckLock(GetCStudy(GetAppStudy(theModule)),GetDesktop(theModule)))
+ return;
+
+ _PTR(SObject) aTimeStampSObj;
+ Handle(SALOME_InteractiveObject) anIO;
+ ColoredPrs3d_i::EPublishInStudyMode aPublishInStudyMode;
+ if (!CheckTimeStamp(theModule,aTimeStampSObj,anIO,aPublishInStudyMode))
+ return;
- CreatePrs3d<TPrs3d_i,SVTK_Viewer,TDlg,IsDlgModal>(theModule);
+ if(aPublishInStudyMode == VISU::ColoredPrs3d_i::EPublishIndependently){
+ CreatePrs3dInViewer<TPrs3d_i,VVTK_Viewer,TDlg,IsDlgModal>
+ (theModule,aTimeStampSObj,anIO,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);
+ return;
+ }
+ CreatePrs3dInViewer<TPrs3d_i,SVTK_Viewer,TDlg,IsDlgModal>
+ (theModule,aTimeStampSObj,anIO,aPublishInStudyMode);
+ }else{
+ if(theDesiredViewerType == VVTK_Viewer::Type())
+ CreatePrs3dInViewer<TPrs3d_i,VVTK_Viewer,TDlg,IsDlgModal>
+ (theModule,aTimeStampSObj,anIO,aPublishInStudyMode);
+ else
+ CreatePrs3dInViewer<TPrs3d_i,VVTK_Viewer,TDlg,IsDlgModal>
+ (theModule,aTimeStampSObj,anIO,aPublishInStudyMode);
+ }
+ }
}
}