Salome HOME
Merge from BR_V5_DEV 16Feb09
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_MeshEditPreview.cxx
index 61900244ee2f90206e0e3020c5fbab2e453fd084..8bed7191fe0d086a50eceffc8f83ee3b89a40371 100644 (file)
@@ -1,6 +1,6 @@
-//  SMESH SMESHGUI : GUI for SMESH component
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
+// SMESH SMESHGUI : GUI for SMESH component
+// File   : SMESHGUI_MeshEditPreview.cxx
+// Author : Open CASCADE S.A.S.
+// SMESH includes
 //
 //
-//
-//  File   : SMESHGUI_MeshEditPreview.cxx
-//  Module : SMESH
-//  $Header:
-
 #include "SMESHGUI_MeshEditPreview.h"
 
 #include "SMESHGUI_MeshEditPreview.h"
 
-#include "VTKViewer_CellLocationsArray.h"
-#include "SVTK_ViewWindow.h"
-
-#include "SMESH_Actor.h"
-#include "SMESH_ActorUtils.h"
 #include "SMESHGUI_VTKUtils.h"
 
 #include "SMESHGUI_VTKUtils.h"
 
-// VTK Includes
+#include <SMESH_Actor.h>
+#include <SMESH_ActorUtils.h>
+
+// SALOME GUI includes
+#include <VTKViewer_CellLocationsArray.h>
+#include <SVTK_ViewWindow.h>
+
+// VTK includes
 #include <vtkPoints.h>
 #include <vtkIdList.h>
 #include <vtkCellArray.h>
 #include <vtkPoints.h>
 #include <vtkIdList.h>
 #include <vtkCellArray.h>
 #include <vtkDataSetMapper.h>
 #include <vtkProperty.h>
 
 #include <vtkDataSetMapper.h>
 #include <vtkProperty.h>
 
-// QT Includes
-#include <qcolor.h>
+// Qt includes
+#include <QColor>
 
 
-// IDL Headers
-#include "SALOMEconfig.h"
+// IDL includes
+#include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SMESH_MeshEditor)
 
 #include CORBA_SERVER_HEADER(SMESH_MeshEditor)
 
-using namespace SMESH;
-
 //================================================================================
 /*!
  * \brief Constructor
 //================================================================================
 /*!
  * \brief Constructor
@@ -74,7 +73,7 @@ SMESHGUI_MeshEditPreview::SMESHGUI_MeshEditPreview(SVTK_ViewWindow* theViewWindo
   myPreviewActor->PickableOff();
 
   vtkFloatingPointType anRGB[3];
   myPreviewActor->PickableOff();
 
   vtkFloatingPointType anRGB[3];
-  GetColor( "SMESH", "selection_element_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) );
+  SMESH::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 );
   SetColor( anRGB[0], anRGB[1], anRGB[2] );
 
   myPreviewActor->SetMapper( aMapper );
@@ -137,7 +136,10 @@ vtkIdType getCellType( const SMDSAbs_ElementType theType,
     else if ( theNbNodes == 20 )  {
       return VTK_QUADRATIC_HEXAHEDRON;
     }
     else if ( theNbNodes == 20 )  {
       return VTK_QUADRATIC_HEXAHEDRON;
     }
-    else if ( theNbNodes==13 || theNbNodes==15 )  {
+    else if ( theNbNodes==15  )  {
+      return VTK_QUADRATIC_WEDGE;
+    }
+    else if ( theNbNodes==13  )  {
       return VTK_CONVEX_POINT_SET;
     }
     else return VTK_EMPTY_CELL;
       return VTK_CONVEX_POINT_SET;
     }
     else return VTK_EMPTY_CELL;
@@ -184,7 +186,7 @@ void SMESHGUI_MeshEditPreview::SetData (const SMESH::MeshPreviewStruct* previewD
   int aNodePos = 0;
 
   for ( int i = 0; i < anElemTypes.length(); i++ ) {
   int aNodePos = 0;
 
   for ( int i = 0; i < anElemTypes.length(); i++ ) {
-    const ElementSubType& anElementSubType = anElemTypes[i];
+    const SMESH::ElementSubType& anElementSubType = anElemTypes[i];
     SMDSAbs_ElementType aType = SMDSAbs_ElementType(anElementSubType.SMDS_ElementType);
     vtkIdType aNbNodes = anElementSubType.nbNodesInElement;
     anIdList->SetNumberOfIds( aNbNodes );
     SMDSAbs_ElementType aType = SMDSAbs_ElementType(anElementSubType.SMDS_ElementType);
     vtkIdType aNbNodes = anElementSubType.nbNodesInElement;
     anIdList->SetNumberOfIds( aNbNodes );
@@ -230,7 +232,7 @@ void SMESHGUI_MeshEditPreview::SetData (const SMESH::MeshPreviewStruct* previewD
 void SMESHGUI_MeshEditPreview::SetVisibility (bool theVisibility)
 {
   myPreviewActor->SetVisibility(theVisibility);
 void SMESHGUI_MeshEditPreview::SetVisibility (bool theVisibility)
 {
   myPreviewActor->SetVisibility(theVisibility);
-  RepaintCurrentView();
+  SMESH::RepaintCurrentView();
 }
 
 //================================================================================
 }
 
 //================================================================================
@@ -243,3 +245,13 @@ void SMESHGUI_MeshEditPreview::SetColor(double R, double G, double B)
 {
   myPreviewActor->SetColor( R, G, B );
 }
 {
   myPreviewActor->SetColor( R, G, B );
 }
+
+//================================================================================
+/*!
+ * \brief Get preview actor
+ */
+//================================================================================
+SALOME_Actor* SMESHGUI_MeshEditPreview::GetActor() const
+{ 
+  return myPreviewActor;
+}