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
This commit is contained in:
eap 2007-02-28 10:26:25 +00:00
parent 2898e9c0df
commit 5b42eae062
2 changed files with 21 additions and 8 deletions

View File

@ -49,7 +49,7 @@
// IDL Headers // IDL Headers
#include "SALOMEconfig.h" #include "SALOMEconfig.h"
#include CORBA_SERVER_HEADER(SMESH_Mesh) #include CORBA_SERVER_HEADER(SMESH_MeshEditor)
using namespace SMESH; using namespace SMESH;
@ -68,17 +68,14 @@ SMESHGUI_MeshEditPreview::SMESHGUI_MeshEditPreview(SVTK_ViewWindow* theViewWindo
vtkDataSetMapper* aMapper = vtkDataSetMapper::New(); vtkDataSetMapper* aMapper = vtkDataSetMapper::New();
aMapper->SetInput( myGrid ); 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 = SALOME_Actor::New();
myPreviewActor->SetInfinitive(true); myPreviewActor->SetInfinitive(true);
myPreviewActor->VisibilityOn(); myPreviewActor->VisibilityOn();
myPreviewActor->PickableOff(); 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 ); myPreviewActor->SetMapper( aMapper );
aMapper->Delete(); aMapper->Delete();
@ -114,6 +111,7 @@ vtkIdType getCellType( const SMDSAbs_ElementType theType,
{ {
switch( theType ) switch( theType )
{ {
case SMDSAbs_Node: return VTK_VERTEX;
case SMDSAbs_Edge: case SMDSAbs_Edge:
if( theNbNodes == 2 ) return VTK_LINE; if( theNbNodes == 2 ) return VTK_LINE;
else if ( theNbNodes == 3 ) return VTK_QUADRATIC_EDGE; else if ( theNbNodes == 3 ) return VTK_QUADRATIC_EDGE;
@ -234,3 +232,14 @@ void SMESHGUI_MeshEditPreview::SetVisibility (bool theVisibility)
myPreviewActor->SetVisibility(theVisibility); myPreviewActor->SetVisibility(theVisibility);
RepaintCurrentView(); RepaintCurrentView();
} }
//================================================================================
/*!
* \brief Set preview color
*/
//================================================================================
void SMESHGUI_MeshEditPreview::SetColor(double R, double G, double B)
{
myPreviewActor->SetColor( R, G, B );
}

View File

@ -53,6 +53,10 @@ public:
void SetVisibility (bool theVisibility); void SetVisibility (bool theVisibility);
void SetColor(double R, double G, double B);
SALOME_Actor* GetActor() { return myPreviewActor; }
}; };
#endif #endif