From: apo Date: Fri, 7 Oct 2005 17:29:12 +0000 (+0000) Subject: 1. To improve ShallowCopy functionality X-Git-Tag: BR-D5-38-2003_D2005-12-10~32 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b4638c98126f123a195ded294298168d2df9f91a;p=modules%2Fvisu.git 1. To improve ShallowCopy functionality - first shallow copy itself, - then shallow copy base class This order of function call gives us possibility to summize all settings by calling Build function 2. Improve Update functionality in the same as ShallowCopy, namely - first updates its own properties, - then updates base class properties. This order of function call gives us possibility to summize all settings --- diff --git a/src/PIPELINE/VISU_CutLinesPL.cxx b/src/PIPELINE/VISU_CutLinesPL.cxx index 2207f492..7f53c951 100644 --- a/src/PIPELINE/VISU_CutLinesPL.cxx +++ b/src/PIPELINE/VISU_CutLinesPL.cxx @@ -37,7 +37,6 @@ vtkStandardNewMacro(VISU_CutLinesPL); VISU_CutLinesPL::VISU_CutLinesPL(){} void VISU_CutLinesPL::ShallowCopy(VISU_PipeLine *thePipeLine){ - VISU_CutPlanesPL::ShallowCopy(thePipeLine); if(VISU_CutLinesPL *aPipeLine = dynamic_cast(thePipeLine)){ SetOrientation(aPipeLine->GetPlaneOrientation(1), aPipeLine->GetRotateX(1),aPipeLine->GetRotateY(1),1); @@ -45,6 +44,7 @@ void VISU_CutLinesPL::ShallowCopy(VISU_PipeLine *thePipeLine){ SetDefault(); if (!aPipeLine->IsDefault()) SetPosition(aPipeLine->GetPosition()); } + VISU_CutPlanesPL::ShallowCopy(thePipeLine); } void VISU_CutLinesPL::Init(){ diff --git a/src/PIPELINE/VISU_CutPlanesPL.cxx b/src/PIPELINE/VISU_CutPlanesPL.cxx index 32fb5612..63dd3e5a 100644 --- a/src/PIPELINE/VISU_CutPlanesPL.cxx +++ b/src/PIPELINE/VISU_CutPlanesPL.cxx @@ -49,7 +49,6 @@ VISU_CutPlanesPL::~VISU_CutPlanesPL(){ } void VISU_CutPlanesPL::ShallowCopy(VISU_PipeLine *thePipeLine){ - VISU_ScalarMapPL::ShallowCopy(thePipeLine); if(VISU_CutPlanesPL *aPipeLine = dynamic_cast(thePipeLine)){ SetOrientation(aPipeLine->GetPlaneOrientation(), aPipeLine->GetRotateX(),aPipeLine->GetRotateY()); @@ -58,6 +57,7 @@ void VISU_CutPlanesPL::ShallowCopy(VISU_PipeLine *thePipeLine){ for (int i = 0, iend = GetNbParts(); i < iend; i++) if(!aPipeLine->IsPartDefault(i)) SetPartPosition(i, aPipeLine->GetPartPosition(i)); } + VISU_ScalarMapPL::ShallowCopy(thePipeLine); } void VISU_CutPlanesPL::Init(){ diff --git a/src/PIPELINE/VISU_DeformedShapePL.cxx b/src/PIPELINE/VISU_DeformedShapePL.cxx index c276548d..913feb18 100644 --- a/src/PIPELINE/VISU_DeformedShapePL.cxx +++ b/src/PIPELINE/VISU_DeformedShapePL.cxx @@ -47,10 +47,10 @@ VISU_DeformedShapePL::~VISU_DeformedShapePL(){ } void VISU_DeformedShapePL::ShallowCopy(VISU_PipeLine *thePipeLine){ - VISU_ScalarMapPL::ShallowCopy(thePipeLine); if(VISU_DeformedShapePL *aPipeLine = dynamic_cast(thePipeLine)){ SetScale(aPipeLine->GetScale()); } + VISU_ScalarMapPL::ShallowCopy(thePipeLine); } float VISU_DeformedShapePL::GetScaleFactor(vtkDataSet* theDataSet){ diff --git a/src/PIPELINE/VISU_GaussPointsPL.cxx b/src/PIPELINE/VISU_GaussPointsPL.cxx index c605cdbb..f339f45d 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.cxx +++ b/src/PIPELINE/VISU_GaussPointsPL.cxx @@ -62,7 +62,6 @@ void VISU_GaussPointsPL ::ShallowCopy(VISU_PipeLine *thePipeLine) { - Superclass::ShallowCopy(thePipeLine); if(VISU_GaussPointsPL *aPipeLine = dynamic_cast(thePipeLine)){ SetGaussPtsIDMapper(aPipeLine->GetGaussPtsIDMapper()); @@ -79,8 +78,8 @@ VISU_GaussPointsPL SetMagnification(aPipeLine->GetMagnification()); SetMagnificationIncrement(aPipeLine->GetMagnificationIncrement()); SetAlphaThreshold(aPipeLine->GetAlphaThreshold()); - Init(); } + Superclass::ShallowCopy(thePipeLine); } @@ -122,15 +121,15 @@ VISU_GaussPointsPL myGeomFilter->SetInput( myFieldTransform->GetUnstructuredGridOutput() ); myPSMapper->SetInput( myGeomFilter->GetOutput() ); + + SetSourceRange(); } //---------------------------------------------------------------------------- -void +void VISU_GaussPointsPL -::Init() +::Update() { - VISU_ScalarMapPL::Init(); - GetSourceRange(mySourceScalarRange); myDeltaScalarRange = mySourceScalarRange[1] - mySourceScalarRange[0]; @@ -140,17 +139,11 @@ VISU_GaussPointsPL vtkCellData* aCellData = aDataSet->GetCellData(); myScalarArray = aCellData->GetScalars(); -} - -//---------------------------------------------------------------------------- -void -VISU_GaussPointsPL -::Update() -{ - VISU_ScalarMapPL::Update(); myPSMapper->SetLookupTable( myMapperTable ); - myPSMapper->SetScalarRange( myMapperTable->GetRange() ); + myPSMapper->SetScalarRange( mySourceScalarRange ); + + VISU_ScalarMapPL::Update(); } //---------------------------------------------------------------------------- diff --git a/src/PIPELINE/VISU_GaussPointsPL.hxx b/src/PIPELINE/VISU_GaussPointsPL.hxx index 0a310f08..dd8f4ea8 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.hxx +++ b/src/PIPELINE/VISU_GaussPointsPL.hxx @@ -66,10 +66,6 @@ public: void Build(); - virtual - void - Init(); - virtual void Update(); diff --git a/src/PIPELINE/VISU_IsoSurfacesPL.cxx b/src/PIPELINE/VISU_IsoSurfacesPL.cxx index 7462ff51..c3ffd9b4 100644 --- a/src/PIPELINE/VISU_IsoSurfacesPL.cxx +++ b/src/PIPELINE/VISU_IsoSurfacesPL.cxx @@ -48,12 +48,12 @@ VISU_IsoSurfacesPL::~VISU_IsoSurfacesPL(){ } void VISU_IsoSurfacesPL::ShallowCopy(VISU_PipeLine *thePipeLine){ - VISU_ScalarMapPL::ShallowCopy(thePipeLine); if(VISU_IsoSurfacesPL *aPipeLine = dynamic_cast(thePipeLine)){ SetNbParts(aPipeLine->GetNbParts()); float aRange[2] = {aPipeLine->GetMin(), aPipeLine->GetMax()}; SetRange(aRange); } + VISU_ScalarMapPL::ShallowCopy(thePipeLine); } int VISU_IsoSurfacesPL::GetNbParts() { diff --git a/src/PIPELINE/VISU_Plot3DPL.cxx b/src/PIPELINE/VISU_Plot3DPL.cxx index a7e8287e..164d9a7a 100644 --- a/src/PIPELINE/VISU_Plot3DPL.cxx +++ b/src/PIPELINE/VISU_Plot3DPL.cxx @@ -68,7 +68,6 @@ void VISU_Plot3DPL:: ShallowCopy(VISU_PipeLine *thePipeLine) { - VISU_ScalarMapPL::ShallowCopy(thePipeLine); if(VISU_Plot3DPL *aPipeLine = dynamic_cast(thePipeLine)){ SetOrientation (aPipeLine->GetPlaneOrientation(), aPipeLine->GetRotateX(), aPipeLine->GetRotateY()); @@ -78,6 +77,7 @@ ShallowCopy(VISU_PipeLine *thePipeLine) SetContourPrs( aPipeLine->GetIsContourPrs() ); SetNumberOfContours( aPipeLine->GetNumberOfContours() ); } + VISU_ScalarMapPL::ShallowCopy(thePipeLine); } VISU_CutPlanesPL::PlaneOrientation diff --git a/src/PIPELINE/VISU_ScalarMapPL.cxx b/src/PIPELINE/VISU_ScalarMapPL.cxx index 1a644c7c..4888d159 100644 --- a/src/PIPELINE/VISU_ScalarMapPL.cxx +++ b/src/PIPELINE/VISU_ScalarMapPL.cxx @@ -28,6 +28,7 @@ #include "VISU_ScalarMapPL.hxx" #include "VISU_PipeLineUtils.hxx" +#include "SALOME_ExtractGeometry.h" //============================================================================ @@ -38,8 +39,6 @@ vtkStandardNewMacro(VISU_ScalarMapPL); VISU_ScalarMapPL ::VISU_ScalarMapPL() { - myFieldTransform = VISU_FieldTransform::New(); - myMapperTable = VISU_LookupTable::New(); myMapperTable->SetScale(VTK_SCALE_LINEAR); myMapperTable->SetHueRange(0.667,0.0); @@ -49,6 +48,10 @@ VISU_ScalarMapPL myBarTable->SetHueRange(0.667,0.0); myExtractor = VISU_Extractor::New(); + myExtractor->SetInput(myExtractGeometry->GetOutput()); + + myFieldTransform = VISU_FieldTransform::New(); + myFieldTransform->SetInput(myExtractor->GetOutput()); myIsShrinkable = true; } @@ -74,7 +77,6 @@ VISU_ScalarMapPL SetScalarMode(aPipeLine->GetScalarMode()); SetNbColors(aPipeLine->GetNbColors()); SetScaling(aPipeLine->GetScaling()); - Update(); } Superclass::ShallowCopy(thePipeLine); } @@ -205,15 +207,13 @@ void VISU_ScalarMapPL ::Init() { - //SetSourceRange(); + SetSourceRange(); } void VISU_ScalarMapPL ::Build() { - myExtractor->SetInput(GetInput2()); - myFieldTransform->SetInput(myExtractor->GetOutput()); myMapper->SetInput(DoHook()); Update(); } diff --git a/src/PIPELINE/VISU_StreamLinesPL.cxx b/src/PIPELINE/VISU_StreamLinesPL.cxx index 9b9f781e..6690dc42 100644 --- a/src/PIPELINE/VISU_StreamLinesPL.cxx +++ b/src/PIPELINE/VISU_StreamLinesPL.cxx @@ -74,14 +74,15 @@ VISU_StreamLinesPL::~VISU_StreamLinesPL(){ } void VISU_StreamLinesPL::ShallowCopy(VISU_PipeLine *thePipeLine){ - VISU_DeformedShapePL::ShallowCopy(thePipeLine); - if(VISU_StreamLinesPL *aPipeLine = dynamic_cast(thePipeLine)) + if(VISU_StreamLinesPL *aPipeLine = dynamic_cast(thePipeLine)){ SetParams(aPipeLine->GetIntegrationStep(), aPipeLine->GetPropagationTime(), aPipeLine->GetStepLength(), aPipeLine->GetSource(), aPipeLine->GetUsedPoints(), aPipeLine->GetDirection()); + } + VISU_DeformedShapePL::ShallowCopy(thePipeLine); } diff --git a/src/PIPELINE/VISU_VectorsPL.cxx b/src/PIPELINE/VISU_VectorsPL.cxx index c34d36d9..9ffb775a 100644 --- a/src/PIPELINE/VISU_VectorsPL.cxx +++ b/src/PIPELINE/VISU_VectorsPL.cxx @@ -70,11 +70,11 @@ VISU_VectorsPL::~VISU_VectorsPL(){ } void VISU_VectorsPL::ShallowCopy(VISU_PipeLine *thePipeLine){ - VISU_DeformedShapePL::ShallowCopy(thePipeLine); if(VISU_VectorsPL *aPipeLine = dynamic_cast(thePipeLine)){ SetGlyphType(aPipeLine->GetGlyphType()); SetGlyphPos(aPipeLine->GetGlyphPos()); } + VISU_DeformedShapePL::ShallowCopy(thePipeLine); }