Back to index

salome-gui  6.5.0
Defines | Functions
VTKViewer_ExtractUnstructuredGrid.cxx File Reference
#include "VTKViewer_ExtractUnstructuredGrid.h"
#include "VTKViewer_CellLocationsArray.h"
#include <vtkUnsignedCharArray.h>
#include <vtkUnstructuredGrid.h>
#include <vtkObjectFactory.h>
#include <vtkCellArray.h>
#include <vtkIdList.h>
#include <vtkCell.h>
#include <vtkInformation.h>
#include <vtkInformationVector.h>
#include <vtkVersion.h>
#include "utilities.h"

Go to the source code of this file.

Defines

#define VTK_XVERSION   (VTK_MAJOR_VERSION*10000+VTK_MINOR_VERSION*100+VTK_BUILD_VERSION)

Functions

 vtkStandardNewMacro (VTKViewer_ExtractUnstructuredGrid)
void InsertCell (vtkUnstructuredGrid *theInput, vtkCellArray *theConnectivity, vtkUnsignedCharArray *theCellTypesArray, vtkIdTypeArray *&theFaces, vtkIdTypeArray *&theFaceLocations, vtkIdType theCellId, vtkIdList *theIdList, bool theStoreMapping, vtkIdType theOutId, VTKViewer_ExtractUnstructuredGrid::TVectorId &theOut2InId, VTKViewer_ExtractUnstructuredGrid::TMapId &theIn2OutId)
void InsertPointCell (vtkCellArray *theConnectivity, vtkUnsignedCharArray *theCellTypesArray, vtkIdType theCellId, vtkIdList *theIdList, bool theStoreMapping, vtkIdType theOutId, VTKViewer_ExtractUnstructuredGrid::TVectorId &theOut2InId, VTKViewer_ExtractUnstructuredGrid::TMapId &theIn2OutId)

Define Documentation

#define VTK_XVERSION   (VTK_MAJOR_VERSION*10000+VTK_MINOR_VERSION*100+VTK_BUILD_VERSION)

Definition at line 47 of file VTKViewer_ExtractUnstructuredGrid.cxx.


Function Documentation

void InsertCell ( vtkUnstructuredGrid *  theInput,
vtkCellArray *  theConnectivity,
vtkUnsignedCharArray *  theCellTypesArray,
vtkIdTypeArray *&  theFaces,
vtkIdTypeArray *&  theFaceLocations,
vtkIdType  theCellId,
vtkIdList *  theIdList,
bool  theStoreMapping,
vtkIdType  theOutId,
VTKViewer_ExtractUnstructuredGrid::TVectorId &  theOut2InId,
VTKViewer_ExtractUnstructuredGrid::TMapId &  theIn2OutId 
) [inline]

Definition at line 98 of file VTKViewer_ExtractUnstructuredGrid.cxx.

{
  vtkCell *aCell = theInput->GetCell(theCellId);
  vtkIdList *aPntIds = aCell->GetPointIds();
  vtkIdType aNbIds = aPntIds->GetNumberOfIds();
  theIdList->SetNumberOfIds(aNbIds);
  for(vtkIdType i = 0; i < aNbIds; i++){
    theIdList->SetId(i,aPntIds->GetId(i));
  }
  vtkIdType aCellType = aCell->GetCellType();
#if VTK_XVERSION > 50700
  if (aCellType != VTK_POLYHEDRON)
    {
#endif
      theConnectivity->InsertNextCell(theIdList);
      if (theFaceLocations)
        theFaceLocations->InsertNextValue(-1);
#if VTK_XVERSION > 50700
    }
  else
    {
      //MESSAGE("InsertCell type VTK_POLYHEDRON " << theStoreMapping);
      if (!theFaces)
        {
          theFaces = vtkIdTypeArray::New();
          theFaces->Allocate(theCellTypesArray->GetSize());
          theFaceLocations = vtkIdTypeArray::New();
          theFaceLocations->Allocate(theCellTypesArray->GetSize());
          // FaceLocations must be padded until the current position
          for (vtkIdType i = 0; i <= theCellTypesArray->GetMaxId(); i++)
            {
              theFaceLocations->InsertNextValue(-1);
            }
        }
      // insert face location
      theFaceLocations->InsertNextValue(theFaces->GetMaxId() + 1);

      // insert cell connectivity and faces stream
      vtkIdType nfaces;
      vtkIdType* face;
      vtkIdType realnpts;
      theInput->GetFaceStream(theCellId, nfaces, face);
      vtkUnstructuredGrid::DecomposeAPolyhedronCell(
          nfaces, face, realnpts, theConnectivity, theFaces);
    }
#endif

  theCellTypesArray->InsertNextValue(aCellType);
  if(theStoreMapping){
    theOut2InId.push_back(theCellId);
    theIn2OutId[theCellId] = theOutId;
  }
}
void InsertPointCell ( vtkCellArray *  theConnectivity,
vtkUnsignedCharArray *  theCellTypesArray,
vtkIdType  theCellId,
vtkIdList *  theIdList,
bool  theStoreMapping,
vtkIdType  theOutId,
VTKViewer_ExtractUnstructuredGrid::TVectorId &  theOut2InId,
VTKViewer_ExtractUnstructuredGrid::TMapId &  theIn2OutId 
) [inline]

Definition at line 162 of file VTKViewer_ExtractUnstructuredGrid.cxx.

{
  theIdList->SetId(0,theCellId);
  theConnectivity->InsertNextCell(theIdList);
  theCellTypesArray->InsertNextValue(VTK_VERTEX);
  if(theStoreMapping){
    theOut2InId.push_back(theCellId);
    theIn2OutId[theCellId] = theOutId;
  }
}
vtkStandardNewMacro ( VTKViewer_ExtractUnstructuredGrid  )