} else {
vtkCellData *aCellData = theInput->GetCellData();
if(!aCellData->GetAttribute(vtkDataSetAttributes::VECTORS)){
- if(theScalarMode==0){
+ if(theScalarMode == 0){
return;
}
}
VISU_ColoredPL
::SetScalarRange(vtkFloatingPointType theRange[2])
{
+ if(theRange[0] > theRange[1])
+ return;
+
myFieldTransform->SetScalarRange(theRange);
myBarTable->SetRange(theRange);
}
VISU_CutLinesPL
::SetPosition(vtkFloatingPointType thePosition)
{
+ bool anIsSameValue = VISU::CheckIsSameValue(myPosition, thePosition);
+ anIsSameValue &= (myCondition == 0);
+ if(anIsSameValue)
+ return;
+
myPosition = thePosition;
myCondition = 0;
Modified();
VISU_CutLinesPL
::SetDefault()
{
+ if(myCondition == 1)
+ return;
+
myCondition = 1;
Modified();
}
::SetDisplacement(vtkFloatingPointType theDisp,
int theNum)
{
+ if(VISU::CheckIsSameValue(myDisplacement[theNum], theDisp))
+ return;
+
myDisplacement[theNum] = theDisp;
Modified();
}
//----------------------------------------------------------------------------
void
VISU_CutPlanesPL
-::SetNbParts(int theNb)
+::SetNbParts(int theNbParts)
{
- if(theNb > 0){
- myNbParts = theNb;
- myPartPosition.resize(myNbParts);
- myPartCondition.resize(myNbParts, 1);
+ if(theNbParts > 0 && myNbParts != theNbParts){
+ myPartPosition.resize(theNbParts);
+ myPartCondition.resize(theNbParts, 1);
+ myNbParts = theNbParts;
Modified();
}
}
if(thePartNumber >= myNbParts)
return;
+ bool anIsSameValue = VISU::CheckIsSameValue(myPartPosition[thePartNumber], thePartPosition);
+ anIsSameValue &= VISU::CheckIsSameValue(myPartCondition[thePartNumber], 0);
+ if(anIsSameValue)
+ return;
+
myPartPosition[thePartNumber] = thePartPosition;
myPartCondition[thePartNumber] = 0;
Modified();
if(thePartNumber >= myNbParts)
return;
+ bool anIsSameValue = VISU::CheckIsSameValue(myPartPosition[thePartNumber], GetPartPosition(thePartNumber));
+ anIsSameValue &= VISU::CheckIsSameValue(myPartCondition[thePartNumber], 1);
+ if(anIsSameValue)
+ return;
+
myPartPosition[thePartNumber] = GetPartPosition(thePartNumber);
myPartCondition[thePartNumber] = 1;
Modified();
::SetNbParts(int theNb)
{
myContourFilter->SetNumberOfContours(theNb);
- Modified();
}
VISU_IsoSurfacesPL
::SetRange(vtkFloatingPointType theRange[2])
{
+ if(VISU::CheckIsSameRange(myRange, theRange))
+ return;
+
if(theRange[0] <= theRange[1]){
myRange[0] = theRange[0];
myRange[1] = theRange[1];
VISU_Plot3DPL::
SetContourPrs(bool theIsContourPrs )
{
+ if(myIsContour == theIsContourPrs)
+ return;
+
myIsContour = theIsContourPrs;
Modified();
}
::SetPlanePosition(vtkFloatingPointType thePosition,
bool theIsRelative)
{
+ bool anIsSameValue = VISU::CheckIsSameValue(myIsRelative, theIsRelative);
+ anIsSameValue &= (myPosition == thePosition);
+ if(anIsSameValue)
+ return;
+
myIsRelative = theIsRelative;
myPosition = thePosition;
Modified();
vtkFloatingPointType theXAngle,
vtkFloatingPointType theYAngle)
{
+ bool anIsSameValue = VISU::CheckIsSameValue(GetRotateX(), theXAngle);
+ anIsSameValue &= VISU::CheckIsSameValue(GetRotateY(), theYAngle);
+ anIsSameValue &= (myOrientation == theOrientation);
+ if(anIsSameValue)
+ return;
+
switch(theOrientation){
case VISU_CutPlanesPL::XY: myAngle[0] = theXAngle; break;
case VISU_CutPlanesPL::YZ: myAngle[1] = theXAngle; break;
case VISU_CutPlanesPL::ZX: myAngle[2] = theXAngle; break;
}
+
switch(theOrientation){
case VISU_CutPlanesPL::XY: myAngle[1] = theYAngle; break;
case VISU_CutPlanesPL::YZ: myAngle[2] = theYAngle; break;
case VISU_CutPlanesPL::ZX: myAngle[0] = theYAngle; break;
}
+
myOrientation = theOrientation;
Modified();
}
VISU_VectorsPL
::SetGlyphType(VISU_VectorsPL::GlyphType theType)
{
+ if(myTypeGlyph == theType)
+ return;
+
myTypeGlyph = theType;
Modified();
}
VISU_VectorsPL
::SetGlyphPos(VISU_VectorsPL::GlyphPos thePos)
{
+ if(myPosGlyph == thePos)
+ return;
+
myPosGlyph = thePos;
Modified();
}
{
Superclass::Init();
- myTypeGlyph = ARROW;
- myPosGlyph = TAIL;
+ SetGlyphType(ARROW);
+ SetGlyphPos(TAIL);
}
if(myUpdateScalars)
SetScalarField( false );
- myPrsCopy->ShowColored(true);
-
VISU::TSameAsFactory<VISU::TSCALARMAPONDEFORMEDSHAPE>().Copy(thePrs, myPrsCopy);
return anIsOk;
#include "VISU_ColoredPrs3d_i.hh"
-#include "VISU_ColoredPL.hxx"
#include "VISU_Result_i.hh"
+#include "VISU_ColoredPL.hxx"
+#include "VISU_PipeLineUtils.hxx"
#include "VISU_Convertor.hxx"
#include "SUIT_ResourceMgr.h"
else if(theScalarMode > aNbComp)
theScalarMode = 0;
- myColoredPL->SetScalarMode(theScalarMode);
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ColoredPL, int>
+ (GetSpecificPL(), &VISU_ColoredPL::SetScalarMode, theScalarMode));
}
//----------------------------------------------------------------------------
VISU::ColoredPrs3d_i
::SetRange(CORBA::Double theMin, CORBA::Double theMax)
{
- if(theMin > theMax)
- return;
vtkFloatingPointType aScalarRange[2] = {theMin, theMax};
- GetSpecificPL()->SetScalarRange(aScalarRange);
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ColoredPL, vtkFloatingPointType*>
+ (GetSpecificPL(), &VISU_ColoredPL::SetScalarRange, aScalarRange));
+
UseFixedRange(true);
}
VISU::ColoredPrs3d_i
::SetSourceRange()
{
- if(IsTimeStampFixed())
+ if(IsTimeStampFixed()){
GetSpecificPL()->SetSourceRange();
- else{
+ ProcessVoidEvent(new TVoidMemFunEvent<VISU_ColoredPL>
+ (GetSpecificPL(), &VISU_ColoredPL::SetSourceRange));
+ }else{
TMinMax aTMinMax = GetField()->GetMinMax(GetScalarMode());
vtkFloatingPointType aScalarRange[2] = {aTMinMax.first, aTMinMax.second};
- GetSpecificPL()->SetScalarRange(aScalarRange);
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ColoredPL, vtkFloatingPointType*>
+ (GetSpecificPL(), &VISU_ColoredPL::SetScalarRange, aScalarRange));
}
UseFixedRange(false);
}
VISU::ColoredPrs3d_i
::SetNbColors(CORBA::Long theNbColors)
{
- GetSpecificPL()->SetNbColors(theNbColors);
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ColoredPL, int>
+ (GetSpecificPL(), &VISU_ColoredPL::SetNbColors, theNbColors));
}
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
void
VISU::ColoredPrs3d_i
-::SetPosition(CORBA::Double X, CORBA::Double Y)
+::SetPosition(CORBA::Double theX, CORBA::Double theY)
{
- myPosition[0] = X;
- myPosition[1] = Y;
+ bool anIsSameValue = VISU::CheckIsSameValue(myPosition[0], theX);
+ anIsSameValue &= VISU::CheckIsSameValue(myPosition[1], theY);
+ if(anIsSameValue)
+ return;
+
+ myPosition[0] = theX;
+ myPosition[1] = theY;
myParamsTime.Modified();
}
VISU::ColoredPrs3d_i
::SetSize(CORBA::Double theWidth, CORBA::Double theHeight)
{
+ bool anIsSameValue = VISU::CheckIsSameValue(myWidth, theWidth);
+ anIsSameValue &= VISU::CheckIsSameValue(myHeight, theHeight);
+ if(anIsSameValue)
+ return;
+
myWidth = theWidth;
myHeight = theHeight;
myParamsTime.Modified();
vtkFloatingPointType theG,
vtkFloatingPointType theB)
{
+ bool anIsSameValue = VISU::CheckIsSameValue(myTitleColor[0], theR);
+ anIsSameValue &= VISU::CheckIsSameValue(myTitleColor[1], theG);
+ anIsSameValue &= VISU::CheckIsSameValue(myTitleColor[2], theB);
+ if(anIsSameValue)
+ return;
+
myTitleColor[0] = theR;
myTitleColor[1] = theG;
myTitleColor[2] = theB;
vtkFloatingPointType theG,
vtkFloatingPointType theB)
{
+ bool anIsSameValue = VISU::CheckIsSameValue(myLabelColor[0], theR);
+ anIsSameValue &= VISU::CheckIsSameValue(myLabelColor[1], theG);
+ anIsSameValue &= VISU::CheckIsSameValue(myLabelColor[2], theB);
+ if(anIsSameValue)
+ return;
+
myLabelColor[0] = theR;
myLabelColor[1] = theG;
myLabelColor[2] = theB;
VISU::ColoredPrs3d_i
::UseFixedRange(bool theUseFixedRange)
{
+ if(myIsFixedRange == theUseFixedRange)
+ return;
+
myIsFixedRange = theUseFixedRange;
+ myParamsTime.Modified();
}
//----------------------------------------------------------------------------
// Orientation
int anOrientation = aResourceMgr->integerValue("VISU", "scalar_bar_orientation", 0);
if(anOrientation == 1)
- myOrientation = VISU::ScalarMap::HORIZONTAL;
+ SetBarOrientation(VISU::ScalarMap::HORIZONTAL);
else
- myOrientation = VISU::ScalarMap::VERTICAL;
+ SetBarOrientation(VISU::ScalarMap::VERTICAL);
// Scalar Bar origin
QString propertyName = QString( "scalar_bar_%1_" ).arg( anOrientation == 0 ? "vertical" : "horizontal" );
VISU::CutLines_i
::SetDisplacement(CORBA::Double theDisp)
{
- myCutLinesPL->SetDisplacement(theDisp);
+ ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_CutLinesPL, vtkFloatingPointType, int>
+ (GetSpecificPL(), &VISU_CutLinesPL::SetDisplacement, theDisp, 0));
}
//---------------------------------------------------------------
VISU::CutLines_i
::SetDisplacement2(CORBA::Double theDisp)
{
- myCutLinesPL->SetDisplacement(theDisp,1);
+ ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_CutLinesPL, vtkFloatingPointType, int>
+ (GetSpecificPL(), &VISU_CutLinesPL::SetDisplacement, theDisp, 1));
}
VISU::CutLines_i
::SetBasePlanePosition(CORBA::Double thePlanePosition)
{
- myCutLinesPL->SetPosition(thePlanePosition);
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_CutLinesPL, vtkFloatingPointType>
+ (GetSpecificPL(), &VISU_CutLinesPL::SetPosition, thePlanePosition));
}
//---------------------------------------------------------------
::SetLinePosition(CORBA::Long thePlaneNumber,
CORBA::Double thePlanePosition)
{
- myCutLinesPL->SetPartPosition(thePlaneNumber,thePlanePosition);
+ ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_CutLinesPL, int, vtkFloatingPointType>
+ (GetSpecificPL(), &VISU_CutLinesPL::SetPartPosition, thePlaneNumber, thePlanePosition));
}
//---------------------------------------------------------------
VISU::CutLines_i
::SetDefault()
{
- myCutLinesPL->SetDefault();
+ ProcessVoidEvent(new TVoidMemFunEvent<VISU_CutLinesPL>
+ (GetSpecificPL(), &VISU_CutLinesPL::SetDefault));
}
//---------------------------------------------------------------
VISU::CutLines_i
::SetDefaultPosition(CORBA::Long thePlaneNumber)
{
- myCutLinesPL->SetPartDefault(thePlaneNumber);
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_CutLinesPL, int>
+ (GetSpecificPL(), &VISU_CutLinesPL::SetPartDefault, thePlaneNumber));
}
//---------------------------------------------------------------
VISU::CutLines_i
::SetAllCurvesInverted(CORBA::Boolean theInvert)
{
- for(int i=0; i<GetNbLines(); i++)
+ for(int i=0; i < GetNbLines(); i++)
SetCurveInverted(i, theInvert);
}
*/
void
VISU::CutLines_i
-::SetCurveInverted(CORBA::Long theCurveNumber,CORBA::Boolean theInvert)
+::SetCurveInverted(CORBA::Long theCurveNumber, CORBA::Boolean theInvert)
{
+ if(myMapCurvesInverted[theCurveNumber] == theInvert)
+ return;
+
myMapCurvesInverted[theCurveNumber] = theInvert;
+ myParamsTime.Modified();
}
//---------------------------------------------------------------
VISU::CutLines_i
::SetUseAbsoluteLength(CORBA::Boolean theAbsLength)
{
+ if(myUseAbsLength == theAbsLength)
+ return;
+
myUseAbsLength = theAbsLength;
+ myParamsTime.Modified();
}
//---------------------------------------------------------------
VISU::CutLines_i
::SetNbLines(CORBA::Long theNb)
{
- myCutLinesPL->SetNbParts(theNb);
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_CutLinesPL, int>
+ (GetSpecificPL(), &VISU_CutLinesPL::SetNbParts, theNb));
}
//---------------------------------------------------------------
CORBA::Double theXAngle,
CORBA::Double theYAngle)
{
- myCutPlanesPL->SetOrientation(VISU_CutPlanesPL::PlaneOrientation(theOrient),
- theXAngle,
- theYAngle);
+ struct TEvent: public SALOME_Event
+ {
+ VISU_CutPlanesPL* myPipeLine;
+ VISU_CutPlanesPL::PlaneOrientation myOrient;
+ CORBA::Double myXAngle;
+ CORBA::Double myYAngle;
+
+ TEvent(VISU_CutPlanesPL* thePipeLine,
+ VISU_CutPlanesPL::PlaneOrientation theOrient,
+ CORBA::Double theXAngle,
+ CORBA::Double theYAngle):
+ myPipeLine(thePipeLine),
+ myOrient(theOrient),
+ myXAngle(theXAngle),
+ myYAngle(theYAngle)
+ {}
+
+ virtual
+ void
+ Execute()
+ {
+ myPipeLine->SetOrientation(myOrient,
+ myXAngle,
+ myYAngle);
+ }
+ };
+
+ ProcessVoidEvent(new TEvent(GetSpecificPL(),
+ VISU_CutPlanesPL::PlaneOrientation(theOrient),
+ theXAngle,
+ theYAngle));
}
//----------------------------------------------------------------------------
VISU::CutPlanes_i
::SetDisplacement(CORBA::Double theDisp)
{
- myCutPlanesPL->SetDisplacement(theDisp);
+ ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_CutPlanesPL, vtkFloatingPointType, int>
+ (GetSpecificPL(), &VISU_CutPlanesPL::SetDisplacement, theDisp, 0));
}
//----------------------------------------------------------------------------
::SetPlanePosition(CORBA::Long thePlaneNumber,
CORBA::Double thePlanePosition)
{
- myCutPlanesPL->SetPartPosition(thePlaneNumber, thePlanePosition);
+ ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_CutPlanesPL, int, vtkFloatingPointType>
+ (GetSpecificPL(), &VISU_CutPlanesPL::SetPartPosition, thePlaneNumber, thePlanePosition));
}
//----------------------------------------------------------------------------
VISU::CutPlanes_i
::SetDefault(CORBA::Long thePlaneNumber)
{
- myCutPlanesPL->SetPartDefault(thePlaneNumber);
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_CutPlanesPL, int>
+ (GetSpecificPL(), &VISU_CutPlanesPL::SetPartDefault, thePlaneNumber));
}
//----------------------------------------------------------------------------
VISU::CutPlanes_i
::SetNbPlanes(CORBA::Long theNb)
{
- myCutPlanesPL->SetNbParts(theNb);
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_CutPlanesPL, int>
+ (GetSpecificPL(), &VISU_CutPlanesPL::SetNbParts, theNb));
}
//----------------------------------------------------------------------------
#include "VISU_ScalarMapAct.h"
#include "VISU_DeformedShapePL.hxx"
+#include "VISU_PipeLineUtils.hxx"
#include "VISU_Convertor.hxx"
#include "SUIT_ResourceMgr.h"
+#include "SALOME_Event.hxx"
#include <vtkDataSetMapper.h>
#include <vtkProperty.h>
VISU::DeformedShape_i
::SetScale(CORBA::Double theScale)
{
- myDeformedShapePL->SetScale(theScale);
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformedShapePL, vtkFloatingPointType>
+ (GetSpecificPL(), &VISU_DeformedShapePL::SetScale, theScale));
}
//---------------------------------------------------------------
VISU::DeformedShape_i
::ShowColored(CORBA::Boolean theColored)
{
+ if(myIsColored == theColored)
+ return;
+
myIsColored = theColored;
myParamsTime.Modified();
}
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;
+
myColor = theColor;
myParamsTime.Modified();
}
VISU::DeformedShape_i
::CheckIsPossible()
{
- return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
+ return IsPossible(GetCResult(),
+ GetCMeshName(),
+ GetEntity(),
+ GetCFieldName(),
+ GetTimeStampNumber(),
+ true);
}
VISU::IsoSurfaces_i
::SetNbSurfaces(CORBA::Long theNb)
{
-
- struct TEvent: public SALOME_Event
- {
- VISU_IsoSurfacesPL* myIsoSurfacesPL;
- CORBA::Long myNb;
-
- TEvent(VISU_IsoSurfacesPL* theIsoSurfacesPL,
- CORBA::Long theNb):
- myIsoSurfacesPL(theIsoSurfacesPL),
- myNb(theNb)
- {}
-
- virtual
- void
- Execute()
- {
- myIsoSurfacesPL->SetNbParts(myNb);
- }
- };
-
- ProcessVoidEvent(new TEvent(myIsoSurfacesPL, theNb));
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_IsoSurfacesPL, int>
+ (GetSpecificPL(), &VISU_IsoSurfacesPL::SetNbParts, theNb));
}
//---------------------------------------------------------------
::SetSubRange(CORBA::Double theMin, CORBA::Double theMax)
{
vtkFloatingPointType aRange[2] = {theMin, theMax};
- myIsoSurfacesPL->SetRange(aRange);
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_IsoSurfacesPL, vtkFloatingPointType*>
+ (GetSpecificPL(), &VISU_IsoSurfacesPL::SetRange, aRange));
}
//---------------------------------------------------------------
//
#include "VISU_Plot3D_i.hh"
+
#include "VISU_Result_i.hh"
#include "VISU_Plot3DPL.hxx"
#include "VISU_Actor.h"
+
#include "SUIT_ResourceMgr.h"
+#include "SALOME_Event.hxx"
#ifdef _DEBUG_
static int MYDEBUG = 0;
CORBA::Double theXAngle,
CORBA::Double theYAngle)
{
- myPlot3DPL->SetOrientation(VISU_CutPlanesPL::PlaneOrientation(theOrient),
- theXAngle,
- theYAngle);
+ struct TEvent: public SALOME_Event
+ {
+ VISU_Plot3DPL* myPipeLine;
+ VISU_CutPlanesPL::PlaneOrientation myOrient;
+ CORBA::Double myXAngle;
+ CORBA::Double myYAngle;
+
+ TEvent(VISU_Plot3DPL* thePipeLine,
+ VISU_CutPlanesPL::PlaneOrientation theOrient,
+ CORBA::Double theXAngle,
+ CORBA::Double theYAngle):
+ myPipeLine(thePipeLine),
+ myOrient(theOrient),
+ myXAngle(theXAngle),
+ myYAngle(theYAngle)
+ {}
+
+ virtual
+ void
+ Execute()
+ {
+ myPipeLine->SetOrientation(myOrient,
+ myXAngle,
+ myYAngle);
+ }
+ };
+
+ ProcessVoidEvent(new TEvent(GetSpecificPL(),
+ VISU_CutPlanesPL::PlaneOrientation(theOrient),
+ theXAngle,
+ theYAngle));
}
::SetPlanePosition(CORBA::Double thePlanePosition,
CORBA::Boolean theIsRelative)
{
- myPlot3DPL->SetPlanePosition(thePlanePosition, theIsRelative);
+ ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_Plot3DPL, vtkFloatingPointType, bool>
+ (GetSpecificPL(), &VISU_Plot3DPL::SetPlanePosition, thePlanePosition, theIsRelative));
}
VISU::Plot3D_i
::SetScaleFactor(CORBA::Double theScaleFactor)
{
- myPlot3DPL->SetScaleFactor(theScaleFactor);
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_Plot3DPL, vtkFloatingPointType>
+ (GetSpecificPL(), &VISU_Plot3DPL::SetScaleFactor, theScaleFactor));
}
VISU::Plot3D_i
::SetNbOfContours(CORBA::Long theNb)
{
- myPlot3DPL->SetNumberOfContours(theNb);
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_Plot3DPL, int>
+ (GetSpecificPL(), &VISU_Plot3DPL::SetNumberOfContours, theNb));
}
VISU::Plot3D_i
::SetContourPrs(CORBA::Boolean theIsContourPrs)
{
- myPlot3DPL->SetContourPrs( theIsContourPrs );
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_Plot3DPL, bool>
+ (GetSpecificPL(), &VISU_Plot3DPL::SetContourPrs, theIsContourPrs));
}
if(MYDEBUG) MESSAGE("Prs3d_i::Update - this = "<<this);
try{
- GetPipeLine()->Update();
+ ProcessVoidEvent(new TVoidMemFunEvent<VISU_PipeLine>
+ (GetPipeLine(), &VISU_PipeLine::Update));
myUpdateTime.Modified();
}catch(std::exception&){
throw;
#include "VISU_Result_i.hh"
#include "SUIT_ResourceMgr.h"
+#include "SALOME_Event.hxx"
#include <vtkUnstructuredGrid.h>
#include <vtkProperty.h>
const std::string& theFieldName,
CORBA::Long theTimeStampNumber)
{
- myIsColored = true;
- myColor.R = myColor.G = myColor.B = 0.5;
-
SetScalarField(theMeshName.c_str(),
theFieldName.c_str(),
theTimeStampNumber,
anEntity);
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;
}
Storable::DataToStream( theStr, "myScalarEntity", int(myScalarEntity));
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 );
}
VISU::ScalarMapOnDeformedShape_i
::SetScale(CORBA::Double theScale)
{
- myScalarMapOnDeformedShapePL->SetScale(theScale);
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ScalarMapOnDeformedShapePL, vtkFloatingPointType>
+ (GetSpecificPL(), &VISU_ScalarMapOnDeformedShapePL::SetScale, theScale));
}
}
-//---------------------------------------------------------------
-CORBA::Boolean
-VISU::ScalarMapOnDeformedShape_i
-::IsColored()
-{
- return myIsColored;
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::ScalarMapOnDeformedShape_i
-::ShowColored(CORBA::Boolean theColored)
-{
- myIsColored = theColored;
- myParamsTime.Modified();
-}
-
-//---------------------------------------------------------------
-SALOMEDS::Color
-VISU::ScalarMapOnDeformedShape_i
-::GetColor()
-{
- return myColor;
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::ScalarMapOnDeformedShape_i
-::SetColor(const SALOMEDS::Color& theColor)
-{
- myColor = theColor;
- myParamsTime.Modified();
-}
-
-
//---------------------------------------------------------------
void
VISU::ScalarMapOnDeformedShape_i
}else
myScalarMapOnDeformedShapePL = dynamic_cast<VISU_ScalarMapOnDeformedShapePL*>(thePipeLine);
- myScalarMapOnDeformedShapePL->GetMapper()->SetScalarVisibility(IsColored());
+ myScalarMapOnDeformedShapePL->GetMapper()->SetScalarVisibility(1);
TSuperClass::CreatePipeLine(myScalarMapOnDeformedShapePL);
}
int aDispMode = aResourceMgr->integerValue("VISU", "scalar_def_represent", 2);
bool toShrink = aResourceMgr->booleanValue("VISU", "scalar_def_shrink", false);
anActor->SetRepresentation(aDispMode);
- if (toShrink) anActor->SetShrink();
- anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
+ if (toShrink)
+ anActor->SetShrink();
anActor->SetVTKMapping(false);
return anActor;
}
::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);
+ anActor->SetBarVisibility(true);
+ GetPipeLine()->GetMapper()->SetScalarVisibility(1);
}
+ TSuperClass::UpdateActor(theActor);
}
vtkUnstructuredGrid* anOutput = anIDMapper->GetUnstructuredGridOutput();
if(myScalarMapOnDeformedShapePL && anOutput)
- myScalarMapOnDeformedShapePL->SetScalars(anOutput);
-
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ScalarMapOnDeformedShapePL, vtkDataSet*>
+ (GetSpecificPL(), &VISU_ScalarMapOnDeformedShapePL::SetScalars, anOutput));
+
myScalarMeshName = theMeshName;
myScalarEntity = theEntity;
myScalarFieldName = theFieldName;
SetTitle(theFieldName);
if(!IsRangeFixed() && IsPipeLineExists())
- GetSpecificPL()->SetSourceRange();
+ ProcessVoidEvent(new TVoidMemFunEvent<VISU_ColoredPL>
+ (GetSpecificPL(), &VISU_ColoredPL::SetSourceRange));
myParamsTime.Modified();
}
CORBA::Double
GetScale();
- virtual
- CORBA::Boolean
- IsColored();
-
- virtual
- void
- ShowColored(CORBA::Boolean theColored);
-
- virtual
- SALOMEDS::Color
- GetColor();
-
- virtual
- void
- SetColor(const SALOMEDS::Color& theColor);
-
virtual
void
SameAs(const Prs3d_i* theOrigin);
private:
VISU_ScalarMapOnDeformedShapePL *myScalarMapOnDeformedShapePL;
- bool myIsColored;
- SALOMEDS::Color myColor;
-
PField myScalarField;
std::string myScalarMeshName;
std::string myScalarFieldName;
VISU::ScalarMap_i
::SetScaling(VISU::Scaling theScaling)
{
- GetSpecificPL()->SetScaling(theScaling);
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ScalarMapPL, int>
+ (GetSpecificPL(), &VISU_ColoredPL::SetScaling, theScaling));
}
//----------------------------------------------------------------------------
#include "VISU_Convertor.hxx"
#include "SUIT_ResourceMgr.h"
+#include "SALOME_Event.hxx"
#include <vtkDataSetMapper.h>
#include <vtkAppendFilter.h>
CORBA::Double thePercents,
VISU::StreamLines::Direction theDirection)
{
- VISU::Prs3d_i* aPrs3d = NULL;
- vtkPointSet* aSource = NULL;
- if (!thePrs3d->_is_nil())
- if ((aPrs3d = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(thePrs3d).in()))) {
- myAppendFilter->RemoveAllInputs();
- myAppendFilter->AddInput(aPrs3d->GetPipeLine()->GetMapper()->GetInput());
- aSource = myAppendFilter->GetOutput();
+ struct TEvent: public SALOME_Event
+ {
+ CORBA::Double myIntStep;
+ CORBA::Double myPropogationTime;
+ CORBA::Double myStepLength;
+ VISU::Prs3d_ptr myPrs3d;
+ CORBA::Double myPercents;
+ VISU::StreamLines::Direction myDirection;
+
+ VISU_StreamLinesPL* myPipeLine;
+ VISU::Prs3d_i*& myPrs3dServant;
+ vtkAppendFilter* myAppendFilter;
+ size_t& myIsAccepted;
+
+ TEvent(CORBA::Double theIntStep,
+ CORBA::Double thePropogationTime,
+ CORBA::Double theStepLength,
+ VISU::Prs3d_ptr thePrs3d,
+ CORBA::Double thePercents,
+ VISU::StreamLines::Direction theDirection,
+ VISU_StreamLinesPL* thePipeLine,
+ VISU::Prs3d_i*& thePrs3dServant,
+ vtkAppendFilter* theAppendFilter,
+ size_t& theIsAccepted):
+ myIntStep(myIntStep),
+ myPropogationTime(thePropogationTime),
+ myStepLength(theStepLength),
+ myPrs3d(thePrs3d),
+ myPercents(thePercents),
+ myDirection(theDirection),
+ myPipeLine(thePipeLine),
+ myPrs3dServant(thePrs3dServant),
+ myAppendFilter(theAppendFilter),
+ myIsAccepted(theIsAccepted)
+ {}
+
+ virtual
+ void
+ Execute()
+ {
+ myPrs3dServant = NULL;
+ vtkDataSet* aSource = NULL;
+ if (!CORBA::is_nil(myPrs3d)){
+ myPrs3dServant = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(myPrs3d).in());
+ if(myPrs3dServant){
+ myAppendFilter->RemoveAllInputs();
+ myAppendFilter->AddInput(myPrs3dServant->GetPipeLine()->GetMapper()->GetInput());
+ aSource = myAppendFilter->GetOutput();
+ }
+ }
+ myIsAccepted = myPipeLine->SetParams(myIntStep,
+ myPropogationTime,
+ myStepLength,
+ aSource,
+ myPercents,
+ myDirection);
}
- size_t anIsAccepted = myStreamLinesPL->SetParams(theIntStep,
- thePropogationTime,
- theStepLength,
- aSource,
- thePercents,
- theDirection);
- if (anIsAccepted)
- SetSource(aPrs3d);
+ };
+
+ size_t anIsAccepted = false;
+ VISU::Prs3d_i* aPrs3dServant = NULL;
+ ProcessVoidEvent(new TEvent(theIntStep,
+ thePropogationTime,
+ theStepLength,
+ thePrs3d,
+ thePercents,
+ theDirection,
+ GetSpecificPL(),
+ aPrs3dServant,
+ myAppendFilter,
+ anIsAccepted));
+ if(anIsAccepted)
+ SetSource(aPrs3dServant);
+
return anIsAccepted;
}
if(thePrs3d){
SALOMEDS::SObject_var aSObject = thePrs3d->GetSObject();
CORBA::String_var aString = aSObject->GetID();
+ if(mySourceEntry == aString.in())
+ return;
+
mySourceEntry = aString.in();
myParamsTime.Modified();
}
#include "VISU_VectorsAct.h"
#include "VISU_VectorsPL.hxx"
+#include "VISU_PipeLineUtils.hxx"
#include "VISU_Convertor.hxx"
#include "SUIT_ResourceMgr.h"
+#include "SALOME_Event.hxx"
#include <vtkProperty.h>
VISU::Vectors_i
::SetLineWidth(CORBA::Double theWidth)
{
+ if(VISU::CheckIsSameValue(myLineWidth, theWidth))
+ return;
+
myLineWidth = theWidth;
myParamsTime.Modified();
}
VISU::Vectors_i
::SetGlyphType(VISU::Vectors::GlyphType theType)
{
- myVectorsPL->SetGlyphType(VISU_VectorsPL::GlyphType(theType));
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_VectorsPL, VISU_VectorsPL::GlyphType>
+ (GetSpecificPL(), &VISU_VectorsPL::SetGlyphType, VISU_VectorsPL::GlyphType(theType)));
}
//---------------------------------------------------------------
VISU::Vectors_i
::SetGlyphPos(VISU::Vectors::GlyphPos thePos)
{
- myVectorsPL->SetGlyphPos(VISU_VectorsPL::GlyphPos(thePos));
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_VectorsPL, VISU_VectorsPL::GlyphPos>
+ (GetSpecificPL(), &VISU_VectorsPL::SetGlyphPos, VISU_VectorsPL::GlyphPos(thePos)));
}
//---------------------------------------------------------------