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
vtkDax::detail::CellTypeInDataSet::~CellTypeInDataSet
~CellTypeInDataSet()
Definition: vtkDaxDetailCommon.h:31
vtkCellTypes.h
vtkDax::detail::CellTypeInDataSet
Definition: vtkDaxDetailCommon.h:27
detail
Definition: vtkGenericDataArrayLookupHelper.h:28
vtkCellTypes::GetCellType
unsigned char GetCellType(int cellId)
Return the type of cell.
Definition: vtkCellTypes.h:107
vtkObjectBase::Delete
virtual void Delete()
Delete a VTK object.
vtkCellTypes::GetNumberOfTypes
vtkIdType GetNumberOfTypes()
Return the number of types in the list.
Definition: vtkCellTypes.h:92
VTK_EMPTY_CELL
@ VTK_EMPTY_CELL
Definition: vtkCellType.h:45
vtkDax::detail::CellTypeInDataSet::Cell
vtkCell * Cell
Definition: vtkDaxDetailCommon.h:32
vtkDax
Definition: vtkDaxContourImpl.h:54
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:59
vtkNew
Allocate and hold a VTK object.
Definition: vtkNew.h:67
vtkDax::detail::cellType
CellTypeInDataSet cellType(vtkDataSet *input)
Definition: vtkDaxDetailCommon.h:36
vtkNew::GetPointer
T * GetPointer() const
Get a raw pointer to the contained object.
Definition: vtkNew.h:113
vtkDataSet.h
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
vtkDax::detail::CellTypeInDataSet::CellTypeInDataSet
CellTypeInDataSet(int cellType)
Definition: vtkDaxDetailCommon.h:29
vtkNew.h
vtkDataSet::GetCellTypes
virtual void GetCellTypes(vtkCellTypes *types)
Get a list of types of cells in a dataset.
vtkGenericCell
provides thread-safe access to cells
Definition: vtkGenericCell.h:39
vtkGenericCell.h