From: apo Date: Fri, 3 Nov 2006 11:49:39 +0000 (+0000) Subject: To publish the new kind of presentations in the 'Points View' on creation X-Git-Tag: WP1_2_3_06-10-2006~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f1b2915e2e92094b334decee98707f0639faa69a;p=modules%2Fvisu.git To publish the new kind of presentations in the 'Points View' on creation --- diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 1dae21e5..7805e73f 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -3286,13 +3286,14 @@ void VisuGUI::OnPlot3dFromCutPlane() } GetResourceMgr()->setValue("VISU", "scalar_bar_position_num", aPos); - VISU::Plot3D_i* aPrs3d = CreatePrs3d(this, - aTimeStampSObj, - aMeshName.latin1(), - (Entity)anEntity.toInt(), - aFieldName.latin1(), - aTimeStampId.toInt(), - ColoredPrs3d_i::EPublishUnderTimeStamp); + VISU::Plot3D_i* aPrs3d = + CreatePrs3dFromFactory(this, + aTimeStampSObj, + aMeshName.latin1(), + (Entity)anEntity.toInt(), + aFieldName.latin1(), + aTimeStampId.toInt(), + ColoredPrs3d_i::EPublishUnderTimeStamp); if (aPrs3d) { SUIT_ResourceMgr* aResourceMgr = GetResourceMgr(); int aValue = aResourceMgr->integerValue("VISU","BuildDefaultPrs3d",0); diff --git a/src/VISUGUI/VisuGUI_Module.cxx b/src/VISUGUI/VisuGUI_Module.cxx index 338267c0..4dbc5fd7 100644 --- a/src/VISUGUI/VisuGUI_Module.cxx +++ b/src/VISUGUI/VisuGUI_Module.cxx @@ -934,7 +934,7 @@ VisuGUI_Module:: OnCreateGaussPoints() { double initialTime = vtkTimerLog::GetCPUTime(); - CreatePrs3d(this); + CreatePrs3d(this, VVTK_Viewer::Type()); INFOS( "VisuGUI_Module::OnCreateGaussPoints() : Gauss Points created in " << vtkTimerLog::GetCPUTime() - initialTime << " seconds" ); } diff --git a/src/VISUGUI/VisuGUI_Prs3dTools.h b/src/VISUGUI/VisuGUI_Prs3dTools.h index 3e245ca9..dc4161d5 100644 --- a/src/VISUGUI/VisuGUI_Prs3dTools.h +++ b/src/VISUGUI/VisuGUI_Prs3dTools.h @@ -111,13 +111,13 @@ namespace VISU template 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)){ @@ -141,10 +141,10 @@ namespace VISU template 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); @@ -169,14 +169,14 @@ namespace VISU QApplication::setOverrideCursor(Qt::waitCursor); TPrs3d_i* aPrs3d = - CreatePrs3d(theModule, - theTimeStamp, - aMeshName.latin1(), - (Entity)anEntity.toInt(), - aFieldName.latin1(), - aTimeStampId.toInt(), - thePublishInStudyMode); - + CreatePrs3dFromFactory(theModule, + theTimeStamp, + aMeshName.latin1(), + (Entity)anEntity.toInt(), + aFieldName.latin1(), + aTimeStampId.toInt(), + thePublishInStudyMode); + QApplication::restoreOverrideCursor(); if (aPrs3d) { SUIT_ResourceMgr* aResourceMgr = GetResourceMgr(); @@ -223,23 +223,17 @@ namespace VISU template 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(theModule)) return; - if (!CreatePrs3d(theModule,aTimeStampSObj,anIO,aPublishInStudyMode)) + if (!CreateAndEditPrs3d(theModule,theTimeStampSObj,theIO,thePublishInStudyMode)) return; theModule->application()->putInfo(QObject::tr("INF_DONE")); @@ -248,13 +242,41 @@ namespace VISU template 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(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(theModule); + if(aPublishInStudyMode == VISU::ColoredPrs3d_i::EPublishIndependently){ + CreatePrs3dInViewer + (theModule,aTimeStampSObj,anIO,aPublishInStudyMode); + return; + }else{ + if(theDesiredViewerType.isNull()){ + if (SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager()) + if (aViewManager->getType() == VVTK_Viewer::Type()){ + CreatePrs3dInViewer + (theModule,aTimeStampSObj,anIO,aPublishInStudyMode); + return; + } + CreatePrs3dInViewer + (theModule,aTimeStampSObj,anIO,aPublishInStudyMode); + }else{ + if(theDesiredViewerType == VVTK_Viewer::Type()) + CreatePrs3dInViewer + (theModule,aTimeStampSObj,anIO,aPublishInStudyMode); + else + CreatePrs3dInViewer + (theModule,aTimeStampSObj,anIO,aPublishInStudyMode); + } + } } }