From: rnv Date: Fri, 15 Oct 2010 06:53:00 +0000 (+0000) Subject: Fix for the IPAL22007 Cut Lines in VTK viewer are shown with square points on ends: X-Git-Tag: V5_1_5rc1~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f89b24479dc25e998ffdb83d592fd9c628557653;p=modules%2Fvisu.git Fix for the IPAL22007 Cut Lines in VTK viewer are shown with square points on ends: Set size of the points of the "Cut Lines" and "Cut Segment" presentation equal to 1. --- diff --git a/src/OBJECT/VISU_ScalarMapAct.cxx b/src/OBJECT/VISU_ScalarMapAct.cxx index f6b85ac4..35673709 100644 --- a/src/OBJECT/VISU_ScalarMapAct.cxx +++ b/src/OBJECT/VISU_ScalarMapAct.cxx @@ -549,3 +549,18 @@ void VISU_ScalarMapAct::SetMarkerTexture( int theMarkerId, VTK::MarkerTexture th Superclass::SetMarkerTexture( theMarkerId, theMarkerTexture ); myPointsActor->SetMarkerTexture( theMarkerId, theMarkerTexture ); } + +/** + * Set size of the 0D elements. + */ +void VISU_ScalarMapAct::Set0DElemSize(vtkFloatingPointType theValue) { + mySurfaceActor->GetProperty()->SetPointSize(theValue); +} + +/** + * Get size of the 0D elements. + */ +vtkFloatingPointType VISU_ScalarMapAct::Get0DElemSize() { + return mySurfaceActor->GetProperty()->GetPointSize(); +} + diff --git a/src/OBJECT/VISU_ScalarMapAct.h b/src/OBJECT/VISU_ScalarMapAct.h index b7a256ca..3233ff90 100644 --- a/src/OBJECT/VISU_ScalarMapAct.h +++ b/src/OBJECT/VISU_ScalarMapAct.h @@ -150,6 +150,10 @@ class VISU_OBJECT_EXPORT VISU_ScalarMapAct : public VISU_DataSetActor int GetBarVisibility(); + virtual + vtkFloatingPointType + Get0DElemSize(); + virtual VISU_ScalarBarActor* GetScalarBar(); @@ -178,6 +182,11 @@ class VISU_OBJECT_EXPORT VISU_ScalarMapAct : public VISU_DataSetActor void SetMarkerTexture( int, VTK::MarkerTexture ); + virtual + void + Set0DElemSize(vtkFloatingPointType theValue); + + protected: VISU_ScalarMapAct(); diff --git a/src/VISU_I/VISU_CutLinesBase_i.cc b/src/VISU_I/VISU_CutLinesBase_i.cc index d2e79d4e..6f1ca95b 100644 --- a/src/VISU_I/VISU_CutLinesBase_i.cc +++ b/src/VISU_I/VISU_CutLinesBase_i.cc @@ -26,6 +26,7 @@ #include "VISU_Result_i.hh" #include "VISU_Actor.h" +#include "VISU_ScalarMapAct.h" #include "VISU_CutLinesBasePL.hxx" #include "VISU_Convertor.hxx" #include "VISU_PipeLineUtils.hxx" @@ -154,6 +155,22 @@ VISU::CutLinesBase_i } +//----------------------------------------------------------------------------^ +VISU_Actor* +VISU::CutLinesBase_i +::CreateActor() +{ + VISU_Actor* anActor = TSuperClass::CreateActor(); + if(VISU_ScalarMapAct* aScalarMapAct = dynamic_cast(anActor)) { + //rnv: To fix the bug IPAL22007 Cut Lines in VTK viewer are shown with square points on ends + //rnv: set small size of the vertices for the "Cut Lines" and "Cut Segment" presentations. + aScalarMapAct->Set0DElemSize(1.0); + } + return anActor; +} + + + //--------------------------------------------------------------- void VISU::CutLinesBase_i diff --git a/src/VISU_I/VISU_CutLinesBase_i.hh b/src/VISU_I/VISU_CutLinesBase_i.hh index 9d9054f3..10d63a3d 100644 --- a/src/VISU_I/VISU_CutLinesBase_i.hh +++ b/src/VISU_I/VISU_CutLinesBase_i.hh @@ -48,6 +48,10 @@ namespace VISU virtual ~CutLinesBase_i(); + virtual + VISU_Actor* + CreateActor(); + virtual void SetNbLines(CORBA::Long theNb);