]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To provide GUI functionality for creation new kind of presentations
authorapo <apo@opencascade.com>
Thu, 2 Nov 2006 09:38:27 +0000 (09:38 +0000)
committerapo <apo@opencascade.com>
Thu, 2 Nov 2006 09:38:27 +0000 (09:38 +0000)
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI_Module.cxx
src/VISUGUI/VisuGUI_Prs3dTools.h
src/VISUGUI/VisuGUI_Tools.cxx
src/VISUGUI/VisuGUI_Tools.h
src/VISU_I/VISU_ColoredPrs3d_i.cc
src/VISU_I/VISU_Gen_i.hh

index ab1727f5444325a5dbf47180b34531c19d0d4c62..9a0937f0e16a143508920921e0d1718957045d09 100644 (file)
@@ -2471,7 +2471,7 @@ createPopupMenus()
   mgr->setRule( action( VISU_PLOT2D ), aRule, true );
 
   // timestamp commands
-  aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TTIMESTAMP'";
+  aRule = "client='ObjectBrowser' and selcount=1 and type in {'VISU::TTIMESTAMP' 'VISU::TFIELD'}";
   mgr->setRule( action( VISU_SCALAR_MAP ), aRule, true );
   mgr->setRule( action( VISU_ISO_SURFACES ), aRule, true );
   mgr->setRule( action( VISU_CUT_PLANES ), aRule, true );
@@ -3286,8 +3286,13 @@ void VisuGUI::OnPlot3dFromCutPlane()
      }
      GetResourceMgr()->setValue("VISU", "scalar_bar_position_num", aPos);
      
-     VISU::Plot3D_i* aPrs3d = CreatePrs3d<VISU::Plot3D_i>(this, aTimeStampSObj, aMeshName.latin1(), (Entity)anEntity.toInt(),
-                                                          aFieldName.latin1(), aTimeStampId.toInt());
+     VISU::Plot3D_i* aPrs3d = CreatePrs3d<VISU::Plot3D_i>(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);
index 3cab58e224a742fe5619f2fdb435a6901702865d..37d38e66f51bfc43bbb1e216d453b9261cccc60c 100644 (file)
@@ -258,7 +258,7 @@ initialize( CAM_Application* theApp )
   mgr->insert( action( GAUSS_CREATE_PRS ), -1, 0, -1 );
   mgr->setRule( action( GAUSS_CREATE_PRS ), 
                "client='ObjectBrowser' and selcount=1 "
-               "and type='VISU::TTIMESTAMP' "
+               "and type in {'VISU::TTIMESTAMP' 'VISU::TFIELD'} "
                "and $medEntity in {'EDGE_ENTITY' 'FACE_ENTITY' 'CELL_ENTITY'} "
                "and $medSource in {'eImportFile' 'eCopyAndImportFile'} ",
                true );
index 62b46d5156dfd0095de629a048dcca274e0d6ead..3e245ca909f5580c4907b1a8b7b160bc6a3f025f 100644 (file)
@@ -116,14 +116,15 @@ namespace VISU
              const char* theMeshName,
              VISU::Entity theEntity,
              const char* theFieldName,
-             int theTimeId)
+             int theTimeId,
+             ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode)
   {
     VISU::Result_var aResult;
     if (CheckResult(theModule,theTimeStamp,aResult)){
       QApplication::setOverrideCursor(Qt::waitCursor);
       TPrs3d_i* aPrs3d =
        GetVisuGen(theModule)->template CreatePrs3d<TPrs3d_i>
-       (aResult,theMeshName,theEntity,theFieldName,theTimeId);
+       (aResult,theMeshName,theEntity,theFieldName,theTimeId,thePublishInStudyMode);
       QApplication::restoreOverrideCursor();
       if(aPrs3d)
        return aPrs3d;
@@ -142,7 +143,8 @@ namespace VISU
   bool
   CreatePrs3d(VisuGUI* theModule,
              _PTR(SObject) theTimeStamp,
-             const Handle(SALOME_InteractiveObject)& theIO)
+             const Handle(SALOME_InteractiveObject)& theIO,
+             ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode)
   {
     Storable::TRestoringMap aMap = getMapOfValue(theTimeStamp);
 
@@ -172,7 +174,8 @@ namespace VISU
                            aMeshName.latin1(),
                            (Entity)anEntity.toInt(),
                            aFieldName.latin1(),
-                           aTimeStampId.toInt());
+                           aTimeStampId.toInt(),
+                           thePublishInStudyMode);
 
     QApplication::restoreOverrideCursor();
     if (aPrs3d) {
@@ -227,7 +230,8 @@ namespace VISU
 
     _PTR(SObject) aTimeStampSObj;
     Handle(SALOME_InteractiveObject) anIO;
-    if (!CheckTimeStamp(theModule,aTimeStampSObj,&anIO))
+    ColoredPrs3d_i::EPublishInStudyMode aPublishInStudyMode;
+    if (!CheckTimeStamp(theModule,aTimeStampSObj,anIO,aPublishInStudyMode))
       return;
 
     // Create new TViewWindow instance, if it does not exist.
@@ -235,7 +239,7 @@ namespace VISU
     if (!GetViewWindow<TViewer>(theModule))
       return;
 
-    if (!CreatePrs3d<TPrs3d_i,TViewer,TDlg,IsDlgModal>(theModule,aTimeStampSObj,anIO))
+    if (!CreatePrs3d<TPrs3d_i,TViewer,TDlg,IsDlgModal>(theModule,aTimeStampSObj,anIO,aPublishInStudyMode))
       return;
 
     theModule->application()->putInfo(QObject::tr("INF_DONE"));
index f9ea32df126fa8ad8b97be5e44f3dd72cec0fd02..212654c11daf399e1c3028744611f147ff013121 100644 (file)
@@ -549,18 +549,24 @@ namespace VISU
   bool
   CheckTimeStamp(const SalomeApp_Module* theModule,
                  _PTR(SObject)&          theSObject,
-                 Handle(SALOME_InteractiveObject)* theIO)
+                 const Handle(SALOME_InteractiveObject)& theIO,
+                ColoredPrs3d_i::EPublishInStudyMode& thePublishInStudyMode)
   {
-    Handle(SALOME_InteractiveObject) anIO;
+    Handle(SALOME_InteractiveObject) anIO = theIO;
     CORBA::Object_var anObject = GetSelectedObj(theModule, &anIO);
-    if (theIO)
-      *theIO = anIO;
     if (!anIO.IsNull() && anIO->hasEntry()){
       _PTR(Study) aStudy = GetCStudy(GetAppStudy(theModule));
       theSObject = aStudy->FindObjectID(anIO->getEntry());
       QString aValue = getValue(theSObject,"myType");
-      if (aValue.toInt() == int(VISU::TTIMESTAMP))
+      if (aValue.toInt() == int(VISU::TTIMESTAMP)){
+       thePublishInStudyMode = ColoredPrs3d_i::EPublishUnderTimeStamp;
         return true;
+      }
+      if (aValue.toInt() == int(VISU::TFIELD)){
+       thePublishInStudyMode = ColoredPrs3d_i::EPublishIndependently;
+       if(theSObject->FindSubObject(2,theSObject))
+         return true;
+      }
     }
     SUIT_MessageBox::warn1(GetDesktop(theModule),
                            QObject::tr("WRN_VISU"),
index 0e4258a0dae942263bf0c9ad3a5f1729593a3d7e..fc53c2c248d79d0b9f8432144e779d7e2787652b 100644 (file)
@@ -31,6 +31,7 @@
 #include "SALOME_InteractiveObject.hxx"
 
 #include "VISUConfig.hh"
+#include "VISU_ColoredPrs3d_i.hh"
 
 #include "SALOMEDSClient_Study.hxx"
 
@@ -52,7 +53,8 @@ class SalomeApp_Module;
 class SalomeApp_Study;
 class VisuGUI;
 
-namespace VISU {
+namespace VISU 
+{
   class Prs3d_i;
   class Result_i;
   class Table_i;
@@ -114,7 +116,8 @@ namespace VISU {
   // SObject type
   bool                                 CheckTimeStamp(const SalomeApp_Module* theModule,
                                                      _PTR(SObject)&          theSObject,
-                                                     Handle(SALOME_InteractiveObject)* theIO = NULL);
+                                                     const Handle(SALOME_InteractiveObject)& theIO,
+                                                     ColoredPrs3d_i::EPublishInStudyMode& thePublishInStudyMode);
   VISU::Result_i*                      CheckResult(const SalomeApp_Module* theModule,
                                                   _PTR(SObject) theSource,
                                                   VISU::Result_var& theResult);
index 4041be759786cdf73fc1651ffd2eb527f0e3512a..be840816c92370a0df5d6c984afbbd52e9327f71 100644 (file)
@@ -980,13 +980,15 @@ VISU::ColoredPrs3d_i
       myName = GenerateName().latin1();
       CORBA::String_var anIOR = GetID();
       std::string aFatherEntry = FindOrCreate3DPresentationsFolder(GetStudyDocument());
+      aComment.sprintf("myComment=%s",
+                      GetComment());
       CreateAttributes(GetStudyDocument(),
                       aFatherEntry,
                       "",
                       anIOR.in(),
                       myName,
                       "",
-                      "",
+                      aComment.latin1(),
                       true);
       SetSObject(GetStudyDocument()->FindObjectIOR(anIOR));
     }
index 1b7b5e898c0999e2ddee182a47ed03786c5d9a3e..efce440a9198242b9403659cd434c98a68f62bbc 100644 (file)
@@ -166,7 +166,8 @@ namespace VISU
                const std::string& theMeshName, 
                VISU::Entity theEntity,
                const std::string& theFieldName, 
-               CORBA::Double theIteration)
+               CORBA::Double theIteration,
+               ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode = ColoredPrs3d_i::EPublishUnderTimeStamp)
     {
       if(myStudyDocument->GetProperties()->IsLocked()) 
        return NULL;
@@ -176,7 +177,7 @@ namespace VISU
       Mutex mt(myMutex);
       if(Result_i* aResult = dynamic_cast<Result_i*>(GetServant(theResult).in())){
        if(TPrs3d_i::IsPossible(aResult,theMeshName,theEntity,theFieldName,int(theIteration))){
-         TPrs3d_i* aPresent = new TPrs3d_i(aResult);
+         TPrs3d_i* aPresent = new TPrs3d_i(aResult,thePublishInStudyMode);
          if(CreatColoredPrs3d(aPresent,theMeshName,theEntity,theFieldName,theIteration))
            return aPresent;
          aPresent->_remove_ref();