From: jfa Date: Mon, 19 Feb 2007 11:53:46 +0000 (+0000) Subject: PAL12874: Object Vector. Display a vector with arrow on its end. X-Git-Tag: V3_2_6a1~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=47e6e806186e7e5b1913f8b1c77bfcb223dc7d52;p=modules%2Fgeom.git PAL12874: Object Vector. Display a vector with arrow on its end. --- diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index 1511436a7..f57deb4c9 100644 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -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();