]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
1. Implement publishing new presentations in corresponding sub-tree.
authorapo <apo@opencascade.com>
Wed, 1 Nov 2006 12:19:07 +0000 (12:19 +0000)
committerapo <apo@opencascade.com>
Wed, 1 Nov 2006 12:19:07 +0000 (12:19 +0000)
2. To move ColoredPrs3d attributes in private section

43 files changed:
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI_ClippingDlg.cxx
src/VISUGUI/VisuGUI_CutLinesDlg.cxx
src/VISUGUI/VisuGUI_CutPlanesDlg.cxx
src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx
src/VISU_I/VISUConfig.cc
src/VISU_I/VISUConfig.hh
src/VISU_I/VISU_ColoredPrs3d_i.cc
src/VISU_I/VISU_ColoredPrs3d_i.hh
src/VISU_I/VISU_CutLines_i.cc
src/VISU_I/VISU_CutLines_i.hh
src/VISU_I/VISU_CutPlanes_i.cc
src/VISU_I/VISU_CutPlanes_i.hh
src/VISU_I/VISU_DeformedShape_i.cc
src/VISU_I/VISU_DeformedShape_i.hh
src/VISU_I/VISU_DumpPython.cc
src/VISU_I/VISU_GaussPoints_i.cc
src/VISU_I/VISU_GaussPoints_i.hh
src/VISU_I/VISU_Gen_i.cc
src/VISU_I/VISU_Gen_i.hh
src/VISU_I/VISU_IsoSurfaces_i.cc
src/VISU_I/VISU_IsoSurfaces_i.hh
src/VISU_I/VISU_Mesh_i.cc
src/VISU_I/VISU_Mesh_i.hh
src/VISU_I/VISU_Plot3D_i.cc
src/VISU_I/VISU_Plot3D_i.hh
src/VISU_I/VISU_Prs3d_i.cc
src/VISU_I/VISU_Prs3d_i.hh
src/VISU_I/VISU_PrsObject_i.cc
src/VISU_I/VISU_PrsObject_i.hh
src/VISU_I/VISU_Result_i.cc
src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc
src/VISU_I/VISU_ScalarMapOnDeformedShape_i.hh
src/VISU_I/VISU_ScalarMap_i.cc
src/VISU_I/VISU_ScalarMap_i.hh
src/VISU_I/VISU_StreamLines_i.cc
src/VISU_I/VISU_StreamLines_i.hh
src/VISU_I/VISU_Table_i.cc
src/VISU_I/VISU_Table_i.hh
src/VISU_I/VISU_Vectors_i.cc
src/VISU_I/VISU_Vectors_i.hh
src/VISU_I/VISU_View_i.cc
src/VISU_I/VISU_View_i.hh

index aee24b7f518206f9fc0309f69e10f74a5b76b82a..ab1727f5444325a5dbf47180b34531c19d0d4c62 100644 (file)
@@ -1727,21 +1727,21 @@ OnCopyPresentation()
   case VISU::TMESH:
     {
       VISU::Mesh_i* aMeshPrs = dynamic_cast<VISU::Mesh_i*>(aPrsObject);
-      VISU::Mesh_i* aSameMesh = new VISU::Mesh_i(aMeshPrs->GetResult());
+      VISU::Mesh_i* aSameMesh = new VISU::Mesh_i(aMeshPrs->GetCResult());
       aSameMesh->SameAs(aMeshPrs);
     }
     break;
   case VISU::TSCALARMAP:
     {
       VISU::ScalarMap_i* aScalarPrs = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
-      VISU::ScalarMap_i* aSameScalar = new VISU::ScalarMap_i(aScalarPrs->GetResult(),true);
+      VISU::ScalarMap_i* aSameScalar = new VISU::ScalarMap_i(aScalarPrs->GetCResult());
       aSameScalar->SameAs(aScalarPrs);
     }
     break;
   case VISU::TDEFORMEDSHAPE:
     {
       VISU::DeformedShape_i* aDefPrs = dynamic_cast<VISU::DeformedShape_i*>(aPrsObject);
-      VISU::DeformedShape_i* aSameDeformed = new VISU::DeformedShape_i(aDefPrs->GetResult(),true);
+      VISU::DeformedShape_i* aSameDeformed = new VISU::DeformedShape_i(aDefPrs->GetCResult());
       aSameDeformed->SameAs(aDefPrs);
     }
     break;
@@ -1750,49 +1750,49 @@ OnCopyPresentation()
       VISU::ScalarMapOnDeformedShape_i* aDefPrs =
         dynamic_cast<VISU::ScalarMapOnDeformedShape_i*>(aPrsObject);
       VISU::ScalarMapOnDeformedShape_i* aSameScalarMapOnDeformed =
-        new VISU::ScalarMapOnDeformedShape_i(aDefPrs->GetResult(),true);
+        new VISU::ScalarMapOnDeformedShape_i(aDefPrs->GetCResult());
       aSameScalarMapOnDeformed->SameAs(aDefPrs);
     }
     break;
   case VISU::TCUTPLANES:
     {
       VISU::CutPlanes_i* aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject);
-      VISU::CutPlanes_i* aSameCut = new VISU::CutPlanes_i(aCutPrs->GetResult(),true);
+      VISU::CutPlanes_i* aSameCut = new VISU::CutPlanes_i(aCutPrs->GetCResult());
       aSameCut->SameAs(aCutPrs);
     }
     break;
   case VISU::TCUTLINES:
     {
       VISU::CutLines_i* aCutPrs = dynamic_cast<VISU::CutLines_i*>(aPrsObject);
-      VISU::CutLines_i* aSameCut = new VISU::CutLines_i(aCutPrs->GetResult(),true);
+      VISU::CutLines_i* aSameCut = new VISU::CutLines_i(aCutPrs->GetCResult());
       aSameCut->SameAs(aCutPrs);
     }
     break;
   case VISU::TISOSURFACE:
     {
       VISU::IsoSurfaces_i* aIsoPrs = dynamic_cast<VISU::IsoSurfaces_i*>(aPrsObject);
-      VISU::IsoSurfaces_i* aSameIso = new VISU::IsoSurfaces_i(aIsoPrs->GetResult(),true);
+      VISU::IsoSurfaces_i* aSameIso = new VISU::IsoSurfaces_i(aIsoPrs->GetCResult());
       aSameIso->SameAs(aIsoPrs);
     }
     break;
   case VISU::TSTREAMLINES:
     {
       VISU::StreamLines_i* aLinesPrs = dynamic_cast<VISU::StreamLines_i*>(aPrsObject);
-      VISU::StreamLines_i* aSameLines = new VISU::StreamLines_i(aLinesPrs->GetResult(),true);
+      VISU::StreamLines_i* aSameLines = new VISU::StreamLines_i(aLinesPrs->GetCResult());
       aSameLines->SameAs(aLinesPrs);
     }
     break;
   case VISU::TVECTORS:
     {
       VISU::Vectors_i* aVectorsPrs = dynamic_cast<VISU::Vectors_i*>(aPrsObject);
-      VISU::Vectors_i* aSameVectors = new VISU::Vectors_i(aVectorsPrs->GetResult(),true);
+      VISU::Vectors_i* aSameVectors = new VISU::Vectors_i(aVectorsPrs->GetCResult());
       aSameVectors->SameAs(aVectorsPrs);
     }
     break;
   case VISU::TPLOT3D:
     {
       VISU::Plot3D_i* aPlot3DPrs = dynamic_cast<VISU::Plot3D_i*>(aPrsObject);
-      VISU::Plot3D_i* aSamePlot3D = new VISU::Plot3D_i(aPlot3DPrs->GetResult(),true);
+      VISU::Plot3D_i* aSamePlot3D = new VISU::Plot3D_i(aPlot3DPrs->GetCResult());
       aSamePlot3D->SameAs(aPlot3DPrs);
     }
     break;
index d3cd143e96293c9c79907da782b013708bb52227..48360aad89ac69935a358ed133ab8283b2ad2c92 100644 (file)
@@ -950,7 +950,7 @@ void VisuGUI_ClippingDlg::SetCurrentPlaneIJKParam()
   if (myPlanes.empty() || myIsSelectPlane || !WidgetIJKTab->isEnabled())
     return;
 
-  VISU::Result_i* result = myPrs3d ? myPrs3d->GetResult() : 0;
+  VISU::Result_i* result = myPrs3d ? myPrs3d->GetCResult() : 0;
   if (!result)
     return;
 
@@ -1020,7 +1020,7 @@ void VisuGUI_ClippingDlg::SetCurrentPlaneIJKParam()
 //=================================================================================
 void VisuGUI_ClippingDlg::setIJKByNonStructured()
 {
-  if (!myPrs3d || myPlanes.empty() || !myPrs3d->GetResult())
+  if (!myPrs3d || myPlanes.empty() || !myPrs3d->GetCResult())
     return;
 
   // get plane normal
@@ -1036,7 +1036,7 @@ void VisuGUI_ClippingDlg::setIJKByNonStructured()
   gp_Dir dir, gridDir;
   double maxDot = 0;
   const vector<vtkFloatingPointType> *curValues, *values = 0;
-  VISU::Result_i* result = myPrs3d->GetResult();
+  VISU::Result_i* result = myPrs3d->GetCResult();
   for (i = 0; i < 3; ++i) {
     VISU::Result_i::TAxis axis = (VISU::Result_i::TAxis) i;
     CORBA::String_var aMeshName = myPrs3d->GetMeshName();
@@ -1089,7 +1089,7 @@ void VisuGUI_ClippingDlg::setIJKByNonStructured()
 //=================================================================================
 bool VisuGUI_ClippingDlg::isStructured() const
 {
-  VISU::Result_i* result = myPrs3d ? myPrs3d->GetResult() : 0;
+  VISU::Result_i* result = myPrs3d ? myPrs3d->GetCResult() : 0;
   if (result) {
     gp_Dir dir;
     CORBA::String_var aMeshName = myPrs3d->GetMeshName();
@@ -1108,7 +1108,7 @@ void VisuGUI_ClippingDlg::onIJKAxisChanged(int axisId)
 {
   // set index range
   int maxIndex = 0;
-  VISU::Result_i* result = myPrs3d ? myPrs3d->GetResult() : 0;
+  VISU::Result_i* result = myPrs3d ? myPrs3d->GetCResult() : 0;
   if (result) {
     VISU::Result_i::TAxis axis = (VISU::Result_i::TAxis) axisId;
     gp_Dir dir;
index 4ff285f3361f8a49190a768624af90dc40bf66c1..fad1a6ae32d0037c49db8eaa64a89d467a7bb756 100644 (file)
@@ -301,7 +301,8 @@ void VisuGUI_CutLinesDlg::initFromPrsObject (VISU::CutLines_i* thePrs)
   setOrientation2(thePrs->GetOrientationType2());
 
   hasInit = true;
-  myCutLines = new VISU::CutLines_i(thePrs->GetResult(),false);
+  myCutLines = new VISU::CutLines_i(thePrs->GetCResult(),
+                                   VISU::ColoredPrs3d_i::EDoNotPublish);
   myCutLines->SameAs(thePrs);
   myCutLines->CopyCurvesInverted(thePrs->GetCurvesInverted());
   if (myCutLines->IsAllCurvesInverted()) myAllCurvesInvertedCheck->setChecked(true);
index c7c9f1909d845ce0a7b73ddd0e2bf1cc62b850c5..d7b4aeb7177bbf0f2dc34ab3b7347d20b637181b 100644 (file)
@@ -185,7 +185,8 @@ void VisuGUI_CutPlanesPane::initFromPrsObject (VISU::CutPlanes_i* thePrs)
   myPosSpn->setValue(thePrs->GetDisplacement());
   hasInit = true;
   // init table
-  myCutPlanes = new VISU::CutPlanes_i(thePrs->GetResult(),false);
+  myCutPlanes = new VISU::CutPlanes_i(thePrs->GetCResult(),
+                                     VISU::ColoredPrs3d_i::EDoNotPublish);
   myCutPlanes->SameAs(thePrs);
   DrawTable();
 
index e93bedef641f49ff48030a6479401ff87b0f76d9..10ae96f311e1a303ee5de9e71afdc4cca2dba063 100644 (file)
@@ -464,7 +464,7 @@ float VisuGUI_ScalarMapOnDeformedShapeDlg::GetFloatValueOfTimeStamp(const char*
                                                                    const int   theIter,
                                                                    const VISU::TEntity  theEntity){
   float ret=1;
-  VISU::Result_i* theResult = myPrs->GetResult();
+  VISU::Result_i* theResult = myPrs->GetCResult();
   VISU::PField aField = theResult->GetInput()->GetField(theMeshName,theEntity,theFieldName);
   if(!aField) return ret;
   VISU::TValField& aValField = aField->myValField;
index 72c1635d2a0c258571691ad3760371256e4f4b93..91624f8fb46261d730c7b8fca9e6a69a65e13468 100644 (file)
@@ -97,7 +97,10 @@ namespace VISU{
 
   //===========================================================================
   static Storable::TCallbackMap VisuStoreMap;
-  string Storable::ToString(){
+  std::string 
+  Storable
+  ::ToString()
+  {
     ostringstream strOut;
     Storable::DataToStream( strOut, "myComment", GetComment() );
     ToStream(strOut);
@@ -106,7 +109,10 @@ namespace VISU{
     return strOut.str();
   }
 
-  void Storable::Registry(const char* theComment, TStorableEngine theEngine)
+  void 
+  Storable
+  ::Registry(const std::string& theComment, 
+            TStorableEngine theEngine)
   {
     if(!VisuStoreMap.insert(TCallbackMap::value_type(theComment,theEngine)).second){
       if(MYDEBUG) MESSAGE("Storable::Registry >> dupliacte registring !!!");
@@ -114,7 +120,11 @@ namespace VISU{
     }
   }
 
-  void Storable::StrToMap(const QString& theStr, VISU::Storable::TRestoringMap& theMap){
+  void 
+  Storable
+  ::StrToMap(const QString& theStr, 
+            VISU::Storable::TRestoringMap& theMap)
+  {
     if(0 && MYDEBUG) MESSAGE("Storable::StrToMap : string="<<theStr);
     QStringList strList = QStringList::split( ";", theStr, false );
     for ( int i = 0; i < strList.count(); i++ ) {
@@ -136,28 +146,47 @@ namespace VISU{
     }
   }
 
-  void Storable::DataToStream(ostringstream& theStr, const QString& theName, const QString& theVal) {
+  void
+  Storable
+  ::DataToStream(std::ostringstream& theStr, 
+                const QString& theName, 
+                const QString& theVal) 
+  {
     QString output = ( !theName.isNull() ? theName : QString("") )
                    + QString( "=" )
                   + ( !theVal.isNull()  ? theVal  : QString("") );
     theStr<<output.latin1()<<";";
   }
 
-  void Storable::DataToStream(ostringstream& theStr, const QString& theName, const int theVal) {
+  void 
+  Storable
+  ::DataToStream(std::ostringstream& theStr, 
+                const QString& theName, 
+                const int theVal) 
+  {
     QString output = ( !theName.isNull() ? theName : QString("") )
                    + QString( "=" )
                   + QString::number( theVal );
     theStr<<output.latin1()<<";";
   }
 
-  void Storable::DataToStream(ostringstream& theStr, const QString& theName, const double theVal) {
+  void
+  Storable
+  ::DataToStream(std::ostringstream& theStr, 
+                const QString& theName, 
+                const double theVal) 
+  {
     QString output = ( !theName.isNull() ? theName : QString("") )
                    + QString( "=" )
                   + QString::number( theVal );
     theStr<<output.latin1()<<";";
   }
-  Storable* Storable::Create(SALOMEDS::SObject_ptr theSObject,
-                            const string& thePrefix, const string& theLocalPersistentID)
+
+  Storable* 
+  Storable
+  ::Create(SALOMEDS::SObject_ptr theSObject,
+                  const std::string& thePrefix, 
+                  const std::string& theLocalPersistentID)
   {
     try{
       QString strIn( theLocalPersistentID.c_str() );
@@ -179,7 +208,11 @@ namespace VISU{
     return NULL;
   }
 
-  QString Storable::FindValue(const TRestoringMap& theMap, const string& theArg, bool* isFind)
+  QString
+  Storable
+  ::FindValue(const TRestoringMap& theMap, 
+             const std::string& theArg, 
+             bool* isFind)
   {
     TRestoringMap::const_iterator i = theMap.find(theArg);
     if(i == theMap.end()) {
@@ -194,7 +227,11 @@ namespace VISU{
   }
 
 
-  QString Storable::FindValue(const TRestoringMap& theMap, const string& theArg, const QString& theDefaultValue)
+  QString
+  Storable
+  ::FindValue(const TRestoringMap& theMap, 
+             const std::string& theArg, 
+             const QString& theDefaultValue)
   {
     bool anIsFound = false;
     QString aValue = FindValue(theMap,theArg,&anIsFound);
@@ -205,7 +242,9 @@ namespace VISU{
 
 
   //===========================================================================
-  PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject){
+  PortableServer::ServantBase_var
+  GetServant(CORBA::Object_ptr theObject)
+  {
     if(CORBA::is_nil(theObject))  return NULL;
     try{
       PortableServer::POA_ptr aPOA = Base_i::GetPOA();
@@ -219,7 +258,9 @@ namespace VISU{
 
 
   //===========================================================================
-  CORBA::Object_var SObjectToObject(SALOMEDS::SObject_ptr theSObject){
+  CORBA::Object_var 
+  SObjectToObject(SALOMEDS::SObject_ptr theSObject)
+  {
     SALOMEDS::GenericAttribute_var anAttr;
     CORBA::Object_var anObj;
     try{
@@ -237,7 +278,9 @@ namespace VISU{
   }
 
   //===========================================================================
-  CORBA::Object_var ClientSObjectToObject(_PTR(SObject) theSObject){
+  CORBA::Object_var
+  ClientSObjectToObject(_PTR(SObject) theSObject)
+  {
     _PTR(GenericAttribute) anAttr;
     CORBA::Object_var anObj;
     try{
@@ -256,11 +299,14 @@ namespace VISU{
 
 
   //===========================================================================
-  string FindEntryWithComment(SALOMEDS::Study_ptr theStudyDocument, const char* theStartEntry,
-                             const char* theComment, int IsAllLevels)
+  std::string
+  FindEntryWithComment(SALOMEDS::Study_ptr theStudyDocument, 
+                      const std::string& theStartEntry,
+                      const std::string& theComment, 
+                      int IsAllLevels)
   {
     SALOMEDS::ChildIterator_var anIter =
-      theStudyDocument->NewChildIterator(theStudyDocument->FindObjectID(theStartEntry));
+      theStudyDocument->NewChildIterator(theStudyDocument->FindObjectID(theStartEntry.c_str()));
     anIter->InitEx(IsAllLevels);
     SALOMEDS::SObject_var aFieldSO;
     for(;anIter->More();anIter->Next()) {
@@ -280,41 +326,45 @@ namespace VISU{
     return "";
   }
   //===========================================================================
-  string CreateAttributes(SALOMEDS::Study_ptr theStudyDocument,
-                         const char* theFatherEntry, const char* theRefFatherEntry,
-                         const char* theIOR, const char* theName,
-                         const char* thePersistentRef, const char* theComment,
-                         CORBA::Boolean theCreateNew)
+  std::string
+  CreateAttributes(SALOMEDS::Study_ptr theStudyDocument,
+                  const std::string& theFatherEntry, 
+                  const std::string& theRefFatherEntry,
+                  const std::string& theIOR, 
+                  const std::string& theName,
+                  const std::string& thePersistentRef, 
+                  const std::string& theComment,
+                  CORBA::Boolean theCreateNew)
   {
     SALOMEDS::StudyBuilder_var aStudyBuilder = theStudyDocument->NewBuilder();
-    SALOMEDS::SObject_var aFather = theStudyDocument->FindObjectID(theFatherEntry);
+    SALOMEDS::SObject_var aFather = theStudyDocument->FindObjectID(theFatherEntry.c_str());
     SALOMEDS::SObject_var newObj;
     if (theCreateNew) newObj = aStudyBuilder->NewObject(aFather);
     else newObj = aFather;
     SALOMEDS::GenericAttribute_var anAttr;
-    if(strcmp(theIOR,"") != 0){
+    if(theIOR != ""){
       anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeIOR");
       SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
-      anIOR->SetValue(theIOR);
+      anIOR->SetValue(theIOR.c_str());
     }
-    if(strcmp(theName,"") != 0){
+    if(theName != ""){
       anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeName");
       SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
-      aName->SetValue(theName);
+      aName->SetValue(theName.c_str());
     }
-    if(strcmp(thePersistentRef,"") != 0){
+    if(thePersistentRef != ""){
       anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributePersistentRef");
       SALOMEDS::AttributePersistentRef_var aPRef = SALOMEDS::AttributePersistentRef::_narrow(anAttr);
-      aPRef->SetValue(thePersistentRef);
+      aPRef->SetValue(thePersistentRef.c_str());
     }
-    if(strcmp(theComment,"") != 0){
+    if(theComment != ""){
       anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeComment");
       SALOMEDS::AttributeComment_var aCmnt = SALOMEDS::AttributeComment::_narrow(anAttr);
-      aCmnt->SetValue(theComment);
+      aCmnt->SetValue(theComment.c_str());
       if(MYDEBUG) INFOS("CreateAttributes - Comment = "<<theComment);
     }
-    if(strcmp(theRefFatherEntry,"") != 0){
-      SALOMEDS::SObject_var aRefFather = theStudyDocument->FindObjectID(theRefFatherEntry);
+    if(theRefFatherEntry != ""){
+      SALOMEDS::SObject_var aRefFather = theStudyDocument->FindObjectID(theRefFatherEntry.c_str());
       SALOMEDS::SObject_var anObj = aStudyBuilder->NewObject(aRefFather);
       aStudyBuilder->Addreference(anObj,newObj);
     }
@@ -324,11 +374,16 @@ namespace VISU{
       INFOS("CreateAttributes - StudyId = "<<theStudyDocument->StudyId()<<"; anEntry = "<<aRet<<"; IOR = '"<<theIOR<<"'");
     return aRet;
   }
-  string CreateAttributes(_PTR(Study) theStudyDocument,
-                         const char* theFatherEntry, const char* theRefFatherEntry,
-                         const char* theIOR, const char* theName,
-                         const char* thePersistentRef, const char* theComment,
-                         CORBA::Boolean theCreateNew)
+  
+  std::string
+  CreateAttributes(_PTR(Study) theStudyDocument,
+                  const std::string& theFatherEntry, 
+                  const std::string& theRefFatherEntry,
+                  const std::string& theIOR, 
+                  const std::string& theName,
+                  const std::string& thePersistentRef, 
+                  const std::string& theComment,
+                  CORBA::Boolean theCreateNew)
   {
     _PTR(StudyBuilder) aStudyBuilder = theStudyDocument->NewBuilder();
     _PTR(SObject) aFather = theStudyDocument->FindObjectID(theFatherEntry);
@@ -339,28 +394,28 @@ namespace VISU{
       newObj = aFather;
 
     _PTR(GenericAttribute) anAttr;
-    if (strcmp(theIOR, "") != 0) {
+    if (theIOR != "") {
       anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeIOR");
       _PTR(AttributeIOR) anIOR (anAttr);
       anIOR->SetValue(theIOR);
     }
-    if (strcmp(theName, "") != 0) {
+    if (theName != "") {
       anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeName");
       _PTR(AttributeName) aName (anAttr);
       aName->SetValue(theName);
     }
-    if (strcmp(thePersistentRef, "") != 0) {
+    if (thePersistentRef != "") {
       anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributePersistentRef");
       _PTR(AttributePersistentRef) aPRef (anAttr);
       aPRef->SetValue(thePersistentRef);
     }
-    if (strcmp(theComment, "") != 0) {
+    if (theComment != "") {
       anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeComment");
       _PTR(AttributeComment) aCmnt (anAttr);
       aCmnt->SetValue(theComment);
       if (MYDEBUG) INFOS("CreateAttributes - Comment = " << theComment);
     }
-    if (strcmp(theRefFatherEntry, "") != 0) {
+    if (theRefFatherEntry != "") {
       _PTR(SObject) aRefFather = theStudyDocument->FindObjectID(theRefFatherEntry);
       _PTR(SObject) anObj = aStudyBuilder->NewObject(aRefFather);
       aStudyBuilder->Addreference(anObj, newObj);
@@ -372,7 +427,9 @@ namespace VISU{
     return aRet;
   }
 
-  QString GenerateName(const string& theFmt, int theId){
+  QString 
+  GenerateName(const string& theFmt, int theId)
+  {
     static QString aName;
     if(theId > 0)
       aName.sprintf("%s:%d",theFmt.c_str(),theId);
@@ -382,7 +439,8 @@ namespace VISU{
   }
 
 
-  SALOMEDS::StudyManager_var GetStudyManager()
+  SALOMEDS::StudyManager_var 
+  GetStudyManager()
   {
     static SALOMEDS::StudyManager_var aStudyManager;
     if(CORBA::is_nil(aStudyManager)){
@@ -394,7 +452,8 @@ namespace VISU{
   }
 
 
-  SALOMEDS::Study_var GetDSStudy(_PTR(Study) theStudy)
+  SALOMEDS::Study_var 
+  GetDSStudy(_PTR(Study) theStudy)
   {
     //std::string aStudyName = theStudy->Name();
     //return GetStudyManager()->GetStudyByName(aStudyName.c_str());
@@ -402,7 +461,8 @@ namespace VISU{
     return GetStudyManager()->GetStudyByID(aStudyID);
   }
 
-  SALOMEDS::SObject_var GetSObject( _PTR(SObject) obj )
+  SALOMEDS::SObject_var 
+  GetSObject( _PTR(SObject) obj )
   {
     _PTR(Study) aStudy = obj->GetStudy();
     SALOMEDS::Study_var aSalomeDSStudy = GetDSStudy( aStudy );
@@ -410,17 +470,19 @@ namespace VISU{
     return aSalomeDSStudy->FindObjectID( id.c_str() );
   }
 
-  _PTR(SObject) GetClientSObject( SALOMEDS::SObject_var obj,
-                                 _PTR(Study) study )
+  _PTR(SObject) 
+  GetClientSObject( SALOMEDS::SObject_var obj,
+                   _PTR(Study) study )
   {
     return study->FindObjectID( obj->GetID() );
 
   }
 
 
-  void RemoveFromStudy (SALOMEDS::SObject_ptr theSObject,
-                       bool theIsAttrOnly,
-                       bool theDestroySubObjects)
+  void
+  RemoveFromStudy (SALOMEDS::SObject_ptr theSObject,
+                  bool theIsAttrOnly,
+                  bool theDestroySubObjects)
   {
     if (theSObject->_is_nil()) return;
 
@@ -460,9 +522,10 @@ namespace VISU{
     aStudyBuilder->RemoveObjectWithChildren(theSObject);
   }
 
-  void RemoveFromStudy (_PTR(SObject) theSObject,
-                       bool theIsAttrOnly,
-                       bool theDestroySubObjects)
+  void
+  RemoveFromStudy (_PTR(SObject) theSObject,
+                  bool theIsAttrOnly,
+                  bool theDestroySubObjects)
   {
     if (!theSObject) return;
 
index 48ea0f5fa072d6c5b332a285fa856e527fbda2ae..c3326194ae79ee9d3fe8b8539e642cc31b97dfb1 100644 (file)
@@ -115,21 +115,69 @@ namespace VISU
   protected:
     virtual void ToStream(std::ostringstream& theStr) = 0;
   public:
-    std::string ToString();
-    virtual const char* GetComment() const = 0;
+    std::string
+    ToString();
+
+    virtual
+    const char* 
+    GetComment() const = 0;
+
     typedef std::map<std::string,QString> TRestoringMap;
+
     typedef Storable* (*TStorableEngine)(SALOMEDS::SObject_ptr theSObject,
-                                        const std::string& thePrefix, const TRestoringMap& theMap);
+                                        const std::string& thePrefix,
+                                        const TRestoringMap& theMap);
     typedef std::map<std::string,TStorableEngine> TCallbackMap;
-    static void Registry(const char* theComment, TStorableEngine theEngine);
-    static Storable* Create(SALOMEDS::SObject_ptr, const std::string& thePrefix, const std::string& theString);
-    static QString FindValue(const TRestoringMap& theMap, const std::string& theArg, bool* isFind = NULL);
-    static QString FindValue(const TRestoringMap& theMap, const std::string& theArg, const QString& theDefaultValue);
-    static void StrToMap(const QString& theStr, VISU::Storable::TRestoringMap& theMap);
-    static SALOMEDS::SObject_ptr GetResultSO(SALOMEDS::SObject_ptr theSObject);
-    static void DataToStream(std::ostringstream& theStr, const QString& theName, const QString& theVal);
-    static void DataToStream(std::ostringstream& theStr, const QString& theName, const int theVal);
-    static void DataToStream(std::ostringstream& theStr, const QString& theName, const double theVal);
+
+    static 
+    void
+    Registry(const std::string& theComment, 
+            TStorableEngine theEngine);
+
+    static
+    Storable* 
+    Create(SALOMEDS::SObject_ptr, 
+          const std::string& thePrefix, 
+          const std::string& theString);
+
+    static 
+    QString 
+    FindValue(const TRestoringMap& theMap, 
+             const std::string& theArg, 
+             bool* isFind = NULL);
+
+    static 
+    QString
+    FindValue(const TRestoringMap& theMap, 
+             const std::string& theArg, 
+             const QString& theDefaultValue);
+
+    static
+    void
+    StrToMap(const QString& theStr, 
+            VISU::Storable::TRestoringMap& theMap);
+
+    static
+    SALOMEDS::SObject_ptr 
+    GetResultSO(SALOMEDS::SObject_ptr theSObject);
+
+    static
+    void
+    DataToStream(std::ostringstream& theStr, 
+                const QString& theName, 
+                const QString& theVal);
+
+    static 
+    void
+    DataToStream(std::ostringstream& theStr, 
+                const QString& theName, 
+                const int theVal);
+
+    static
+    void
+    DataToStream(std::ostringstream& theStr, 
+                const QString& theName, 
+                const double theVal);
   };
 
   //===========================================================================
@@ -151,32 +199,49 @@ namespace VISU
   _PTR(SComponent) ClientFindOrCreateVisuComponent(_PTR(Study) theStudyDocument);
   SALOMEDS::SComponent_var FindOrCreateVisuComponent(SALOMEDS::Study_ptr theStudyDocument);
 
-  std::string CreateAttributes(SALOMEDS::Study_ptr theStudyDocument,
-                              const char* theFatherEntry, const char* theRefFatherEntry,
-                              const char* theIOR, const char* theName,
-                              const char* thePersistentRef, const char* theComment,
-                              CORBA::Boolean theCreateNew = true);
-
-  std::string CreateAttributes(_PTR(Study) theStudyDocument,
-                              const char* theFatherEntry, const char* theRefFatherEntry,
-                              const char* theIOR, const char* theName,
-                              const char* thePersistentRef, const char* theComment,
-                              CORBA::Boolean theCreateNew = true);
-
-  std::string FindEntryWithComment(SALOMEDS::Study_ptr theStudyDocument, const char* theStartEntry,
-                                  const char* theComment, int IsAllLevels = true);
-
-  SALOMEDS::SObject_var GetSObject(_PTR(SObject));
-  _PTR(SObject) GetClientSObject(SALOMEDS::SObject_var, _PTR(Study));
-
-  SALOMEDS::Study_var GetDSStudy(_PTR(Study));
-
-  void RemoveFromStudy(SALOMEDS::SObject_ptr theSObject,
-                      bool theIsAttrOnly = true,
-                      bool theDestroySubObjects = false);
-  void RemoveFromStudy(_PTR(SObject) theSObject,
-                      bool theIsAttrOnly = true,
-                      bool theDestroySubObjects = false);
+  std::string 
+  CreateAttributes(SALOMEDS::Study_ptr theStudyDocument,
+                  const std::string& theFatherEntry, 
+                  const std::string& theRefFatherEntry,
+                  const std::string& theIOR, 
+                  const std::string& theName,
+                  const std::string& thePersistentRef, 
+                  const std::string& theComment,
+                  CORBA::Boolean theCreateNew = true);
+
+  std::string 
+  CreateAttributes(_PTR(Study) theStudyDocument,
+                  const std::string& theFatherEntry, 
+                  const std::string& theRefFatherEntry,
+                  const std::string& theIOR, 
+                  const std::string& theName,
+                  const std::string& thePersistentRef, 
+                  const std::string& theComment,
+                  CORBA::Boolean theCreateNew = true);
+
+  std::string 
+  FindEntryWithComment(SALOMEDS::Study_ptr theStudyDocument, 
+                      const std::string& theStartEntry,
+                      const std::string& theComment, 
+                      int IsAllLevels = true);
+  
+  SALOMEDS::SObject_var
+  GetSObject(_PTR(SObject));
+
+  _PTR(SObject) 
+    GetClientSObject(SALOMEDS::SObject_var, _PTR(Study));
+
+  SALOMEDS::Study_var 
+  GetDSStudy(_PTR(Study));
+
+  void
+  RemoveFromStudy(SALOMEDS::SObject_ptr theSObject,
+                 bool theIsAttrOnly = true,
+                 bool theDestroySubObjects = false);
+  void 
+  RemoveFromStudy(_PTR(SObject) theSObject,
+                 bool theIsAttrOnly = true,
+                 bool theDestroySubObjects = false);
 }
 
 #endif
index 7a06e9f976aedfb5ad2629995d741006c5a4d04f..4041be759786cdf73fc1651ffd2eb527f0e3512a 100644 (file)
@@ -46,9 +46,10 @@ static int MYDEBUG = 0;
 //============================================================================
 VISU::ColoredPrs3d_i::
 ColoredPrs3d_i(Result_i* theResult,
-              bool theAddToStudy) :
+              EPublishInStudyMode thePublishInStudyMode) :
   PrsObject_i(SALOMEDS::Study::_nil()),
-  Prs3d_i(theResult,theAddToStudy),
+  Prs3d_i(theResult),
+  myPublishInStudyMode(thePublishInStudyMode),
   myScalarMapPL(NULL),
   myIsFixedRange(false)
 {}
@@ -57,9 +58,10 @@ ColoredPrs3d_i(Result_i* theResult,
 //---------------------------------------------------------------
 VISU::ColoredPrs3d_i::
 ColoredPrs3d_i(Result_i* theResult,
-              SALOMEDS::SObject_ptr theSObject) :
+              SALOMEDS::SObject_var theSObject) :
   PrsObject_i(theSObject->GetStudy()),
   Prs3d_i(theResult,theSObject),
+  myPublishInStudyMode(EDoNotPublish),
   myScalarMapPL(NULL),
   myIsFixedRange(false)
 {}
@@ -104,7 +106,7 @@ VISU::ColoredPrs3d_i
   if(TSuperClass::SetInput()){
     if(CheckIsPossible()){
       if(OnSetInput()){
-       if(Create(GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber()))
+       if(Create(GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber()))
          return true;
       }else
        return true;
@@ -149,6 +151,17 @@ VISU::ColoredPrs3d_i
   return myEntity;
 }
 
+
+//----------------------------------------------------------------------------
+VISU::TEntity
+VISU::ColoredPrs3d_i
+::GetTEntity() const 
+{ 
+  return VISU::TEntity(int(myEntity));
+}
+
+
+//----------------------------------------------------------------------------
 void 
 VISU::ColoredPrs3d_i
 ::SetFieldName(const char* theFieldName)
@@ -159,6 +172,8 @@ VISU::ColoredPrs3d_i
   }
 }
 
+
+//----------------------------------------------------------------------------
 char*
 VISU::ColoredPrs3d_i
 ::GetFieldName()
@@ -166,6 +181,35 @@ VISU::ColoredPrs3d_i
   return CORBA::string_dup(myFieldName.c_str());
 }
 
+
+//----------------------------------------------------------------------------
+std::string
+VISU::ColoredPrs3d_i
+::GetCFieldName() const
+{
+  return myFieldName;
+}
+
+
+//----------------------------------------------------------------------------
+const VISU::PField&
+VISU::ColoredPrs3d_i
+::GetField() const 
+{ 
+  return myField;
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::ColoredPrs3d_i
+::SetField(VISU::PField theField)
+{
+  myField = theField;
+}
+
+
+//----------------------------------------------------------------------------
 void 
 VISU::ColoredPrs3d_i
 ::SetTimeStampNumber(CORBA::Long theTimeStampNumber)
@@ -176,6 +220,8 @@ VISU::ColoredPrs3d_i
   }
 }
 
+
+//----------------------------------------------------------------------------
 CORBA::Long
 VISU::ColoredPrs3d_i
 ::GetTimeStampNumber()
@@ -192,9 +238,9 @@ VISU::ColoredPrs3d_i
   if(const ColoredPrs3d_i* aPrs3d = dynamic_cast<const ColoredPrs3d_i*>(theOrigin)){
     ColoredPrs3d_i* anOrigin = const_cast<ColoredPrs3d_i*>(aPrs3d);
  
-    SetMeshName(anOrigin->GetMeshName());
+    SetMeshName(anOrigin->GetCMeshName().c_str());
     SetEntity(anOrigin->GetEntity());
-    SetFieldName(anOrigin->GetFieldName());
+    SetFieldName(anOrigin->GetCFieldName().c_str());
     SetTimeStampNumber(anOrigin->GetTimeStampNumber());
     OnSetInput();
 
@@ -245,6 +291,7 @@ VISU::ColoredPrs3d::TimeStampsRange*
 VISU::ColoredPrs3d_i
 ::GetTimeStampsRange()
 {
+  // To exclude timstamps with repeated time
   typedef std::map<std::string, long> TTimeStampsRange;
   TTimeStampsRange aRange;
   {
@@ -257,13 +304,27 @@ VISU::ColoredPrs3d_i
       aRange[aTime] = aTimeStampNumber;
     }
   }
-  VISU::ColoredPrs3d::TimeStampsRange_var aTimeStampsRange = new VISU::ColoredPrs3d::TimeStampsRange();
+
+  // To sort timestamps according to their timestamp number
+  typedef std::map<long, std::string> TTimeStampsSortedRange;
+  TTimeStampsSortedRange aSortedRange;
   {
-    aTimeStampsRange->length(aRange.size());
     TTimeStampsRange::const_iterator anIter = aRange.begin();
     for(size_t aCounter = 0; anIter != aRange.end(); anIter++, aCounter++){
       vtkIdType aTimeStampNumber = anIter->second;
       const std::string& aTime = anIter->first;
+      aSortedRange[aTimeStampNumber] = aTime;
+    }
+  }
+
+  // To map the C++ data structures to the corresponding CORBA ones
+  VISU::ColoredPrs3d::TimeStampsRange_var aTimeStampsRange = new VISU::ColoredPrs3d::TimeStampsRange();
+  {
+    aTimeStampsRange->length(aRange.size());
+    TTimeStampsSortedRange::const_iterator anIter = aSortedRange.begin();
+    for(size_t aCounter = 0; anIter != aSortedRange.end(); anIter++, aCounter++){
+      vtkIdType aTimeStampNumber = anIter->first;
+      const std::string& aTime = anIter->second;
       VISU::ColoredPrs3d::TimeStampInfo anInfo;
       anInfo.myNumber = aTimeStampNumber;
       anInfo.myTime = aTime.c_str();
@@ -398,10 +459,10 @@ VISU::ColoredPrs3d_i
 
 void
 VISU::ColoredPrs3d_i
-::SetTitle(const char* theName) 
+::SetTitle(const char* theTitle) 
 {
-  if(myTitle != theName){
-    myTitle = theName;
+  if(myTitle != theTitle){
+    myTitle = theTitle;
     myParamsTime.Modified();
   }
 }
@@ -413,6 +474,13 @@ VISU::ColoredPrs3d_i
   return CORBA::string_dup(myTitle.c_str());
 }
 
+std::string 
+VISU::ColoredPrs3d_i
+::GetCTitle() 
+{ 
+  return myTitle;
+}
+
 bool
 VISU::ColoredPrs3d_i
 ::IsBoldTitle() 
@@ -596,20 +664,35 @@ VISU::ColoredPrs3d_i
 }
 
 
+//----------------------------------------------------------------------------
+bool
+VISU::ColoredPrs3d_i
+::IsRangeFixed() 
+{ 
+  return myIsFixedRange; 
+}
+
+void
+VISU::ColoredPrs3d_i
+::UseFixedRange(bool theUseFixedRange)
+{
+  myIsFixedRange = theUseFixedRange;
+}
+
 //----------------------------------------------------------------------------
 /**
  * Creates ColoredPrs3d and initialises it from resources
  */
 VISU::Storable* 
 VISU::ColoredPrs3d_i
-::Create(const char* theMeshName, 
+::Create(const std::string& theMeshName, 
         VISU::Entity theEntity,
-        const char* theFieldName, 
+        const std::string& theFieldName, 
         int theTimeStampNumber)
 {
-  SetMeshName(theMeshName);
+  SetMeshName(theMeshName.c_str());
   SetEntity(theEntity);
-  SetFieldName(theFieldName);
+  SetFieldName(theFieldName.c_str());
   SetTimeStampNumber(theTimeStampNumber);
   OnSetInput();
 
@@ -723,8 +806,6 @@ VISU::ColoredPrs3d_i
   SetTimeStampNumber(VISU::Storable::FindValue(theMap,"myIteration").toInt());
   OnSetInput();
 
-  myAddToStudy = false; //SRN Added 21/06/2003 SAL2983: to avoid addition of the new ScalarMap to study.
-
   Build(ERestore);
 
   TSuperClass::Restore(theMap);
@@ -769,10 +850,10 @@ VISU::ColoredPrs3d_i
   Storable::DataToStream( theStr, "myNumberOfColors", int(GetNbColors()) );
   Storable::DataToStream( theStr, "myOrientation",    myOrientation );
 
-  Storable::DataToStream( theStr, "myMeshName",       myMeshName.c_str() );
-  Storable::DataToStream( theStr, "myEntity",         myEntity );
-  Storable::DataToStream( theStr, "myFieldName",      myFieldName.c_str() );
-  Storable::DataToStream( theStr, "myIteration",      int(myTimeStampNumber) );
+  Storable::DataToStream( theStr, "myMeshName",       GetCMeshName() );
+  Storable::DataToStream( theStr, "myEntity",         GetEntity() );
+  Storable::DataToStream( theStr, "myFieldName",      GetCFieldName() );
+  Storable::DataToStream( theStr, "myIteration",      int(GetTimeStampNumber()) );
 
   Storable::DataToStream( theStr, "myTitle",          myTitle.c_str() );
   Storable::DataToStream( theStr, "myNumberOfLabels", myNumberOfLabels );
@@ -814,6 +895,30 @@ VISU::ColoredPrs3d_i
   SetPipeLine(myScalarMapPL);
 }
 
+//----------------------------------------------------------------------------
+std::string
+FindOrCreate3DPresentationsFolder(SALOMEDS::Study_ptr theStudy)
+{
+  static char aFolderName[] = "3D Presentations";
+  CORBA::String_var anEntry;
+  SALOMEDS::SObject_var aSObject = theStudy->FindObject(aFolderName);
+  if(!CORBA::is_nil(aSObject) && aSObject->Depth() == 3){
+    anEntry = aSObject->GetID();
+    return anEntry.in();
+  }
+  SALOMEDS::SComponent_var aSComponent = VISU::FindOrCreateVisuComponent(theStudy);
+  CORBA::String_var aFatherEntry = aSComponent->GetID();
+  anEntry = VISU::CreateAttributes(theStudy,
+                                  aFatherEntry.in(),
+                                  "",
+                                  "",
+                                  aFolderName,
+                                  "",
+                                  "",
+                                  true).c_str();
+  return anEntry.in();
+}
+
 //----------------------------------------------------------------------------
 VISU::Storable* 
 VISU::ColoredPrs3d_i
@@ -822,7 +927,7 @@ VISU::ColoredPrs3d_i
   if(MYDEBUG)
     MESSAGE("ColoredPrs3d_i::Build - "<<myFieldName<<"; theBuildMode = "<<theBuildMode);
   SALOMEDS::StudyBuilder_var aStudyBuilder = GetStudyDocument()->NewBuilder();
-  if(myAddToStudy
+  if(myPublishInStudyMode != EDoNotPublish
     aStudyBuilder->NewCommand();  // There is a transaction
 #ifndef _DEXCEPT_
   try{
@@ -832,26 +937,58 @@ VISU::ColoredPrs3d_i
     if(theBuildMode == ECreateNew || theBuildMode == ESameAs){
       if(!myIsFixedRange) 
        myScalarMapPL->SetSourceRange();
-      const VISU::TValField& aValField = myField->myValField;
-      const VISU::PValForTime aValForTime = aValField.find(myTimeStampNumber)->second;
-      aComment.sprintf("%s %s",myFieldName.c_str(),VISU_Convertor::GenerateName(aValForTime->myTime).c_str());
+      const VISU::TValField& aValField = GetField()->myValField;
+      const VISU::PValForTime aValForTime = aValField.find(GetTimeStampNumber())->second;
+      aComment.sprintf("%s %s",
+                      GetCFieldName().c_str(),
+                      VISU_Convertor::GenerateName(aValForTime->myTime).c_str());
       if(theBuildMode == ECreateNew) 
        myTitle = aComment.simplifyWhiteSpace().latin1();
     }
-    if(myAddToStudy){
+    if(myPublishInStudyMode == EPublishUnderTimeStamp){
       myName = GenerateName().latin1();
       aComment.sprintf("myComment=TIMESTAMP;myType=%d;myMeshName=%s;myEntityId=%d;myFieldName=%s;myTimeStampId=%d;myNumComponent=%d",
-                      VISU::TTIMESTAMP,myMeshName.c_str(),myEntity,myFieldName.c_str(),myTimeStampNumber,myField->myNbComp);
-      std::string aResultEntry = myResult->GetEntry();
-      std::string aRefFatherEntry = myResult->GetRefFatherEntry();
-      std::string anEntry = myResult->GetEntry(aComment.latin1());
+                      VISU::TTIMESTAMP,
+                      GetCMeshName().c_str(),
+                      GetEntity(),
+                      GetCFieldName().c_str(),
+                      GetTimeStampNumber(),
+                      GetField()->myNbComp);
+      std::string aResultEntry = GetCResult()->GetEntry();
+      std::string aRefFatherEntry = GetCResult()->GetRefFatherEntry();
+      std::string anEntry = GetCResult()->GetEntry(aComment.latin1());
       if(anEntry == "") 
        throw std::runtime_error("There is no Entry for binding the presentation !!!");
       aComment.sprintf("myComment=%s;myMeshName=%s;myEntityId=%d;myFieldName=%s;myTimeStampId=%d;myNumComponent=%d",
-                      GetComment(),myMeshName.c_str(),myEntity,myFieldName.c_str(),myTimeStampNumber,myField->myNbComp);
+                      GetComment(),
+                      GetCMeshName().c_str(),
+                      GetEntity(),
+                      GetCFieldName().c_str(),
+                      GetTimeStampNumber(),
+                      GetField()->myNbComp);
       CORBA::String_var anIOR = GetID();
-      CreateAttributes(GetStudyDocument(),anEntry.c_str(),aRefFatherEntry.c_str(),anIOR,myName.c_str(),"",aComment.latin1(),true);
-      mySObject = GetStudyDocument()->FindObjectIOR(anIOR);
+      CreateAttributes(GetStudyDocument(),
+                      anEntry,
+                      aRefFatherEntry,
+                      anIOR.in(),
+                      myName,
+                      "",
+                      aComment.latin1(),
+                      true);
+      SetSObject(GetStudyDocument()->FindObjectIOR(anIOR));
+    }else if(myPublishInStudyMode == EPublishIndependently){
+      myName = GenerateName().latin1();
+      CORBA::String_var anIOR = GetID();
+      std::string aFatherEntry = FindOrCreate3DPresentationsFolder(GetStudyDocument());
+      CreateAttributes(GetStudyDocument(),
+                      aFatherEntry,
+                      "",
+                      anIOR.in(),
+                      myName,
+                      "",
+                      "",
+                      true);
+      SetSObject(GetStudyDocument()->FindObjectIOR(anIOR));
     }
 #ifndef _DEXCEPT_
   }catch(std::exception& exc){
@@ -862,23 +999,7 @@ VISU::ColoredPrs3d_i
     throw;
   }
 #endif
-  if(myAddToStudy
+  if(myPublishInStudyMode != EDoNotPublish
     aStudyBuilder->CommitCommand();
   return this;
 }
-
-
-//----------------------------------------------------------------------------
-const VISU::PField&
-VISU::ColoredPrs3d_i
-::GetField() const 
-{ 
-  return myField;
-}
-
-VISU::TEntity
-VISU::ColoredPrs3d_i
-::GetTEntity() const 
-{ 
-  return VISU::TEntity(int(myEntity));
-}
index 9c28c9023b232064e2825439b640680c0af3dd3f..afd7f67eb3ec8517f09aebd88c045c40d73dda76 100644 (file)
@@ -43,12 +43,17 @@ namespace VISU
     //----------------------------------------------------------------------------
     typedef Prs3d_i TSuperClass;
 
+    /*! 
+      The enumeration allow to define what mode should be used for the presentation building.
+    */
+    enum EPublishInStudyMode {EPublishUnderTimeStamp, EPublishIndependently, EDoNotPublish};
+
     explicit
     ColoredPrs3d_i(Result_i* theResult,
-                  bool theAddToStudy);
+                  EPublishInStudyMode thePublishInStudyMode = EPublishUnderTimeStamp);
     explicit
     ColoredPrs3d_i(Result_i* theResult,
-                  SALOMEDS::SObject_ptr theSObject);
+                  SALOMEDS::SObject_var theSObject);
 
     virtual
     ~ColoredPrs3d_i();
@@ -66,6 +71,9 @@ namespace VISU
     Entity
     GetEntity();
 
+    TEntity
+    GetTEntity() const;
+
     virtual
     void
     SetFieldName(const char* theFieldName);
@@ -74,6 +82,13 @@ namespace VISU
     char*
     GetFieldName();
 
+    std::string
+    GetCFieldName() const;
+
+    virtual 
+    const VISU::PField&
+    GetField() const;
+
     virtual
     void 
     SetTimeStampNumber(CORBA::Long theTimeStampNumber);
@@ -153,28 +168,25 @@ namespace VISU
 
     virtual
     void
-    SetTitle(const char* theName);
+    SetTitle(const char* theTitle);
 
     virtual
     char* 
     GetTitle();
 
-    //----------------------------------------------------------------------------
-  protected:
-    VISU::ScalarMap::Orientation myOrientation;
-    std::string myTitle;
-    int myNumberOfLabels;
-    vtkFloatingPointType myPosition[2], myWidth, myHeight;
+    std::string 
+    GetCTitle();
 
+    //----------------------------------------------------------------------------
   public:
     /*!
       Initlizes the in first time presentation
     */
     virtual
     Storable* 
-    Create(const char* theMeshName, 
+    Create(const std::string& theMeshName, 
           VISU::Entity theEntity,
-          const char* theFieldName, 
+          const std::string& theFieldName, 
           int theTimeStampNumber);
 
     /*!
@@ -206,12 +218,6 @@ namespace VISU
     void
     SameAsParams(const ColoredPrs3d_i* theOrigin);
 
-    TEntity
-    GetTEntity() const;
-
-    virtual const VISU::PField&
-    GetField() const;
-
     virtual 
     bool
     IsBoldTitle();
@@ -300,6 +306,10 @@ namespace VISU
                  vtkFloatingPointType theG, 
                  vtkFloatingPointType theB);
 
+    virtual
+    bool
+    IsRangeFixed();
+
     VISU_ScalarMapPL* 
     GetSpecificPL() const
     { 
@@ -360,14 +370,26 @@ namespace VISU
     Storable* 
     Build(EBuildMode theBuildMode);
 
-  protected:
+    void
+    SetField(VISU::PField theField);
+
+    void
+    UseFixedRange(bool theUseFixedRange);
+
+  private:
     // Decalare basic input parameters
     Entity myEntity;
     std::string myFieldName;
     CORBA::Long myTimeStampNumber;
 
     PField myField;
-    
+    EPublishInStudyMode myPublishInStudyMode;
+
+    std::string myTitle;
+    int myNumberOfLabels;
+    VISU::ScalarMap::Orientation myOrientation;
+    vtkFloatingPointType myPosition[2], myWidth, myHeight;
+
     //Font management
     bool myIsBoldTitle;
     bool myIsItalicTitle;
index 2b8bbd22a45c335382bb4e71d420f1a2ccd7749b..0957d2bc2f60d7977b4cd8acb303e9c8126fc258 100644 (file)
@@ -49,9 +49,9 @@ static int MYDEBUG = 0;
 int
 VISU::CutLines_i
 ::IsPossible(Result_i* theResult, 
-            const char* theMeshName, 
+            const std::string& theMeshName, 
             VISU::Entity theEntity, 
-            const char* theFieldName, 
+            const std::string& theFieldName, 
             int theTimeStampNumber, 
             int isMemoryCheck)
 {
@@ -88,11 +88,11 @@ VISU::CutLines_i
 //---------------------------------------------------------------
 VISU::CutLines_i::
 CutLines_i(Result_i* theResult, 
-          bool theAddToStudy) :
+          EPublishInStudyMode thePublishInStudyMode) :
   PrsObject_i(SALOMEDS::Study::_nil()), 
-  Prs3d_i(theResult,theAddToStudy),
-  ColoredPrs3d_i(theResult,theAddToStudy),
-  ScalarMap_i(theResult,theAddToStudy),
+  Prs3d_i(theResult),
+  ColoredPrs3d_i(theResult,thePublishInStudyMode),
+  ScalarMap_i(theResult,thePublishInStudyMode),
   myCutLinesPL(NULL)
 {}
 
@@ -100,7 +100,7 @@ CutLines_i(Result_i* theResult,
 //---------------------------------------------------------------
 VISU::CutLines_i::
 CutLines_i(Result_i* theResult, 
-          SALOMEDS::SObject_ptr theSObject) :
+          SALOMEDS::SObject_var theSObject) :
   PrsObject_i(theSObject->GetStudy()), 
   Prs3d_i(theResult,theSObject),
   ColoredPrs3d_i(theResult,theSObject),
@@ -123,9 +123,9 @@ VISU::CutLines_i
 //---------------------------------------------------------------
 VISU::Storable* 
 VISU::CutLines_i
-::Create(const char* theMeshName, 
+::Create(const std::string& theMeshName, 
         VISU::Entity theEntity,
-        const char* theFieldName, 
+        const std::string& theFieldName, 
         int theTimeStampNumber)
 {
   return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
@@ -478,7 +478,7 @@ bool
 VISU::CutLines_i
 ::CheckIsPossible() 
 {
-  return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
+  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
 }
 
 
@@ -500,7 +500,7 @@ VISU::CutLines_i
 //---------------------------------------------------------------
 void
 VISU::CutLines_i
-::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject)
+::BuildTableOfReal(SALOMEDS::SObject_var theSObject)
 {
   try{
     if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal");
@@ -516,7 +516,7 @@ VISU::CutLines_i
     typedef map<long,long> TLineIdCont;
     
     QString aTitle;
-    aTitle.sprintf("%s",myTitle.c_str());
+    aTitle.sprintf("%s",GetCTitle().c_str());
     aTitle = aTitle.simplifyWhiteSpace();
     aTableOfReal->SetTitle(aTitle.latin1());
     
@@ -659,10 +659,10 @@ VISU::CutLines_i
     {
       aTableOfReal->SetRowTitle(1,"X");
       aTableOfReal->SetRowUnit(1,"-");
-      QString aUnitName = myField->myUnitNames[0].c_str();
+      QString aUnitName = GetField()->myUnitNames[0].c_str();
       int aScalarMode = myCutLinesPL->GetScalarMode();
       if(aScalarMode != 0) 
-       aUnitName = myField->myUnitNames[aScalarMode-1].c_str();
+       aUnitName = GetField()->myUnitNames[aScalarMode-1].c_str();
       aUnitName = aUnitName.simplifyWhiteSpace();
       if(aUnitName.isEmpty()) aUnitName = "-";
       TXYMapCont::const_iterator aXYMapContIter = aXYMapCont.begin();
index 7bf3291ae0ad3b8c3f31d0c1efbb78743e9a701a..c9c7b726a50d0155deaa7cf3b991dfabede2767f 100644 (file)
@@ -45,10 +45,10 @@ namespace VISU
 
     explicit
     CutLines_i(Result_i* theResult,
-              bool theAddToStudy);
+              EPublishInStudyMode thePublishInStudyMode = EPublishUnderTimeStamp);
     explicit
     CutLines_i(Result_i* theResult,
-              SALOMEDS::SObject_ptr theSObject);
+              SALOMEDS::SObject_var theSObject);
     virtual
     ~CutLines_i();
 
@@ -206,18 +206,18 @@ namespace VISU
     static
     int
     IsPossible(Result_i* theResult, 
-              const char* theMeshName, 
+              const std::string& theMeshName, 
               VISU::Entity theEntity,
-              const char* theFieldName, 
+              const std::string& theFieldName, 
               int theTimeStampNumber, 
               int isMemoryCheck = true);
 
     //! Extends VISU_ColoredPrs3d_i::Create
     virtual 
     Storable* 
-    Create(const char* theMeshName, 
+    Create(const std::string& theMeshName, 
           VISU::Entity theEntity,
-          const char* theFieldName, 
+          const std::string& theFieldName, 
           int theTimeStampNumber);
 
     //! Extends VISU_ColoredPrs3d_i::ToStream
@@ -235,7 +235,7 @@ namespace VISU
     VISU_Actor* 
     CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
 
-    void BuildTableOfReal(SALOMEDS::SObject_ptr theSObject);
+    void BuildTableOfReal(SALOMEDS::SObject_var theSObject);
 
     static const std::string myComment;
 
index 70d0fc179848e05d173c1624ad8b1c386051296a..c9286737b8df9d2b3214ad0ab9b99934ece3e164 100644 (file)
@@ -42,9 +42,9 @@ static int MYDEBUG = 0;
 int 
 VISU::CutPlanes_i
 ::IsPossible(Result_i* theResult, 
-            const char* theMeshName, 
+            const std::string& theMeshName, 
             VISU::Entity theEntity, 
-            const char* theFieldName, 
+            const std::string& theFieldName, 
             int theTimeStampNumber, 
             int isMemoryCheck)
 {
@@ -78,11 +78,11 @@ VISU::CutPlanes_i
 //----------------------------------------------------------------------------
 VISU::CutPlanes_i
 ::CutPlanes_i(Result_i* theResult, 
-             bool theAddToStudy):
+             EPublishInStudyMode thePublishInStudyMode):
   PrsObject_i(SALOMEDS::Study::_nil()), 
-  Prs3d_i(theResult,theAddToStudy),
-  ColoredPrs3d_i(theResult,theAddToStudy),
-  ScalarMap_i(theResult,theAddToStudy),
+  Prs3d_i(theResult),
+  ColoredPrs3d_i(theResult,thePublishInStudyMode),
+  ScalarMap_i(theResult,thePublishInStudyMode),
   myCutPlanesPL(NULL)
 {}
 
@@ -90,7 +90,7 @@ VISU::CutPlanes_i
 //----------------------------------------------------------------------------
 VISU::CutPlanes_i
 ::CutPlanes_i(Result_i* theResult, 
-             SALOMEDS::SObject_ptr theSObject):
+             SALOMEDS::SObject_var theSObject):
   PrsObject_i(theSObject->GetStudy()), 
   Prs3d_i(theResult,theSObject),
   ColoredPrs3d_i(theResult,theSObject),
@@ -102,9 +102,9 @@ VISU::CutPlanes_i
 //----------------------------------------------------------------------------
 VISU::Storable* 
 VISU::CutPlanes_i
-::Create(const char* theMeshName, 
+::Create(const std::string& theMeshName, 
         VISU::Entity theEntity,
-        const char* theFieldName, 
+        const std::string& theFieldName, 
         int theTimeStampNumber)
 {
   return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
@@ -286,7 +286,7 @@ bool
 VISU::CutPlanes_i
 ::CheckIsPossible() 
 {
-  return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
+  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
 }
 
 //----------------------------------------------------------------------------
index 6ce30b042ec5ccde7bfbe32003aa735d38e39882..f011b773b892ac71d72bf8087f17fe3b5a54dc2d 100644 (file)
@@ -45,10 +45,10 @@ namespace VISU
 
     explicit
     CutPlanes_i(Result_i* theResult,
-               bool theAddToStudy);
+               EPublishInStudyMode thePublishInStudyMode = EPublishUnderTimeStamp);
     explicit
     CutPlanes_i(Result_i* theResult,
-               SALOMEDS::SObject_ptr theSObject);
+               SALOMEDS::SObject_var theSObject);
     virtual
     ~CutPlanes_i();
 
@@ -135,18 +135,18 @@ namespace VISU
     static
     int
     IsPossible(Result_i* theResult, 
-              const char* theMeshName, 
+              const std::string& theMeshName, 
               VISU::Entity theEntity,
-              const char* theFieldName, 
+              const std::string& theFieldName, 
               int theTimeStampNumber, 
               int isMemoryCheck = true);
 
     //! Redefines VISU_ColoredPrs3d_i::Create
     virtual 
     Storable* 
-    Create(const char* theMeshName, 
+    Create(const std::string& theMeshName, 
           VISU::Entity theEntity,
-          const char* theFieldName, 
+          const std::string& theFieldName, 
           int theTimeStampNumber);
 
     //! Redefines VISU_ColoredPrs3d_i::ToStream
index 0776e8d77c1c71f17b029dac9dbbe947fb4f5725..9552cb48eb779929af5ac3c8446406f8b69c1905 100644 (file)
@@ -47,9 +47,9 @@ static int MYDEBUG = 0;
 int
 VISU::DeformedShape_i
 ::IsPossible(Result_i* theResult, 
-            const char* theMeshName, 
+            const std::string& theMeshName, 
             VISU::Entity theEntity, 
-            const char* theFieldName, 
+            const std::string& theFieldName, 
             int theTimeStampNumber, 
             int isMemoryCheck)
 {
@@ -102,11 +102,11 @@ VISU::DeformedShape_i
 //---------------------------------------------------------------
 VISU::DeformedShape_i
 ::DeformedShape_i(Result_i* theResult, 
-                 bool theAddToStudy):
+                 EPublishInStudyMode thePublishInStudyMode):
   PrsObject_i(SALOMEDS::Study::_nil()), 
-  Prs3d_i(theResult,theAddToStudy),
-  ColoredPrs3d_i(theResult,theAddToStudy),
-  ScalarMap_i(theResult,theAddToStudy),
+  Prs3d_i(theResult),
+  ColoredPrs3d_i(theResult,thePublishInStudyMode),
+  ScalarMap_i(theResult,thePublishInStudyMode),
   myDeformedShapePL(NULL)
 {
   if(MYDEBUG) MESSAGE("DeformedShape_i::DeformedShape_i");
@@ -116,7 +116,7 @@ VISU::DeformedShape_i
 //---------------------------------------------------------------
 VISU::DeformedShape_i
 ::DeformedShape_i(Result_i* theResult, 
-                 SALOMEDS::SObject_ptr theSObject):
+                 SALOMEDS::SObject_var theSObject):
   PrsObject_i(theSObject->GetStudy()), 
   Prs3d_i(theResult,theSObject),
   ColoredPrs3d_i(theResult,theSObject),
@@ -145,9 +145,9 @@ VISU::DeformedShape_i
 //---------------------------------------------------------------
 VISU::Storable* 
 VISU::DeformedShape_i
-::Create(const char* theMeshName, 
+::Create(const std::string& theMeshName, 
         VISU::Entity theEntity,
-        const char* theFieldName, 
+        const std::string& theFieldName, 
         int theTimeStampNumber)
 {
   myIsColored = false;
@@ -272,7 +272,7 @@ bool
 VISU::DeformedShape_i
 ::CheckIsPossible() 
 {
-  return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
+  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
 }
 
 
index 3e768bcd12cf4bd9d0b752bc8c3123bfd2b0458e..ae6ae7893540ef22a1ed46d9280810a7db7189f4 100644 (file)
@@ -45,10 +45,10 @@ namespace VISU
 
     explicit
     DeformedShape_i(Result_i* theResult,
-                   bool theAddToStudy);
+                   EPublishInStudyMode thePublishInStudyMode = EPublishUnderTimeStamp);
     explicit
     DeformedShape_i(Result_i* theResult,
-                   SALOMEDS::SObject_ptr theSObject);
+                   SALOMEDS::SObject_var theSObject);
     virtual 
     void 
     SameAs(const Prs3d_i* theOrigin);
@@ -114,17 +114,17 @@ namespace VISU
     static
     int
     IsPossible(Result_i* theResult, 
-              const char* theMeshName, 
+              const std::string& theMeshName, 
               VISU::Entity theEntity,
-              const char* theFieldName, 
+              const std::string& theFieldName, 
               int theTimeStampNumber, 
               int isMemoryCheck = true);
 
     virtual 
     Storable* 
-    Create(const char* theMeshName, 
+    Create(const std::string& theMeshName, 
           VISU::Entity theEntity,
-          const char* theFieldName, 
+          const std::string& theFieldName, 
           int theTimeStampNumber);
 
     static const std::string myComment;
index 251abdd75ddc346fb86368af65f282042ae90980..1c4337f677898baa84d25d69aa654612ce0a6789 100644 (file)
@@ -180,12 +180,10 @@ namespace VISU
       break;
     }
 
-    CORBA::String_var aMeshName = theServant->GetMeshName();
-    CORBA::String_var aFieldName = theServant->GetFieldName();
     theStr<<thePrefix<<theName<<" = aVisu."<<theConstructorName<<"("<<theArgumentName<<
-      ",'"<<aMeshName.in()<<"'"<<
+      ",'"<<theServant->GetCMeshName()<<"'"<<
       ","<<aParam<<
-      ",'"<<aFieldName.in()<<"'"<<
+      ",'"<<theServant->GetCFieldName()<<"'"<<
       ","<<theServant->GetTimeStampNumber()<<
       ")"<<endl;
 
@@ -619,7 +617,6 @@ namespace VISU
           if(Mesh_i* aServant = dynamic_cast<Mesh_i*>(GetServant(anObj).in())){            
            VISU::Entity anEntity = aServant->GetEntity();
            const std::string& aSubMeshName = aServant->GetSubMeshName();
-           CORBA::String_var aMeshName = aServant->GetMeshName();
            if(anEntity >= 0){
              std::string aParam;
              switch(anEntity){
@@ -639,18 +636,18 @@ namespace VISU
 
              if(aSubMeshName == "")
                theStr<<thePrefix<<aName<<" = aVisu.MeshOnEntity("<<theArgumentName<<
-                 ",'"<<aMeshName.in()<<"'"<<
+                 ",'"<<aServant->GetCMeshName()<<"'"<<
                  ","<<aParam<<
                  ")"<<endl;
              else
                theStr<<thePrefix<<aName<<" = aVisu.FamilyMeshOnEntity("<<theArgumentName<<
-                 ",'"<<aMeshName.in()<<"'"<<
+                 ",'"<<aServant->GetCMeshName()<<"'"<<
                  ","<<aParam<<
                  ",'"<<aSubMeshName<<"'"<<
                  ")"<<endl;
            }else
              theStr<<thePrefix<<aName<<" = aVisu.GroupMesh("<<theArgumentName<<
-               ",'"<<aMeshName.in()<<"'"<<
+               ",'"<<aServant->GetCMeshName()<<"'"<<
                ",'"<<aSubMeshName<<"'"<<
                ")"<<endl;
 
index 8765c43a52c960f61c5103ef1bb0f01c46accdbc..674cbe0d7a5d3edf4a7a6d98e12e35318af2d376 100644 (file)
@@ -53,9 +53,9 @@ static int MYDEBUG = 0;
 int
 VISU::GaussPoints_i
 ::IsPossible(Result_i* theResult, 
-            const char* theMeshName, 
+            const std::string& theMeshName, 
             VISU::Entity theEntity, 
-            const char* theFieldName, 
+            const std::string& theFieldName, 
             int theIteration, 
             int isMemoryCheck)
 {
@@ -96,10 +96,10 @@ VISU::GaussPoints_i
 //----------------------------------------------------------------------------
 VISU::GaussPoints_i::
 GaussPoints_i(Result_i* theResult, 
-             bool theAddToStudy) : 
+             EPublishInStudyMode thePublishInStudyMode) : 
   PrsObject_i(SALOMEDS::Study::_nil()), 
-  Prs3d_i(theResult,theAddToStudy),
-  ColoredPrs3d_i(theResult,theAddToStudy),
+  Prs3d_i(theResult),
+  ColoredPrs3d_i(theResult,thePublishInStudyMode),
   myGaussPointsPL(NULL),
   myColor(Qt::blue),
   myIsActiveLocalScalarBar(true),
@@ -114,7 +114,7 @@ GaussPoints_i(Result_i* theResult,
 //----------------------------------------------------------------------------
 VISU::GaussPoints_i::
 GaussPoints_i(Result_i* theResult, 
-             SALOMEDS::SObject_ptr theSObject) : 
+             SALOMEDS::SObject_var theSObject) : 
   PrsObject_i(theSObject->GetStudy()), 
   Prs3d_i(theResult,theSObject),
   ColoredPrs3d_i(theResult,theSObject),
@@ -131,9 +131,9 @@ GaussPoints_i(Result_i* theResult,
 //----------------------------------------------------------------------------
 VISU::Storable* 
 VISU::GaussPoints_i
-::Create(const char* theMeshName, 
+::Create(const std::string& theMeshName, 
         VISU::Entity theEntity, 
-        const char* theFieldName, 
+        const std::string& theFieldName, 
         int theIteration)
 {
   TSuperClass::Create(theMeshName,theEntity,theFieldName,theIteration);
@@ -506,25 +506,25 @@ void
 VISU::GaussPoints_i
 ::DoSetInput()
 {
-  VISU::Result_i::TInput* anInput = myResult->GetInput();
+  VISU::Result_i::TInput* anInput = GetCResult()->GetInput();
   if(!anInput)
     throw std::runtime_error("Mesh_i::Build - myResult->GetInput() == NULL !!!");
 
-  myField = anInput->GetField(GetMeshName(),GetTEntity(),GetFieldName());
-  if(!myField
+  SetField(anInput->GetField(GetCMeshName(),GetTEntity(),GetCFieldName()));
+  if(!GetField()
     throw std::runtime_error("There is no Field with the parameters !!!");
 
   VISU::PGaussPtsIDMapper aGaussPtsIDMapper =
-    anInput->GetTimeStampOnGaussPts(GetMeshName(),GetTEntity(),GetFieldName(),GetTimeStampNumber());
+    anInput->GetTimeStampOnGaussPts(GetCMeshName(),GetTEntity(),GetCFieldName(),GetTimeStampNumber());
 
   if(!aGaussPtsIDMapper) 
     throw std::runtime_error("There is no TimeStamp with the parameters !!!");
 
-  myGaussPointsPL->SetGaussPtsIDMapper(aGaussPtsIDMapper);
-  myGaussPointsPL->Init();
-  myGaussPointsPL->Build();
+  GetSpecificPL()->SetGaussPtsIDMapper(aGaussPtsIDMapper);
+  GetSpecificPL()->Init();
+  GetSpecificPL()->Build();
 
-  myResult->MinMaxConnect(this);
+  GetCResult()->MinMaxConnect(this);
 }
 
 
@@ -533,7 +533,7 @@ bool
 VISU::GaussPoints_i
 ::CheckIsPossible() 
 {
-  return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
+  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
 }
 
 
@@ -631,28 +631,36 @@ VISU::GaussPoints_i
 ::UpdateScalarBar(vtkScalarBarActor *theScalarBar,
                  vtkLookupTable* theLookupTable)
 {
-  theScalarBar->SetTitle(myTitle.c_str());
-  theScalarBar->SetOrientation(myOrientation);
-  theScalarBar->SetNumberOfLabels(myNumberOfLabels);
+  theScalarBar->SetTitle(GetCTitle().c_str());
+  theScalarBar->SetOrientation(GetBarOrientation());
+  theScalarBar->SetNumberOfLabels(GetLabels());
 
   vtkLookupTable* aLookupTable = GetSpecificPL()->GetBarTable();
   
   theLookupTable->SetNumberOfColors(aLookupTable->GetNumberOfColors());
   theScalarBar->SetMaximumNumberOfColors(aLookupTable->GetNumberOfColors());
 
+    vtkFloatingPointType anRGB[3];
+
   vtkTextProperty* aTitleProp = theScalarBar->GetTitleTextProperty();
-  aTitleProp->SetFontFamily(myTitFontType);
-  aTitleProp->SetColor(myTitleColor[0],myTitleColor[1],myTitleColor[2]);
-  (myIsBoldTitle)? aTitleProp->BoldOn() : aTitleProp->BoldOff();
-  (myIsItalicTitle)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
-  (myIsShadowTitle)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
+  aTitleProp->SetFontFamily(GetTitFontType());
+
+  GetTitleColor(&anRGB[0],&anRGB[1],&anRGB[2]);
+  aTitleProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+
+  IsBoldTitle()? aTitleProp->BoldOn() : aTitleProp->BoldOff();
+  IsItalicTitle()? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
+  IsShadowTitle()? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
   
   vtkTextProperty* aLabelProp = theScalarBar->GetLabelTextProperty();
-  aLabelProp->SetFontFamily(myLblFontType);
-  aLabelProp->SetColor(myLabelColor[0],myLabelColor[1],myLabelColor[2]);
-  (myIsBoldLabel)? aLabelProp->BoldOn() : aLabelProp->BoldOff();
-  (myIsItalicLabel)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
-  (myIsShadowLabel)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
+  aLabelProp->SetFontFamily(GetLblFontType());
+
+  GetLabelColor(&anRGB[0],&anRGB[1],&anRGB[2]);
+  aLabelProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+
+  IsBoldLabel()? aLabelProp->BoldOn() : aLabelProp->BoldOff();
+  IsItalicLabel()? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
+  IsShadowLabel()? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
   
   theScalarBar->Modified();
 }
@@ -676,7 +684,7 @@ VISU::GaussPoints_i
       TMinMax aTMinMax(-VTK_LARGE_FLOAT,VTK_LARGE_FLOAT);
       bool anIsMinMaxDone = IsGlobalRangeDefined();
       if(anIsMinMaxDone)
-       aTMinMax = myField->GetMinMax(GetScalarMode());
+       aTMinMax = GetField()->GetMinMax(GetScalarMode());
       aScalarBarCtrl->SetGlobalRangeIsDefined(anIsMinMaxDone);
       aScalarBarCtrl->SetRangeGlobal(aTMinMax.first, aTMinMax.second);
       
@@ -701,9 +709,11 @@ VISU::GaussPoints_i
       aScalarBarCtrl->SetMode(aScalarBarMode);
       
       // Position
-      aScalarBarCtrl->SetWidth(myWidth);
-      aScalarBarCtrl->SetHeight(myHeight);
-      aScalarBarCtrl->SetPosition(myPosition);
+      aScalarBarCtrl->SetWidth(GetWidth());
+      aScalarBarCtrl->SetHeight(GetHeight());
+
+      vtkFloatingPointType aPosition[] = {GetPosX(), GetPosY()};
+      aScalarBarCtrl->SetPosition(aPosition);
       
       aScalarBarCtrl->SetSpacing(mySpacing);
       
@@ -796,7 +806,7 @@ bool
 VISU::GaussPoints_i
 ::IsGlobalRangeDefined() const 
 {
-  return myResult->IsMinMaxDone();
+  return GetCResult()->IsMinMaxDone();
 }
 
 bool
index 8e8a9bcf748f2b79120b076f1a11bf2c53af7d6e..e14bf9c587ddbcb6da1cf331217d7a9a72c3882d 100644 (file)
@@ -54,10 +54,10 @@ namespace VISU
 
     explicit
     GaussPoints_i(Result_i* theResult,
-                 bool theAddToStudy);
+                 EPublishInStudyMode thePublishInStudyMode = EPublishUnderTimeStamp);
     explicit
     GaussPoints_i(Result_i* theResult,
-                 SALOMEDS::SObject_ptr theSObject);
+                 SALOMEDS::SObject_var theSObject);
 
     virtual
     ~GaussPoints_i();
@@ -298,16 +298,16 @@ namespace VISU
     static 
     int
     IsPossible(Result_i* theResult, 
-              const char* theMeshName, 
+              const std::string& theMeshName, 
               VISU::Entity theEntity,
-              const char* theFieldName, 
+              const std::string& theFieldName, 
               int theIteration, 
               int isMemoryCheck = true);
     virtual
     Storable* 
-    Create(const char* theMeshName, 
+    Create(const std::string& theMeshName, 
           VISU::Entity theEntity,
-          const char* theFieldName, 
+          const std::string& theFieldName, 
           int theIteration);
 
     static const std::string myComment;
index b6c2c82a394cb7ec38c35a7acb8ad72c5f7578cf..0ba7f8cf8f37a1e107a615f964ec7c55c8462615 100644 (file)
@@ -253,7 +253,7 @@ namespace VISU
     if(!theStudy->GetProperties()->IsLocked()){
       typedef typename TPrs3d_i::TInterface TPrs3d;
       typename TPrs3d::_var_type aPrs3d;
-      if(TPrs3d_i* aPresent = new TPrs3d_i(NULL,true)){
+      if(TPrs3d_i* aPresent = new TPrs3d_i(NULL,ColoredPrs3d_i::EPublishIndependently)){
        return aPresent->_this();
       }
     }
@@ -294,9 +294,9 @@ namespace VISU
 
   bool
   CreatColoredPrs3d(ColoredPrs3d_i* theColoredPrs3d,
-                   const char* theMeshName, 
+                   const std::string& theMeshName, 
                    VISU::Entity theEntity,
-                   const char* theFieldName, 
+                   const std::string& theFieldName, 
                    CORBA::Double theIteration)
   {
 #ifndef _DEXCEPT_
@@ -821,7 +821,7 @@ namespace VISU
   }
 
   void VISU_Gen_i::RenameGroupInStudy(Result_ptr  theResult,
-                                     const char* theMeshName,
+                                     const char*  theMeshName,
                                      const char* theGroupName,
                                      const char* theNewName)
   {
@@ -889,7 +889,7 @@ namespace VISU
                                             const char* theFieldName,
                                             CORBA::Double theIteration)
   {
-    return Prs3dOnField<VISU::ScalarMap_i>(theResult,theMeshName,theEntity,theFieldName,theIteration,true)._retn();
+    return Prs3dOnField<VISU::ScalarMap_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
   }
 
   GaussPoints_ptr VISU_Gen_i::GaussPointsOnField(Result_ptr theResult,
@@ -898,7 +898,7 @@ namespace VISU
                                                 const char* theFieldName,
                                                 CORBA::Double theIteration)
   {
-    return Prs3dOnField<VISU::GaussPoints_i>(theResult,theMeshName,theEntity,theFieldName,theIteration,true)._retn();
+    return Prs3dOnField<VISU::GaussPoints_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
   }
 
   DeformedShape_ptr VISU_Gen_i::DeformedShapeOnField(Result_ptr theResult,
index 1faf9ca2395f03a8ff5a7a2d0bcdce6272472f13..1b7b5e898c0999e2ddee182a47ed03786c5d9a3e 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "SALOME_Component_i.hxx"
 #include "SALOME_NamingService.hxx"
+#include "VISU_ColoredPrs3d_i.hh"
 
 #include <string>
 
@@ -38,9 +39,9 @@ namespace VISU
 
   bool
   CreatColoredPrs3d(ColoredPrs3d_i* theColoredPrs3d,
-                   const char* theMeshName, 
+                   const std::string& theMeshName, 
                    VISU::Entity theEntity,
-                   const char* theFieldName, 
+                   const std::string& theFieldName, 
                    CORBA::Double theIteration);
 
   class VISU_Gen_i : public virtual POA_VISU::VISU_Gen,
@@ -131,7 +132,7 @@ namespace VISU
     virtual
     void
     RenameGroupInStudy(Result_ptr  theResult,
-                      const char* theMeshName,
+                      const char*  theMeshName,
                       const char* theGroupName,
                       const char* theNewName);
 
@@ -162,11 +163,10 @@ namespace VISU
     //Create 3D collored Presentation Of Different Types
     template<typename TPrs3d_i> TPrs3d_i*
     CreatePrs3d(Result_ptr theResult, 
-               const char* theMeshName, 
+               const std::string& theMeshName, 
                VISU::Entity theEntity,
-               const char* theFieldName, 
-               CORBA::Double theIteration, 
-               bool theAddToStudy = true)
+               const std::string& theFieldName, 
+               CORBA::Double theIteration)
     {
       if(myStudyDocument->GetProperties()->IsLocked()) 
        return NULL;
@@ -176,7 +176,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,theAddToStudy);
+         TPrs3d_i* aPresent = new TPrs3d_i(aResult);
          if(CreatColoredPrs3d(aPresent,theMeshName,theEntity,theFieldName,theIteration))
            return aPresent;
          aPresent->_remove_ref();
@@ -187,15 +187,14 @@ namespace VISU
 
     template<typename TPrs3d_i> typename TPrs3d_i::TInterface::_var_type
     Prs3dOnField(Result_ptr theResult, 
-                const char* theMeshName, 
+                const std::string& theMeshName, 
                 VISU::Entity theEntity,
-                const char* theFieldName, 
-                CORBA::Double theIteration, 
-                bool theAddToStudy = true)
+                const std::string& theFieldName, 
+                CORBA::Double theIteration)
     {
       typedef typename TPrs3d_i::TInterface TPrs3d;
       typename TPrs3d::_var_type aPrs3d;
-      if(TPrs3d_i* aPrs3d = CreatePrs3d<TPrs3d_i>(theResult,theMeshName,theEntity,theFieldName,theIteration,theAddToStudy))
+      if(TPrs3d_i* aPrs3d = CreatePrs3d<TPrs3d_i>(theResult,theMeshName,theEntity,theFieldName,theIteration))
        return aPrs3d->_this();
       return TPrs3d::_nil();
     }
index 18994dfc5189eb9e47234763696eb3cb8f83e5d7..5ef29a5d5fb5871aa226243b8740805f86716b64 100644 (file)
@@ -41,9 +41,9 @@ static int MYDEBUG = 0;
 int
 VISU::IsoSurfaces_i
 ::IsPossible(Result_i* theResult, 
-            const char* theMeshName, 
+            const std::string& theMeshName, 
             VISU::Entity theEntity, 
-            const char* theFieldName, 
+            const std::string& theFieldName, 
             int theTimeStampNumber, 
             int isMemoryCheck)
 {
@@ -79,11 +79,11 @@ VISU::IsoSurfaces_i
 //---------------------------------------------------------------
 VISU::IsoSurfaces_i
 ::IsoSurfaces_i(Result_i* theResult, 
-               bool theAddToStudy) :
+               EPublishInStudyMode thePublishInStudyMode) :
   PrsObject_i(SALOMEDS::Study::_nil()), 
-  Prs3d_i(theResult,theAddToStudy),
-  ColoredPrs3d_i(theResult,theAddToStudy),
-  ScalarMap_i(theResult,theAddToStudy),
+  Prs3d_i(theResult),
+  ColoredPrs3d_i(theResult,thePublishInStudyMode),
+  ScalarMap_i(theResult,thePublishInStudyMode),
   myIsoSurfacesPL(NULL)
 {}
 
@@ -91,7 +91,7 @@ VISU::IsoSurfaces_i
 //---------------------------------------------------------------
 VISU::IsoSurfaces_i
 ::IsoSurfaces_i(Result_i* theResult, 
-               SALOMEDS::SObject_ptr theSObject) :
+               SALOMEDS::SObject_var theSObject) :
   PrsObject_i(theSObject->GetStudy()), 
   Prs3d_i(theResult,theSObject),
   ColoredPrs3d_i(theResult,theSObject),
@@ -103,9 +103,9 @@ VISU::IsoSurfaces_i
 //---------------------------------------------------------------
 VISU::Storable* 
 VISU::IsoSurfaces_i
-::Create(const char* theMeshName, 
+::Create(const std::string& theMeshName, 
         VISU::Entity theEntity,
-        const char* theFieldName, 
+        const std::string& theFieldName, 
         int theTimeStampNumber)
 {
   return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
@@ -211,7 +211,7 @@ bool
 VISU::IsoSurfaces_i
 ::CheckIsPossible() 
 {
-  return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
+  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
 }
 
 //---------------------------------------------------------------
index 961953650bbe7f0c2f66d1537b382ec4fdfb32e7..ce1b0526c941dc6836089a1d774c5b9a62a9a7dd 100644 (file)
@@ -45,10 +45,10 @@ namespace VISU
 
     explicit
     IsoSurfaces_i(Result_i* theResult,
-                 bool theAddToStudy);
+                 EPublishInStudyMode thePublishInStudyMode = EPublishUnderTimeStamp);
     explicit
     IsoSurfaces_i(Result_i* theResult,
-                 SALOMEDS::SObject_ptr theSObject);
+                 SALOMEDS::SObject_var theSObject);
     virtual 
     ~IsoSurfaces_i();
 
@@ -104,17 +104,17 @@ namespace VISU
     static
     int
     IsPossible(Result_i* theResult, 
-              const char* theMeshName, 
+              const std::string& theMeshName, 
               VISU::Entity theEntity,
-              const char* theFieldName, 
+              const std::string& theFieldName, 
               int theTimeStampNumber, 
               int isMemoryCheck = true);
 
     virtual
     Storable* 
-    Create(const char* theMeshName, 
+    Create(const std::string& theMeshName, 
           VISU::Entity theEntity,
-          const char* theFieldName, 
+          const std::string& theFieldName, 
           int theTimeStampNumber);
 
     static const std::string myComment;
index dfc8499cc070c5bdd407fab53d6b3dba50ff1b30..7d924cffb47652a26c45c8a3bf8e4c178c92db6f 100644 (file)
@@ -48,16 +48,31 @@ static int MYDEBUG = 0;
 
 static int INCMEMORY = 4;
 
+//----------------------------------------------------------------------------
 int VISU::Mesh_i::myNbPresent = 0;
 
-QString VISU::Mesh_i::GenerateName() { return VISU::GenerateName("Mesh",myNbPresent++);}
+//----------------------------------------------------------------------------
+QString
+VISU::Mesh_i
+::GenerateName() 
+{ 
+  return VISU::GenerateName("Mesh",myNbPresent++);
+}
 
+//----------------------------------------------------------------------------
 const string VISU::Mesh_i::myComment = "MESH";
 
-const char* VISU::Mesh_i::GetComment() const { return myComment.c_str();}
+//----------------------------------------------------------------------------
+const char* 
+VISU::Mesh_i
+::GetComment() const
+{ 
+  return myComment.c_str();
+}
 
-VISU::Mesh_i::
-Mesh_i(Result_i* theResult) :
+//----------------------------------------------------------------------------
+VISU::Mesh_i
+::Mesh_i(Result_i* theResult) :
   PrsObject_i(theResult->GetStudyDocument()),
   Prs3d_i(theResult,false),
   myMeshPL(VISU_MeshPL::New())
@@ -66,8 +81,9 @@ Mesh_i(Result_i* theResult) :
 }
 
 
-VISU::Mesh_i::
-Mesh_i(Result_i* theResult,
+//----------------------------------------------------------------------------
+VISU::Mesh_i
+::Mesh_i(Result_i* theResult,
        SALOMEDS::SObject_ptr theSObject) :
   PrsObject_i(theResult->GetStudyDocument()),
   Prs3d_i(theResult,theSObject),
@@ -78,7 +94,9 @@ Mesh_i(Result_i* theResult,
 
 
 //---------------------------------------------------------------
-void VISU::Mesh_i::RemoveFromStudy()
+void
+VISU::Mesh_i
+::RemoveFromStudy()
 {
   struct TRemoveFromStudy: public SALOME_Event
   {
@@ -100,15 +118,23 @@ void VISU::Mesh_i::RemoveFromStudy()
 }
 
 
-void VISU::Mesh_i::SameAs (const Prs3d_i* theOrigin)
+//----------------------------------------------------------------------------
+void
+VISU::Mesh_i
+::SameAs(const Prs3d_i* theOrigin)
 {
   return; // "SameAs" command for mesh is not valid in current architecture
 }
 
 
 
-int VISU::Mesh_i::IsPossible (Result_i* theResult, const char* theMeshName,
-                             Entity theEntity, const char* theFamilyName)
+//----------------------------------------------------------------------------
+int
+VISU::Mesh_i
+::IsPossible(Result_i* theResult, 
+            const std::string& theMeshName,
+            Entity theEntity, 
+            const char* theFamilyName)
 {
   try{
     MESSAGE("Mesh_i::IsPossible - theMeshName = '"<<theMeshName<<"'; theEntity = "<<theEntity<<"; theFamilyName = '"<<theFamilyName<<"'");
@@ -125,19 +151,24 @@ int VISU::Mesh_i::IsPossible (Result_i* theResult, const char* theMeshName,
   return 0;
 }
 
-VISU::Storable* VISU::Mesh_i::Create (const char* theMeshName,
-                                     Entity theEntity,
-                                     const char* theFamilyName)
+VISU::Storable* 
+VISU::Mesh_i
+::Create(const std::string& theMeshName,
+        Entity theEntity,
+        const char* theFamilyName)
 {
-  myMeshName = theMeshName;
-  //jfa IPAL9284:myEntity = VISU::TEntity(theEntity);
+  SetMeshName(theMeshName.c_str());
   myEntity = int(theEntity);//jfa IPAL9284
   mySubMeshName = theFamilyName;
   return Build(false);
 }
 
 
-int VISU::Mesh_i::IsPossible (Result_i* theResult, const char* theMeshName, const char* theGroupName)
+int 
+VISU::Mesh_i
+::IsPossible(Result_i* theResult, 
+            const std::string& theMeshName, 
+            const char* theGroupName)
 {
   try{
     MESSAGE("Mesh_i::IsPossible - theMeshName = '"<<theMeshName<<"'; theGroupName = '"<<theGroupName<<"'");
@@ -155,23 +186,25 @@ int VISU::Mesh_i::IsPossible (Result_i* theResult, const char* theMeshName, cons
 }
 
 
-VISU::Storable* VISU::Mesh_i::Create (const char* theMeshName,
-                                     const char* theGroupName)
+VISU::Storable* 
+VISU::Mesh_i
+::Create(const std::string& theMeshName,
+        const char* theGroupName)
 {
-  myMeshName = theMeshName;
-  //jfa IPAL9284:myEntity = VISU::TEntity(-1);
+  SetMeshName(theMeshName.c_str());
   myEntity = -1;//jfa IPAL9284
   mySubMeshName = theGroupName;
   return Build(false);
 }
 
 
-VISU::Storable* VISU::Mesh_i::Restore(const Storable::TRestoringMap& theMap)
+VISU::Storable* 
+VISU::Mesh_i
+::Restore(const Storable::TRestoringMap& theMap)
 {
   Prs3d_i::Restore(theMap);
 
-  myMeshName = VISU::Storable::FindValue(theMap,"myMeshName").latin1();
-  //jfa IPAL9284:myEntity = (VISU::TEntity)VISU::Storable::FindValue(theMap,"myEntity").toInt();
+  SetMeshName(VISU::Storable::FindValue(theMap,"myMeshName").latin1());
   myEntity = VISU::Storable::FindValue(theMap,"myEntity").toInt();//jfa IPAL9284
   mySubMeshName = VISU::Storable::FindValue(theMap,"mySubMeshName").latin1();
 
@@ -193,10 +226,13 @@ VISU::Storable* VISU::Mesh_i::Restore(const Storable::TRestoringMap& theMap)
 }
 
 
-void VISU::Mesh_i::ToStream(std::ostringstream& theStr){
+void 
+VISU::Mesh_i
+::ToStream(std::ostringstream& theStr)
+{
   Prs3d_i::ToStream(theStr);
 
-  Storable::DataToStream( theStr, "myMeshName", myMeshName.c_str() );
+  Storable::DataToStream( theStr, "myMeshName", GetCMeshName() );
   Storable::DataToStream( theStr, "myEntity", myEntity );
   Storable::DataToStream( theStr, "mySubMeshName", mySubMeshName.c_str() );
 
@@ -216,18 +252,22 @@ void VISU::Mesh_i::ToStream(std::ostringstream& theStr){
 }
 
 
-VISU::Mesh_i::~Mesh_i(){
+VISU::Mesh_i
+::~Mesh_i()
+{
   if(MYDEBUG) MESSAGE("Mesh_i::~Mesh_i()");
 }
 
 
-VISU::Storable* VISU::Mesh_i::Build (int theRestoring)
+VISU::Storable* 
+VISU::Mesh_i
+::Build(int theRestoring)
 {
   SALOMEDS::StudyBuilder_var aStudyBuilder = GetStudyDocument()->NewBuilder();
   aStudyBuilder->NewCommand();  // There is a transaction
   try {
-    if (myResult->GetInput() == NULL)
-      throw std::runtime_error("Mesh_i::Build - myResult->GetInput() == NULL !!!");
+    if (GetCResult()->GetInput() == NULL)
+      throw std::runtime_error("Mesh_i::Build - GetCResult()->GetInput() == NULL !!!");
     if (!theRestoring) {
       myPresentType =  VISU::PresentationType(VISU::GetResourceMgr()->integerValue("VISU" , "mesh_represent", 2));
       if(myEntity == VISU::NODE_ENTITY)
@@ -250,28 +290,41 @@ VISU::Storable* VISU::Mesh_i::Build (int theRestoring)
     QString aComment,aTmp;
 
     VISU::PIDMapper anIDMapper;
+    VISU::Result_i::TInput* anInput = GetCResult()->GetInput();
     switch(myType){
     case VISU::TENTITY :
-      anIDMapper = myResult->GetInput()->GetMeshOnEntity(myMeshName,(VISU::TEntity)myEntity);//jfa IPAL9284
+      anIDMapper = anInput->GetMeshOnEntity(GetCMeshName(),
+                                           (VISU::TEntity)myEntity);//jfa IPAL9284
       aComment = "";
       aComment.append(aTmp.sprintf("myComment=ENTITY;myType=%d;",VISU::TENTITY));
-      aComment.append("myMeshName=");aComment.append(myMeshName);aComment.append(";");
+      aComment.append("myMeshName=");
+      aComment.append(GetCMeshName().c_str());
+      aComment.append(";");
       aComment.append(aTmp.sprintf("myId=%d",myEntity));
       break;
     case VISU::TFAMILY :
-      anIDMapper = myResult->GetInput()->GetFamilyOnEntity(myMeshName,(VISU::TEntity)myEntity,mySubMeshName);
+      anIDMapper = anInput->GetFamilyOnEntity(GetCMeshName(),
+                                             (VISU::TEntity)myEntity,
+                                             mySubMeshName);
       aComment = "";
       aComment.append(aTmp.sprintf("myComment=FAMILY;myType=%d;",VISU::TFAMILY));
-      aComment.append("myMeshName=");aComment.append(myMeshName);aComment.append(";");
+      aComment.append("myMeshName=");
+      aComment.append(GetCMeshName().c_str());
+      aComment.append(";");
       aComment.append(aTmp.sprintf("myEntityId=%d;",myEntity));
-      aComment.append("myName=");aComment.append(mySubMeshName);
+      aComment.append("myName=");
+      aComment.append(mySubMeshName);
       break;
     case VISU::TGROUP :
-      anIDMapper = myResult->GetInput()->GetMeshOnGroup(myMeshName,mySubMeshName);
+      anIDMapper = anInput->GetMeshOnGroup(GetCMeshName(),
+                                          mySubMeshName);
       aComment = "";
       aComment.append(aTmp.sprintf("myComment=GROUP;myType=%d;",VISU::TGROUP));
-      aComment.append("myMeshName=");aComment.append(myMeshName);aComment.append(";");
-      aComment.append("myName=");aComment.append(mySubMeshName);
+      aComment.append("myMeshName=");
+      aComment.append(GetCMeshName().c_str());
+      aComment.append(";");
+      aComment.append("myName=");
+      aComment.append(mySubMeshName);
       
       break;
     }
@@ -283,16 +336,17 @@ VISU::Storable* VISU::Mesh_i::Build (int theRestoring)
 
     if(!theRestoring) { //Setting IOR on the label
       myMeshPL->Init();
-      string aResultEntry = myResult->GetEntry();
-      string anEntry = myResult->GetEntry(aComment.latin1());
+      string aResultEntry = GetCResult()->GetEntry();
+      string anEntry = GetCResult()->GetEntry(aComment.latin1());
       if(anEntry == "") 
        throw std::runtime_error("Mesh_i::Build - anEntry was not found !!!");
-      mySObject = GetStudyDocument()->FindObjectID(anEntry.c_str());
+      SALOMEDS::SObject_var aSObject = GetStudyDocument()->FindObjectID(anEntry.c_str());
       SALOMEDS::StudyBuilder_var aStudyBuilder = GetStudyDocument()->NewBuilder();
-      SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(mySObject,"AttributeIOR");
+      SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject,"AttributeIOR");
       SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
       CORBA::String_var aString = GetID();
       anIOR->SetValue(aString);
+      SetSObject(aSObject);
     }
   }catch(std::exception& exc){
     INFOS("Follow exception was occured :\n"<<exc.what());
@@ -306,7 +360,9 @@ VISU::Storable* VISU::Mesh_i::Build (int theRestoring)
 }
 
 
-VISU_Actor* VISU::Mesh_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
+VISU_Actor* 
+VISU::Mesh_i
+::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
 {
   VISU_MeshAct* anActor = VISU_MeshAct::New();
   try{
@@ -323,7 +379,10 @@ VISU_Actor* VISU::Mesh_i::CreateActor(const Handle(SALOME_InteractiveObject)& th
 }
 
 
-void VISU::Mesh_i::UpdateActor(VISU_Actor* theActor) {
+void
+VISU::Mesh_i
+::UpdateActor(VISU_Actor* theActor) 
+{
   if(VISU_MeshAct* anActor = dynamic_cast<VISU_MeshAct*>(theActor)){
     if(MYDEBUG) MESSAGE("Mesh_i::UpdateActor");
     VISU::Prs3d_i::UpdateActor(anActor);
index ed769cfff6a3fa154581b09d8928503052289b13..2f87b943ef8925ac971bc0e5589cbcfb15ac8f15 100644 (file)
@@ -84,12 +84,12 @@ namespace VISU
     struct SALOMEDS::Color myCellColor, myNodeColor, myLinkColor;
 
   public:
-    static int IsPossible(Result_i* theResult, const char* theMeshName,
+    static int IsPossible(Result_i* theResult, const std::string& theMeshName,
                          Entity theEntity, const char* theFamilyName = "");
-    virtual Storable* Create(const char* theMeshName, Entity theEntity, const char* theFamilyName = "");
+    virtual Storable* Create(const std::string& theMeshName, Entity theEntity, const char* theFamilyName = "");
 
-    static int IsPossible(Result_i* theResult, const char* theMeshName, const char* theGroupName);
-    virtual Storable* Create(const char* theMeshName, const char* theGroupName);
+    static int IsPossible(Result_i* theResult, const std::string& theMeshName, const char* theGroupName);
+    virtual Storable* Create(const std::string& theMeshName, const char* theGroupName);
 
     VISU::Entity GetEntity() const { return VISU::Entity(myEntity);}
     const string& GetSubMeshName() const { return mySubMeshName;}
index 238d47d5f340c4deb0b6cb7236b3a0d532d87d06..5ef41c8953ad4a8e5895381c90bbd3424fdb418c 100644 (file)
@@ -35,9 +35,9 @@ static int MYDEBUG = 0;
 int 
 VISU::Plot3D_i
 ::IsPossible(Result_i* theResult, 
-            const char* theMeshName, 
+            const std::string& theMeshName, 
             VISU::Entity theEntity, 
-            const char* theFieldName, 
+            const std::string& theFieldName, 
             int theTimeStampNumber, 
             int isMemoryCheck)
 {
@@ -75,11 +75,11 @@ VISU::Plot3D_i
 //---------------------------------------------------------------
 VISU::Plot3D_i
 ::Plot3D_i(Result_i* theResult, 
-          bool theAddToStudy) :
+          EPublishInStudyMode thePublishInStudyMode) :
   PrsObject_i(SALOMEDS::Study::_nil()),
-  Prs3d_i(theResult,theAddToStudy),
-  ColoredPrs3d_i(theResult,theAddToStudy),
-  ScalarMap_i(theResult,theAddToStudy),
+  Prs3d_i(theResult),
+  ColoredPrs3d_i(theResult,thePublishInStudyMode),
+  ScalarMap_i(theResult,thePublishInStudyMode),
   myPlot3DPL(NULL)
 {}
 
@@ -87,7 +87,7 @@ VISU::Plot3D_i
 //---------------------------------------------------------------
 VISU::Plot3D_i
 ::Plot3D_i(Result_i* theResult, 
-          SALOMEDS::SObject_ptr theSObject) :
+          SALOMEDS::SObject_var theSObject) :
   PrsObject_i(theSObject->GetStudy()),
   Prs3d_i(theResult,theSObject),
   ColoredPrs3d_i(theResult,theSObject),
@@ -99,9 +99,9 @@ VISU::Plot3D_i
 //---------------------------------------------------------------
 VISU::Storable* 
 VISU::Plot3D_i
-::Create(const char* theMeshName, 
+::Create(const std::string& theMeshName, 
         VISU::Entity theEntity,
-        const char* theFieldName, 
+        const std::string& theFieldName, 
         int theTimeStampNumber)
 {
   return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
@@ -295,7 +295,7 @@ bool
 VISU::Plot3D_i
 ::CheckIsPossible() 
 {
-  return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
+  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
 }
 
 //---------------------------------------------------------------
index cf64efe8da1cec5ab315b42443e6de38a4a97884..d7c6bb29a7f60bf398496068de0fa60bf78fbf23 100644 (file)
@@ -39,10 +39,10 @@ namespace VISU
 
     explicit
     Plot3D_i(Result_i* theResult, 
-            bool theAddToStudy);
+            EPublishInStudyMode thePublishInStudyMode = EPublishUnderTimeStamp);
     explicit
     Plot3D_i(Result_i* theResult, 
-            SALOMEDS::SObject_ptr theSObject);
+            SALOMEDS::SObject_var theSObject);
 
     virtual 
     ~Plot3D_i();
@@ -133,17 +133,17 @@ namespace VISU
     static
     int
     IsPossible(Result_i* theResult, 
-              const char* theMeshName, 
+              const std::string& theMeshName, 
               VISU::Entity theEntity,
-              const char* theFieldName, 
+              const std::string& theFieldName, 
               int theTimeStampNumber, 
               int isMemoryCheck = true);
 
     virtual 
     Storable* 
-    Create(const char* theMeshName, 
+    Create(const std::string& theMeshName, 
           VISU::Entity theEntity,
-          const char* theFieldName, 
+          const std::string& theFieldName, 
           int theTimeStampNumber);
 
     virtual
index dfa1c78f9701250892c9da780dee22462bfdea70..6e6f942403430125cffa0431cb6d423c0e19d3b6 100644 (file)
@@ -50,12 +50,10 @@ static int MYDEBUG = 0;
 
 //----------------------------------------------------------------------------
 VISU::Prs3d_i
-::Prs3d_i(Result_i* theResult,
-         SALOMEDS::SObject_ptr theSObject) :
-  PrsObject_i(theSObject->GetStudy()),
-  mySObject(SALOMEDS::SObject::_duplicate(theSObject)),
+::Prs3d_i(Result_i* theResult) :
+  PrsObject_i(SALOMEDS::Study::_nil()),
   myActorCollection(vtkActorCollection::New()),
-  myAddToStudy(true),
+  mySObject(SALOMEDS::SObject::_nil()),
   myResult(theResult),
   myPipeLine(NULL)
 {
@@ -72,11 +70,10 @@ VISU::Prs3d_i
 //----------------------------------------------------------------------------
 VISU::Prs3d_i
 ::Prs3d_i(Result_i* theResult,
-         bool theAddToStudy) :
-  PrsObject_i(SALOMEDS::Study::_nil()),
+         SALOMEDS::SObject_var theSObject) :
+  PrsObject_i(theSObject->GetStudy()),
+  mySObject(theSObject),
   myActorCollection(vtkActorCollection::New()),
-  mySObject(SALOMEDS::SObject::_nil()),
-  myAddToStudy(theAddToStudy),
   myResult(theResult),
   myPipeLine(NULL)
 {
@@ -129,9 +126,15 @@ CORBA::Boolean
 VISU::Prs3d_i
 ::Apply()
 {
-  if(SetInput()){
-    UpdateActors();
-    return true;
+  try{
+    if(SetInput()){
+      UpdateActors();
+      return true;
+    }
+  }catch(std::exception& exc){
+    INFOS("Follow exception was occured :\n"<<exc.what());
+  }catch(...){
+    INFOS("Unknown exception was occured!");
   }
   return false;
 }
@@ -164,6 +167,15 @@ VISU::Prs3d_i
 }
 
 
+//----------------------------------------------------------------------------
+Result_i* 
+VISU::Prs3d_i
+::GetCResult() const 
+{ 
+  return myResult;
+}
+
+
 //----------------------------------------------------------------------------
 void 
 VISU::Prs3d_i
@@ -185,6 +197,15 @@ VISU::Prs3d_i
 }
 
 
+//----------------------------------------------------------------------------
+std::string
+VISU::Prs3d_i
+::GetCMeshName() const
+{
+  return myMeshName;
+}
+
+
 //----------------------------------------------------------------------------
 unsigned long int 
 VISU::Prs3d_i
@@ -233,13 +254,16 @@ VISU::Prs3d_i
   return mySObject;
 }
 
-Result_i* 
+
+//----------------------------------------------------------------------------
+void 
 VISU::Prs3d_i
-::GetResult() const 
-{ 
-  return myResult;
+::SetSObject(SALOMEDS::SObject_var theSObject)
+{
+  mySObject = theSObject;
 }
 
+
 //----------------------------------------------------------------------------
 void
 VISU::Prs3d_i
@@ -355,7 +379,8 @@ GetInput()
 //----------------------------------------------------------------------------
 void
 VISU::Prs3d_i
-::CreateActor(VISU_Actor* theActor, const Handle(SALOME_InteractiveObject)& theIO)
+::CreateActor(VISU_Actor* theActor, 
+             const Handle(SALOME_InteractiveObject)& theIO)
 {
   try{
     Handle(SALOME_InteractiveObject) anIO = theIO;
@@ -519,11 +544,10 @@ VISU::Prs3d_i
 
 //----------------------------------------------------------------------------
 VISU::Result_i* 
-VISU::GetResult(SALOMEDS::SObject_ptr theSObject)
+VISU::GetResult(SALOMEDS::SObject_var theSObject)
 {
   VISU::Result_var aResult = FindResult(theSObject);
   if(!aResult->_is_nil())
     return dynamic_cast<VISU::Result_i*>(VISU::GetServant(aResult.in()).in());
   return NULL;
 }
-
index c9c29049601b777afe7e728ce65ff462b4894f64..1852c1c7a89486e472bd6d6f1d31f1d5e784ec3e 100644 (file)
@@ -76,13 +76,12 @@ namespace VISU
     //----------------------------------------------------------------------------
     //! A constructor to create a fresh instance of the class
     explicit
-    Prs3d_i(Result_i* theResult,
-           bool theAddToStudy);
+    Prs3d_i(Result_i* theResult);
 
     //! A constructor to restore an instance of the class
     explicit
     Prs3d_i(Result_i* theResult,
-           SALOMEDS::SObject_ptr theSObject);
+           SALOMEDS::SObject_var theSObject);
 
     //! To create a deep copy from another instance of the class
     virtual
@@ -105,6 +104,10 @@ namespace VISU
     VISU::Result_ptr
     GetResultObject();
 
+    //! Get corresponding Result_i
+    Result_i* 
+    GetCResult() const;
+
     virtual
     void 
     SetMeshName(const char* theMeshName);
@@ -113,6 +116,9 @@ namespace VISU
     char*
     GetMeshName();
 
+    std::string
+    GetCMeshName() const;
+
     //----------------------------------------------------------------------------
     //! To generate an unique type name for the class (used into persistent functionality)
     virtual
@@ -135,10 +141,6 @@ namespace VISU
     ToStream(std::ostringstream& theStr);
 
     //----------------------------------------------------------------------------
-    //! Get corresponding Result_i
-    Result_i* 
-    GetResult() const;
-
     //! Get corresponding SALOMEDS::SObject
     virtual
     SALOMEDS::SObject_var 
@@ -261,29 +263,31 @@ namespace VISU
     void
     CheckDataSet();
 
+    void 
+    SetSObject(SALOMEDS::SObject_var theSObject);
+
   protected:
     vtkTimeStamp myUpdateTime;
+    vtkTimeStamp myParamsTime;
 
+  private:
     Result_i *myResult;
     std::string myMeshName;
 
     CORBA::Float myOffset[3];
-    vtkTimeStamp myParamsTime;
 
     SALOMEDS::SObject_var mySObject;
-    bool myAddToStudy;
 
     boost::signal0<void> myUpdateActorsSignal;
     boost::signal0<void> myRemoveActorsFromRendererSignal;
     vtkSmartPointer<vtkActorCollection> myActorCollection;
 
-  private:
     VISU_PipeLine *myPipeLine;
   };
 
   //----------------------------------------------------------------------------
   Result_i* 
-  GetResult(SALOMEDS::SObject_ptr theSObject);
+  GetResult(SALOMEDS::SObject_var theSObject);
 
   //----------------------------------------------------------------------------
   template<class TPrs3d>
@@ -292,10 +296,10 @@ namespace VISU
          const std::string& thePrefix,
          const Storable::TRestoringMap& theMap)
   {
-    VISU::Result_i* pResult = GetResult(theSObject);
-    if(pResult != NULL){
-      TPrs3d* pPrs3d = new TPrs3d(pResult,theSObject);
-      return pPrs3d->Restore(theMap);
+    if(VISU::Result_i* aResult = GetResult(theSObject)){
+      SALOMEDS::SObject_var aSObject = SALOMEDS::SObject::_duplicate(theSObject);
+      TPrs3d* aPrs3d = new TPrs3d(aResult,aSObject);
+      return aPrs3d->Restore(theMap);
     }
     return NULL;
   }
index e47dc9eeff2cef11c861296edfb7ea673b96c71d..8ce68939ebe6a1c38a2d3266714da9a2cea1a9ac 100644 (file)
@@ -52,7 +52,7 @@ VISU::PrsObject_i
 //---------------------------------------------------------------
 void
 VISU::PrsObject_i
-::SetName(const char* theName)
+::SetName(const std::string& theName)
 {
   myName = theName;
   SALOMEDS::SObject_var aSObject = myStudy->FindObjectID( GetEntry() );
@@ -60,7 +60,7 @@ VISU::PrsObject_i
     SALOMEDS::StudyBuilder_var aBuilder = myStudy->NewBuilder();
     SALOMEDS::GenericAttribute_var anAttr = aBuilder->FindOrCreateAttribute( aSObject, "AttributeName" );
     SALOMEDS::AttributeName_var aNameAttr = SALOMEDS::AttributeName::_narrow( anAttr );
-    aNameAttr->SetValue( theName );
+    aNameAttr->SetValue( theName.c_str() );
   }
 }
 
index cae0511790ff5e02fbe232fd14bedfcb961a2d17..4fc64ebde157c991cd7bd063ffc5ace12681690b 100644 (file)
@@ -56,7 +56,7 @@ namespace VISU
 
     virtual 
     void
-    SetName(const char* theName);
+    SetName(const std::string& theName);
 
     const SALOMEDS::Study_var& 
     GetStudyDocument() const;
index db7457fba8d80d0435fad6015a0de74c7539d131..367f24bf01cce4eac235f7ed671be6f27e545206 100644 (file)
@@ -139,7 +139,7 @@ namespace VISU
 
   //---------------------------------------------------------------
   QString
-  GenerateName (const char* theName)
+  GenerateName (const std::string& theName)
   {
     TLock aLock(myMutex);
 
index c5da5978422362080da8f280dc784fcef103a3fb..7d4cc2119091aae85f0a994bf91b3c9a91474136 100644 (file)
@@ -53,20 +53,20 @@ static int INCMEMORY = 4+12;
 int
 VISU::ScalarMapOnDeformedShape_i
 ::IsPossible(Result_i* theResult, 
-            const char* theMeshName, 
+            const std::string& theMeshName, 
             VISU::Entity theEntity, 
-            const char* theFieldName, 
+            const std::string& theFieldName, 
             int theTimeStampNumber, 
             int isMemoryCheck)
 {
   bool aResult = false;
   try{
-    aResult = VISU::ScalarMap_i::IsPossible(theResult,
-                                          theMeshName,
-                                          theEntity,
-                                          theFieldName,
-                                          theTimeStampNumber,
-                                          false);
+    aResult = TSuperClass::IsPossible(theResult,
+                                     theMeshName,
+                                     theEntity,
+                                     theFieldName,
+                                     theTimeStampNumber,
+                                     false);
     if(isMemoryCheck && aResult){
       VISU::Result_i::TInput* anInput = theResult->GetInput();
       const VISU::PField aField = anInput->GetField(theMeshName,
@@ -115,11 +115,11 @@ VISU::ScalarMapOnDeformedShape_i
 //---------------------------------------------------------------
 VISU::ScalarMapOnDeformedShape_i
 ::ScalarMapOnDeformedShape_i(Result_i* theResult, 
-                            bool theAddToStudy) :
+                            EPublishInStudyMode thePublishInStudyMode) :
   PrsObject_i(SALOMEDS::Study::_nil()), 
-  Prs3d_i(theResult,theAddToStudy),
-  ColoredPrs3d_i(theResult,theAddToStudy),
-  ScalarMap_i(theResult,theAddToStudy),
+  Prs3d_i(theResult),
+  ColoredPrs3d_i(theResult,thePublishInStudyMode),
+  ScalarMap_i(theResult,thePublishInStudyMode),
   myScalarMapOnDeformedShapePL(NULL),
   myScalarIteration(1)
 {}
@@ -127,7 +127,7 @@ VISU::ScalarMapOnDeformedShape_i
 //---------------------------------------------------------------
 VISU::ScalarMapOnDeformedShape_i
 ::ScalarMapOnDeformedShape_i(Result_i* theResult, 
-                            SALOMEDS::SObject_ptr theSObject):
+                            SALOMEDS::SObject_var theSObject):
   PrsObject_i(theSObject->GetStudy()), 
   Prs3d_i(theResult,theSObject),
   ColoredPrs3d_i(theResult,theSObject),
@@ -139,9 +139,9 @@ VISU::ScalarMapOnDeformedShape_i
 //---------------------------------------------------------------
 VISU::Storable* 
 VISU::ScalarMapOnDeformedShape_i
-::Create(const char* theMeshName, 
+::Create(const std::string& theMeshName, 
         VISU::Entity theEntity,
-        const char* theFieldName, 
+        const std::string& theFieldName, 
         int theTimeStampNumber)
 {
   myIsColored = true;
@@ -344,7 +344,7 @@ bool
 VISU::ScalarMapOnDeformedShape_i
 ::CheckIsPossible() 
 {
-  return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
+  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
 }
 
 
@@ -387,13 +387,13 @@ VISU::ScalarMapOnDeformedShape_i
 //---------------------------------------------------------------
 void
 VISU::ScalarMapOnDeformedShape_i
-::SetScalarField(const char* theMeshName,
-                const char* theFieldName,
+::SetScalarField(const std::string& theMeshName,
+                const std::string& theFieldName,
                 int   theIteration,
                 VISU::TEntity  theEntity)
 {
-  VISU::Result_i::TInput* anInput = myResult->GetInput();
-  myScalarField = anInput->GetField(theMeshName,theEntity,theFieldName);
+  VISU::Result_i::TInput* anInput = GetCResult()->GetInput();
+  SetField(anInput->GetField(theMeshName,theEntity,theFieldName));
   VISU::PIDMapper anIDMapper = anInput->GetTimeStampOnMesh(theMeshName,
                                                           theEntity,
                                                           theFieldName,
@@ -424,7 +424,7 @@ VISU::ScalarMapOnDeformedShape_i
 //---------------------------------------------------------------
 void
 VISU::ScalarMapOnDeformedShape_i
-::SetScalarMeshName(const char* theName)
+::SetScalarMeshName(const std::string& theName)
 {
   if(myScalarMeshName != theName){
     myScalarMeshName = theName;
@@ -443,7 +443,7 @@ VISU::ScalarMapOnDeformedShape_i
 //---------------------------------------------------------------
 void 
 VISU::ScalarMapOnDeformedShape_i
-::SetScalarFieldName(const char* theName)
+::SetScalarFieldName(const std::string& theName)
 {
   if(myScalarFieldName != theName){
     myScalarFieldName = theName;
@@ -517,11 +517,3 @@ VISU::ScalarMapOnDeformedShape_i
 {
   return VISU::Entity(myScalarEntity);
 }
-
-//---------------------------------------------------------------
-const VISU::PField&
-VISU::ScalarMapOnDeformedShape_i
-::GetField() const 
-{ 
-  return myScalarField;
-}
index d3fa40c1055360c30a2c71bee5db141fb922a7b8..10b770d8f1622ec0caa380d7429d80d8baaf6943 100644 (file)
@@ -48,10 +48,10 @@ namespace VISU
     
     explicit
     ScalarMapOnDeformedShape_i(Result_i* theResult,
-                              bool theAddToStudy);
+                              EPublishInStudyMode thePublishInStudyMode = EPublishUnderTimeStamp);
     explicit
     ScalarMapOnDeformedShape_i(Result_i* theResult,
-                              SALOMEDS::SObject_ptr theSObject);
+                              SALOMEDS::SObject_var theSObject);
     
     virtual ~ScalarMapOnDeformedShape_i();
 
@@ -101,9 +101,6 @@ namespace VISU
     void
     SameAs(const Prs3d_i* theOrigin);
 
-    virtual const VISU::PField&
-    GetField() const;
-
     typedef VISU::ScalarMapOnDeformedShape TInterface;
     
     VISU_ScalarMapOnDeformedShapePL* 
@@ -130,25 +127,24 @@ namespace VISU
     std::string myScalarFieldName;
     VISU::TEntity myScalarEntity;
     int myScalarIteration;
-    PField myScalarField;
 
   public:
     //! Redefines VISU_ColoredPrs3d_i::IsPossible
     static
     int
     IsPossible(Result_i* theResult, 
-                  const char* theMeshName, 
+                  const std::string& theMeshName, 
                   VISU::Entity theEntity,
-                  const char* theFieldName, 
+                  const std::string& theFieldName, 
                   int theTimeStampNumber, 
                   int isMemoryCheck = true);
 
     //! Redefines VISU_ColoredPrs3d_i::IsPossible
     virtual
     Storable* 
-    Create(const char* theMeshName, 
+    Create(const std::string& theMeshName, 
           VISU::Entity theEntity,
-          const char* theFieldName, 
+          const std::string& theFieldName, 
           int theTimeStampNumber);
 
     //! Redefines VISU_ColoredPrs3d_i::ToStream
@@ -187,8 +183,8 @@ namespace VISU
 
     virtual
     void
-    SetScalarField(const char* theMeshName,
-                  const char* theFieldName,
+    SetScalarField(const std::string& theMeshName,
+                  const std::string& theFieldName,
                   int   theIteration,
                   VISU::TEntity  theEntity);
     
@@ -201,7 +197,7 @@ namespace VISU
 
     virtual 
     void
-    SetScalarFieldName(const char* theName);
+    SetScalarFieldName(const std::string& theName);
 
     virtual
     std::string 
@@ -217,7 +213,7 @@ namespace VISU
 
     virtual
     void
-    SetScalarMeshName(const char* theName);
+    SetScalarMeshName(const std::string& theName);
 
     virtual
     std::string
index 8f8cc517d14083bcb902f69d32586c1918a9b084..cb3e6b08a578995c467344ff1ea4ec6da46f4838 100644 (file)
@@ -51,9 +51,9 @@ static int INCMEMORY = 4;
 int
 VISU::ScalarMap_i
 ::IsPossible(Result_i* theResult, 
-            const char* theMeshName, 
+            const std::string& theMeshName, 
             VISU::Entity theEntity, 
-            const char* theFieldName, 
+            const std::string& theFieldName, 
             int theTimeStampNumber, 
             int isMemoryCheck)
 {
@@ -106,16 +106,16 @@ VISU::ScalarMap_i
 //----------------------------------------------------------------------------
 VISU::ScalarMap_i::
 ScalarMap_i(Result_i* theResult,
-           bool theAddToStudy) :
+           EPublishInStudyMode thePublishInStudyMode) :
   PrsObject_i(SALOMEDS::Study::_nil()),
-  Prs3d_i(theResult,theAddToStudy),
-  ColoredPrs3d_i(theResult,theAddToStudy)
+  Prs3d_i(theResult),
+  ColoredPrs3d_i(theResult,thePublishInStudyMode)
 {}
 
 //----------------------------------------------------------------------------
 VISU::ScalarMap_i::
 ScalarMap_i(Result_i* theResult,
-           SALOMEDS::SObject_ptr theSObject) :
+           SALOMEDS::SObject_var theSObject) :
   PrsObject_i(theSObject->GetStudy()),
   Prs3d_i(theResult,theSObject),
   ColoredPrs3d_i(theResult,theSObject)
@@ -138,7 +138,7 @@ VISU::ScalarMap_i
     ScalarMap_i* anOrigin = const_cast<ScalarMap_i*>(aPrs3d);
  
     SetRange(anOrigin->GetMin(), anOrigin->GetMax());
-    myIsFixedRange = anOrigin->IsRangeFixed();
+    UseFixedRange(anOrigin->IsRangeFixed());
 
     SetScaling(anOrigin->GetScaling());
     
@@ -153,9 +153,9 @@ VISU::ScalarMap_i
  */
 VISU::Storable* 
 VISU::ScalarMap_i
-::Create(const char* theMeshName, 
+::Create(const std::string& theMeshName, 
         VISU::Entity theEntity,
-        const char* theFieldName, 
+        const std::string& theFieldName, 
         int theTimeStampNumber)
 {
   TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
@@ -164,14 +164,13 @@ VISU::ScalarMap_i
 
   // Scalar Range
   int aRangeType = aResourceMgr->integerValue("VISU" , "scalar_range_type", 0);
-  myIsFixedRange = (aRangeType == 1) ? true : false;
-
-  if(myIsFixedRange){
+  if(aRangeType == 1){
     float aMin = aResourceMgr->doubleValue("VISU", "scalar_range_min", 0);
     float aMax = aResourceMgr->doubleValue("VISU", "scalar_range_max", 0);
     SetRange(aMin,aMax);
   }
 
+  UseFixedRange((aRangeType == 1) ? true : false);
   bool isLog = aResourceMgr->booleanValue("VISU", "scalar_bar_logarithmic", false);
 
   if( isLog )
@@ -195,7 +194,7 @@ VISU::ScalarMap_i
   float aMax = VISU::Storable::FindValue(theMap,"myScalarRange[1]").toDouble();
   SetRange(aMin,aMax);
 
-  myIsFixedRange = VISU::Storable::FindValue(theMap,"myIsFixedRange").toInt();
+  UseFixedRange(VISU::Storable::FindValue(theMap,"myIsFixedRange").toInt());
 
   return this;
 }
@@ -209,7 +208,7 @@ VISU::ScalarMap_i
 
   Storable::DataToStream( theStr, "myScalarRange[0]", GetMin() );
   Storable::DataToStream( theStr, "myScalarRange[1]", GetMax() );
-  Storable::DataToStream( theStr, "myIsFixedRange",   myIsFixedRange );
+  Storable::DataToStream( theStr, "myIsFixedRange",   IsRangeFixed() );
   Storable::DataToStream( theStr, "myScaling",        GetScaling() );
 }
 
@@ -235,7 +234,7 @@ VISU::Scaling
 VISU::ScalarMap_i
 ::GetScaling()
 {
-  return VISU::Scaling(myScalarMapPL->GetScaling());
+  return VISU::Scaling(GetSpecificPL()->GetScaling());
 }
 
 //----------------------------------------------------------------------------
@@ -243,7 +242,7 @@ void
 VISU::ScalarMap_i
 ::SetScaling(VISU::Scaling theScaling)
 {
-  myScalarMapPL->SetScaling(theScaling);
+  GetSpecificPL()->SetScaling(theScaling);
 }
 
 //----------------------------------------------------------------------------
@@ -254,8 +253,8 @@ VISU::ScalarMap_i
   if(theMin > theMax) 
     return;
   vtkFloatingPointType aScalarRange[2] = {theMin, theMax};
-  myScalarMapPL->SetScalarRange(aScalarRange);
-  myIsFixedRange = true;
+  GetSpecificPL()->SetScalarRange(aScalarRange);
+  UseFixedRange(true);
 }
 
 
@@ -264,23 +263,23 @@ void
 VISU::ScalarMap_i
 ::DoSetInput()
 {
-  VISU::Result_i::TInput* anInput = myResult->GetInput();
+  VISU::Result_i::TInput* anInput = GetCResult()->GetInput();
   if(!anInput)
-    throw std::runtime_error("Mesh_i::Build - myResult->GetInput() == NULL !!!");
+    throw std::runtime_error("Mesh_i::Build - GetCResult()->GetInput() == NULL !!!");
 
-  myField = anInput->GetField(GetMeshName(),GetTEntity(),GetFieldName());
-  if(!myField) 
+  SetField(anInput->GetField(GetCMeshName(),GetTEntity(),GetCFieldName()));
+  if(!GetField())
     throw std::runtime_error("There is no Field with the parameters !!!");
 
   VISU::PIDMapper anIDMapper =
-    anInput->GetTimeStampOnMesh(GetMeshName(),GetTEntity(),GetFieldName(),GetTimeStampNumber());
+    anInput->GetTimeStampOnMesh(GetCMeshName(),GetTEntity(),GetCFieldName(),GetTimeStampNumber());
 
   if(!anIDMapper) 
     throw std::runtime_error("There is no TimeStamp with the parameters !!!");
 
-  myScalarMapPL->SetIDMapper(anIDMapper);
-  myScalarMapPL->Init();
-  myScalarMapPL->Build();
+  GetSpecificPL()->SetIDMapper(anIDMapper);
+  GetSpecificPL()->Init();
+  GetSpecificPL()->Build();
 }
 
 
@@ -289,7 +288,7 @@ bool
 VISU::ScalarMap_i
 ::CheckIsPossible() 
 {
-  return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
+  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
 }
 
 
@@ -298,15 +297,7 @@ void
 VISU::ScalarMap_i
 ::SetMapScale(double theMapScale)
 {
-  myScalarMapPL->SetMapScale(theMapScale);
-}
-
-//----------------------------------------------------------------------------
-bool
-VISU::ScalarMap_i
-::IsRangeFixed() 
-{ 
-  return myIsFixedRange; 
+  GetSpecificPL()->SetMapScale(theMapScale);
 }
 
 //----------------------------------------------------------------------------
@@ -314,8 +305,8 @@ void
 VISU::ScalarMap_i
 ::SetSourceRange()
 {
-  myScalarMapPL->SetSourceRange();
-  myIsFixedRange = false;
+  GetSpecificPL()->SetSourceRange();
+  UseFixedRange(false);
 }
 
 //----------------------------------------------------------------------------
@@ -357,28 +348,36 @@ VISU::ScalarMap_i
 {
   if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
     VISU_ScalarBarActor *aScalarBar = anActor->GetScalarBar();
-    aScalarBar->SetLookupTable(myScalarMapPL->GetBarTable());
-    aScalarBar->SetTitle(myTitle.c_str());
-    aScalarBar->SetOrientation(myOrientation);
+    aScalarBar->SetLookupTable(GetSpecificPL()->GetBarTable());
+    aScalarBar->SetTitle(GetCTitle().c_str());
+    aScalarBar->SetOrientation(GetBarOrientation());
     aScalarBar->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport();
-    aScalarBar->GetPositionCoordinate()->SetValue(myPosition[0],myPosition[1]);
-    aScalarBar->SetWidth(myWidth);
-    aScalarBar->SetHeight(myHeight);
-    aScalarBar->SetNumberOfLabels(myNumberOfLabels);
+    aScalarBar->GetPositionCoordinate()->SetValue(GetPosX(),GetPosY());
+    aScalarBar->SetWidth(GetWidth());
+    aScalarBar->SetHeight(GetHeight());
+    aScalarBar->SetNumberOfLabels(GetLabels());
+
+    vtkFloatingPointType anRGB[3];
 
     vtkTextProperty* aTitleProp = aScalarBar->GetTitleTextProperty();
-    aTitleProp->SetFontFamily(myTitFontType);
-    aTitleProp->SetColor(myTitleColor[0],myTitleColor[1],myTitleColor[2]);
-    (myIsBoldTitle)? aTitleProp->BoldOn() : aTitleProp->BoldOff();
-    (myIsItalicTitle)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
-    (myIsShadowTitle)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
+    aTitleProp->SetFontFamily(GetTitFontType());
+
+    GetTitleColor(&anRGB[0],&anRGB[1],&anRGB[2]);
+    aTitleProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+
+    IsBoldTitle()? aTitleProp->BoldOn() : aTitleProp->BoldOff();
+    IsItalicTitle()? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
+    IsShadowTitle()? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
 
     vtkTextProperty* aLabelProp = aScalarBar->GetLabelTextProperty();
-    aLabelProp->SetFontFamily(myLblFontType);
-    aLabelProp->SetColor(myLabelColor[0],myLabelColor[1],myLabelColor[2]);
-    (myIsBoldLabel)? aLabelProp->BoldOn() : aLabelProp->BoldOff();
-    (myIsItalicLabel)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
-    (myIsShadowLabel)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
+    aLabelProp->SetFontFamily(GetLblFontType());
+
+    GetLabelColor(&anRGB[0],&anRGB[1],&anRGB[2]);
+    aLabelProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+
+    IsBoldLabel()? aLabelProp->BoldOn() : aLabelProp->BoldOff();
+    IsItalicLabel()? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
+    IsShadowLabel()? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
 
     aScalarBar->Modified();
   }
index 8f507dcab489482c97b32f4e3f8b86c54d368e0c..34f2266a9b77201e40fc54fcb779ce67b36dcb8d 100644 (file)
@@ -46,10 +46,10 @@ namespace VISU
 
     explicit
     ScalarMap_i(Result_i* theResult,
-               bool theAddToStudy);
+               EPublishInStudyMode thePublishInStudyMode = EPublishUnderTimeStamp);
     explicit
     ScalarMap_i(Result_i* theResult,
-               SALOMEDS::SObject_ptr theSObject);
+               SALOMEDS::SObject_var theSObject);
     virtual
     ~ScalarMap_i();
 
@@ -102,18 +102,18 @@ namespace VISU
     static
     int
     IsPossible(Result_i* theResult, 
-              const char* theMeshName, 
+              const std::string& theMeshName, 
               VISU::Entity theEntity,
-              const char* theFieldName, 
+              const std::string& theFieldName, 
               int theTimeStampNumber, 
               int isMemoryCheck = true);
 
     //! Redefines VISU_ColoredPrs3d_i::Create
     virtual
     Storable* 
-    Create(const char* theMeshName, 
+    Create(const std::string& theMeshName, 
           VISU::Entity theEntity,
-          const char* theFieldName, 
+          const std::string& theFieldName, 
           int theTimeStampNumber);
 
     virtual 
@@ -144,10 +144,6 @@ namespace VISU
     void
     SetMapScale(double theMapScale = 1.0);
 
-    virtual
-    bool
-    IsRangeFixed();
-
     virtual 
     void
     SetSourceRange();
index 9ca45dafcc3a14207d3aa139537d090b4c940ad6..a803592738b07aa44c8cd798e3d086fbb756019d 100644 (file)
@@ -48,9 +48,9 @@ static int MYDEBUG = 0;
 int
 VISU::StreamLines_i
 ::IsPossible(Result_i* theResult, 
-            const char* theMeshName, 
+            const std::string& theMeshName, 
             VISU::Entity theEntity, 
-            const char* theFieldName, 
+            const std::string& theFieldName, 
             int theTimeStampNumber, 
             int isMemoryCheck)
 {
@@ -99,12 +99,12 @@ VISU::StreamLines_i
 //---------------------------------------------------------------
 VISU::StreamLines_i
 ::StreamLines_i(Result_i* theResult, 
-               bool theAddToStudy) :
+               EPublishInStudyMode thePublishInStudyMode) :
   PrsObject_i(SALOMEDS::Study::_nil()), 
-  Prs3d_i(theResult,theAddToStudy),
-  ColoredPrs3d_i(theResult,theAddToStudy),
-  ScalarMap_i(theResult,theAddToStudy),
-  DeformedShape_i(theResult,theAddToStudy),
+  Prs3d_i(theResult),
+  ColoredPrs3d_i(theResult,thePublishInStudyMode),
+  ScalarMap_i(theResult,thePublishInStudyMode),
+  DeformedShape_i(theResult,thePublishInStudyMode),
   myStreamLinesPL(NULL),
   myAppendFilter(vtkAppendFilter::New())
 {}
@@ -113,7 +113,7 @@ VISU::StreamLines_i
 //---------------------------------------------------------------
 VISU::StreamLines_i
 ::StreamLines_i(Result_i* theResult, 
-               SALOMEDS::SObject_ptr theSObject) :
+               SALOMEDS::SObject_var theSObject) :
   PrsObject_i(theSObject->GetStudy()), 
   Prs3d_i(theResult,theSObject),
   ColoredPrs3d_i(theResult,theSObject),
@@ -141,9 +141,9 @@ VISU::StreamLines_i
 //---------------------------------------------------------------
 VISU::Storable* 
 VISU::StreamLines_i
-::Create(const char* theMeshName, 
+::Create(const std::string& theMeshName, 
         VISU::Entity theEntity,
-        const char* theFieldName, 
+        const std::string& theFieldName, 
         int theTimeStampNumber)
 {
   return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
@@ -354,7 +354,7 @@ bool
 VISU::StreamLines_i
 ::CheckIsPossible() 
 {
-  return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
+  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
 }
 
 
index 0329f3a43ae7da3e131da2d211364dfa79acab33..41fd93cbe03362f4c0be15d87c38b2009252b99e 100644 (file)
@@ -46,10 +46,10 @@ namespace VISU
 
     explicit
     StreamLines_i(Result_i* theResult,
-                 bool theAddToStudy);
+                 EPublishInStudyMode thePublishInStudyMode = EPublishUnderTimeStamp);
     explicit
     StreamLines_i(Result_i* theResult,
-                 SALOMEDS::SObject_ptr theSObject);
+                 SALOMEDS::SObject_var theSObject);
 
     virtual
     void
@@ -137,18 +137,18 @@ namespace VISU
     static 
     int
     IsPossible(Result_i* theResult, 
-              const char* theMeshName, 
+              const std::string& theMeshName, 
               VISU::Entity theEntity,
-              const char* theFieldName, 
+              const std::string& theFieldName, 
               int theTimeStampNumber, 
               int isMemoryCheck = true);
 
     //! Extends VISU_ColoredPrs3d_i::Create
     virtual
     Storable* 
-    Create(const char* theMeshName, 
+    Create(const std::string& theMeshName, 
           VISU::Entity theEntity,
-          const char* theFieldName, 
+          const std::string& theFieldName, 
           int theTimeStampNumber);
 
     //! Extends VISU_ColoredPrs3d_i::ToStream
index 309cfbae3ef1083383bb381b24e932ced9416d98..77bd7333f27aa16a26b9e3e46a52e0b6e4b2f66b 100644 (file)
@@ -223,8 +223,8 @@ VISU::Storable* VISU::Table_i::Build( int theRestoring )
 VISU::Storable* VISU::Table_i::Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr SO)
 {
   if(MYDEBUG) MESSAGE(GetComment());
-  myName = (const char*)(VISU::Storable::FindValue(theMap,"myName"));
-  myTitle = (const char*)(VISU::Storable::FindValue(theMap,"myTitle"));
+  myName = VISU::Storable::FindValue(theMap,"myName").latin1();
+  myTitle = VISU::Storable::FindValue(theMap,"myTitle").latin1();
   myOrientation = ( VISU::Table::Orientation )( VISU::Storable::FindValue(theMap,"myOrientation").toInt() );
   mySObj = SALOMEDS::SObject::_duplicate(SO);
   return Build( true );
index ceb9eade3172660c028f0d02119f6f31c3249151..ec13b30bc61309aec2693e101489bd8a902ff6d2 100644 (file)
@@ -46,7 +46,7 @@ namespace VISU{
     virtual ~Table_i();
     virtual VISU::VISUType GetType() { return VISU::TTABLE;};
 
-    virtual void SetTitle( const char* theName ) { SetName( theName ); }
+    virtual void SetTitle( const char* theTitle ) { SetName( theTitle ); }
     virtual char* GetTitle() { return CORBA::string_dup( GetName() ); }
 
     virtual void SetOrientation( VISU::Table::Orientation theOrientation ) { myOrientation = theOrientation; }
@@ -96,7 +96,7 @@ namespace VISU{
     virtual ~Curve_i();
     virtual VISU::VISUType GetType() { return VISU::TCURVE;};
 
-    virtual void SetTitle( const char* theName ) { SetName( theName ); }
+    virtual void SetTitle( const char* theTitle ) { SetName( theTitle ); }
     virtual char* GetTitle() { return CORBA::string_dup( GetName() ); }
 
     virtual void SetColor( const SALOMEDS::Color& theColor ) { myColor = theColor; myAuto = false; }
index fa7f6c9960cbe2bf82c7ed8feef9c8e92255597c..cbea1cb7dce737b412f3df433bd23ef2629bbf0b 100644 (file)
@@ -48,9 +48,9 @@ static int INCMEMORY = 4+12;
 int 
 VISU::Vectors_i
 ::IsPossible(Result_i* theResult, 
-            const char* theMeshName, 
+            const std::string& theMeshName, 
             VISU::Entity theEntity, 
-            const char* theFieldName, 
+            const std::string& theFieldName, 
             int theTimeStampNumber, 
             int isMemoryCheck)
 {
@@ -106,12 +106,12 @@ VISU::Vectors_i
 //---------------------------------------------------------------
 VISU::Vectors_i
 ::Vectors_i(Result_i* theResult, 
-           bool theAddToStudy) :
+           EPublishInStudyMode thePublishInStudyMode) :
   PrsObject_i(SALOMEDS::Study::_nil()), 
-  Prs3d_i(theResult,theAddToStudy),
-  ColoredPrs3d_i(theResult,theAddToStudy),
-  ScalarMap_i(theResult,theAddToStudy),
-  DeformedShape_i(theResult,theAddToStudy),
+  Prs3d_i(theResult),
+  ColoredPrs3d_i(theResult,thePublishInStudyMode),
+  ScalarMap_i(theResult,thePublishInStudyMode),
+  DeformedShape_i(theResult,thePublishInStudyMode),
   myLineWidth(1.0),
   myVectorsPL(NULL)
 {}
@@ -120,7 +120,7 @@ VISU::Vectors_i
 //---------------------------------------------------------------
 VISU::Vectors_i
 ::Vectors_i(Result_i* theResult, 
-           SALOMEDS::SObject_ptr theSObject) :
+           SALOMEDS::SObject_var theSObject) :
   PrsObject_i(theSObject->GetStudy()), 
   Prs3d_i(theResult,theSObject),
   ColoredPrs3d_i(theResult,theSObject),
@@ -148,9 +148,9 @@ VISU::Vectors_i
 //---------------------------------------------------------------
 VISU::Storable* 
 VISU::Vectors_i
-::Create(const char* theMeshName, 
+::Create(const std::string& theMeshName, 
         VISU::Entity theEntity,
-        const char* theFieldName, 
+        const std::string& theFieldName, 
         int theTimeStampNumber)
 {
   return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
@@ -276,7 +276,7 @@ bool
 VISU::Vectors_i
 ::CheckIsPossible() 
 {
-  return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
+  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
 }
 
 //---------------------------------------------------------------
index 09432446fe7b783ed3856ff290ee3be67db83764..019110cd86afa84c933c387bd89ac159d5dc65e6 100644 (file)
@@ -45,10 +45,10 @@ namespace VISU
 
     explicit
     Vectors_i(Result_i* theResult,
-             bool theAddToStudy);
+             EPublishInStudyMode thePublishInStudyMode = EPublishUnderTimeStamp);
     explicit
     Vectors_i(Result_i* theResult,
-             SALOMEDS::SObject_ptr theSObject);
+             SALOMEDS::SObject_var theSObject);
 
     virtual
     void
@@ -118,18 +118,18 @@ namespace VISU
     //! Redefines VISU_ColoredPrs3d_i::IsPossible
     static 
     int IsPossible(Result_i* theResult, 
-                  const char* theMeshName, 
+                  const std::string& theMeshName, 
                   VISU::Entity theEntity,
-                  const char* theFieldName, 
+                  const std::string& theFieldName, 
                   int theTimeStampNumber, 
                   int isMemoryCheck = true);
 
     //! Redefines VISU_ColoredPrs3d_i::Create
     virtual
     Storable* 
-    Create(const char* theMeshName, 
+    Create(const std::string& theMeshName, 
           VISU::Entity theEntity,
-          const char* theFieldName, 
+          const std::string& theFieldName, 
           int theTimeStampNumber);
 
     //! Redefines VISU_ColoredPrs3d_i::ToStream
index 421c4552497ca5f7fcfb51f369695a03ca576a85..1553fe8d3d871fa0c8dceab4494fb6f48dedbe05 100644 (file)
@@ -1582,11 +1582,11 @@ namespace VISU {
       ProcessVoidEvent(new TEvent(aViewWindow));
   }
 
-  bool View3D_i::SaveViewParams (SUIT_ViewManager* theViewManager, const char* theName)
+  bool View3D_i::SaveViewParams (SUIT_ViewManager* theViewManager, const std::string& theName)
   {
     MESSAGE("View3D_i::SaveViewParams()");
 
-    if (!theViewManager || !theName)
+    if (!theViewManager || theName == "")
       return false;
 
     _PTR(Study) aCStudy;
@@ -1598,8 +1598,8 @@ namespace VISU {
     if (!aCStudy)
       return false;
 
-    if (strcmp(theName, "") != 0) {
-      std::vector<_PTR(SObject)> aList = aCStudy->FindObjectByName(theName, "VISU");
+    if (theName != "") {
+      std::vector<_PTR(SObject)> aList = aCStudy->FindObjectByName(theName.c_str(), "VISU");
       _PTR(GenericAttribute) anAttr;
       int iEnd = aList.size();
       for (int i = 0; i < iEnd; i++) {
@@ -1619,7 +1619,12 @@ namespace VISU {
     }
     _PTR(SComponent) aSComponent = ClientFindOrCreateVisuComponent(aCStudy);
     string aSComponentEntry = aSComponent->GetID();
-    string anEntry = CreateAttributes(aCStudy, aSComponentEntry.c_str(), "", "", theName, "",
+    string anEntry = CreateAttributes(aCStudy, 
+                                     aSComponentEntry.c_str(), 
+                                     "", 
+                                     "", 
+                                     theName, 
+                                     "",
                                      ToString(theViewManager->getActiveView()).c_str());
     return true;
   }
@@ -1627,10 +1632,10 @@ namespace VISU {
   class TSaveViewParamsEvent: public SALOME_Event
   {
     SUIT_ViewManager* myViewMgr;
-    const char*       myName;
+    std::string       myName;
   public:
     TSaveViewParamsEvent (SUIT_ViewManager* theViewManager,
-                         const char*       theName):
+                         const std::string& theName):
       myViewMgr(theViewManager),
       myName(theName)
     {}
@@ -1643,12 +1648,12 @@ namespace VISU {
     TResult myResult;
   };
 
-  CORBA::Boolean View3D_i::SaveViewParams (const char* theName)
+  CORBA::Boolean View3D_i::SaveViewParams (const char* theViewParamsName)
   {
-    return ProcessEvent(new TSaveViewParamsEvent (myViewManager, theName));
+    return ProcessEvent(new TSaveViewParamsEvent (myViewManager, theViewParamsName));
   }
 
-  bool View3D_i::RestoreViewParams (SUIT_ViewManager* theViewManager, const char* theName)
+  bool View3D_i::RestoreViewParams (SUIT_ViewManager* theViewManager, const std::string& theName)
   {
     _PTR(Study) aCStudy;
     if (SUIT_Study* aSStudy = theViewManager->study()) {
@@ -1686,10 +1691,10 @@ namespace VISU {
   class TRestoreViewParamsEvent: public SALOME_Event
   {
     SUIT_ViewManager* myViewMgr;
-    const char*       myName;
+    std::string       myName;
   public:
     TRestoreViewParamsEvent (SUIT_ViewManager* theViewManager,
-                            const char*       theName):
+                            const std::string& theName):
       myViewMgr(theViewManager),
       myName(theName)
     {}
@@ -1702,9 +1707,9 @@ namespace VISU {
     TResult myResult;
   };
 
-  CORBA::Boolean View3D_i::RestoreViewParams (const char* theName)
+  CORBA::Boolean View3D_i::RestoreViewParams (const char* theViewParamsName)
   {
-    return ProcessEvent(new TRestoreViewParamsEvent (myViewManager, theName));
+    return ProcessEvent(new TRestoreViewParamsEvent (myViewManager, theViewParamsName));
   }
 
   void View3D_i::Restore (SUIT_ViewWindow* theViewWindow,
index 2000ab7996f67b4ef75be90a93f26bd154069916..0c1cf1f0398deaf704dc975a7fd91ef1a2692660 100644 (file)
@@ -278,12 +278,12 @@ namespace VISU
     static void ToStream (SUIT_ViewWindow* theViewWindow, std::ostringstream& theStr);
 
     static  bool           SaveViewParams (SUIT_ViewManager* theViewManager,
-                                           const char* theName);
-    virtual CORBA::Boolean SaveViewParams (const char* theName);
+                                           const std::string& theName);
+    virtual CORBA::Boolean SaveViewParams (const char* theViewParamsName);
 
     static  bool           RestoreViewParams (SUIT_ViewManager* theViewManager,
-                                              const char* theName);
-    virtual CORBA::Boolean RestoreViewParams (const char* theName);
+                                              const std::string& theName);
+    virtual CORBA::Boolean RestoreViewParams (const char* theViewParamsName);
 
     static QString GenerateViewParamsName();