FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
PartialElementRenderer.hpp
1#ifndef __PartialElementRenderer_HPP
2#define __PartialElementRenderer_HPP
3
4#include <GLvish/VBO.hpp>
5#include <GLvish/IndexBuffer.hpp>
6#include <GLvish/VGLRenderContext.hpp>
7#include <field/FragmentSelector.hpp>
8
9#include "fishGLDllApi.h"
10
11namespace GL
12{
13
15typedef std::multimap<double, index_t> DepthToIndexMap;
16
19
20template <class Type>
22 const DepthToIndexMap&points)
23{
24using std::vector;
25
28
29 for(DepthToIndexMap::const_iterator it = points.begin();
30 it != points.end(); it++)
31 {
32 index_t sorted_idx = it->second;
35 }
36#ifdef VERBOSE
37 puts("indices copied, creating index buffer");fflush(stdout);
38#endif
40}
41
53
54template <class Type>
56{
59
61 : BaryCenters(BC)
62 {}
63
65 {
66 assert( BaryCenters );
67 MemCore::RefPtr<CellArray_t> Cells = BaryCenters->create();
68 assert( Cells );
69
70 MemCore::RefPtr<MemCore::TypedChunk<Type> > C = Cells->getStorage();
71 assert( C );
72
74 IB = SortElements(C->get_vector(), points);
75
76 return IB;
77 }
78};
79
137
139
140} // namespace GL
141
142#endif // __PartialElementRenderer_HPP
143
constexpr void sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
index_t count() const
Return the number of steps which can be traversed through this ElementIterator.
Definition HyperslabParameters.hpp:147
IndexTypeConfig< sizeof(void *)>::index_t index_t
Define the index type as according to the size of a pointer, i.e.
Definition Index.hpp:22
MemCore::RefPtr< IndexBufferObject > newIndexBuffer(const MemCore::RefPtr< MemCore::ChunkBase > &data, BufferArray::usage usage_hint=BufferArray::STATIC_DRAW)
Definition fs/init.hpp:20
Base class to draw a selection of elements as OpenGL points.
Definition PartialElementRenderer.hpp:85
IBO_t CurrentIBO
Index Buffer Object that is supposed to be used.
Definition PartialElementRenderer.hpp:103
MemCore::RefPtr< Wizt::IndexBufferObject > IBO_t
An index buffer object.
Definition PartialElementRenderer.hpp:87
Fiber::MemArray< 3, IBO_t > ViewBufferArray_t
Type to be used for storing index arrays for view-dependent rendering via depth-sorting.
Definition PartialElementRenderer.hpp:93
MemCore::RefPtr< ViewBufferArray_t > SortedIndices
Storage of view-dependent index arrays.
Definition PartialElementRenderer.hpp:98
Definition PartialElementRenderer.hpp:43
Definition PartialElementRenderer.hpp:56