]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
PAL11080: Wrong magnitude coloring of published animation. The method SameAs() of...
authorjfa <jfa@opencascade.com>
Tue, 10 Jan 2006 10:53:33 +0000 (10:53 +0000)
committerjfa <jfa@opencascade.com>
Tue, 10 Jan 2006 10:53:33 +0000 (10:53 +0000)
18 files changed:
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_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_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_Vectors_i.cc
src/VISU_I/VISU_Vectors_i.hh

index 36fd00a591496cee1a1f91af53265164dc1ee3dc..e08e3ff7515c9ebdd864f576b67f286577543a16 100644 (file)
@@ -79,10 +79,6 @@ CutLines_i(Result_i* theResult,
 }
 
 
-void VISU::CutLines_i::SameAs(const CutLines_i* theOrigin){
-  VISU::ScalarMap_i::SameAs(theOrigin);
-}
-
 /*! Copy map to /a myMapCurvesInverted.
  * \param theCurves - map
  */
index 93780198116665cab0b42c9073abd9730a5cf5b0..84540a186645daca90937ae3fd4036e8584007df 100644 (file)
@@ -45,7 +45,6 @@ namespace VISU{
     explicit
     CutLines_i(Result_i* theResult,
               SALOMEDS::SObject_ptr theSObject);
-    virtual void SameAs(const CutLines_i* theOrigin);
     virtual ~CutLines_i();
 
     virtual VISU::VISUType GetType() { return VISU::TCUTLINES;};
index b0dca7d0340edd9ddbc094c9e280f965eb439483..9cd09af54ff892137646ff7caa54e9ee6a71eff5 100644 (file)
@@ -75,11 +75,6 @@ CutPlanes_i(Result_i* theResult,
 }
 
 
-void VISU::CutPlanes_i::SameAs(const CutPlanes_i* theOrigin){
-  VISU::ScalarMap_i::SameAs(theOrigin);
-}
-
-
 VISU::Storable* VISU::CutPlanes_i::Create(const char* theMeshName, VISU::Entity theEntity, 
                                          const char* theFieldName, int theIteration)
 {
index 28abd7d30165de36dc2fed1f4b3db60fb1489666..7c76d8c89db197ca004812d7cf59327a83c61957 100644 (file)
@@ -45,7 +45,6 @@ namespace VISU{
     explicit
     CutPlanes_i(Result_i* theResult,
                SALOMEDS::SObject_ptr theSObject);
-    virtual void SameAs(const CutPlanes_i* theOrigin);
     virtual ~CutPlanes_i();
 
     virtual VISU::VISUType GetType() { return VISU::TCUTPLANES;};
index 1198ad2d3d31b797a08d9d0136589fdc4eedb4db..f99b0794b52b28a47de49a56c27f5f13ae2bbe68 100644 (file)
@@ -86,13 +86,15 @@ DeformedShape_i(Result_i* theResult,
 }
 
 
-void VISU::DeformedShape_i::SameAs(const DeformedShape_i* theOrigin)
+void VISU::DeformedShape_i::SameAs(const Prs3d_i* theOrigin)
 {
-  DeformedShape_i* aDefShape = const_cast<DeformedShape_i*>(theOrigin);
   VISU::ScalarMap_i::SameAs(theOrigin);
 
-  SetColor(aDefShape->GetColor());
-  ShowColored(aDefShape->IsColored());
+  if (const DeformedShape_i* aConstDefShape = dynamic_cast<const DeformedShape_i*>(theOrigin)) {
+    DeformedShape_i* aDefShape = const_cast<DeformedShape_i*>(aConstDefShape);
+    SetColor(aDefShape->GetColor());
+    ShowColored(aDefShape->IsColored());
+  }
 }
 
 
index a930c37df2daed393f0682929b629a7623eb1688..de9167b4ad7d49c2f30e3ec352bd029d73a57e10 100644 (file)
@@ -45,7 +45,7 @@ namespace VISU{
     explicit
     DeformedShape_i(Result_i* theResult,
                    SALOMEDS::SObject_ptr theSObject);
-    virtual void SameAs(const DeformedShape_i* theOrigin);
+    virtual void SameAs(const Prs3d_i* theOrigin);
     virtual ~DeformedShape_i();
 
     virtual VISU::VISUType GetType() { return VISU::TDEFORMEDSHAPE;};
index 79b2a877fd328bda3c1605e5d1aa3fcb1298cdba..853a5499b20f02345f48c0ad9ebd21cb482f761e 100644 (file)
@@ -73,11 +73,6 @@ IsoSurfaces_i(Result_i* theResult,
 }
 
 
-void VISU::IsoSurfaces_i::SameAs(const IsoSurfaces_i* theOrigin) {
-  VISU::ScalarMap_i::SameAs(theOrigin);
-}
-
-
 VISU::Storable* VISU::IsoSurfaces_i::Create(const char* theMeshName, VISU::Entity theEntity, 
                                            const char* theFieldName, int theIteration)
 {
index c7371b6a48b4130e08b91e22aa62acc11bc6f7ee..d51f36aaeb44cf1a678e95eba9e0b69c93db87d4 100644 (file)
@@ -45,7 +45,6 @@ namespace VISU{
     explicit
     IsoSurfaces_i(Result_i* theResult,
                  SALOMEDS::SObject_ptr theSObject);
-    virtual void SameAs(const IsoSurfaces_i* theOrigin);
     virtual ~IsoSurfaces_i();
 
     virtual VISU::VISUType GetType() { return VISU::TISOSURFACE;};
index 6d8851026cffc5f8d9b7b9b16bb237ee8807cdaf..5c3cb3179cc10cd8589e56bc50f70a0283d62c54 100644 (file)
@@ -79,7 +79,7 @@ void VISU::Mesh_i::RemoveFromStudy()
 }
 
 
-void VISU::Mesh_i::SameAs (const Mesh_i* theOrigin)
+void VISU::Mesh_i::SameAs (const Prs3d_i* theOrigin)
 {
   return; // "SameAs" command for mesh is not valid in current architecture
 }
index 6f7ffd5f2bce994717ad775d33a5a36d2b87d75d..a9eb6f7efdb51db3dfb4d6c4bf6ccd316bbcc193 100644 (file)
@@ -44,7 +44,7 @@ namespace VISU{
     explicit
     Mesh_i(Result_i* theResult,
           SALOMEDS::SObject_ptr theSObject);
-    virtual void SameAs(const Mesh_i* theOrigin);
+    virtual void SameAs(const Prs3d_i* theOrigin);
     virtual ~Mesh_i();
     virtual void RemoveFromStudy();
 
index a91f5bd53178b946a9c2b9cbfaad273aab793066..8f69fd9f3810b2b12e97dd843a1b5118aaf5128c 100644 (file)
@@ -64,11 +64,6 @@ VISU::Plot3D_i::Plot3D_i (Result_i* theResult, SALOMEDS::SObject_ptr theSObject)
 {
 }
 
-void VISU::Plot3D_i::SameAs (const Plot3D_i* theOrigin)
-{
-  VISU::ScalarMap_i::SameAs(theOrigin);
-}
-
 VISU::Storable* VISU::Plot3D_i::Create (const char* theMeshName, VISU::Entity theEntity,
                                        const char* theFieldName, int theIteration)
 {
index 14c3901561da07ceab5f3bcba7a00e088efdfc5d..acd7644013132875935acd272f30d250531fdb65 100644 (file)
@@ -39,7 +39,6 @@ namespace VISU {
     explicit
     Plot3D_i (Result_i* theResult, SALOMEDS::SObject_ptr theSObject);
 
-    virtual void SameAs (const Plot3D_i* theOrigin);
     virtual ~Plot3D_i();
 
     virtual VISU::VISUType GetType() { return VISU::TPLOT3D; };
index c8ef879efdda1f8df2187e3e5c9c6ea6e18479ac..ee0d28ed304908bc0b6edb4c59f08abee6cd548c 100644 (file)
@@ -100,11 +100,15 @@ void VISU::ScalarMap_i::RemoveFromStudy()
 }
 
 
-void VISU::ScalarMap_i::SameAs(const ScalarMap_i* theOrigin)
+void VISU::ScalarMap_i::SameAs(const Prs3d_i* theOrigin)
 {
-  ScalarMap_i* aScalarMap = const_cast<ScalarMap_i*>(theOrigin);
   DoHook();
-  VISU::Prs3d_i::SameAs(aScalarMap);
+  VISU::Prs3d_i::SameAs(theOrigin);
+
+  const ScalarMap_i* aConstScalarMap = dynamic_cast<const ScalarMap_i*>(theOrigin);
+  if (!aConstScalarMap) return;
+
+  ScalarMap_i* aScalarMap = const_cast<ScalarMap_i*>(aConstScalarMap);
   myField = aScalarMap->GetField();
   myMeshName = myField->myMeshName;
   myEntity = myField->myEntity;
index 3ff150209184e1f5993f98d0109ee32f4fc02136..a1b3f0a5d4835ede996521de4e3b4638513169f0 100644 (file)
@@ -46,7 +46,7 @@ namespace VISU{
     explicit
     ScalarMap_i(Result_i* theResult,
                SALOMEDS::SObject_ptr theSObject);
-    virtual void SameAs(const ScalarMap_i* theOrigin);
+    virtual void SameAs(const Prs3d_i* theOrigin);
     virtual ~ScalarMap_i();
     virtual void RemoveFromStudy();
 
@@ -173,7 +173,7 @@ namespace VISU{
     const std::string& GetMeshName() const { return myMeshName;}
     VISU::Entity GetEntity() const { return VISU::Entity(myEntity);}
     const string& GetFieldName() const { return myFieldName;}
-    int GetIteration() const { return myIteration;}
+    //int GetIteration() const { return myIteration;}
 
     virtual void ToStream(std::ostringstream& theStr);
 
index ecfe43c5942117fc36e2752bdcd2ba668c8ab5d1..418d20cbc0b2f49c56a6f10e1de9514f51dc1d30 100644 (file)
@@ -95,10 +95,14 @@ StreamLines_i(Result_i* theResult,
 }
 
 
-void VISU::StreamLines_i::SameAs(const StreamLines_i* theOrigin) {
-  StreamLines_i* aStreamLines = const_cast<StreamLines_i*>(theOrigin);
+void VISU::StreamLines_i::SameAs(const Prs3d_i* theOrigin)
+{
   VISU::DeformedShape_i::SameAs(theOrigin);
-  SetSource(aStreamLines->GetSource());
+
+  if (const StreamLines_i* aConstStreamLines = dynamic_cast<const StreamLines_i*>(theOrigin)) {
+    StreamLines_i* aStreamLines = const_cast<StreamLines_i*>(aConstStreamLines);
+    SetSource(aStreamLines->GetSource());
+  }
 }
 
 
index ab8429033c669e926ef33eabfd47bfbd9dbc89f4..a5a1a2530d940be47d3ecfb9bd3a759e0b0f6a38 100644 (file)
@@ -46,7 +46,7 @@ namespace VISU{
     explicit
     StreamLines_i(Result_i* theResult,
                  SALOMEDS::SObject_ptr theSObject);
-    virtual void SameAs(const StreamLines_i* theOriginal);
+    virtual void SameAs(const Prs3d_i* theOriginal);
     virtual ~StreamLines_i();
 
     virtual VISU::VISUType GetType() { return VISU::TSTREAMLINES;}
index bd086a600491d10d3f657e513fb2c365d6603259..3fb107803770b0e5b742a2d0f017ab2cc7aee42c 100644 (file)
@@ -93,11 +93,14 @@ Vectors_i(Result_i* theResult,
 }
 
 
-void VISU::Vectors_i::SameAs(const VISU::Vectors_i* theOrigin) {
-  Vectors_i* aVectors = const_cast<Vectors_i*>(theOrigin);
+void VISU::Vectors_i::SameAs(const VISU::Prs3d_i* theOrigin)
+{
   VISU::DeformedShape_i::SameAs(theOrigin);
 
-  SetLineWidth(aVectors->GetLineWidth());
+  if (const VISU::Vectors_i* aConstVec = dynamic_cast<const VISU::Vectors_i*>(theOrigin)) {
+    VISU::Vectors_i* aVectors = const_cast<VISU::Vectors_i*>(aConstVec);
+    SetLineWidth(aVectors->GetLineWidth());
+  }
 }
 
 
index bcb4ab2fd2a108860504a75e0f1be590c66930f3..7c167ae063642ec4358af29460ef34b39d702deb 100644 (file)
@@ -45,7 +45,7 @@ namespace VISU{
     explicit
     Vectors_i(Result_i* theResult,
              SALOMEDS::SObject_ptr theSObject);
-    virtual void SameAs(const Vectors_i* theOrigin);
+    virtual void SameAs(const Prs3d_i* theOrigin);
     virtual ~Vectors_i();
 
     virtual VISU::VISUType GetType() { return VISU::TVECTORS;};