Fish - FiberLib for VISH 0.3
Fish - The Fiber Bundle API for the Vish Visualization Shell
Wizt::GridActor< GridInspector, CreativeObject > Struct Template Reference

Creator for objects operating on certain kinds of Grid objects, providing an interface for the function Fiber::hasProperty() . More...

#include <GridActor.hpp>

Inheritance diagram for Wizt::GridActor< GridInspector, CreativeObject >:
Wizt::VCreator< void, AcceptList< Fiber::Grid > >

Public Types

typedef VCreator< CreativeObject, AcceptList< Fiber::Grid > > Base_t

Public Member Functions

 GridActor (const std::string &name, int quality, const RefPtr< VCreationPreferences > &VP=nullptr, const char *const CreatorReleaseIdentifier=VISH_INPUT_CREATOR_RELEASE_IDENTIFIER)
 Construct grid actor from name and quality description.
template<unsigned ID>
 GridActor (const VCreatorProperty< ID > &CreatorProperties, int quality, const RefPtr< VCreationPreferences > &VP=nullptr, const char *const CreatorReleaseIdentifier=VISH_INPUT_CREATOR_RELEASE_IDENTIFIER)
 Construct grid actor from creation properties.
VAcceptInfoList_t accept (const RefPtr< VObject > &vobj) const override
 Acceptance function: check whether a grid exists with a Skeleton of type (1,1) (dimensionality one, index depth one -> edges).
Public Member Functions inherited from Wizt::VCreator< void, AcceptList< Fiber::Grid > >
VAcceptInfoList_t accept (const RefPtr< VObject > &vobj) const override
RefPtr< VObject > create (const VCreatorBase::CreationInfo &name, const Intercube &CreationContext, const RefPtr< VCreationPreferences > &AdditionalPreferences) const override
string createChildname (const string &parent_name) const override
 VCreator (const VCreatorProperties &CreatorProperties, int quality, const RefPtr< VCreationPreferences > &prop=nullptr, const char *const CreatorReleaseIdentifier=VISH_CREATOR_RELEASE_IDENTIFIER)
VCreatorProperty< ID1+ID2 > operator+ (const VCreatorProperty< ID1 > &l, const VCreatorProperty< ID2 > &r)
VCreatorProperty< ID1+ID2 > operator/ (const VCreatorProperty< ID1 > &l, const VCreatorProperty< ID2 > &r)

Detailed Description

template<class GridInspector, class CreativeObject = void>
struct Wizt::GridActor< GridInspector, CreativeObject >

Creator for objects operating on certain kinds of Grid objects, providing an interface for the function Fiber::hasProperty() .

This template class provides a VCreator which requires input objects to provide Fiber::Grid objects that fulfull certain conditions, such as being a triangular surface or a set of lines.

Such conditions are formulated as a Fiber::BundleProperty, this template is a convenience helper class for VCreator objects that maps BundleProperty objects to VCreator acceptance functions.

For instance, one possible property to look for in a Grid object is the existence of a specific Skeleton. This property is modeled via a SkeletonExistence object. Code for objects operating on LineSets would look like this:

struct LineSetOperationObject;
struct MyGridInspector
{
static SkeletonExistence InspectionProperty()
{
return SkeletonExistence( LineSet::ID() );
}
};
static Ref<GridActor<MyGridInspector, LineSetOperationObject> >
VLineSetOperationObjectCreator("Demo/LineSetOperationObject", ObjectQuality::DEMO);
A concrete Grid Property which looks for the existence of a Skeleton of the specified dimension and i...
Definition BundleProperty.hpp:76

Note that the function MyGridInspector::InspectionProperty() may return any object that is derived from class Fiber::BundleProperty and is accepted by Fiber::hasProperty(). For instance, a generic property may be defined as

struct MyGridInspector
{
struct MyProperty : Fiber::BundleProperty
{
bool checkSlice(Slice&S, const string&GridName) const override
{
...
}
};
static MyProperty&InspectionProperty()
{
static MyProperty myProperty;
return myProperty;
}
};
Convenient abstract base class for inspecting and evaluating properties of Bundles.
Definition BundleProperty.hpp:21
Information per time slice, mainly a set of Grid objects that are accessed via GridID objects.
Definition Slice.hpp:36

To generically check for a specific Grid derive from the GridProperty class:

struct MyGridInspector
{
struct MyProperty : Fiber::GridProperty
{
bool checkGrid(const Grid&G) const override
{
return true;
}
};
static const MyProperty&InspectionProperty()
{
static MyProperty myProperty;
return myProperty;
}
};
An abstract bundle property which returns true if a Grid with the property query as implemented in th...
Definition BundleProperty.hpp:59
A Grid is a set of Skeleton objects, each of them accessed via some unique SkeletonID object.
Definition Grid.hpp:60
Note
User code may #define VERBOSE_GRIDACTOR prior to any header file inclusion to enable printing of some informative messages when the GridActor evaluates objects and tries to find out if there is a match.

, Fiber::BundleProperty, Fiber::GridSelector