9 #ifndef GlobeEngine_Cluster_h
10 #define GlobeEngine_Cluster_h
12 #include <vmmlib/vmmlib.hpp>
13 #include "OpenGL_Includes.h"
34 void create(vmml::Vector2ui _clusterCount,
35 vmml::Vector2d _clusterSize,
36 vmml::Vector4d _objectBounds);
47 vmml::Vector4d
getClusterBounds(vmml::Vector2ui _cluster,
double _lineAdditionalDistance);
67 unsigned int clusterCount1D;
68 vmml::Vector2ui clusterCount;
69 vmml::Vector2d clusterSize;
70 vmml::Vector4d objectBounds;
72 unsigned int gpuIndexCount;
73 std::vector<unsigned int> lineSegmentIDPerClusterID[65536];
74 std::vector<size_t> mortonOrderPerClusterID[65536];
76 unsigned int idOffsetsPerClusterID[65536];
78 unsigned int maxMortonDepthPerClusterID[65536];
79 unsigned int offsetMortonBoundsPerClusterID[65536];
~ClusterGrid()
Definition: ClusterGrid.cpp:14
ClusterGrid()
Definition: ClusterGrid.cpp:10
vmml::Vector2ui getClusterIDForPoint(const ge::Vertex2d &_p1, double _addDistance)
Definition: ClusterGrid.cpp:41
Definition: ClusterGrid.h:17
Definition: ClusterGrid.h:19
unsigned int getLineSegmentIDForCluster(int _clusterID, int _lineIdx) const
Definition: ClusterGrid.cpp:230
Definition: ClusterGrid.h:27
void copyClusterGridToGPUBuffer()
Definition: ClusterGrid.cpp:178
vmml::Vector2d getClusterSize() const
Definition: ClusterGrid.cpp:246
vmml::Vector4d getBounds() const
Definition: ClusterGrid.cpp:250
vmml::Vector4ui getClusterIDBoundsForLine(const ge::Vertex2d &_p1, const ge::Vertex2d &_p2, double _lineAdditionalDistance)
Definition: ClusterGrid.cpp:53
void copyClusterGridBoundInfoToGPUBuffer()
Definition: ClusterGrid.cpp:204
unsigned int getGPUIndexCount() const
Definition: ClusterGrid.cpp:254
unsigned int getClusterCount() const
Definition: ClusterGrid.cpp:238
const ClusterGridTextures * getClusterHandles()
Definition: ClusterGrid.cpp:258
std::shared_ptr< ge::Texture2Dui > maxMortonDepthTexture
Definition: ClusterGrid.h:23
vmml::Vector4d getClusterBounds() const
void clear()
Definition: ClusterGrid.cpp:18
std::shared_ptr< ge::Texture2Dui > boundOffsetTexture
Definition: ClusterGrid.h:24
bool intersectLineWithClusters(vmml::Vector2ui _cluster, double _lineAdditionalDistance, const ge::Vertex2d &_p1, const ge::Vertex2d &_p2)
Definition: ClusterGrid.cpp:138
std::shared_ptr< ge::Texture2Dui > offsetTexture
Definition: ClusterGrid.h:22
void setMortonForCluster(unsigned int _idx, std::vector< size_t > _mortonCodes)
Definition: ClusterGrid.cpp:226
unsigned int getNumberOfLinesForCluster(int _clusterId) const
Definition: ClusterGrid.cpp:234
void assignLineToClusterIDs(unsigned int _lineSegmentID, std::vector< unsigned int > _clusterIds)
Definition: ClusterGrid.cpp:169
Definition: VBOVertex.h:51
std::vector< unsigned int > getClustersByLineIntersection(const ge::Vertex2d &_p1, const ge::Vertex2d &_p2, double _lineWidth)
Definition: ClusterGrid.cpp:94
std::vector< size_t > getMortonCodesForCluster(unsigned int _idx)
Definition: ClusterGrid.cpp:222
vmml::Vector2ui getClusterID2D(unsigned int _clusterID)
Definition: ClusterGrid.cpp:33
vmml::Vector2ui getClusterCount2D() const
Definition: ClusterGrid.cpp:242
void setMaxMortonDepthForCluster(unsigned int _idx, unsigned int _depth)
Definition: ClusterGrid.cpp:218
void create(vmml::Vector2ui _clusterCount, vmml::Vector2d _clusterSize, vmml::Vector4d _objectBounds)
Definition: ClusterGrid.cpp:23
void setMortonBoundOffsetForCluster(unsigned int _idx, unsigned int _offset)
Definition: ClusterGrid.cpp:214