VTK
vtkDaxDetailCommon.h
Go to the documentation of this file.
1 //=============================================================================
2 //
3 // Copyright (c) Kitware, Inc.
4 // All rights reserved.
5 // See LICENSE.txt for details.
6 //
7 // This software is distributed WITHOUT ANY WARRANTY; without even
8 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9 // PURPOSE. See the above copyright notice for more information.
10 //
11 // Copyright 2012 Sandia Corporation.
12 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
13 // the U.S. Government retains certain rights in this software.
14 //
15 //=============================================================================
16 
17 #ifndef vtkDaxDetailCommon_h
18 #define vtkDaxDetailCommon_h
19 
20 #include "vtkCellTypes.h"
21 #include "vtkDataSet.h"
22 #include "vtkGenericCell.h"
23 #include "vtkNew.h"
24 
25 namespace vtkDax {
26 namespace detail {
28  {
29  explicit CellTypeInDataSet(int cellType):
30  Cell(vtkGenericCell::InstantiateCell(cellType)){}
33  };
34 
35  //returns if a dataset can be used from within Dax
37  {
38  //determine the cell types that the dataset has
39  vtkNew<vtkCellTypes> cellTypes;
40  input->GetCellTypes(cellTypes.GetPointer());
41 
42  if(cellTypes->GetNumberOfTypes() > 1)
43  {
44  //we currently only support a single cell type
46  }
47 
48  return CellTypeInDataSet(cellTypes->GetCellType(0));
49  }
50 }}
51 #endif // DaxDetailCommon_h
52 // VTK-HeaderTest-Exclude: vtkDaxDetailCommon.h
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
provides thread-safe access to cells
abstract class to specify cell behavior
Definition: vtkCell.h:59
virtual void GetCellTypes(vtkCellTypes *types)
Get a list of types of cells in a dataset.
CellTypeInDataSet cellType(vtkDataSet *input)
T * GetPointer() const
Get a raw pointer to the contained object.
Definition: vtkNew.h:113
Allocate and hold a VTK object.
Definition: vtkNew.h:67
unsigned char GetCellType(int cellId)
Return the type of cell.
Definition: vtkCellTypes.h:107
vtkIdType GetNumberOfTypes()
Return the number of types in the list.
Definition: vtkCellTypes.h:92
virtual void Delete()
Delete a VTK object.