Version: 6.3.1
Functions

src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx File Reference

#include "SMESHGUI_MeshEditPreview.h"
#include "SMESHGUI_VTKUtils.h"
#include <SMESH_Actor.h>
#include <SMESH_ActorUtils.h>
#include <VTKViewer_CellLocationsArray.h>
#include <SVTK_ViewWindow.h>
#include <vtkPoints.h>
#include <vtkIdList.h>
#include <vtkCellArray.h>
#include <vtkUnsignedCharArray.h>
#include <vtkUnstructuredGrid.h>
#include <vtkUnstructuredGridWriter.h>
#include <vtkDataSetMapper.h>
#include <vtkProperty.h>
#include <QColor>
#include <SALOMEconfig.h>
#include <CORBA_SERVER_HEADER(SMESH_MeshEditor)>
Include dependency graph for SMESHGUI_MeshEditPreview.cxx:

Go to the source code of this file.

Functions

vtkIdType getCellType (const SMDSAbs_ElementType theType, const bool thePoly, const int theNbNodes)
 Returns vtk cell type.

Function Documentation

vtkIdType getCellType ( const SMDSAbs_ElementType  theType,
const bool  thePoly,
const int  theNbNodes 
)

Returns vtk cell type.

Definition at line 108 of file SMESHGUI_MeshEditPreview.cxx.

References SMDSAbs_Edge, SMDSAbs_Face, SMDSAbs_Node, and SMDSAbs_Volume.

Referenced by SMESHGUI_MeshEditPreview.SetData().

{
  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;
    else return VTK_EMPTY_CELL;

  case SMDSAbs_Face  :
    if (thePoly && theNbNodes>2 ) return VTK_POLYGON;
    else if ( theNbNodes == 3 )   return VTK_TRIANGLE;
    else if ( theNbNodes == 4 )   return VTK_QUAD;
    else if ( theNbNodes == 6 )   return VTK_QUADRATIC_TRIANGLE;
    else if ( theNbNodes == 8 )   return VTK_QUADRATIC_QUAD;
    else return VTK_EMPTY_CELL;

  case SMDSAbs_Volume:
    if (thePoly && theNbNodes>3 ) return VTK_CONVEX_POINT_SET;
    else if ( theNbNodes == 4 )   return VTK_TETRA;
    else if ( theNbNodes == 5 )   return VTK_PYRAMID;
    else if ( theNbNodes == 6 )   return VTK_WEDGE;
    else if ( theNbNodes == 8 )   return VTK_HEXAHEDRON;
    else if ( theNbNodes == 10 )  {
      return VTK_QUADRATIC_TETRA;
    }
    else if ( theNbNodes == 20 )  {
      return VTK_QUADRATIC_HEXAHEDRON;
    }
    else if ( theNbNodes==15  )  {
      return VTK_QUADRATIC_WEDGE;
    }
    else if ( theNbNodes==13  )  {
      return VTK_CONVEX_POINT_SET;
    }
    else return VTK_EMPTY_CELL;

  default: return VTK_EMPTY_CELL;
  }
}
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS