vtkMaterialInterfaceIdListItem.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: $RCSfile$
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
21 #ifndef vtkMaterialInterfaceIdListItem_h
22 #define vtkMaterialInterfaceIdListItem_h
23 
24 #include "vtkPVVTKExtensionsFiltersMaterialInterfaceModule.h" //needed for exports
25 
27 {
28 public:
29  enum
30  {
31  LOCAL_ID = 0,
32  GLOBAL_ID = 1,
33  SIZE = 2
34  };
35  //
36  vtkMaterialInterfaceIdListItem() { this->Clear(); }
37  vtkMaterialInterfaceIdListItem(int globalId) { this->Initialize(-1, globalId); }
38  //
40  {
41  this->Initialize(other.GetLocalId(), other.GetGlobalId());
42  }
43  //
44  ~vtkMaterialInterfaceIdListItem() { this->Clear(); }
45  //
46  void Clear()
47  {
48  this->Data[LOCAL_ID] = -1;
49  this->Data[GLOBAL_ID] = -1;
50  }
51  //
52  void Initialize(int localId, int globalId)
53  {
54  this->Data[LOCAL_ID] = localId;
55  this->Data[GLOBAL_ID] = globalId;
56  }
57  //
58  int GetLocalId() const { return this->Data[LOCAL_ID]; }
59  //
60  int GetGlobalId() const { return this->Data[GLOBAL_ID]; }
61  // Comparison made by global id.
62  bool operator<(const vtkMaterialInterfaceIdListItem& other) const
63  {
64  return this->GetGlobalId() < other.GetGlobalId();
65  }
66  // Comparison made by global id.
67  bool operator<=(const vtkMaterialInterfaceIdListItem& other) const
68  {
69  return this->GetGlobalId() <= other.GetGlobalId();
70  }
71  // Comparison made by global id.
72  bool operator>(const vtkMaterialInterfaceIdListItem& other) const
73  {
74  return this->GetGlobalId() > other.GetGlobalId();
75  }
76  // Comparison made by global id.
77  bool operator>=(const vtkMaterialInterfaceIdListItem& other) const
78  {
79  return this->GetGlobalId() >= other.GetGlobalId();
80  }
81  // Comparison made by global id.
82  bool operator==(const vtkMaterialInterfaceIdListItem& other) const
83  {
84  return this->GetGlobalId() == other.GetGlobalId();
85  }
86  //
88  {
89  this->Initialize(other.GetLocalId(), other.GetGlobalId());
90  return *this;
91  }
92 
93 private:
94  int Data[SIZE];
95 };
96 #endif
97 
98 // VTK-HeaderTest-Exclude: vtkMaterialInterfaceIdListItem.h
#define VTKPVVTKEXTENSIONSFILTERSMATERIALINTERFACE_EXPORT
void Initialize(int localId, int globalId)
bool operator==(const vtkMaterialInterfaceIdListItem &other) const
bool operator>=(const vtkMaterialInterfaceIdListItem &other) const
bool operator<(const vtkMaterialInterfaceIdListItem &other) const
vtkMaterialInterfaceIdListItem(const vtkMaterialInterfaceIdListItem &other)
bool operator>(const vtkMaterialInterfaceIdListItem &other) const
bool operator<=(const vtkMaterialInterfaceIdListItem &other) const
Elemental data type for fragment id list containers.
vtkMaterialInterfaceIdListItem & operator=(const vtkMaterialInterfaceIdListItem &other)