]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
PAL12874: Object Vector. Display a vector with arrow on its end.
authorjfa <jfa@opencascade.com>
Mon, 19 Feb 2007 11:53:46 +0000 (11:53 +0000)
committerjfa <jfa@opencascade.com>
Mon, 19 Feb 2007 11:53:46 +0000 (11:53 +0000)
src/GEOMGUI/GEOM_Displayer.cxx

index 1511436a7cf66248777a2fa74f7ebffbbcdc9db9..f57deb4c997bd7f92bb878ef3b098c9e23d0b687 100644 (file)
@@ -40,6 +40,7 @@
 #include "GEOM_Actor.h"
 #include "GEOM_AssemblyBuilder.h"
 #include "GEOM_AISShape.hxx"
+#include "GEOM_AISVector.hxx"
 #include "GEOM_AISTrihedron.hxx"
 #include "GEOM_VTKTrihedron.hxx"
 
@@ -520,7 +521,12 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
     {
       if ( !myShape.IsNull() )
       {
-        Handle(GEOM_AISShape) AISShape = new GEOM_AISShape( myShape, "" );
+        //Handle(GEOM_AISShape) AISShape = new GEOM_AISShape( myShape, "" );
+        Handle(GEOM_AISShape) AISShape;
+        if (myType == GEOM_VECTOR)
+          AISShape = new GEOM_AISVector (myShape, "");
+        else
+          AISShape = new GEOM_AISShape (myShape, "");
         // Temporary staff: vertex must be infinite for correct visualization
         AISShape->SetInfiniteState( myShape.Infinite() || myShape.ShapeType() == TopAbs_VERTEX );
 
@@ -530,7 +536,8 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
 
        // Set color and number for iso lines
        SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
-       QColor col = aResMgr->colorValue( "Geometry", "isos_color", QColor(int(0.5*255), int(0.5*255), int(0.5*255)) );
+       QColor col = aResMgr->colorValue( "Geometry", "isos_color",
+                                          QColor(int(0.5*255), int(0.5*255), int(0.5*255)) );
        Quantity_Color aColor = SalomeApp_Tools::color( col );
        int anUIsoNumber = aResMgr->integerValue("OCCViewer", "iso_number_u", 1);
        int aVIsoNumber  = aResMgr->integerValue("OCCViewer", "iso_number_v", 1);
@@ -675,7 +682,7 @@ void GEOM_Displayer::Update( SALOME_VTKPrs* prs )
 
   vtkActorCollection* theActors = 0;
 
-  if ( myType == GEOM_MARKER && !myShape.IsNull() && myShape.ShapeType() == TopAbs_FACE )
+  if ( myType == GEOM_MARKER && myShape.ShapeType() == TopAbs_FACE )
   {
     myToActivate = false;
     GEOM_VTKTrihedron* aTrh = GEOM_VTKTrihedron::New();
@@ -703,7 +710,10 @@ void GEOM_Displayer::Update( SALOME_VTKPrs* prs )
     theActors->AddItem( aTrh );
   }
   else
-    theActors = GEOM_AssemblyBuilder::BuildActors( myShape, 0, 0, Standard_True );
+  {
+    bool isVector = (myType == GEOM_VECTOR);
+    theActors = GEOM_AssemblyBuilder::BuildActors( myShape, 0, 0, Standard_True, isVector );
+  }
 
   theActors->InitTraversal();