Salome HOME
Copyright update 2022
[modules/gui.git] / src / VTKViewer / VTKViewer_DataSetMapper.cxx
index 554f80f2d24fe6614e9f4d1e259f3961dd779fc9..4ffd3c270b60254792c4358ea6bf2bbf1cdcff76 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 #include <vtkDataSetSurfaceFilter.h>
 #include <vtkObjectFactory.h>
 
-vtkStandardNewMacro(VTKViewer_DataSetMapper);
+vtkStandardNewMacro(VTKViewer_DataSetMapper)
 
 //----------------------------------------------------------------------------
 VTKViewer_DataSetMapper::VTKViewer_DataSetMapper()
 {
   this->MarkerEnabled = false;
   this->BallEnabled = false;
+  this->BallScale = 1;
   this->MarkerType    = VTK::MT_NONE;
   this->MarkerScale   = VTK::MS_NONE;
   this->MarkerId      = 0;
@@ -56,6 +57,7 @@ void VTKViewer_DataSetMapper::Render(vtkRenderer *ren, vtkActor *act)
     else
       pm->SetMarkerTexture( this->MarkerId, this->MarkerTexture );
     pm->SetBallEnabled( this->BallEnabled );
+    pm->SetBallScale( this->BallScale );
     
     this->GeometryExtractor = gf;
     this->PolyDataMapper = pm;
@@ -82,6 +84,14 @@ void VTKViewer_DataSetMapper::SetBallEnabled( bool theBallEnabled )
       aMapper->SetBallEnabled( theBallEnabled );
 }
 
+//-----------------------------------------------------------------------------
+void VTKViewer_DataSetMapper::SetBallScale( double theBallScale )
+{
+  this->BallScale = theBallScale;
+  if( this->PolyDataMapper )
+    if( VTKViewer_PolyDataMapper* aMapper = dynamic_cast<VTKViewer_PolyDataMapper*>( this->PolyDataMapper ) )
+      aMapper->SetBallScale( theBallScale );
+}
 
 //----------------------------------------------------------------------------
 void VTKViewer_DataSetMapper::SetMarkerStd( VTK::MarkerType theMarkerType, VTK::MarkerScale theMarkerScale )