]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fix for point 3 of issue 0020137: EDF 931 VISU : Trihedron Issues
authorouv <ouv@opencascade.com>
Thu, 22 Jan 2009 15:00:50 +0000 (15:00 +0000)
committerouv <ouv@opencascade.com>
Thu, 22 Jan 2009 15:00:50 +0000 (15:00 +0000)
src/VTKViewer/VTKViewer_Trihedron.cxx
src/VTKViewer/VTKViewer_Trihedron.h

index e3be10d16d1d69b8f19cabfebade943fc74c54c1..067dfecf689f73778e549b101d9227c373940cc2 100755 (executable)
@@ -98,7 +98,7 @@ void VTKViewer_UnScaledActor::Render(vtkRenderer *theRenderer)
 vtkStandardNewMacro(VTKViewer_LineActor);
 
 vtkCxxSetObjectMacro(VTKViewer_LineActor,LabelActor,VTKViewer_UnScaledActor);
-vtkCxxSetObjectMacro(VTKViewer_LineActor,ArrowActor,VTKViewer_UnScaledActor);
+vtkCxxSetObjectMacro(VTKViewer_LineActor,ArrowActor,vtkFollower);
 
 /*!Adds Label and Arrow actors to \a theRenderer.*/
 void VTKViewer_LineActor::Render(vtkRenderer *theRenderer)
@@ -132,16 +132,17 @@ VTKViewer_Axis::VTKViewer_Axis()
   
   /*! \li Initialize the Arrow pipe-line representation*/
   myConeSource =  vtkConeSource::New();
-  myConeSource->SetResolution(2);
+  myConeSource->SetResolution(16);
   myConeSource->SetAngle(10);
+  myConeSource->SetCenter(-0.5,0.0,0.0);
   
   myMapper[1] = vtkPolyDataMapper::New();
   myMapper[1]->SetInput(myConeSource->GetOutput());
   
-  myArrowActor = VTKViewer_UnScaledActor::New();
+  myArrowActor = vtkFollower::New();
   myArrowActor->SetMapper(myMapper[1]);
-  static int aArrowActorSize = 24;
-  myArrowActor->SetSize(aArrowActorSize);
+  static int aArrowActorSize = 16;
+  myArrowActor->SetScale(aArrowActorSize);
   myArrowActor->PickableOff();
   
   myLineActor->SetArrowActor(myArrowActor);
@@ -255,11 +256,15 @@ void VTKViewer_Axis::SetProperty(vtkProperty* theProperty){
 void VTKViewer_Axis::SetSize(vtkFloatingPointType theSize)
 {
   vtkFloatingPointType aPosition[3] = {myDir[0]*theSize, myDir[1]*theSize, myDir[2]*theSize};
-  myLineSource->SetPoint2(aPosition);
+
+  vtkFloatingPointType aCoef = 0.99;
+  vtkFloatingPointType aLinePosition[3] = {aPosition[0]*aCoef, aPosition[1]*aCoef, aPosition[2]*aCoef};
+  myLineSource->SetPoint2(aLinePosition);
   
   myArrowActor->SetPosition(0.0,0.0,0.0);
   myArrowActor->AddPosition(aPosition);
   myArrowActor->SetOrientation(myRot);
+  myArrowActor->SetScale(theSize / 10.);
   
   myLabelActor->SetPosition(0.0,0.0,0.0);
   myLabelActor->AddPosition(aPosition);
index 1fa61da8b5604fee1b89977b7b1fbad21cc2688c..f1bf77d3e66406c700f3c5844b915416be70a52c 100755 (executable)
@@ -89,7 +89,7 @@ public:
   /*! Sets Arrow actor.
    * \param theLabelActor - VTKViewer_UnScaledActor
    */
-  void SetArrowActor(VTKViewer_UnScaledActor* theLabelActor);
+  void SetArrowActor(vtkFollower* theArrowActor);
 
   virtual void Render(vtkRenderer *theRenderer);
   
@@ -111,7 +111,7 @@ protected:
   VTKViewer_UnScaledActor* LabelActor;
 
   /*!Arrow actor pointer*/
-  VTKViewer_UnScaledActor* ArrowActor;
+  vtkFollower* ArrowActor;
 };
 
 /*!This class provide support trihedron object in vtk viewer.*/
@@ -242,7 +242,7 @@ public:
   /*! Get arrow actor.
    * \retval Return myArrowActor
    */
-  virtual VTKViewer_UnScaledActor* GetArrow() { return myArrowActor; }
+  virtual vtkFollower* GetArrow() { return myArrowActor; }
 
   /*! Check if actor belongs to the axis object
    * \param theActor - vtkActor pointer
@@ -267,9 +267,9 @@ protected:
    */
   VTKViewer_LineActor *myLineActor;
 
-  /*! VTKViewer_UnScaledActor actor pointer
+  /*! vtkFollower actor pointer
    */
-  VTKViewer_UnScaledActor *myArrowActor;
+  vtkFollower *myArrowActor;
 
   /*! VTKViewer_UnScaledActor actor pointer
    */