SheafSystem  0.0.0.0
visualization_iterator.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 visualization_iterator
19 
20 
21 #ifndef VISUALIZATION_ITERATOR_H
22 #define VISUALIZATION_ITERATOR_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef FILTERED_DEPTH_FIRST_ITERATOR_H
29 #include "SheafSystem/filtered_depth_first_iterator.h"
30 #endif
31 
32 #ifndef SEC_VD_H
33 #include "SheafSystem/sec_vd.h"
34 #endif
35 
36 #ifndef SECTION_ITERATION_STATE_H
37 #include "SheafSystem/section_iteration_state.h"
38 #endif
39 
40 #ifndef VTKTYPE_H
41 #include "vtkType.h"
42 #endif
43 
44 class vtkDoubleArray;
45 class vtkIdTypeArray;
46 
47 namespace tool
48 {
49 
50 using namespace fiber_bundle;
51 
56 class SHEAF_DLL_SPEC visualization_iterator :
58 {
59 public:
60 
61  // ===========================================================
62  // ANY FACET
63  // ===========================================================
64 
68  virtual bool is_ancestor_of(const any* xother) const;
69 
73  virtual visualization_iterator* clone() const = 0;
74 
78  bool invariant() const;
79 
80  // ===========================================================
81  // DEPTH_FIRST_ITERATOR FACET
82  // ===========================================================
83 
87  virtual void force_is_done();
88 
90 
94  virtual void put_anchor(const section_space_schema_member& xcoords_schema,
95  const section_space_schema_member& xprop_schema);
96 
100  virtual void put_anchor(const section_space_schema_member& xcoords_schema);
101 
105  virtual void reset(bool xreset_markers = true);
106 
107  // ===========================================================
108  // VISUALIZATION_ITERATOR FACET
109  // ===========================================================
110 
114  static visualization_iterator*
115  new_visualization_iterator(const section_space_schema_member& xcoords_schema,
116  const section_space_schema_member& xprop_schema,
117  bool xinitialize = true);
118 
122  static visualization_iterator*
123  new_visualization_iterator(const section_space_schema_member& xcoords_schema,
124  bool xinitialize = true);
125 
130 
134  const section_space_schema_member& coordinates_schema() const;
135 
139  bool has_property() const;
140 
144  const section_space_schema_member& property_schema() const;
145 
150  bool use_point_top_ids() const;
151 
155  void put_use_point_top_ids(bool xvalue);
156 
161  bool use_cell_top_ids() const;
162 
166  void put_use_cell_top_ids(bool xvalue);
167 
168 
172  virtual void set_vtk_data(const sec_vd& xcoords,
173  const sec_vd& xprop,
174  vtkDoubleArray* xvtk_pt_coords,
175  vtkDoubleArray* xvtk_prop,
176  int xprop_tensor_rank,
177  block<int>& xvtk_cell_types,
178  block<vtkIdType>& xvtk_cell_connectivity,
179  block<int>& xvtk_cell_type_map,
180  vtkIdTypeArray* xvtk_pt_label_ids,
181  vtkIdTypeArray* xvtk_cell_label_ids);
182 
186  virtual void set_vtk_data(const sec_vd& xcoords,
187  vtkDoubleArray* xvtk_pt_coords,
188  block<int>& xvtk_cell_types,
189  block<vtkIdType>& xvtk_cell_connectivity,
190  block<int>& xvtk_cell_type_map,
191  vtkIdTypeArray* xvtk_pt_label_ids,
192  vtkIdTypeArray* xvtk_cell_label_ids);
193 
197  virtual void set_vtk_data(const sec_vd& xprop,
198  vtkDoubleArray* xvtk_prop,
199  int xprop_tensor_rank);
200 
201 protected:
202 
207 
212  {}
213 
218  void initialize_iteration(const section_space_schema_member& xcoordinates_schema,
219  const section_space_schema_member& xproperty_schema);
220 
225  void initialize_iteration(
226  const section_space_schema_member& xcoordinates_schema);
227 
232 
238 
244 
249 
254 
259 
263  struct SHEAF_DLL_SPEC depth_flags_type
264  {
265  bool coord_eval;
266  bool coord_disc;
267  bool prop_eval;
268  bool prop_disc;
269  bool vis_eval;
270  bool vis_disc;
271 
272  depth_flags_type& operator=(bool xvalue)
273  {
274  coord_eval = xvalue;
275  coord_disc = xvalue;
276  prop_eval = xvalue;
277  prop_disc = xvalue;
278  vis_eval = xvalue;
279  vis_disc = xvalue;
280 
281  return(*this);
282  };
283  };
284 
290 
296 
300  // static const size_type _coord_dofs_ub = 3;
301 
302  enum static_const_int {COORD_DOFS_UB = 3, PROP_DOFS_UB = 16};
303 
307  sec_vd_dof_type _coord_dofs[COORD_DOFS_UB];
308 
311  //static const size_type _prop_dofs_ub = 16;
312 
316  sec_vd_dof_type _prop_dofs[PROP_DOFS_UB];
317 
321  void initialize_buffers();
322 
326  void clear_down_set();
327 
332  const abstract_poset_member& x2) const;
333 
337  void initialize_states(const section_space_schema_member& xcoordinates_schema,
338  const section_space_schema_member& xproperty_schema);
339 
340 
344  void initialize_states(const section_space_schema_member& xcoordinates_schema);
345 
350 
355 
360  void put_prop_dofs(sec_vd_dof_type* xprop_dofs,
361  size_type xprop_df,
362  int xprop_tensor_rank,
363  vtkDoubleArray* xvtk_prop,
364  int xvtk_tuple_id);
365 
369  double _st2_e3[3][3];
370 
374  double _st2_e2[3][3];
375 
380 
381 };
382 
383 } // namespace tool
384 
385 #endif // ifndef VISUALIZATION_ITERATOR_H
int _cell_seq_id
The sequece id of the current vtk cell (i.e. element or zone).
scoped_index _maximal_eval_id
The index of the current maximal evaluation member.
static_const_int
Upper bound for _coord_dofs.
Namespace for the tools component of the sheaf system.
Abstract base class with useful features for all objects.
Definition: any.h:39
depth_flags_type _at
True if current iteration is a member of the subposet associated with the flag.
int _pt_seq_id
The sequece id of the current vtk point (i.e. vertex).
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
Descriptor for iteration state of individual section. Intended for implementing various iterators...
section_iteration_state _coord_state
Descriptor for coordinate section iteration.
visualization_iterator(const visualization_iterator &xother)
Copy constructor; disabled.
A section of a fiber bundle with a d-dimensional vector space fiber.
Definition: sec_vd.h:54
SHEAF_DLL_SPEC void min(const vd &x0, vd_value_type &xresult, bool xauto_access)
Minimum component of x0, pre-allocated version.
Definition: vd.cc:2161
Abstract iterator over the schema of both the coordinates and property sections of a visualization...
bool _has_property
True if this visualization has a property section.
bool _use_cell_top_ids
If true use top ids to label cells; otherwise, use evaluation ids.
section_iteration_state _prop_state
Descriptor for property section iteration.
A client handle for a poset member which has been prepared for use as a schema for a section space...
bool _use_point_top_ids
If true use top ids to label points; otherwise, use discretization ids.
virtual void put_anchor(const abstract_poset_member *xanchor)
Set anchor() to xanchor.
An abstract client handle for a member of a poset.
double sec_vd_dof_type
The type of degree of freedom in the section space.
Definition: fiber_bundle.h:78
section_iteration_state _vis_state
Descriptor for visualization section iteration.
Namespace for the fiber_bundles component of the sheaf system.
depth_flags_type _above
True if current iteration is above the subposet associated with the flag.