Salome HOME
IPAL21489 Filter by Scalars... does not show visible elements for some presentations.
[modules/visu.git] / src / VISU_I / VISU_DeformedShape_i.cc
index 5e8ae25df85037ccdb09dd3661c2870ab03b4893..fa280ebf1af303c12ec38d2e2f48824a9e20a181 100644 (file)
@@ -1,29 +1,29 @@
-//  VISU OBJECT : interactive object for VISU entities implementation
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  VISU OBJECT : interactive object for VISU entities implementation
 //  File   : VISU_PrsObject_i.cxx
 //  Author : Alexey PETROV
 //  Module : VISU
-
+//
 #include "VISU_DeformedShape_i.hh"
 #include "VISU_Prs3dUtils.hh"
 #include "VISU_Result_i.hh"
@@ -34,7 +34,7 @@
 #include "VISU_Convertor.hxx"
 
 #include "SUIT_ResourceMgr.h"
-#include "SALOME_Event.hxx"
+#include "SALOME_Event.h"
 
 #include <vtkDataSetMapper.h>
 #include <vtkProperty.h>
@@ -45,6 +45,7 @@ static int MYDEBUG = 0;
 static int MYDEBUG = 0;
 #endif
 
+using namespace std;
 
 //---------------------------------------------------------------
 size_t
@@ -123,6 +124,7 @@ VISU::DeformedShape_i
 ::DeformedShape_i(EPublishInStudyMode thePublishInStudyMode):
   ColoredPrs3d_i(thePublishInStudyMode),
   ScalarMap_i(thePublishInStudyMode),
+  MonoColorPrs_i(thePublishInStudyMode),
   myDeformedShapePL(NULL)
 {
   if(MYDEBUG) MESSAGE("DeformedShape_i::DeformedShape_i");
@@ -151,8 +153,6 @@ VISU::DeformedShape_i
         const std::string& theFieldName, 
         CORBA::Long theTimeStampNumber)
 {
-  myIsColored = false;
-  myColor.R = myColor.G = myColor.B = 0.5;
   return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
 }
 
@@ -167,10 +167,6 @@ VISU::DeformedShape_i
     return NULL;
 
   SetScale(VISU::Storable::FindValue(theMap,"myFactor").toDouble());
-  myIsColored = VISU::Storable::FindValue(theMap,"myIsColored").toInt();
-  myColor.R = VISU::Storable::FindValue(theMap,"myColor.R").toDouble();
-  myColor.G = VISU::Storable::FindValue(theMap,"myColor.G").toDouble();
-  myColor.B = VISU::Storable::FindValue(theMap,"myColor.B").toDouble();
 
   return this;
 }
@@ -184,11 +180,6 @@ VISU::DeformedShape_i
   TSuperClass::ToStream(theStr);
 
   Storable::DataToStream( theStr, "myFactor", GetScale() );
-
-  Storable::DataToStream( theStr, "myIsColored", myIsColored );
-  Storable::DataToStream( theStr, "myColor.R", myColor.R );
-  Storable::DataToStream( theStr, "myColor.G", myColor.G );
-  Storable::DataToStream( theStr, "myColor.B", myColor.B );
 }
 
 
@@ -220,54 +211,6 @@ VISU::DeformedShape_i
 }
 
 
-//---------------------------------------------------------------
-CORBA::Boolean 
-VISU::DeformedShape_i
-::IsColored()
-{
-  return myIsColored;
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::DeformedShape_i
-::ShowColored(CORBA::Boolean theColored)
-{
-  if(myIsColored == theColored)
-    return;
-
-  myIsColored = theColored; 
-  myParamsTime.Modified();
-}
-
-//---------------------------------------------------------------
-SALOMEDS::Color 
-VISU::DeformedShape_i
-::GetColor()
-{
-  return myColor;
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::DeformedShape_i
-::SetColor(const SALOMEDS::Color& theColor)
-{
-  bool anIsSameValue = VISU::CheckIsSameValue(myColor.R, theColor.R);
-  anIsSameValue &= VISU::CheckIsSameValue(myColor.G, theColor.G);
-  anIsSameValue &= VISU::CheckIsSameValue(myColor.B, theColor.B);
-  if(anIsSameValue)
-    return;
-
-  VISU::TSetModified aModified(this);
-  
-  myColor = theColor;
-  myParamsTime.Modified();
-}
-
-
 //---------------------------------------------------------------
 void
 VISU::DeformedShape_i
@@ -321,34 +264,7 @@ VISU::DeformedShape_i
   bool toShrink  = aResourceMgr->booleanValue("VISU", "deformed_shape_shrink", false);
   anActor->SetRepresentation(aDispMode);
   if (toShrink && !toSupressShrinking) anActor->SetShrink();
-  anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
   return anActor;
 }
 
 
-//---------------------------------------------------------------
-VISU_Actor* 
-VISU::DeformedShape_i
-::CreateActor() 
-{
-  return CreateActor(false);
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::DeformedShape_i
-::UpdateActor(VISU_Actor* theActor) 
-{
-  if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
-    if(IsColored()){
-      anActor->SetBarVisibility(true);
-      GetPipeLine()->GetMapper()->SetScalarVisibility(1);
-    }else{
-      anActor->SetBarVisibility(false);
-      GetPipeLine()->GetMapper()->SetScalarVisibility(0);
-      anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
-    }
-    TSuperClass::UpdateActor(theActor);
-  }
-}