|
The Vish Visualization Shell 0.3
Vish
|
Intermediate class managing connections between objects. More...
#include <ocean/plankton/VConnectable.hpp>
Public Member Functions | |
| virtual void | adjustConnections (const RefPtr< VSlot > &ChangedSlot, const RefPtr< VParameter > &par) |
| Callback function that is called when a Connect() has been issued. | |
| VSlotContainer::AttachErrorCode | attach (const ParameterID &whichone, VSlotContainer &sourceObject, const ParameterID &sourceName) |
| Share a parameter with another one. | |
| AttachErrorCode | attach (const RefPtr< VParameter > &OldParam, const RefPtr< VParameter > &NewParam, const string &Member={}) |
| Replace a given parameter of the current object with another parameter. | |
| AttachErrorCode | attachUniqueObject (const RefPtr< VParameter > ¶m, const RefPtr< VCreationPreferences > &VCP=NullPtr(), bool ReallyUnique=true) |
| Try to find an existing object that matches its type with the specified parameter. | |
| AttachErrorCode | attachUniqueObject (const RefPtr< VSlot > &slot, const RefPtr< VCreationPreferences > &VCP=NullPtr(), bool ReallyUnique=true) |
| Try to find an existing object that matches its type with the specified parameter. | |
| RefPtr< VSlot > | Connect (const RefPtr< VParameter > &SourceParam) |
| Given a certain parameter, overload a parameter of the same type in the current object with this one. | |
| RefPtr< VSlot > | ConnectInterface (const RefPtr< VSlotContainer > &Provider, const RefPtr< InterfaceBase > &IB) |
| virtual bool | CreatedFilteredConnection (const RefPtr< VParameter > &SourceParam) |
| We wish to connect the current object to the given parameter, but it provides an output type that cannot be used by this current object as input type. | |
Public Member Functions inherited from Wizt::VSlotContainer< ExpertLevel > | |
| Ageable & | age (const RefPtr< ValuePool > &VP) |
| Return the age of this object, which may be modified. | |
| const Ageable & | age (const RefPtr< ValuePool > &VP) const |
| Return the age of this object in read-only form. | |
| const Ageable & | ConnectionAge () const |
| Return the age when connections had last been modified. | |
| bool | ConnectionsHaveChanged (const RefPtr< ValuePool > &VP) const |
| Check whether the connections have changed on this object. | |
| bool | HasYoungerInput (const RefPtr< ValuePool > &Context, int RecursionLevel=0) const |
| Ageable | YoungestInput (const RefPtr< ValuePool > &Context) const |
| Return the age of the youngest input. | |
| Ageable | YoungestOutput (const RefPtr< ValuePool > &Context) const |
| Determine the age of the youngest output object. | |
| Ageable | YoungestUncachedInput (const RefPtr< ValuePool > &Context) const |
| Return the age of the youngest input slot that is not cached. | |
| virtual | ~VSlotContainer () |
| Destructor. | |
| RefPtr< VSlot > | addParameter (const ParameterID &name, int EL, const RefPtr< VParameter > ¶m, bool overwriteExistingSlot) |
| Specify a parameter (type) as input for this VObject. | |
| virtual bool | allowParameterReplacement (const RefPtr< VParameter > &NewParam, const RefPtr< VParameter > &OldParam, const string &localName, int ExpertLevel) |
| Virtual callback function invoked by replaceParameter() when the implementation of a parameter is changed by another one. | |
| virtual int | connectSlots (const VSlotContainerPtr &vobj) |
| Tries to connect all slots found in the given VObject with those of the current one. | |
| bool | removeParameter (const ParameterID &s) |
| Remove a parameter from the list of input objects. | |
| RefPtr< VParameter > | getParameter (const ParameterID &s) const |
| Return the local input parameter slot for a certain parameter name. | |
| RefPtr< VSlot > | getSlot (const ParameterID &s, int &EL) const |
| A more verbose version of getParameter() which also provides information about which member of a certain parameter is used here; note that the type of the full parameter will be different from the type of a member of the parameter. | |
| bool | setSlotValueFromText (const ParameterID &s, const string &ValueText, const RefPtr< ValuePool > &VP, const string &theMember={}) |
| Convenience function to set an input value from its textual representation. | |
| RefPtr< VSlot > | findSlot (const RefPtr< VParameter > ¶m) const |
| Given a parameter, find a slot that refers to this one. | |
| string | getSlotName (const RefPtr< VParameter > ¶m) const |
| Check whether this object contains the given parameter, and if so, under which slot's name. | |
| bool | AddAction (const ParameterID &s, const RefPtr< ValueActionBase > &VAB) |
| Associate the change of a certain parameter of this object with a certain action. | |
| template<class DerivedObject > | |
| bool | AddAction (const RefPtr< VSlot > &ActionSlot, bool(DerivedObject::*Action)(const RefPtr< VValueBase > &value)) |
| Connect the change of a parameter with the invocation of an object's member function. | |
| RefPtr< VParameter > | mkUniqueParameterInput (const ParameterID &s, const string &ContainerName) |
| Calls VParameter::copy();. | |
| int | getExpertLevel (const ParameterID &s) const |
| Get the expert level of a parameter. | |
| int | setExpertLevel (const ParameterID &s, int EL) |
| Set the expert level of a parameter. | |
| int | getExpertLevel (const RefPtr< VParameter > &) const |
| Get the expert level of a parameter via pointer. | |
| int | getExpertLevel (const RefPtr< VSlot > &S) const |
| Get the expert level of a parameter via pointer. | |
| int | setExpertLevel (const RefPtr< VSlot > &S, int EL) |
| Set the expert level of a parameter via pointer. | |
| int | setExpertLevel (const RefPtr< VParameter > &s, int EL) |
| Set the expert level of a parameter via pointer. | |
| bool | hasChanged (const ParameterID &s, const RefPtr< ValuePool > &Context) const |
| Check whether a certain input parameter has changed. | |
| bool | hasChanged (const RefPtr< VSlot > &, const RefPtr< ValuePool > &Context) const |
| Check whether a certain input slot has changed. | |
| bool | hasChanged (const RefPtr< ValuePool > &Context, int n,...) const |
| Check a set of input parameters whether one has changed. | |
| bool | hasChanged (RefPtr< ValuePool > Context,...) const |
| Check a set of input parameters whether one has changed. | |
| virtual bool | ignoreInput (const RefPtr< VSlot > &theSlot) const |
| Allow ignoring certain slots on update(). | |
| template<class Type > | |
| bool | getParameterValue (Type &Variable, const ParameterID &s, const RefPtr< ValuePool > &VP) const |
| Get a value for a certain parameter. | |
| template<class Type > | |
| bool | getParameterValue (Type &Variable, const ParameterID &s, const VContext &C) const |
| Get a value for a certain parameter. | |
| template<class Type > | |
| bool | getParameterValue (Type &Variable, const ParameterID &s, const VRequest &R) const |
| Get a value for a certain parameter. | |
| template<class Type > | |
| bool | setParameterValue (const Type &Variable, const ParameterID &s, const RefPtr< ValuePool > &VP, bool autoCreateLocalValue) const |
| Set a value for a parameter, given a ValuePool. | |
| template<class Type > | |
| bool | setParameterValue (const Type &Variable, const ParameterID &s, VContext &C, bool autoCreateLocalValue) const |
| Set a value for a parameter, given a context. | |
| template<class Type > | |
| bool | setParameterValue (const Type &Variable, const ParameterID &s, VRequest &R, bool autoCreateLocalValue=false) const |
| Set a value for a parameter, given a context. | |
| template<class Type > | |
| RefPtr< VSlot > | addParam (const ParameterID &name, const Type &init, const RefPtr< VCreationPreferences > &VP=NullPtr(), int expertLevel=0, bool overwriteExistingSlot=true) |
| Add an input parameter to the VObject. | |
| bool | setParameterProperty (const ParameterID ¶m, const string &Properties, const RefPtr< VValueBase > &Value=NullPtr()) |
| Set a property of an input parameter, such as the minimum or maximum of a bounded numerical value. | |
| RefPtr< VSlot > | addFloatParam (double init, const ParameterID ¶m, double min, double max, const RefPtr< VCreationPreferences > &IP=NullPtr(), int expertLevel=0) |
| Shortcut function to add a floating point parameter. | |
| AttachErrorCode | attach (const RefPtr< VParameter > &OldParam, const RefPtr< VParameter > &NewParam, const string &Member={}) |
| Replace a given parameter of the current object with another parameter. | |
| int | iterateParameters (int expertLevel, VSlotIterator &VIIt) const |
| Iterate over all VInput objects that have an expert level lower or equal to the expertLevel parameter. | |
| int | iterateInputSlots (int expertLevel, VSlotIterator &VIIt) const |
| Same as iterateParameters(). | |
| int | iterateInputs (VSlotIterator &VIIt, int expertLevel=0) |
| Iterate all inputs with expert level smaller than zero (default), or as specified. | |
| int | iterate_inputs (const std::function< bool(VSlot &what, int ExpertLevel)>) const |
| Iterate over all VInput objects that have an expert level lower or equal to the expertLevel parameter. | |
| RefPtr< VSlot > | getUniqueInputSlot (const type_info &what) |
| Find an input slot that queries a specific type. | |
| int | getNumberOfParameters (int expertLevel) const |
| Get the number of parameters up to a certain expert level. | |
| virtual bool | implements (const type_info &what) const |
| Check whether this VObject implements a certain type. | |
| virtual RefPtr< VParameter > | getImplementation (const type_info &what, const string &name={}, const string &member={}) const |
| By querying a type and an optional finer textual description, retrieve an Parameter that is implemented by this VObject. | |
| RefPtr< VSlot > | getImplementationSlot (const type_info &what, const string &Name={}, const string &Member={}) const |
| Query an output slot for the given type. | |
| VAcceptInfoList_t | getAcceptInfoList (const std::type_info &request_type) const |
| Get a list of possible output implementations for the given request type. | |
| bool | provides (const RefPtr< VSlot > &OutputSlot) const |
| Verifies that the specified slot is provided by the current VObject. | |
| RefPtr< VSlot > | findOutputSlot (const RefPtr< VParameter > &Who) const |
| Find an output slot that refers to the given parameter, i.e. | |
| bool | isYounger (const RefPtr< VParameter > &OutputParam, const RefPtr< ValuePool > &VP) const |
| Check if an output parameter is of younger age, which might be the case if it has been recently connected or modified through external means. | |
| bool | isNewlyConnected (const RefPtr< VParameter > &Who, const RefPtr< ValuePool > &VP) const |
| Check if an output parameter has been recently connected or modified through external means. | |
| bool | hasNewlyConnectedOutputs (const RefPtr< ValuePool > &VP) const |
| Check if there are new connections. | |
| void | findNewlyConnectedOutputs (const RefPtr< ValuePool > &VP, VSlotSet &WhichOnes) const |
| Find all output parameters that have been recently connected since the last update() call. | |
| RefPtr< VSlot > | getOutput (const string &Name) const |
| Get the output slot for a given name. | |
| RefPtr< MemCore::StringList > | getOutputs (const type_info &what=typeid(void)) const |
| Get a list of all output names that are provided by this object. | |
| virtual int | iterateOutputs (VOutputIterator &VOut, const type_info &just_these=typeid(void)) const |
| Iterate over all the Outputs of this VObject, i.e. | |
| bool | registerOutput (const RefPtr< VParameter > &P, const string &AsName={}) |
| Register a certain parameter as being output by this VObject under the given name (optionally). | |
| bool | registerOutput (const RefPtr< VParameter > &P, const string &AsName, const type_info &MemberType, const string &UseMember) |
| Register a member of a parameter, that is output by this VObject, as being available to external VObjects. | |
| bool | registerOutput (const RefPtr< VParameter > &P, const type_info &MemberType, const string &UseMember) |
| Register a component of a parameter, using the default name of the parameter. | |
| int | getNumberOfInputs () const |
| Get the number of input parameters, ie. on how many parameters does this object depend on? | |
| int | getNumberOfOutputs () const |
| Get the number of output parameters, ie. how many parameters does this object provide? | |
| bool | hasChangedSlots (const MemCore::Intercube &IC, const RefPtr< ValuePool > &Context) const |
| Check if the given Intercube hosts any VSlots that have been changed relative to the given Context. | |
| template<typename... SlotList> | |
| auto | include_self (const std::tuple< SlotList... > &t) const -> decltype(std::tuple_cat(std::make_tuple(this), t)) |
| Given a tuple of values, create a new tuple that includes the object itself. | |
Public Member Functions inherited from Wizt::VManagedObjectBase | |
| VManagedObjectBase () | |
| Constructor. | |
| ~VManagedObjectBase () | |
| Destructor. | |
Public Member Functions inherited from MemCore::ReferenceBase< VManagedObjectBase > | |
| auto | getObjectCountID () const noexcept |
| Get a unique ID for this object in the given domain. | |
| bool | isIdentical (const WeakPtr< VManagedObjectBase, VManagedObjectBase > &PossibleSelf) const noexcept |
| Check if this object is identical to the one used by the given pointer. | |
| void | mkAutoDestructive () |
| Marks this object as being automatically destructed, e.g. | |
| refcount_t | refcount () const noexcept |
| The strong reference count. | |
| ReferenceBase (VManagedObjectBase *that) noexcept | |
| Constructor, initializes reference counter to zero. | |
| const auto & | self () const |
| Return weak pointer to the object self. | |
| refcount_t | wrefcount () const noexcept |
| The weak reference count. | |
Static Public Member Functions | |
| static bool | attachSlot (const WeakPtr< VSlot > &DestSlot, const RefPtr< VParameter > &ProvidedParam, const string &Member={}) |
| Attach a given parameter to a slot of the current object. | |
| static bool | attachSlot (const WeakPtr< VSlot > &DestSlot, const RefPtr< VSlot > &SourceSlot, const string &Member={}) |
| Attach the source slot's parameter to the destination slot's parameter, overwriting the destination slot's par. | |
| static bool | detachSlot (const RefPtr< VSlot > &SourceSlot) |
| Detach the source slot's parameter by assigning a copy of the parameter to itself. | |
Static Public Member Functions inherited from Wizt::VSlotContainer< ExpertLevel > | |
| static const char * | AttachErrorCodeMessage (AttachErrorCode) |
| Given an error code from one of the attach() functions, return some textual description. | |
| static bool | attachParameter (const RefPtr< VParameter > &theProvidedParam, const WeakPtr< VSlot > &theDestSlot, const string &theMember={}) |
| This function basically does: | |
Static Public Member Functions inherited from Wizt::ValueCacheable | |
| static ValueCache & | consider (MemCore::Intercube &IC, const WeakPtr< VSlot > &VS, const RefPtr< ValuePool > &Context) |
| static ValueCache & | getValueCache (MemCore::Intercube &IC) |
| Get, and possibly create, a ValueCache that will be stored at the given Intercube. | |
| static bool | hasChangedSlots (const WeakPtrToVSlotContainer &theSlotOwner, const MemCore::Intercube &IC, const RefPtr< ValuePool > &Context) |
| Check if the given Intercube hosts any VSlots that have been changed relative to the given Context. | |
Additional Inherited Members | |
Public Types inherited from Wizt::VSlotContainer< ExpertLevel > | |
| enum | { AllLevels = INT_MAX } |
| typedef void | AcceptableInputTypes |
| Each VObject may define a set of possible input types, which are types that are provided by some other objects to be used as inputs of this object. | |
| typedef VSlotSet | CreationSlots_t |
| A set of slots. | |
| template<int I> | |
| using | Empty = VSlot::Empty< I > |
| Shortcut typedef to be used in construction of empty slots. | |
| enum | AttachErrorCode { } |
Public Types inherited from MemCore::ReferenceBase< VManagedObjectBase > | |
| using | reference_domain_t = VManagedObjectBase |
| The type of the base class. | |
| using | SelfPtr_t = WeakPtr< VManagedObjectBase, VManagedObjectBase > |
| Type for a pointer to this object itself. | |
Static Public Attributes inherited from Wizt::VSlotContainer< ExpertLevel > | |
Protected Member Functions inherited from Wizt::VSlotContainer< ExpertLevel > | |
| virtual void | setup (const CreationSlots_t &CreationSlots) |
| When a VObject is created as a child of an existing VObject, this variant of the setup function is called, telling which slot is the one connected to the object that triggered creation of this one. | |
Protected Member Functions inherited from MemCore::ReferenceBase< VManagedObjectBase > | |
| virtual void | extremeUnction () |
| A virtual function that will be called just before the object is destroyed. | |
| ReferenceBase & | operator= (const ReferenceBase &R) |
| Protected assignment operator (should not be called). | |
| void | suicide () |
| Delete this. | |
| virtual | ~ReferenceBase () |
| Virtual destructor. | |
Related Symbols inherited from Wizt::VSlotContainer< ExpertLevel > | |
| bool | CheckIfThereExistNewerOutputs (const VRequest &request, bool AdjustObjectAge) const |
| Check if there are outputs in this very object that are newer (more recent) than this object itself. | |
Intermediate class managing connections between objects.
| VSlotContainer::AttachErrorCode Wizt::VConnectable::attach | ( | const ParameterID & | whichone, |
| VSlotContainer & | sourceObject, | ||
| const ParameterID & | sourceName | ||
| ) |
Share a parameter with another one.
The current parameter input implementation is destroyed.
References Wizt::VSlotContainer< ExpertLevel >::allowParameterReplacement(), Wizt::VSlotContainer< ExpertLevel >::attachParameter(), Wizt::VSlotContainer< ExpertLevel >::DestParameterNotFound, Wizt::VSlotContainer< ExpertLevel >::getImplementationSlot(), Wizt::VSlotContainer< ExpertLevel >::getSlot(), and Wizt::VSlotContainer< ExpertLevel >::InvalidDestParameter.
Referenced by Wizt::VObject::attachInputObject(), Wizt::VObject::attachNewObject(), attachUniqueObject(), Wizt::Brush::connectBrushAsInput(), and Wizt::VObject::createInput().
| VSlotContainer::AttachErrorCode Wizt::VSlotContainer< ExpertLevel >::attach | ( | const RefPtr< VParameter > & | OldParam, |
| const RefPtr< VParameter > & | NewParam, | ||
| const string & | Member = {} |
||
| ) |
Replace a given parameter of the current object with another parameter.
| OldParam | The old parameter, which is currently an input to this object. |
| NewParam | The new parameter, which may be newly created, part of another object's input or output, or even already belong to this object itself. |
| Member | An optional member of this parameter in case its type is a compound type |
|
inlinestatic |
Attach a given parameter to a slot of the current object.
| DestSlot | A slot of the current object. |
| ProvidedParam | The new parameter to be used, an output of some other object. |
Referenced by Wizt::VSlot::attachSlot(), detachSlot(), Wizt::TimeDependent::TimeSetup(), and Wizt::Viewer::Viewer().
| VConnectable::AttachErrorCode Wizt::VConnectable::attachUniqueObject | ( | const RefPtr< VParameter > & | param, |
| const RefPtr< VCreationPreferences > & | VCP = NullPtr(), |
||
| bool | ReallyUnique = true |
||
| ) |
Try to find an existing object that matches its type with the specified parameter.
| ReallyUnique | Set this value to try if the existence of multiple objects implementing the same type are to be regarded as error. |
References attach(), and Wizt::VObject::findUniqueOutputObject().
Referenced by attachUniqueObject(), Wizt::MovieRecorder::MovieRecorder(), and Wizt::Viewer::Viewer().
| VConnectable::AttachErrorCode Wizt::VConnectable::attachUniqueObject | ( | const RefPtr< VSlot > & | slot, |
| const RefPtr< VCreationPreferences > & | VCP = NullPtr(), |
||
| bool | ReallyUnique = true |
||
| ) |
Try to find an existing object that matches its type with the specified parameter.
| ReallyUnique | Set this value to try if the existence of multiple objects implementing the same type are to be regarded as error. |
References attachUniqueObject().
| RefPtr< VSlot > Wizt::VConnectable::Connect | ( | const RefPtr< VParameter > & | SourceParam | ) |
Given a certain parameter, overload a parameter of the same type in the current object with this one.
Note that the first parameter found that has a compatible type will be overloaded, so the result might be slightly random if there are multiple types provided. For better control, use the attach() functions, this one here is mostly convenience.
References adjustConnections(), and Wizt::VSlotContainer< ExpertLevel >::attachParameter().
| RefPtr< VSlot > Wizt::VConnectable::ConnectInterface | ( | const RefPtr< VSlotContainer > & | Provider, |
| const RefPtr< InterfaceBase > & | IB | ||
| ) |
touching a parameter independent from its value pool this is probably dangerous and does not work as it should
NEW: This following line might just do instead. However, connections to object interfaces are not frequently used in Vish anyway.
References Wizt::VSlotContainer< ExpertLevel >::AllLevels, and Wizt::VSlotContainer< ExpertLevel >::iterateParameters().
|
virtual |
We wish to connect the current object to the given parameter, but it provides an output type that cannot be used by this current object as input type.
Then this virtual function may take care of such issues and create a filter object.
Detach the source slot's parameter by assigning a copy of the parameter to itself.
(mr)
WB: This should be mkUniqueParameterInput!!???
References attachSlot().