]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for the IPAL22007 Cut Lines in VTK viewer are shown with square points on ends:
authorrnv <rnv@opencascade.com>
Fri, 15 Oct 2010 06:53:00 +0000 (06:53 +0000)
committerrnv <rnv@opencascade.com>
Fri, 15 Oct 2010 06:53:00 +0000 (06:53 +0000)
Set size of the points of the "Cut Lines" and "Cut Segment" presentation equal to 1.

src/OBJECT/VISU_ScalarMapAct.cxx
src/OBJECT/VISU_ScalarMapAct.h
src/VISU_I/VISU_CutLinesBase_i.cc
src/VISU_I/VISU_CutLinesBase_i.hh

index f6b85ac49bd6cab733af3b3dc701c4c64f4d59d4..35673709de805e610be4ef5f79a751e59cf59274 100644 (file)
@@ -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();
+}
+
index b7a256ca25f09861414e482d04a433a749dc404c..3233ff90aac61043001b49930a0066eadf6fcffb 100644 (file)
@@ -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();
 
index d2e79d4ed0a945748c77b02c171e3a8cc86e52e7..6f1ca95b108e54a62981ab20f351849bf7d25d8e 100644 (file)
@@ -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<VISU_ScalarMapAct*>(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
index 9d9054f37961a25ebca7c33e6b5a99c9da50b829..10d63a3d36a97df4ef18ec4100f9109d08eb9878 100644 (file)
@@ -48,6 +48,10 @@ namespace VISU
     virtual
     ~CutLinesBase_i();
 
+    virtual
+    VISU_Actor*
+    CreateActor();
+
     virtual 
     void 
     SetNbLines(CORBA::Long theNb);