SheafSystem  0.0.0.0
vtk_poly_data_builder.h
1 
2 //
3 // Copyright (c) 2014 Limit Point Systems, Inc.
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 
18 // Interface for class vtk_poly_data_builder
19 
20 #ifndef VTK_POLY_DATA_BUILDER_H
21 #define VTK_POLY_DATA_BUILDER_H
22 
23 #ifndef SHEAF_DLL_SPEC_H
24 #include "SheafSystem/sheaf_dll_spec.h"
25 #endif
26 
27 #ifndef ANY_H
28 #include "SheafSystem/any.h"
29 #endif
30 
31 #ifndef BLOCK_H
32 #include "SheafSystem/block.h"
33 #endif
34 
35 #ifndef SEC_VD_H
36 #include "SheafSystem/sec_vd.h"
37 #endif
38 
39 #ifndef SHEAF_H
40 #include "SheafSystem/sheaf.h"
41 #endif
42 
43 #ifndef VTKTYPE_H
44 #include "vtkType.h"
45 #endif
46 
47 class vtkDataSet;
48 class vtkDataArray;
49 class vtkDoubleArray;
50 class vtkPolyData;
51 
52 namespace sheaf
53 {
54 class namespace_poset;
55 }
56 
57 namespace fiber_bundle
58 {
59 class base_space_poset;
60 class sec_rep_space;
61 }
62 
63 namespace tool
64 {
65 
66 using namespace sheaf;
67 using namespace fiber_bundle;
68 
69 
73 class SHEAF_DLL_SPEC vtk_poly_data_builder : public any
74 {
75 
76 public:
77 
79 
80  typedef sec_vd::dof_type dof_type;
81 
82  // ===========================================================
83  // ANY FACET
84  // ===========================================================
85 
89  virtual bool is_ancestor_of(const any* other) const;
90 
95  virtual vtk_poly_data_builder* clone() const;
96 
101  vtk_poly_data_builder& operator=(const vtk_poly_data_builder& xother);
102 
106  virtual bool invariant() const;
107 
108  // ===========================================================
109  // VTK_POLY_DATA_BUILDER FACET
110  // ===========================================================
111 
117 
121  virtual ~vtk_poly_data_builder();
122 
127 
131  vtkPolyData* build(const sec_vd& xcoords, const sec_vd& xproperty);
132 
136  vtkPolyData* build(const sec_vd& xcoords);
137 
141  void build_pa(const sec_vd& xcoords, const sec_vd& xproperty, vtkPolyData& xresult);
142 
147  void build_pa(const sec_vd& xcoords, vtkPolyData& xresult);
148 
155  void build_file(const sec_vd& xcoords, const sec_vd& xproperty,
156  const std::string& xvtk_file_name, bool xis_ascii = true);
157 
164  void build_file(const sec_vd& xcoords,
165  const std::string& xvtk_file_name, bool xis_ascii = true);
166 
170  void construct_property(const sec_vd& xproperty, vtkPolyData& xresult);
171 
172 
173 private:
174 
180 
181 
182  //===========================================================================
183 
187  namespace_poset& name_space() const;
188 
192  void construct_mesh(const sec_vd& xcoords, vtkPolyData& xresult);
193 
197  void init_cell_type_map();
198 
202  size_type count_connectivity_entries(const sec_vd& xcoords) const;
203 
207  void get_connectivity(const sec_vd& xmbr);
208 
212  int get_dof_count(const sec_vd& xmbr) const;
213 
217  dof_type* get_dofs(const sec_vd& xmbr) const;
218 
219  // ==========================================================================
220  // DATA MEMBERS
221  // ==========================================================================
222 
226  namespace_poset* _name_space;
227 
231  block<int> _cell_type_map;
232 
236  block<int> _vtk_cell_types;
237 
241  block<vtkIdType> _vtk_cell_connectivity;
242 
243 };
244 
245 // ===========================================================
246 // NON-MEMBER FUNCTIONS
247 // ===========================================================
248 
249 
250 } // namespace tool
251 
252 #endif // ifndef VTK_POLY_DATA_BUILDER_H
The default name space; a poset which contains other posets as members.
Namespace for the tools component of the sheaf system.
Abstract base class with useful features for all objects.
Definition: any.h:39
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
Creates a vtkPolyData from sheaf field objects.
A section of a fiber bundle with a d-dimensional vector space fiber.
Definition: sec_vd.h:54
sec_vd_dof_type dof_type
The type of degree of freedom.
Definition: sec_vd.h:91
Namespace for the sheaves component of the sheaf system.
Namespace for the fiber_bundles component of the sheaf system.