vtkbone
vtkboneMaterialTable.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Copyright 2010-2016, Numerics88 Solutions Ltd.
4  http://www.numerics88.com/
5 
6  Copyright (c) Eric Nodwell and Steven K. Boyd
7  See Copyright.txt for details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notice for more information.
12 =========================================================================*/
13 
34 #ifndef __vtkboneMaterialTable_h
35 #define __vtkboneMaterialTable_h
36 
37 #include "vtkDataObject.h"
38 #include "vtkboneWin32Header.h"
39 #include <map>
40 #include <set>
41 
42 // Forward declarations
43 class vtkboneMaterial;
45 
47  {
48  public:
49  static vtkboneMaterialTable* New();
50  vtkTypeMacro(vtkboneMaterialTable, vtkDataObject);
51  void PrintSelf(ostream& os, vtkIndent indent);
52 
54  int GetNumberOfMaterials();
55 
57  int GetMaximumIndex();
58 
60 
62  void AddMaterial(int index, vtkboneMaterial* material);
63  // The sole reason for the following overloaded method is that the Python
64  // wrapping in VTK (at least for version 6.3) fails to identify that subclasses
65  // of vtkboneMaterialArray are also subclasses of vtkboneMaterial.
66  void AddMaterial(int index, vtkboneMaterialArray* material)
67  { this->AddMaterial(index,(vtkboneMaterial*)material); }
69 
72  int AppendMaterial(vtkboneMaterial* material);
73 
76  void RemoveMaterial(int index);
77 
79  void RemoveAll();
80 
82  int GetIndex(const char* name);
83 
85 
86  vtkboneMaterial* GetMaterial(int index);
87  vtkboneMaterial* GetMaterial(const char* name);
89 
91 
96  void GetMaterialOrArray(
97  int index,
98  vtkboneMaterial*& material,
99  int& offset);
101 
103 
110  vtkboneMaterial* GetMaterialOrArray(int index);
111  int GetArrayOffset ();
113 
117  void InitTraversal();
118 
123  int GetNextIndex();
124 
131  int GetNextUniqueIndex();
132 
135  vtkboneMaterial* GetCurrentMaterial();
136 
140  int CheckNames();
141 
142  protected:
145 
146  //BTX
147  typedef std::map<int,vtkboneMaterial*,std::less<int> > material_table_t;
148  material_table_t materials;
149  material_table_t::iterator traversal_iterator;
150  std::set<vtkboneMaterial*> visited_materials;
152  //ETX
153 
155 
156  private:
157  vtkboneMaterialTable(const vtkboneMaterialTable&); // Not implemented.
158  void operator=(const vtkboneMaterialTable&); // Not implemented.
159  };
160 
161 #endif
offset
#define VTKBONE_EXPORT
static vtkDataObject * New()
void AddMaterial(int index, vtkboneMaterialArray *material)
material_table_t materials
name
Material Table finite element mesh.
An abstract base class for materials of materials of the same type.
std::set< vtkboneMaterial * > visited_materials
An abstract base class for materials used in finite element models.
vtkboneMaterial * current_material
std::map< int, vtkboneMaterial *, std::less< int > > material_table_t
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
index
material_table_t::iterator traversal_iterator
void operator=(const vtkObjectBase &)