SheafSystem  0.0.0.0
vtk_unstructured_grid_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_unstructured_grid_builder
19 
20 #ifndef VTK_UNSTRUCTURED_GRID_BUILDER_H
21 #define VTK_UNSTRUCTURED_GRID_BUILDER_H
22 
23 #ifndef SHEAF_DLL_SPEC_H
24 #include "SheafSystem/sheaf_dll_spec.h"
25 #endif
26 
27 #ifndef VTK_ABSTRACT_GRID_BUILDER_H
28 #include "SheafSystem/vtk_abstract_grid_builder.h"
29 #endif
30 
31 #ifndef VTKTYPE_H
32 #include "vtkType.h"
33 #endif
34 
35 namespace tool
36 {
37 
41 class SHEAF_DLL_SPEC vtk_unstructured_grid_builder :
43 {
44 
45 public:
46 
47  // ===========================================================
48  // ANY FACET
49  // ===========================================================
50 
54  virtual bool is_ancestor_of(const any* other) const;
55 
60  virtual vtk_unstructured_grid_builder* clone() const;
61 
66  virtual vtk_unstructured_grid_builder& operator=
67  (const vtk_abstract_grid_builder& xother);
68 
73  (const vtk_unstructured_grid_builder& xother);
74 
78  virtual bool invariant() const;
79 
80  // ===========================================================
81  // VTK_UNSTRUCTURED_GRID_BUILDER FACET
82  // ===========================================================
83 
88 
94 
99 
104 
109  void set_name_space(namespace_poset& xns);
110 
114  vtkUnstructuredGrid* build(const sec_vd& xcoords, const sec_vd& xproperty);
115 
120  vtkUnstructuredGrid* build(const sec_vd& xcoords,
121  const sec_vd& xproperty1,
122  const sec_vd& xproperty2);
123 
127  vtkUnstructuredGrid* build(const sec_vd& xcoords);
128 
133  vtkUnstructuredGrid* build(const sec_vd& xcoords,
134  const std::string& xpartition_name);
135 
140  vtkUnstructuredGrid* build(const sec_vd& xcoords,
141  const block<sec_vd*>& xproperties);
142 
146  void build_pa(const sec_vd& xcoords,
147  const sec_vd& xproperty,
148  vtkUnstructuredGrid& xresult);
149 
154  void build_pa(const sec_vd& xcoords,
155  const sec_vd& xproperty1,
156  const sec_vd& xproperty2,
157  vtkUnstructuredGrid& xresult);
158 
162  void build_pa(const sec_vd& xcoords, vtkUnstructuredGrid& xresult);
163 
168  void build_pa(const sec_vd& xcoords,
169  const std::string& xpartition_name,
170  vtkUnstructuredGrid& xresult);
171 
176  void build_pa(const sec_vd& xcoords,
177  const block<sec_vd*>& xproperties,
178  vtkUnstructuredGrid& xresult);
179 
180 
187  void build_file(const sec_vd& xcoords, const sec_vd& xproperty,
188  const std::string& xvtk_file_name, bool xis_ascii = true);
189 
193  bool is_scalar(const sec_vd* xsec) const;
194 
198  bool is_vector(const sec_vd* xsec) const;
199 
203  bool is_tensor(const sec_vd* xsec) const;
204 
205 private:
206 
207  //===========================================================================
208 
212  namespace_poset& name_space() const;
213 
217  void init_cell_type_map();
218 
223  void set_cell_data(abstract_poset_member& xbase,
224  const std::string& xpartition_name,
225  vtkUnstructuredGrid& xresult);
226 
230  namespace_poset* _name_space;
231 
235  block<int> _cell_type_map;
236 
240  block<int>* _vtk_cell_types;
241 
245  block<vtkIdType>* _vtk_cell_connectivity;
246 
250  bool _is_point_mesh;
251 
255  block<bool> _prop_is_pt_data;
256 
260  block<int> _prop_tensor_rank;
261 
265  int _pt_ct;
266 
270  int _cell_ct;
271 
275  vtkDoubleArray* _vtk_coord_dofs;
276 
280  block<vtkDoubleArray*> _vtk_prop_dofs;
281 
285  void initialize_vtk_mesh_data(const sec_vd& xsec, std::string xcoords_name);
286 
290  void finalize_vtk_mesh_data(vtkUnstructuredGrid& xresult);
291 
295  void initialize_vtk_prop_data(const sec_vd* xprop);
296 
300  void finalize_vtk_prop_data(const sec_vd* xprop,
301  bool xprop_is_pt_data,
302  int xprop_tensor_rank,
303  vtkDoubleArray* xvtk_prop_dofs,
304  vtkUnstructuredGrid& xresult);
305 };
306 
307 // ===========================================================
308 // NON-MEMBER FUNCTIONS
309 // ===========================================================
310 
311 
312 } // namespace tool
313 
314 #endif // ifndef VTK_UNSTRUCTURED_GRID_BUILDER_H
The default name space; a poset which contains other posets as members.
Abstract class for creating a vtkUnstructuredGrid from sheaf field objects.
Namespace for the tools component of the sheaf system.
Abstract base class with useful features for all objects.
Definition: any.h:39
Creates a vtkUnstructuredGrid from sheaf field objects.
A section of a fiber bundle with a d-dimensional vector space fiber.
Definition: sec_vd.h:54
An abstract client handle for a member of a poset.
An auto_block with a no-initialization initialization policy.