FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
VertexPicking.hpp
1#ifndef VERTEX_PICKING_HPP
2#define VERTEX_PICKING_HPP
3
4#include <iostream>
5
6#include "fish/fiber/field/Fragment.hpp"
7
8//#define MDEV
9#include "FiberHDF5/mtoolslib/MDefs.hpp"
10
11
12namespace Fiber
13{
14
16{
17 map<size_t, size_t > m_fragment_start_vindex;
18 size_t m_count_size;
19
21 : m_count_size(0)
22 {
23 m_fragment_start_vindex.clear();
24 }
25
27 {
28 if( f )
29 MTOOLS_DEV_OUT( "frag name: " << f->Name() )
30 else
31 MTOOLS_DEV_OUT( "frag name: NullPtr()" );
32
33 size_t f_id = 0;
34
35 if( f ) f_id = f->getNumericalID();
36
37 m_fragment_start_vindex[ f_id ] = m_count_size;
38
39 if (RefPtr<SizeInterface> SI = getSize(dc) )
40 {
41 m_count_size += SI->nElements();
42 }
43 else
44 {
45 RefPtr<MemBase> data = dc->create();
46 if( !data )
47 {
48 MTOOLS_ERR_OUT( "CollectVertexFieldStartIndizes:apply() Error: Cannot create data" );
49 return true;
50 }
51 m_count_size += dc->create()->nElements();
52 }
53
54 MTOOLS_DEV_OUT( "CollectVertexFieldStartIndizes::apply() id: " << f_id << " size: "<< m_count_size );
55
56 return true;
57 }
58};
59
60}
61
62#endif
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
Base class for iterators over the fragments of a field.
Definition FragmentID.hpp:249
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2
Definition VertexPicking.hpp:16
bool apply(const RefPtr< FragmentID > &f, const RefPtr< CreativeArrayBase > &dc)
Iteration callback function.
Definition VertexPicking.hpp:26