FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
grid/types/RegularlyFragmentedClusteredPointCloudGrid.hpp
1#ifndef __FIBER_GRID_TYPES_REGULARLYFRAGMENTEDCLUSTEREDPOINTGRID_HPP
2#define __FIBER_GRID_TYPES_REGULARLYFRAGMENTEDCLUSTEREDPOINTGRID_HPP
3
4#include "gridtypesDllApi.h"
5
6#include "RegularlyFragmentedGrid.hpp"
7
8#include "elementary/aerie/BoundingBox.hpp"
9#include "fish/fiber/bundle/Bundle.hpp"
10
11
12
13namespace Fiber
14{
22{
23
25
28
30
32
35 {
36 return getCoordData(I);
37 }
38
39 bool isValid() const
40 {
41 return FragmentCoordinates.valid();
42 }
43
44
49static FragmentedUniformGrid3DPoints create( Grid&grid, const MultiIndex<3>&nr_fragments,
50 const Eagle::point3&start, const Eagle::point3&end );
51
52static FragmentedUniformGrid3DPoints create( Grid&grid, const MultiIndex<3>&nr_fragments,
53 const Eagle::BoundingBox&bb );
54};
55
56
57typedef uint32_t vc_index_t;
58
59
61{
62vc_index_t start;
63vc_index_t size;
64};
65
71{
72RefPtr<Skeleton> Cell; // topology storing the cell geometry
73RefPtr<Skeleton> Cluster; // topology storing vertex cluster as the lookup into the cells (sparse), and data thereon
74
75RefPtr<Representation> CellsAsCartesian; // geometry of cells as cartesian chart
76RefPtr<Representation> ClusterAsPoints; // cluster as points stores start indices of the cluster into the cart. vertices
77RefPtr<Representation> ClusterAsCells; // cluster as cells sotres an serialized index into the cells 1D -> 3D
78
79RefPtr<RegularlyFragmentedField<3> > CellPositions; // cell geometry is a uniform grid
80RefPtr<RegularlyFragmentedField<3> > ClusterAsPointsPositions; // positions field with 1D array of cell indices
81RefPtr<RegularlyFragmentedField<3> > ClusterAsCellPositions; // positions field width 1D array of vertex start indices
82
83// types of the data arrays used in the position fields
88
89public:
91
93
98 {
101 CellArray_t CellArray;
102 ClusterStartsArray_t ClusterStartsArray;
103 ClusterArray_t ClusterArray;
104
105 // mapping of 3D MultiIndex of uniform grid to sparse cluster index
106 map<vc_index_t, vc_index_t> FullIndexToSparseIndex;
107
109
112
115
116
117 bool findVertexClustersOnLine( const Eagle::PhysicalSpace::point& line_start,
119 double distance, vector<VertexCluster>& vertex_clusters );
120
121 RefPtr<Chunk<vc_index_t> > findVertices( const Eagle::PhysicalSpace::point& query_position, double radius );
122
123 };
124
125static SkeletonID ClusterCellID()
126{
127 return SkeletonID(0,2);
128}
129
130static SkeletonID ClusterLookUpID()
131{
132 return SkeletonID(0,3);
133}
134
135
136CellArray_t getCellArray( const MultiIndex<3>&frag ) const;
137
138ClusterStartsArray_t getClusterStartsArray( const MultiIndex<3>&frag ) const;
139
140ClusterArray_t getClusterLookUpArray( const MultiIndex<3>&frag ) const;
141
142
143
147bool findFragment( const Eagle::PhysicalSpace::point& query_position, MultiIndex<3>& index ) const;
148
149
150
154bool findCell( const Eagle::PhysicalSpace::point& query_position, const MultiIndex<3>&frag_index, MultiIndex<3>&cell_index ) const;
155
156
157
161bool findFragmentAndCell( const Eagle::PhysicalSpace::point& query_position, MultiIndex<3>&frag_index, MultiIndex<3>&cell_index ) const;
162
163
164
165RefPtr<Chunk<MultiIndex<3> > > findCellsManhatten( const Eagle::PhysicalSpace::point& query_position, double radius ) const;
166
167
168
171
172
173
176
177
178
181
182
183
186
187
188
189/*
190PointCluster findPointCluster( const Eagle::PhysicalSpace::point& query_position );
191
192RefPtr<Chunk<unsigned> > findPointIndices( const Eagle::PhysicalSpace::point& query_position, double radius );
193*/
194static int getCellsWherePointIsInGhostZone( const MultiIndex<3>& current, const MultiIndex<3>& max_cells, const Eagle::PhysicalSpace::point &pos, const Eagle::PhysicalSpace::point &t_min, const Eagle::PhysicalSpace::tvector &t_diag, double ghost_r, Eagle::FixedArray<MultiIndex<3>, 7>& cells );
195
196
197static bool create( RefPtr<Grid>& RegularGrid,
198 const RefPtr<RegularlyFragmentedField<3> >& CellPositions,
199 const RefPtr<RegularlyFragmentedField<3> >& ClusterAsPointsPositions,
200 const RefPtr<RegularlyFragmentedField<3> >& ClusterAsCellPositions );
201
202static bool create( RefPtr<Grid>& grid,
204 const RefPtr<Eagle::BoundingBox>& bb );
205
206};
207
208
209
210
211} // namespace Fiber
212
213#endif
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
Identifier for Skeletons within a Grid.
Definition SkeletonID.hpp:24
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2
A type describing a cell in a cell complex.
Definition Cell.hpp:42
Definition FragmentSkeleton.hpp:155
Definition grid/types/RegularlyFragmentedClusteredPointCloudGrid.hpp:22
RefPtr< CoordsArray_t > getCoords(const MultiIndex< 3 > &I) const
Get the coordinates for the given fragment via its fragment index.
Definition grid/types/RegularlyFragmentedClusteredPointCloudGrid.hpp:34
RefPtr< UniformCartesianArray > FragmentCoordinates
The coordinates, i.e. corner points, of each fragment.
Definition grid/types/RegularlyFragmentedClusteredPointCloudGrid.hpp:27
Class which can be used, when working with one explicit fragment only, providing all required data ar...
Definition grid/types/RegularlyFragmentedClusteredPointCloudGrid.hpp:98
bool findVertexCluster(const Eagle::PhysicalSpace::point &query_position, VertexCluster &vertex_cluster)
get start index and size of cluster in vertices
bool findCluster(const Eagle::PhysicalSpace::point &query_position, vc_index_t &cluster)
get index of cluster int cluster topo
Grid type for a fragmented point cloud proving a cell look into presorted vertices.
Definition grid/types/RegularlyFragmentedClusteredPointCloudGrid.hpp:71
RefPtr< Chunk< MultiIndex< 3 > > > findCells(const Eagle::PhysicalSpace::point &query_position, double radius)
Get a chunk of cluster cells around the query point.
RefPtr< Chunk< Eagle::PhysicalSpace::point > > findPoints(const Eagle::PhysicalSpace::point &query_position, double radius)
Get a chunk of points around the qurey point.
RefPtr< Chunk< Eagle::PhysicalSpace::point > > findPoints(const Eagle::PhysicalSpace::point &query_position, double radius, const MultiIndex< 3 > &frag_index)
Get a chunk of points around the qurey point.
Definition grid/types/RegularlyFragmentedGrid.hpp:294
Definition grid/types/RegularlyFragmentedClusteredPointCloudGrid.hpp:61