The Vish Visualization Shell  0.3
Vish
Classes | Public Member Functions | List of all members
Wizt::VCreationPreferences Class Reference

A certain object (especcially input types) might have multiple implementations by the GUI or alternative input mechanism. More...

#include <ocean/plankton/VCreationPreferences.hpp>

Inheritance diagram for Wizt::VCreationPreferences:
MemCore::Interface< VCreationPreferences > MemCore::InterfaceBase MemCore::ReferenceBase< InterfaceBase >

Classes

struct  ConstIterator
 
struct  Iterator
 Iterator class. More...
 

Public Member Functions

bool contains (const string &p) const
 Check if a certain property is contained in this preference list.
 
VCreationPreferencesoperator+= (const string &p)
 Add a property.
 
size_t size () const
 How many entries do we have here?
 
 VCreationPreferences ()
 Empty creation preferences.
 
 VCreationPreferences (const string &p1)
 Create creation preferences with one entry of weight 1.0.
 
 VCreationPreferences (const string &p1, const string &p2)
 Create creation preferences with two entries of weight 1.0.
 
 VCreationPreferences (const string &p1, const string &p2, const string &p3)
 Create creation preferences with three entries of weight 1.0.
 
 VCreationPreferences (const VCreationPreferencesPtr &VP)
 Copy from pointer constructor, copy all elements by value.
 
double weight (const string &p) const
 What is the stored weight for this entry?
 
double weight (const VCreationPreferences &) const
 Compute the correlation of the current creation preference with another one. More...
 
- Public Member Functions inherited from MemCore::InterfaceBase
virtual bool apply (Intercube &I, const RefPtr< InterfaceIterationParameter > &)
 modifyable callback function
 
virtual bool apply_const (const Intercube &I, const RefPtr< InterfaceIterationParameter > &)
 constant callback function
 
 InterfaceBase () throw ()
 Constructor.
 
 ~InterfaceBase ()
 Destructor.
 
- Public Member Functions inherited from MemCore::ReferenceBase< InterfaceBase >
long getObjectCountID () const noexcept
 Get a unique ID for this object in the given domain. More...
 
bool isIdentical (const WeakPtrImpl< InterfaceBase, InterfaceBase > &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. More...
 
int refcount () const noexcept
 The strong reference count.
 
 ReferenceBase (InterfaceBase *that) noexcept
 Constructor, initializes reference counter to zero.
 
const WeakPtrImpl
< InterfaceBase, InterfaceBase > & 
self () const
 Return weak pointer to the object self. More...
 
void speak (const char *s, const char *prefix="") const noexcept
 Print a debug message with the class name preceded.
 
int wrefcount () const noexcept
 The weak reference count.
 

Additional Inherited Members

- Public Types inherited from MemCore::ReferenceBase< InterfaceBase >
using reference_domain_t = InterfaceBase
 The type of the base class.
 
using SelfPtr_t = WeakPtrImpl< InterfaceBase, InterfaceBase >
 Type for a pointer to this object itself.
 
- Protected Member Functions inherited from MemCore::ReferenceBase< InterfaceBase >
virtual void extremeUnction ()
 A virtual function that will be called just before the object is destroyed. More...
 
ReferenceBaseoperator= (const ReferenceBase &R)
 Protected assignment operator (should not be called). More...
 
virtual ~ReferenceBase ()
 Virtual destructor.
 

Detailed Description

A certain object (especcially input types) might have multiple implementations by the GUI or alternative input mechanism.

An object may request one specific implementation in preference to others. As not all interface imlementations might provide the same variety of input objects, the preference for such a specific implementation is specified through an abstraction layer casted into this VCreationPreferences class.

A list of desired properties which are requested from an input parameter. Each property is specified via a textual description and is assigned an weight which indicates the importance of this property.

Examples:
DynamicBackground.cpp, and MouseBackground.cpp.

Member Function Documentation

double Wizt::VCreationPreferences::weight ( const VCreationPreferences P) const

Compute the correlation of the current creation preference with another one.

The returned value is the sum of the product of all desired weights with all found weights. Properties which are not available in both preference list are ignored and thus do not contribute.

References weight().