]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
INT PAL 0052682: Local selection for ball elements has incorrect size
authorimn <imn@opencascade.com>
Fri, 17 Apr 2015 08:01:36 +0000 (11:01 +0300)
committerimn <imn@opencascade.com>
Fri, 17 Apr 2015 08:01:36 +0000 (11:01 +0300)
src/SVTK/SVTK_DeviceActor.cxx
src/SVTK/SVTK_DeviceActor.h
src/VTKViewer/VTKViewer_DataSetMapper.cxx
src/VTKViewer/VTKViewer_DataSetMapper.h

index d1cb768435325e97c28e7ddce359b46338281763..4f83e9c7034d347e24a3b6b2b5443d0c572fb60c 100644 (file)
@@ -704,6 +704,13 @@ double SVTK_DeviceActor::GetQuadraticArcAngle(){
 void SVTK_DeviceActor::SetBallEnabled( bool theBallEnabled ) {
   myMapper->SetBallEnabled( theBallEnabled );
 }
+/*!
+ * Set ball scale factor
+ * \param theBallScale double value a scale factor of ball element
+ */
+void SVTK_DeviceActor::SetBallScale( double theBallScale ) {
+  myMapper->SetBallScale( theBallScale );
+}
 
 /*!
  * Set point marker enabled
index a9d7b332ad7ef1dd7115c0868434bea5f89761de..d9471c8c9b85952f861a9a91c0b34407eceee4c5 100644 (file)
@@ -222,6 +222,9 @@ class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor
   void
   SetMarkerEnabled( bool );
 
+  void
+  SetBallScale( double );
+
   void
   SetMarkerStd( VTK::MarkerType, VTK::MarkerScale );
 
index aac2f9279e05563acdc1f6a79d012ce1b20b596a..0a075827a6ba7671c97f33c37d05c1bcf9db4242 100644 (file)
@@ -30,6 +30,7 @@ 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 )
index c333ee5403be6de4695b8b525ecb6f6872ff61e1..f206d46ef8b2b6388f3e6b0895f5283ed43f2b70 100644 (file)
@@ -33,8 +33,13 @@ public:
 
   //! Set point marker enabled
   void SetMarkerEnabled( bool );
+  
+  //! Set ball element enabled
   void SetBallEnabled( bool );
-
+  
+  //! Set ball element scale factor
+  void SetBallScale( double );
+  
   //! Set standard point marker
   void SetMarkerStd( VTK::MarkerType, VTK::MarkerScale );
 
@@ -64,6 +69,7 @@ private:
 private:
   bool               MarkerEnabled;
   bool               BallEnabled;
+  double           BallScale;
   VTK::MarkerType    MarkerType;
   VTK::MarkerScale   MarkerScale;
   int                MarkerId;