From 5b42eae062e05b63c281c1c01df7ac9dec8f5f8f Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 28 Feb 2007 10:26:25 +0000 Subject: [PATCH] PAL13639 ( Create "0D Hypothesis" ) + void SetColor(double R, double G, double B); + SALOME_Actor* GetActor() { return myPreviewActor; } extract SMESH_MeshEditor.idl from SMESH_Mesh.idl --- src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx | 25 +++++++++++++++-------- src/SMESHGUI/SMESHGUI_MeshEditPreview.h | 4 ++++ 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx b/src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx index d57186894..61900244e 100644 --- a/src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx @@ -49,7 +49,7 @@ // IDL Headers #include "SALOMEconfig.h" -#include CORBA_SERVER_HEADER(SMESH_Mesh) +#include CORBA_SERVER_HEADER(SMESH_MeshEditor) using namespace SMESH; @@ -68,17 +68,14 @@ SMESHGUI_MeshEditPreview::SMESHGUI_MeshEditPreview(SVTK_ViewWindow* theViewWindo vtkDataSetMapper* aMapper = vtkDataSetMapper::New(); aMapper->SetInput( myGrid ); - vtkProperty* aProp = vtkProperty::New(); - vtkFloatingPointType anRGB[3]; - GetColor( "SMESH", "selection_element_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) ); - aProp->SetColor( anRGB[0], anRGB[1], anRGB[2] ); - myPreviewActor = SALOME_Actor::New(); myPreviewActor->SetInfinitive(true); myPreviewActor->VisibilityOn(); myPreviewActor->PickableOff(); - myPreviewActor->SetProperty( aProp ); - aProp->Delete(); + + vtkFloatingPointType anRGB[3]; + GetColor( "SMESH", "selection_element_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) ); + SetColor( anRGB[0], anRGB[1], anRGB[2] ); myPreviewActor->SetMapper( aMapper ); aMapper->Delete(); @@ -114,6 +111,7 @@ vtkIdType getCellType( const SMDSAbs_ElementType theType, { switch( theType ) { + case SMDSAbs_Node: return VTK_VERTEX; case SMDSAbs_Edge: if( theNbNodes == 2 ) return VTK_LINE; else if ( theNbNodes == 3 ) return VTK_QUADRATIC_EDGE; @@ -234,3 +232,14 @@ void SMESHGUI_MeshEditPreview::SetVisibility (bool theVisibility) myPreviewActor->SetVisibility(theVisibility); RepaintCurrentView(); } + +//================================================================================ +/*! + * \brief Set preview color + */ +//================================================================================ + +void SMESHGUI_MeshEditPreview::SetColor(double R, double G, double B) +{ + myPreviewActor->SetColor( R, G, B ); +} diff --git a/src/SMESHGUI/SMESHGUI_MeshEditPreview.h b/src/SMESHGUI/SMESHGUI_MeshEditPreview.h index 2178863a2..7e2012560 100644 --- a/src/SMESHGUI/SMESHGUI_MeshEditPreview.h +++ b/src/SMESHGUI/SMESHGUI_MeshEditPreview.h @@ -53,6 +53,10 @@ public: void SetVisibility (bool theVisibility); + void SetColor(double R, double G, double B); + + SALOME_Actor* GetActor() { return myPreviewActor; } + }; #endif -- 2.39.2