VTK  9.5.20251011
vtkCellTypeUtilities.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
12#ifndef vtkCellTypeUtilities_h
13#define vtkCellTypeUtilities_h
14
15#include "vtkCommonDataModelModule.h" // For export macro
16#include "vtkObject.h"
17
18#include <string>
19
20VTK_ABI_NAMESPACE_BEGIN
21
22class VTKCOMMONDATAMODEL_EXPORT vtkCellTypeUtilities : public vtkObject
23{
24public:
26
28 void PrintSelf(ostream& os, vtkIndent indent) override;
29
34 static std::string GetTypeAsString(int typeId);
35
40 static int GetTypeIdFromName(const std::string& name);
41
46 static const char* GetClassNameFromTypeId(int typeId);
47
52 static int GetTypeIdFromClassName(const char* classname);
53
60 static int IsLinear(unsigned char type);
61
65 static int GetDimension(unsigned char type);
66
67protected:
69 ~vtkCellTypeUtilities() override = default;
70
71private:
73 void operator=(const vtkCellTypeUtilities&) = delete;
74};
75
76VTK_ABI_NAMESPACE_END
77#endif
vtkCellTypeUtilities is a collection of methods for cell type lookup.
static const char * GetClassNameFromTypeId(int typeId)
Given an int (as defined in vtkCellType.h) identifier for a class return it's classname.
static vtkCellTypeUtilities * New()
vtkCellTypeUtilities()=default
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static int GetTypeIdFromName(const std::string &name)
Return a cell type (as defined in vtkCellType.h) from the given display name.
static int GetDimension(unsigned char type)
Get the dimension of a cell.
~vtkCellTypeUtilities() override=default
static int GetTypeIdFromClassName(const char *classname)
Given a data object classname, return it's int identified (as defined in vtkCellType....
static int IsLinear(unsigned char type)
This convenience method is a fast check to determine if a cell type represents a linear or nonlinear ...
static std::string GetTypeAsString(int typeId)
Return a display name for the given cell type, or an empty string if the id is not recognized.
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162