]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
PAL13639 ( Create "0D Hypothesis" )
authoreap <eap@opencascade.com>
Wed, 28 Feb 2007 10:26:25 +0000 (10:26 +0000)
committereap <eap@opencascade.com>
Wed, 28 Feb 2007 10:26:25 +0000 (10:26 +0000)
+  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
src/SMESHGUI/SMESHGUI_MeshEditPreview.h

index d57186894f4f36297974d15f466fa5100b750d88..61900244ee2f90206e0e3020c5fbab2e453fd084 100644 (file)
@@ -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 );
+}
index 2178863a2faf381bfba76e51b5bd3b2fc5f712b8..7e2012560bd988d163e2592ce229abb314440f73 100644 (file)
@@ -53,6 +53,10 @@ public:
 
   void SetVisibility (bool theVisibility);
 
+  void SetColor(double R, double G, double B);
+
+  SALOME_Actor* GetActor() { return myPreviewActor; }
+
 };
 
 #endif