Fish - FiberLib for VISH 0.3
Fish - The Fiber Bundle API for the Vish Visualization Shell

Base class for render objects that require a collection of Fields given on a Grid. More...

#include <VertexFieldCollection.hpp>

Inheritance diagram for Wizt::VertexFieldCollection:
Wizt::Fish< Fiber::Grid > std::multimap< string, RefPtr< VertexField > > Wizt::Fish< double > Wizt::Fish< VObject > Wizt::VSkale Wizt::VConnectable Wizt::VSlotContainer Wizt::VManagedObjectBase Wizt::VConnectionValidatorList Wizt::ValueCacheable MemCore::ReferenceBase< VManagedObjectBase > Wizt::FragmentPainter Wizt::VertexRenderObject Wizt::SplatRenderObject Wizt::VertexGeometryShader VectorViz::VectorSpeckle Wizt::TensorShaderBase

Classes

struct  Iterator
 Abstract iterator class for inspecting the currently available VertexFields. More...

Public Types

enum  { NumberOfInputFields = 1 }
Public Types inherited from Wizt::VSlotContainer
enum  AttachErrorCode
typedef void AcceptableInputTypes
typedef VSlotSet CreationSlots_t
typedef VSlot::Empty< I > Empty
Public Types inherited from MemCore::ReferenceBase< VManagedObjectBase >
typedef Object reference_domain_t
typedef WeakPtr< Object, Object > SelfPtr_t

Public Member Functions

 VertexFieldCollection (VObject *that)
 Construct a collection of fields on the vertices of a Grid.
 ~VertexFieldCollection ()
 Destructor.
TypedSlot< Fiber::Field > & insertVertexField (const string &s, const RefPtr< VertexField > &)
 Add a vertex field under the given name.
RefPtr< VertexField > & operator[] (const string &s)
 Retrieve a VertexField for the given name, create one, if required.
RefPtr< VertexFieldoperator() (const string &s) const
 Search for a VertexField under the given name.
Fiber::Info< Fiber::SkeletongetRefinementLevel (int Level, const RefPtr< ValuePool > &VP, int IndexDepth=0, const Fiber::BundlePtr &SpaceTime=Fiber::BundlePtr(NullPtr())) const override
 Implementation of the virtual callback function that will load data sets from a grid into a collection of VertexFields, as specified earlier.
virtual GridSelector myGridSelector (const RefPtr< ValuePool > &VP) const
 Virtual function that allows child classes to specify the Grid that shall be used.
GridSelector getGridSelector (const RefPtr< ValuePool > &VP) const override
 Get the Grid that will be used here.
void retrieveFields (Fiber::FieldCollection &FieldMap, const RefPtr< Fiber::Representation > &MyRepresentation, const RefPtr< ValuePool > &Context, const RefPtr< Fiber::Skeleton > &DestVertices, Fiber::Grid &DestGrid, Fiber::Slice &DestGridSlice, const string &HelperDestGridName, bool StoreResult=true)
 From the given Representation, retrieve all fields as required here into the provided Fieldmap.
int append (const RefPtr< VBO > &myVBO, const VertexFragment &VertexFragments, const RefPtr< GLProgram > &Shader) const
 Append all the fields stored in these vertex fragments to the given vertex buffer object.
bool isOlderThan (const Ageable &A, const RefPtr< ValuePool > &Context) const
 Check if all parameters in this collection of fields is older than the given age.
void updateAge (Ageable &A, const RefPtr< ValuePool > &Context) const
RefPtr< StringListgetCurrentFieldnames (const RefPtr< ValuePool > &Context) const
 Get a list of all currently selected fields.
int iterate (Iterator &It) const
 Iterate through all available vertex fields.
Public Member Functions inherited from Wizt::Fish< Fiber::Grid >
 Fish (const string &s="grid", int prior=2)
 Constructor, optionally pass a parameter of this grid's name (ie.
virtual ~Fish ()
 Destructor.
void registerGridAsOutput ()
 Make grid visible as output.
Fiber::Bundle::GridInfo_t findMostRecentGrid (GridSelector &GS, const RefPtr< ValuePool > &VP, const Fiber::BundlePtr &SpaceTime=Fiber::BundlePtr(NullPtr())) const
 This is a convenience function to find the most recent grid for the current time ( Fish<Slice>() or virtual function getTime() ).
Fiber::Bundle::GridInfo_t findMostRecentGrid (const RefPtr< ValuePool > &VP, const Fiber::BundlePtr &SpaceTime=Fiber::BundlePtr(NullPtr())) const
 Find the most recent grid for the current time ( Fish<Slice>() or virtual function getTime() ).
bool IterateLevelsOnMostRecentGrid (LevelIterator &LI, const RefPtr< ValuePool > &Context, const Fiber::BundlePtr &SpaceTime=Fiber::BundlePtr(NullPtr())) const
 Iterate over all the selected levels of a Grid via an instance of the LevelIterator.
RefPtr< Fiber::FieldgetField (const Fiber::FieldSelector &FS, const RefPtr< ValuePool > &VP, const Fiber::BundlePtr &SpaceTime=Fiber::BundlePtr(NullPtr()))
 Retrieve a field for the given FieldSelector on the currently selected Grid.
Public Member Functions inherited from Wizt::Fish< double >
 Fish ()
 Default constructor.
 ~Fish ()
 Destructor.
virtual double getTime (const RefPtr< ValuePool > &VP, const RefPtr< Fiber::Bundle > &SpaceTime) const =0
 Most virtual time retrieval function.
virtual int getMaxRefinementLevel (const RefPtr< ValuePool > &VP) const
 Get the maximum refinement level that we seek to handle here.
virtual int getMinRefinementLevel (const RefPtr< ValuePool > &VP) const
bool IterateLevels (LevelIterator &LI, const Fiber::Info< Fiber::Grid > &G, const RefPtr< ValuePool > &Context) const
 Iterate over the diverse refinement levels of a Grid, which may exist at times different from the given coarsest grid.
Public Member Functions inherited from Wizt::VConnectable
virtual void adjustConnections (const RefPtr< VSlot > &ChangedSlot, const RefPtr< VParameter > &par)
VSlotContainer::AttachErrorCode attach (const ParameterID &whichone, VSlotContainer &sourceObject, const ParameterID &sourceName)
AttachErrorCode attach (const RefPtr< VParameter > &OldParam, const RefPtr< VParameter > &NewParam, const string &Member={})
AttachErrorCode attachUniqueObject (const RefPtr< VParameter > &param, const RefPtr< VCreationPreferences > &VCP=NullPtr(), bool ReallyUnique=true)
AttachErrorCode attachUniqueObject (const RefPtr< VSlot > &slot, const RefPtr< VCreationPreferences > &VCP=NullPtr(), bool ReallyUnique=true)
RefPtr< VSlotConnect (const RefPtr< VParameter > &SourceParam)
RefPtr< VSlotConnectInterface (const RefPtr< VSlotContainer > &Provider, const RefPtr< InterfaceBase > &IB)
virtual bool CreatedFilteredConnection (const RefPtr< VParameter > &SourceParam)
Public Member Functions inherited from Wizt::VSlotContainer
Ageableage (const RefPtr< ValuePool > &VP)
const Ageableage (const RefPtr< ValuePool > &VP) const
const AgeableConnectionAge () const
bool ConnectionsHaveChanged (const RefPtr< ValuePool > &VP) const
bool HasYoungerInput (const RefPtr< ValuePool > &Context, int RecursionLevel=0) const
Ageable YoungestInput (const RefPtr< ValuePool > &Context) const
Ageable YoungestOutput (const RefPtr< ValuePool > &Context) const
Ageable YoungestUncachedInput (const RefPtr< ValuePool > &Context) const
bool CheckIfThereExistNewerOutputs (const VRequest &request, bool AdjustObjectAge) const
RefPtr< VSlotaddParameter (const ParameterID &name, int EL, const RefPtr< VParameter > &param, bool overwriteExistingSlot)
virtual bool allowParameterReplacement (const RefPtr< VParameter > &NewParam, const RefPtr< VParameter > &OldParam, const string &localName, int ExpertLevel)
virtual int connectSlots (const VSlotContainerPtr &vobj)
bool removeParameter (const ParameterID &s)
RefPtr< VParametergetParameter (const ParameterID &s) const
RefPtr< VSlotgetSlot (const ParameterID &s, int &EL) const
bool setSlotValueFromText (const ParameterID &s, const string &ValueText, const RefPtr< ValuePool > &VP, const string &theMember={})
RefPtr< VSlotfindSlot (const RefPtr< VParameter > &param) const
string getSlotName (const RefPtr< VParameter > &param) const
bool AddAction (const ParameterID &s, const RefPtr< ValueActionBase > &VAB)
bool AddAction (const RefPtr< VSlot > &ActionSlot, bool(DerivedObject::*Action)(const RefPtr< VValueBase > &value))
RefPtr< VParametermkUniqueParameterInput (const ParameterID &s, const string &ContainerName)
int getExpertLevel (const ParameterID &s) const
int setExpertLevel (const ParameterID &s, int EL)
int getExpertLevel (const RefPtr< VParameter > &) const
int getExpertLevel (const RefPtr< VSlot > &S) const
int setExpertLevel (const RefPtr< VSlot > &S, int EL)
int setExpertLevel (const RefPtr< VParameter > &s, int EL)
bool hasChanged (const ParameterID &s, const RefPtr< ValuePool > &Context) const
bool hasChanged (const RefPtr< VSlot > &, const RefPtr< ValuePool > &Context) const
bool hasChanged (const RefPtr< ValuePool > &Context, int n,...) const
bool hasChanged (RefPtr< ValuePool > Context,...) const
virtual bool ignoreInput (const RefPtr< VSlot > &theSlot) const
bool getParameterValue (Type &Variable, const ParameterID &s, const RefPtr< ValuePool > &VP) const
bool getParameterValue (Type &Variable, const ParameterID &s, const VContext &C) const
bool getParameterValue (Type &Variable, const ParameterID &s, const VRequest &R) const
bool setParameterValue (const Type &Variable, const ParameterID &s, const RefPtr< ValuePool > &VP, bool autoCreateLocalValue) const
bool setParameterValue (const Type &Variable, const ParameterID &s, VContext &C, bool autoCreateLocalValue) const
bool setParameterValue (const Type &Variable, const ParameterID &s, VRequest &R, bool autoCreateLocalValue=false) const
RefPtr< VSlotaddParam (const ParameterID &name, const Type &init, const RefPtr< VCreationPreferences > &VP=NullPtr(), int expertLevel=0, bool overwriteExistingSlot=true)
bool setParameterProperty (const ParameterID &param, const string &Properties, const RefPtr< VValueBase > &Value=NullPtr())
RefPtr< VSlotaddFloatParam (double init, const ParameterID &param, double min, double max, const RefPtr< VCreationPreferences > &IP=NullPtr(), int expertLevel=0)
AttachErrorCode attach (const RefPtr< VParameter > &OldParam, const RefPtr< VParameter > &NewParam, const string &Member={})
int iterateParameters (int expertLevel, VSlotIterator &VIIt) const
int iterateInputSlots (int expertLevel, VSlotIterator &VIIt) const
int iterateInputs (VSlotIterator &VIIt, int expertLevel=0)
int iterate_inputs (const std::function< bool(VSlot &what, int ExpertLevel)>) const
RefPtr< VSlotgetUniqueInputSlot (const type_info &what)
int getNumberOfParameters (int expertLevel) const
virtual bool implements (const type_info &what) const
virtual RefPtr< VParametergetImplementation (const type_info &what, const string &name={}, const string &member={}) const
RefPtr< VSlotgetImplementationSlot (const type_info &what, const string &Name={}, const string &Member={}) const
VAcceptInfoList_t getAcceptInfoList (const std::type_info &request_type) const
bool provides (const RefPtr< VSlot > &OutputSlot) const
RefPtr< VSlotfindOutputSlot (const RefPtr< VParameter > &Who) const
bool isYounger (const RefPtr< VParameter > &OutputParam, const RefPtr< ValuePool > &VP) const
bool isNewlyConnected (const RefPtr< VParameter > &Who, const RefPtr< ValuePool > &VP) const
bool hasNewlyConnectedOutputs (const RefPtr< ValuePool > &VP) const
void findNewlyConnectedOutputs (const RefPtr< ValuePool > &VP, VSlotSet &WhichOnes) const
RefPtr< VSlotgetOutput (const string &Name) const
RefPtr< MemCore::StringListgetOutputs (const type_info &what=typeid(void)) const
virtual int iterateOutputs (VOutputIterator &VOut, const type_info &just_these=typeid(void)) const
bool registerOutput (const RefPtr< VParameter > &P, const string &AsName={})
bool registerOutput (const RefPtr< VParameter > &P, const string &AsName, const type_info &MemberType, const string &UseMember)
bool registerOutput (const RefPtr< VParameter > &P, const type_info &MemberType, const string &UseMember)
int getNumberOfInputs () const
int getNumberOfOutputs () const
bool hasChangedSlots (const MemCore::Intercube &IC, const RefPtr< ValuePool > &Context) const
auto include_self (const std::tuple< SlotList... > &t) const -> decltype(std::tuple_cat(std::make_tuple(this), t))
Public Member Functions inherited from MemCore::ReferenceBase< VManagedObjectBase >
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

RefPtr< VertexFieldPositions
 The coordinates are a field that will always be available here.
Public Attributes inherited from Wizt::Fish< Fiber::Grid >
TypedSlot< Fiber::GridMyGrid
Public Attributes inherited from Wizt::VSlotContainer
 AllLevels
 DestParameterNotFound
 InvalidDestParameter

Additional Inherited Members

Static Public Member Functions inherited from Wizt::VConnectable
static bool attachSlot (const WeakPtr< VSlot > &DestSlot, const RefPtr< VParameter > &ProvidedParam, const string &Member={})
static bool attachSlot (const WeakPtr< VSlot > &DestSlot, const RefPtr< VSlot > &SourceSlot, const string &Member={})
static bool detachSlot (const RefPtr< VSlot > &SourceSlot)
Static Public Member Functions inherited from Wizt::VSlotContainer
static const char * AttachErrorCodeMessage (AttachErrorCode)
static bool attachParameter (const RefPtr< VParameter > &theProvidedParam, const WeakPtr< VSlot > &theDestSlot, const string &theMember={})
Static Public Member Functions inherited from Wizt::ValueCacheable
static ValueCacheconsider (MemCore::Intercube &IC, const WeakPtr< VSlot > &VS, const RefPtr< ValuePool > &Context)
static ValueCachegetValueCache (MemCore::Intercube &IC)
static bool hasChangedSlots (const WeakPtrToVSlotContainer &theSlotOwner, const MemCore::Intercube &IC, const RefPtr< ValuePool > &Context)
Protected Member Functions inherited from Wizt::VSlotContainer
virtual void setup (const CreationSlots_t &CreationSlots)
Protected Member Functions inherited from MemCore::ReferenceBase< VManagedObjectBase >
virtual void extremeUnction ()
ReferenceBaseoperator= (const ReferenceBase &R)
void suicide ()

Detailed Description

Base class for render objects that require a collection of Fields given on a Grid.

This base class supports loading the respective fields into the arrays of Vertex Buffer Object and calls an use-defined rendering methods.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
NumberOfInputFields 

By default a collection of vertex fields requires input objects that provided at least one field.

This setting can be changed in a child class by defining another enum. It will only affect the associated FieldInputCreator<>, specifying for what kind of objects the derived class may be used as output.

Member Function Documentation

◆ append()

int Wizt::VertexFieldCollection::append ( const RefPtr< VBO > & myVBO,
const VertexFragment & VertexFragments,
const RefPtr< GLProgram > & Shader ) const

Append all the fields stored in these vertex fragments to the given vertex buffer object.

The VertexFragments may actually contain more fields, but only those required by this VBO are actually requested.

The VertexFragments structure contains a set of named data fragments.

References std::multimap< string, RefPtr< VertexField > >::begin(), std::multimap< string, RefPtr< VertexField > >::count(), std::multimap< string, RefPtr< VertexField > >::end(), and std::multimap< string, RefPtr< VertexField > >::size().

Referenced by operator[]().

◆ getGridSelector()

GridSelector Wizt::VertexFieldCollection::getGridSelector ( const RefPtr< ValuePool > & VP) const
overridevirtual

Get the Grid that will be used here.

This will be the Grid object that is explicitly connected, the virtual findMyGrid() or the Grid that is attached to the first VertexField found.

This function overrides Fish<Grid>::getGridSelector() to use a field from the collection or the one defined in the virtual myGridSelector() function.

Reimplemented from Wizt::Fish< Fiber::Grid >.

References std::multimap< string, RefPtr< VertexField > >::begin(), std::multimap< string, RefPtr< VertexField > >::end(), and myGridSelector().

Referenced by operator[](), and Wizt::VertexRenderObject::update().

◆ getRefinementLevel()

Info< Fiber::Skeleton > Wizt::VertexFieldCollection::getRefinementLevel ( int Level,
const RefPtr< ValuePool > & VP,
int IndexDepth = 0,
const Fiber::BundlePtr & SpaceTime = Fiber::BundlePtr(NullPtr() ) ) const
overridevirtual

Implementation of the virtual callback function that will load data sets from a grid into a collection of VertexFields, as specified earlier.

Reimplemented from Wizt::Fish< Fiber::Grid >.

References Wizt::Fish< Fiber::Grid >::Fish(), std::multimap< string, RefPtr< VertexField > >::begin(), std::multimap< string, RefPtr< VertexField > >::end(), Wizt::Fish< double >::getTime(), and Positions.

Referenced by operator[]().

◆ myGridSelector()

GridSelector Wizt::VertexFieldCollection::myGridSelector ( const RefPtr< ValuePool > & VP) const
virtual

Virtual function that allows child classes to specify the Grid that shall be used.

This function is called after the internal Grid object is queried (thus, will only be used if there is no Grid object explicitly connected), and before the stored vertex fields are inspected.

Reimplemented in Wizt::TensorShaderBase.

Referenced by getGridSelector(), and operator[]().

◆ retrieveFields()

void Wizt::VertexFieldCollection::retrieveFields ( Fiber::FieldCollection & FieldMap,
const RefPtr< Fiber::Representation > & MyRepresentation,
const RefPtr< ValuePool > & Context,
const RefPtr< Fiber::Skeleton > & DestVertices,
Fiber::Grid & DestGrid,
Fiber::Slice & DestGridSlice,
const string & HelperDestGridName,
bool StoreResult = true )

From the given Representation, retrieve all fields as required here into the provided Fieldmap.

Calls EvalFieldOnRepresentation() for each of the input slots.

Parameters
FieldMapoutput - a map from strings to RefPtr<Fields>.
MyRepresentationall fields are requested to reside on this Representation
ContextThe map of VertexField input slots is evaluated relative to this ValuePool
DestGridSliceForwarded to EvalFieldOnRepresentation(): Slice of the destination grid, the place where to store a helper Grid. It may be a temporary one that is not part of a Bundle if this helper Grid should not be permanently stored. This Slice is also used to find lookup information about the current Grid object, for instance interpolation values from curvilinear to uniform coordinates.
StoreResultForwarded to EvalFieldOnRepresentation(): Flag to tell if the fields shall be stored on the destination Grid (and thus be re-used on the next call), or just returned as a temporary.
HelperDestGridNameForwarded to EvalFieldOnRepresentation(): If the evaluation of the fields allows to cache some intermediate information in the form of a Grid (such as interpolation weights), then this Grid may be stored on the same Slice DestGridSlice under the provided name, which should be unique and be related to the name of the original Grid.

References std::multimap< string, RefPtr< VertexField > >::begin(), std::multimap< string, RefPtr< VertexField > >::end(), Fiber::EvalFieldOnRepresentation(), and Positions.

Referenced by operator[](), and Wizt::VertexRenderObject::update().