-// 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"
#include "VISU_Convertor.hxx"
#include "SUIT_ResourceMgr.h"
-#include "SALOME_Event.hxx"
+#include "SALOME_Event.h"
#include <vtkDataSetMapper.h>
#include <vtkProperty.h>
static int MYDEBUG = 0;
#endif
+using namespace std;
//---------------------------------------------------------------
size_t
::DeformedShape_i(EPublishInStudyMode thePublishInStudyMode):
ColoredPrs3d_i(thePublishInStudyMode),
ScalarMap_i(thePublishInStudyMode),
+ MonoColorPrs_i(thePublishInStudyMode),
myDeformedShapePL(NULL)
{
if(MYDEBUG) MESSAGE("DeformedShape_i::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);
}
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;
}
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 );
}
}
-//---------------------------------------------------------------
-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
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);
- }
-}