|
FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
|
A VertexField is a (abstract) gateway from RAM to GPU memory. More...
#include <VertexField.hpp>
Classes | |
| struct | Error |
| Exception class. More... | |
Public Member Functions | |
| VertexField (VObject *what, const string &fieldname, bool ConvertToElements=true, int expertLevel=0) | |
| Constructor. | |
| ~VertexField () | |
| Destructor. | |
| virtual RefPtr< BufferArray > | createVBOArray (const RefPtr< Fiber::MemBase > &MB, const string &arrayname, const RefPtr< GLProgram > &Shader, const Fiber::MemBase::Creator_t &theCreator) const =0 |
| Virtual function to create a vertex array from a given memory array. | |
| bool | append (VBO &myVBO, const RefPtr< Fiber::CreativeArrayBase > &CAb, const string &arrayname, const RefPtr< GLProgram > &Shader) const |
| Loading a given dataset as provided by the creator into a vertex array and append it to the given vertex buffer object. | |
| virtual bool | isOlderThan (const Ageable &A, const RefPtr< ValuePool > &Context) const |
| Check if the parameters associated with this field are older than the given age. | |
| virtual void | updateAge (Ageable &A, const RefPtr< ValuePool > &Context) const |
| Update the given age object with the age of the current field parameters. | |
Public Member Functions inherited from MemCore::ReferenceBase< VertexField > | |
| auto | getObjectCountID () const noexcept |
| bool | isIdentical (const WeakPtr< Object, Object > &PossibleSelf) const noexcept |
| void | mkAutoDestructive () |
| refcount_t | refcount () const noexcept |
| ReferenceBase (Object *that) noexcept | |
| const auto & | self () const |
| refcount_t | wrefcount () const noexcept |
Public Attributes | |
| TypedSlot< Fiber::Field > | MyField |
| const bool | ConvertToElements = false |
| A flag telling whether the elements of memory arrays shall be converted into temporary explicit arrays, for the sake of loading into vertex arrays. | |
Additional Inherited Members | |
Public Types inherited from MemCore::ReferenceBase< VertexField > | |
| typedef Object | reference_domain_t |
| typedef WeakPtr< Object, Object > | SelfPtr_t |
Protected Member Functions inherited from MemCore::ReferenceBase< VertexField > | |
| virtual void | extremeUnction () |
| ReferenceBase & | operator= (const ReferenceBase &R) |
| void | suicide () |
A VertexField is a (abstract) gateway from RAM to GPU memory.
It takes a data array in RAM (provided by the base class Fiber::MemBase) and transforms it into an OpenGL Buffer Array, e.g. to be used as a vertex attribute for some Shader program. It does so via the virtual function
which is implemented in child classes for the specific types that are to be transferred from CPU to GPU.
The member function VertexField::append() is then to be used in the rendering routine to add a certain vertex field to a vertex buffer object (VBO) for rendering.
Note that class VertexField does not deal with Fiber::Fields itself, but it provides a slot connecting to such. The class FragmentPainter provides the iterators to transform the various fragments of a Field into a sequence of VBO's, each with a collection of appropriate VertexField's attached. Be aware that a single Field may well consist of many fragments, and therefore be loaded as many BufferArray's through the same VertexField.
| Wizt::VertexField::VertexField | ( | VObject * | what, |
| const string & | fieldname, | ||
| bool | ConvertToElements = true, |
||
| int | expertLevel = 0 |
||
| ) |
Constructor.
| what | The VObject which will host all the field inputs. |
| fieldname | The name under which the Field input slot will appear. |
| ConvertToElements | A flag telling whether procedural fields shall be converted to elements; this depends on the rendering method whether procedural fields are supported here or not. A derived class must decide in its constructor whether this is the case and set this flag accordingly. |
| expertLevel | The expert level of the Field input slot. |
| bool Wizt::VertexField::append | ( | VBO & | myVBO, |
| const RefPtr< Fiber::CreativeArrayBase > & | CAb, | ||
| const string & | arrayname, | ||
| const RefPtr< GLProgram > & | Shader | ||
| ) | const |
Loading a given dataset as provided by the creator into a vertex array and append it to the given vertex buffer object.
This function must be called within a valid OpenGL Context.
References createVBOArray(), Eagle::norm2(), std::vector< typename _Tp, typename _Alloc >::size(), and MemCore::Typename().
|
pure virtual |
Virtual function to create a vertex array from a given memory array.
This function must be called within a valid OpenGL Context.
Implemented in Wizt::VBOField< VBOArrayType >, Wizt::VBOField< NextType >, Wizt::VBOField< TypedTexCoordArray< Type > >, Wizt::VBOField< TypedVertexAttribArray< Type > >, Wizt::VBOField< LIST< VBOArrayType, NextType > >, Wizt::VBOField< LIST< TypedVertexAttribArray< Type >, NextType > >, Wizt::VBOTensorField, and Wizt::VBORGBAField.
Referenced by append().
|
virtual |
Check if the parameters associated with this field are older than the given age.
If nothing has changed, return true, which is the default. Returning false here will trigger some action like reloading and/or recomputing data, which might be expensive.
A flag telling whether the elements of memory arrays shall be converted into temporary explicit arrays, for the sake of loading into vertex arrays.
This is significantly slower but makes the rendering code easier because it does not need to deal with multiple cases of procedural arrays.