~ubuntu-branches/ubuntu/raring/openwalnut/raring

« back to all changes in this revision

Viewing changes to src/core/common/WPropertyBase.h

  • Committer: Package Import Robot
  • Author(s): Sebastian Eichelbaum
  • Date: 2012-12-12 11:26:32 UTC
  • mfrom: (3.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20121212112632-xhiuwkxuz5h0idkh
Tags: 1.3.1+hg5849-1
* Minor changes compared to 1.3.0 but included several bug fixes.
* See http://www.openwalnut.org/versions/4

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
#include "WProperties_Fwd.h"
37
37
#include "WCondition.h"
38
38
#include "WConditionSet.h"
39
 
#include "WExportCommon.h"
 
39
 
40
40
 
41
41
/**
42
42
 * Abstract base class for all properties. Simply provides name and type information.
43
43
 */
44
 
class OWCOMMON_EXPORT WPropertyBase: public boost::enable_shared_from_this< WPropertyBase >
 
44
class WPropertyBase: public boost::enable_shared_from_this< WPropertyBase >
45
45
{
46
46
public:
47
47
    /**
182
182
     * dynamic type of the property.
183
183
     *
184
184
     * \param value the new value.
 
185
     * \param recommendedOnly if true, property types which support recommended values apply the given value as recommendation.
185
186
     *
186
187
     * \return true if the value has been accepted.
187
188
     */
188
 
    virtual bool set( boost::shared_ptr< WPropertyBase > value ) = 0;
 
189
    virtual bool set( boost::shared_ptr< WPropertyBase > value, bool recommendedOnly = false ) = 0;
189
190
 
190
191
    /////////////////////////////////////////////////////////////////////////////////////////////
191
192
    // Helpers for easy conversion to the possible types
264
265
    /**
265
266
     * Helper converts this instance to its native type.
266
267
     *
 
268
     * \return the property as matrix4x4 property
 
269
     */
 
270
    WPropTransferFunction toPropTransferFunction();
 
271
 
 
272
    /**
 
273
     * Helper converts this instance to its native type.
 
274
     *
267
275
     * \return the property as group
268
276
     */
269
277
    WPropGroup toPropGroup();
270
278
 
271
279
    /**
 
280
     * Convert the property to a WPropertyGroupBase. This can be done with property structs and groups-
 
281
     *
 
282
     * \return the property as base group.
 
283
     */
 
284
    boost::shared_ptr< WPropertyGroupBase > toPropGroupBase();
 
285
 
 
286
    /**
272
287
     * Helper converts this instance to an arbitrary type.
273
288
     *
274
289
     * \return the property of given type of NULL if not valid type
282
297
    typedef boost::function<void ( boost::shared_ptr< WPropertyBase > )> PropertyChangeNotifierType;
283
298
 
284
299
protected:
285
 
 
286
300
    /**
287
301
     * Name of the property.
288
302
     */