Loading...
Searching...
No Matches
SBCClassInterface.hpp File Reference

Classes

class  SBCClassInterface
 This class describes a class interface in a class proxy. More...
 

Typedefs

typedef SBCClassInterface SBInterface
 The short name of SBCClassInterface.
 

Descriptions of class interfaces

#define SB_INTERFACE_BEGIN
 Declares the beginning of the class interface.
 
#define SB_INTERFACE_END
 Declares the end of the class interface.
 
#define SB_INHERIT(INTERFACE, CLASS, CLASS_INTERFACE)
 

Descriptions of functions

#define SB_FUNCTION_0(OUTPUT, CLASS, FUNCTION)
 Declares a class function OUTPUT CLASS::FUNCTION()
 
#define SB_FUNCTION_1(OUTPUT, CLASS, FUNCTION, T0)
 Declares a class function OUTPUT CLASS::FUNCTION(T0)
 
#define SB_FUNCTION_2(OUTPUT, CLASS, FUNCTION, T0, T1)
 Declares a class function OUTPUT CLASS::FUNCTION(T0,T1)
 
#define SB_FUNCTION_3(OUTPUT, CLASS, FUNCTION, T0, T1, T2)
 Declares a class function OUTPUT CLASS::FUNCTION(T0,T1,T2)
 
#define SB_FUNCTION_4(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3)
 Declares a class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3)
 
#define SB_FUNCTION_5(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4)
 Declares a class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4)
 
#define SB_FUNCTION_6(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5)
 Declares a class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5)
 
#define SB_FUNCTION_7(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6)
 Declares a class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6)
 
#define SB_FUNCTION_8(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7)
 Declares a class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7)
 
#define SB_FUNCTION_9(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8)
 Declares a class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8)
 
#define SB_FUNCTION_10(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)
 Declares a class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9)
 
#define SB_FUNCTION_11(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
 Declares a class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10)
 
#define SB_FUNCTION_12(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)
 Declares a class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11)
 
#define SB_FUNCTION_13(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)
 Declares a class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12)
 
#define SB_FUNCTION_14(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)
 Declares a class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13)
 
#define SB_FUNCTION_15(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)
 Declares a class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14)
 
#define SB_FUNCTION_16(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)
 Declares a class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15)
 

Descriptions of const functions

#define SB_CONST_FUNCTION_0(OUTPUT, CLASS, FUNCTION)
 Declares a const class function OUTPUT CLASS::FUNCTION()
 
#define SB_CONST_FUNCTION_1(OUTPUT, CLASS, FUNCTION, T0)
 Declares a const class function OUTPUT CLASS::FUNCTION(T0)
 
#define SB_CONST_FUNCTION_2(OUTPUT, CLASS, FUNCTION, T0, T1)
 Declares a const class function OUTPUT CLASS::FUNCTION(T0,T1)
 
#define SB_CONST_FUNCTION_3(OUTPUT, CLASS, FUNCTION, T0, T1, T2)
 Declares a const class function OUTPUT CLASS::FUNCTION(T0,T1,T2)
 
#define SB_CONST_FUNCTION_4(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3)
 Declares a const class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3)
 
#define SB_CONST_FUNCTION_5(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4)
 Declares a const class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4)
 
#define SB_CONST_FUNCTION_6(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5)
 Declares a const class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5)
 
#define SB_CONST_FUNCTION_7(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6)
 Declares a const class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6)
 
#define SB_CONST_FUNCTION_8(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7)
 Declares a const class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7)
 
#define SB_CONST_FUNCTION_9(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8)
 Declares a const class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8)
 
#define SB_CONST_FUNCTION_10(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)
 Declares a const class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9)
 
#define SB_CONST_FUNCTION_11(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
 Declares a const class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10)
 
#define SB_CONST_FUNCTION_12(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)
 Declares a const class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11)
 
#define SB_CONST_FUNCTION_13(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)
 Declares a const class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12)
 
#define SB_CONST_FUNCTION_14(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)
 Declares a const class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13)
 
#define SB_CONST_FUNCTION_15(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)
 Declares a const class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14)
 
#define SB_CONST_FUNCTION_16(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)
 Declares a const class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15)
 

Descriptions of static functions

#define SB_STATIC_FUNCTION_0(OUTPUT, CLASS, FUNCTION)
 Declares a static class function OUTPUT CLASS::FUNCTION()
 
#define SB_STATIC_FUNCTION_1(OUTPUT, CLASS, FUNCTION, T0)
 Declares a static class function OUTPUT CLASS::FUNCTION(T0)
 
#define SB_STATIC_FUNCTION_2(OUTPUT, CLASS, FUNCTION, T0, T1)
 Declares a static class function OUTPUT CLASS::FUNCTION(T0,T1)
 
#define SB_STATIC_FUNCTION_3(OUTPUT, CLASS, FUNCTION, T0, T1, T2)
 Declares a static class function OUTPUT CLASS::FUNCTION(T0,T1,T2)
 
#define SB_STATIC_FUNCTION_4(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3)
 Declares a static class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3)
 
#define SB_STATIC_FUNCTION_5(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4)
 Declares a static class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4)
 
#define SB_STATIC_FUNCTION_6(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5)
 Declares a static class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5)
 
#define SB_STATIC_FUNCTION_7(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6)
 Declares a static class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6)
 
#define SB_STATIC_FUNCTION_8(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7)
 Declares a static class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7)
 
#define SB_STATIC_FUNCTION_9(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8)
 Declares a static class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8)
 
#define SB_STATIC_FUNCTION_10(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)
 Declares a static class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9)
 
#define SB_STATIC_FUNCTION_11(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
 Declares a static class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10)
 
#define SB_STATIC_FUNCTION_12(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)
 Declares a static class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11)
 
#define SB_STATIC_FUNCTION_13(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)
 Declares a static class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12)
 
#define SB_STATIC_FUNCTION_14(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)
 Declares a static class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13)
 
#define SB_STATIC_FUNCTION_15(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)
 Declares a static class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14)
 
#define SB_STATIC_FUNCTION_16(OUTPUT, CLASS, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)
 Declares a static class function OUTPUT CLASS::FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15)
 

General descriptions of attributes

#define SB_ATTRIBUTE_BEGIN(ATTRIBUTE_TYPE, TYPE, CLASS, NAME, DESCRIPTION, GROUP)
 
#define SB_ATTRIBUTE_END
 
#define SB_ATTRIBUTE_GET(TYPE, CLASS, FUNCTION_NAME)
 
#define SB_ATTRIBUTE_NON_CONST_GET(TYPE, CLASS, FUNCTION_NAME)
 
#define SB_ATTRIBUTE_SET(TYPE, CLASS, FUNCTION_NAME)
 
#define SB_ATTRIBUTE_HAS(CLASS, FUNCTION_NAME)
 
#define SB_ATTRIBUTE_CLEAR(CLASS, FUNCTION_NAME)
 
#define SB_ATTRIBUTE_SIZE(CLASS, FUNCTION_NAME)
 
#define SB_ATTRIBUTE_DEFAULT(TYPE, CLASS, FUNCTION_NAME)
 
#define SB_ATTRIBUTE_MINIMUM(TYPE, CLASS, FUNCTION_NAME)
 
#define SB_ATTRIBUTE_MAXIMUM(TYPE, CLASS, FUNCTION_NAME)
 
#define SB_ATTRIBUTE_SINGLE_STEP(TYPE, CLASS, FUNCTION_NAME)
 
#define SB_ATTRIBUTE_SUFFIX(CLASS, FUNCTION_NAME)
 
#define SB_ATTRIBUTE_COUNT(CLASS, FUNCTION_NAME)
 
#define SB_ATTRIBUTE_GET_CURRENT_INDEX(CLASS, FUNCTION_NAME)
 
#define SB_ATTRIBUTE_SET_CURRENT_INDEX(CLASS, FUNCTION_NAME)
 
#define SB_ATTRIBUTE_ITEM_TEXT(CLASS, FUNCTION_NAME)
 
#define SB_ATTRIBUTE_TOOL_TIP(CLASS, FUNCTION_NAME)
 
#define SB_ATTRIBUTE_ENABLED_FLAG(CLASS, FUNCTION_NAME)
 
#define SB_ATTRIBUTE_VISIBILITY_FLAG(CLASS, FUNCTION_NAME)
 

Convenience descriptions of attributes

#define SB_ATTRIBUTE_READ_ONLY(TYPE, CLASS, NAME, DESCRIPTION, GROUP)
 
#define SB_ATTRIBUTE_READ_ONLY_NONCONST(TYPE, CLASS, NAME, DESCRIPTION, GROUP)
 
#define SB_ATTRIBUTE_READ_WRITE(TYPE, CLASS, NAME, DESCRIPTION, GROUP)
 
#define SB_ATTRIBUTE_READ_WRITE_RESET(TYPE, CLASS, NAME, DESCRIPTION, GROUP)
 
#define SB_ATTRIBUTE_READ_WRITE_CLEAR(TYPE, CLASS, NAME, DESCRIPTION, GROUP)
 
#define SB_ATTRIBUTE_READ_WRITE_CLEAR_ARRAY(TYPE, CLASS, NAME, DESCRIPTION, GROUP)
 
#define SB_ATTRIBUTE_READ_WRITE_RANGE(TYPE, CLASS, NAME, DESCRIPTION, GROUP)
 
#define SB_ATTRIBUTE_READ_WRITE_RESET_RANGE(TYPE, CLASS, NAME, DESCRIPTION, GROUP)
 
#define SB_ATTRIBUTE_READ_WRITE_RANGE_SLIDER(TYPE, CLASS, NAME, DESCRIPTION, GROUP)
 
#define SB_ATTRIBUTE_READ_WRITE_RESET_RANGE_SLIDER(TYPE, CLASS, NAME, DESCRIPTION, GROUP)
 
#define SB_ATTRIBUTE_READ_WRITE_LIST(CLASS, NAME, DESCRIPTION, GROUP)
 
#define SB_ATTRIBUTE_READ_WRITE_RESET_LIST(CLASS, NAME, DESCRIPTION, GROUP)
 
#define SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_ONLY(CLASS, NAME, DESCRIPTION, GROUP)
 
#define SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE(CLASS, NAME, DESCRIPTION, GROUP)
 
#define SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE_CLEAR(CLASS, NAME, DESCRIPTION, GROUP)
 

Descriptions of functions/attributes that can serve as widgets in the Inspector

#define SB_ATTRIBUTE_PUSH_BUTTON(CLASS, TEXT, DESCRIPTION, GROUP, CLICKED_SLOT)
 
#define SB_ATTRIBUTE_PUSH_BUTTON_CONST(CLASS, TEXT, DESCRIPTION, GROUP, CLICKED_SLOT)
 
#define SB_ATTRIBUTE_PUSH_BUTTON_STATIC(CLASS, TEXT, DESCRIPTION, GROUP, CLICKED_SLOT)
 
#define SB_ATTRIBUTE_SPIN_BOX(TYPE, CLASS, NAME, DESCRIPTION, GROUP)
 SB_ATTRIBUTE_READ_WRITE_RANGE
 
#define SB_ATTRIBUTE_SPIN_BOX_RESET(TYPE, CLASS, NAME, DESCRIPTION, GROUP)
 SB_ATTRIBUTE_READ_WRITE_RESET_RANGE
 
#define SB_ATTRIBUTE_SLIDER(TYPE, CLASS, NAME, DESCRIPTION, GROUP)
 SB_ATTRIBUTE_READ_WRITE_RANGE_SLIDER
 
#define SB_ATTRIBUTE_SLIDER_RESET(TYPE, CLASS, NAME, DESCRIPTION, GROUP)
 SB_ATTRIBUTE_READ_WRITE_RESET_RANGE_SLIDER
 
#define SB_ATTRIBUTE_COMBO_BOX(CLASS, NAME, DESCRIPTION, GROUP)
 SB_ATTRIBUTE_READ_WRITE_LIST
 
#define SB_ATTRIBUTE_COMBO_BOX_RESET(CLASS, NAME, DESCRIPTION, GROUP)
 SB_ATTRIBUTE_READ_WRITE_RESET_LIST
 

Macro Definition Documentation

◆ SB_ATTRIBUTE_BEGIN

#define SB_ATTRIBUTE_BEGIN (   ATTRIBUTE_TYPE,
  TYPE,
  CLASS,
  NAME,
  DESCRIPTION,
  GROUP 
)

A general and advanced way to declare an attribute.

Note: For a list of a single-line convenience descriptions of attributes check the next section "Convenience descriptions of attributes".

Declares an attribute NAME of type TYPE from a class CLASS which associated functionality should be exposed and which should also be accessible for users in the Inspector in a group GROUP with a description name DESCRIPTION.

The type of the attribute, and hence how it will be represented in the Inspector, are defined by the ATTRIBUTE_TYPE and the TYPE.

The registered function for the attribute should be present in the CLASS.

Note that this is an advanced way of registration and it does not internally check for the type match and the presence of all the functions required by the ATTRIBUTE_TYPE, so it should be used only if the existing convenience macros for attribute declaration are not enough.

It also requires that the TYPE is registered in SAMSON. Note that the most used types are already registered in SAMSON, including all the standard C++ types and most used types defined in SAMSON (e.g. SBQuantity::length, SBPosition3, etc).

The functions registered with the macros below will also be exposed, so you do not need to expose them using e.g. SB_FUNCTION_1 macros.

For the list of available values for ATTRIBUTE_TYPE see SBCClassAttribute::Type.

Examples

Let's say that we want to expose in the Inspector an attribute called "ShowSpheres" of type "bool" from a class called "SEMyVisualModel" that might be enabled or disabled based on some internal logic, e.g. based on values of another attributes. Let's say we have the following functions implemented in the class CLASS:

  • bool SEMyVisualModel::getShowSpheres() const;
  • void SEMyVisualModel::setShowSpheres(bool value);
  • bool SEMyVisualModel::getShowSpheresEnabledFlag() const;
  • std::string SEMyVisualModel::getShowSpheresToolTip() const;

Then, in the class descriptor file, you can expose the attribute with its functionality in the Inspector as follows:

SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CONSTRUCTOR_0(SEMyVisualModel);
SB_ATTRIBUTE_BEGIN(SBAttribute::Type::ReadWrite, bool, SEMyVisualModel, ShowSpheres, "Show spheres", "Properties");
SB_ATTRIBUTE_GET(bool, SEMyVisualModel, getShowSpheres);
SB_ATTRIBUTE_SET(bool, SEMyVisualModel, setShowSpheres);
SB_ATTRIBUTE_ENABLED_FLAG(SEMyVisualModel, getShowSpheresEnabledFlag);
SB_ATTRIBUTE_TOOLTIP(SEMyVisualModel, getShowSpheresToolTip);
SB_CLASS_END(SEMyVisualModel);
#define SB_FACTORY_BEGIN
Declares the beginning of the class factory.
Definition: SBCClassFactory.hpp:77
#define SB_FACTORY_END
Declares the end of the class factory.
Definition: SBCClassFactory.hpp:91
#define SB_CONSTRUCTOR_0(CLASS)
Declares a class constructor CLASS::CLASS()
Definition: SBCClassFactory.hpp:111
#define SB_INTERFACE_END
Declares the end of the class interface.
Definition: SBCClassInterface.hpp:122
#define SB_ATTRIBUTE_END
Definition: SBCClassInterface.hpp:597
#define SB_ATTRIBUTE_BEGIN(ATTRIBUTE_TYPE, TYPE, CLASS, NAME, DESCRIPTION, GROUP)
Definition: SBCClassInterface.hpp:587
#define SB_INTERFACE_BEGIN
Declares the beginning of the class interface.
Definition: SBCClassInterface.hpp:107
#define SB_ATTRIBUTE_ENABLED_FLAG(CLASS, FUNCTION_NAME)
Definition: SBCClassInterface.hpp:777
#define SB_ATTRIBUTE_SET(TYPE, CLASS, FUNCTION_NAME)
Definition: SBCClassInterface.hpp:621
#define SB_ATTRIBUTE_GET(TYPE, CLASS, FUNCTION_NAME)
Definition: SBCClassInterface.hpp:603
#define SB_CLASS_TYPE(CLASS_TYPE)
Declares the type of the class.
Definition: SBCClassProxy.hpp:196
#define SB_CLASS_END(CLASS)
Declares the end of a class.
Definition: SBCClassProxy.hpp:260
#define SB_CLASS_DESCRIPTION(CLASS_DESCRIPTION)
Declares the description of the class.
Definition: SBCClassProxy.hpp:202
#define SB_CLASS_VERSION_NUMBER(CLASS_VERSION_NUMBER)
Declares the version number of the class.
Definition: SBCClassProxy.hpp:250
#define SB_CLASS_BEGIN(CLASS)
Declares the beginning of a class.
Definition: SBCClassProxy.hpp:173
@ ReadWrite
A read and write scalar attribute.
@ VisualModel
Visual models.
Definition: SBCClass.hpp:49

Let's say that we now want to expose in the Inspector an attribute called "SphereRadius" of type SBQuantity::length from a class called "SEMyVisualModel" that might be visible or not based on some internal logic, e.g. based on values of another attributes. Let's say we have the following functions implemented in the class CLASS:

  • SBQuantity::length SEMyVisualModel::getSphereRadius() const;
  • void SEMyVisualModel::setSphereRadius(SBQuantity::length value);
  • SBQuantity::length SEMyVisualModel::getMinimumSphereRadius() const;
  • SBQuantity::length SEMyVisualModel::getMaximumSphereRadius() const;
  • SBQuantity::length SEMyVisualModel::getSphereRadiusSingleStep() const;
  • SBQuantity::length SEMyVisualModel::getDefaultSphereRadius() const;
  • std::string SEMyVisualModel::getSphereRadiusSuffix() const;
  • bool SEMyVisualModel::getSphereRadiusVisibilityFlag() const;

And we want to expose it as a double spin box. Then, in the class descriptor file, you can expose the attribute with its functionality in the Inspector as follows:

SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CONSTRUCTOR_0(SEMyVisualModel);
SB_ATTRIBUTE_BEGIN(SBAttribute::Type::ReadWriteRange, SBQuantity::length, SEMyVisualModel, SphereRadius, "Sphere radius", "Properties");
SB_ATTRIBUTE_GET(SBQuantity::length, SEMyVisualModel, getSphereRadius);
SB_ATTRIBUTE_SET(SBQuantity::length, SEMyVisualModel, setSphereRadius);
SB_ATTRIBUTE_MINIMUM(SBQuantity::length, SEMyVisualModel, getMinimumSphereRadius);
SB_ATTRIBUTE_MAXIMUM(SBQuantity::length, SEMyVisualModel, getMaximumSphereRadius);
SB_ATTRIBUTE_SINGLE_STEP(SBQuantity::length, SEMyVisualModel, getSphereRadiusSingleStep);
SB_ATTRIBUTE_DEFAULT(SBQuantity::length, SEMyVisualModel, getDefaultSphereRadius);
SB_ATTRIBUTE_SUFFIX(SEMyVisualModel, getSphereRadiusSuffix);
SB_ATTRIBUTE_VISIBILITY_FLAG(SEMyVisualModel, getSphereRadiusVisibilityFlag);
SB_CLASS_END(SEMyVisualModel);
#define SB_ATTRIBUTE_VISIBILITY_FLAG(CLASS, FUNCTION_NAME)
Definition: SBCClassInterface.hpp:787
#define SB_ATTRIBUTE_SUFFIX(CLASS, FUNCTION_NAME)
Definition: SBCClassInterface.hpp:708
#define SB_ATTRIBUTE_MINIMUM(TYPE, CLASS, FUNCTION_NAME)
Definition: SBCClassInterface.hpp:672
#define SB_ATTRIBUTE_MAXIMUM(TYPE, CLASS, FUNCTION_NAME)
Definition: SBCClassInterface.hpp:684
#define SB_ATTRIBUTE_DEFAULT(TYPE, CLASS, FUNCTION_NAME)
Definition: SBCClassInterface.hpp:660
#define SB_ATTRIBUTE_SINGLE_STEP(TYPE, CLASS, FUNCTION_NAME)
Definition: SBCClassInterface.hpp:696
@ ReadWriteRange
A read and write range attribute.
This template class defines physical quantity types.
Definition: SBDQuantityType.hpp:43

SAMSON SDK provides a number of convenience macros to declare attributes in a single line. Please see the list of macros described in the next section "Convenience descriptions of attributes".

◆ SB_ATTRIBUTE_CLEAR

#define SB_ATTRIBUTE_CLEAR (   CLASS,
  FUNCTION_NAME 
)

This macro adds to the currently described attribute from class CLASS a function FUNCTION_NAME that clears the attribute's value, if possible

See also
SB_ATTRIBUTE_BEGIN

◆ SB_ATTRIBUTE_COUNT

#define SB_ATTRIBUTE_COUNT (   CLASS,
  FUNCTION_NAME 
)

This macro adds to the currently described attribute from class CLASS a function FUNCTION_NAME that returns the number of items of the attribute.

This is required if you would like to represent the attribute in the Inspector as a combo box.

See also
SB_ATTRIBUTE_BEGIN

◆ SB_ATTRIBUTE_DEFAULT

#define SB_ATTRIBUTE_DEFAULT (   TYPE,
  CLASS,
  FUNCTION_NAME 
)

This macro adds to the currently described attribute from class CLASS a function FUNCTION_NAME that returns the attribute's default value.

This is required if you would like to make it possible for the user to reset the attribute's object value to a default one.

See also
SB_ATTRIBUTE_BEGIN

◆ SB_ATTRIBUTE_ENABLED_FLAG

#define SB_ATTRIBUTE_ENABLED_FLAG (   CLASS,
  FUNCTION_NAME 
)

This macro adds to the currently described attribute from class CLASS a function FUNCTION_NAME that returns whether the attribute should be enabled in the Inspector.

See also
SB_ATTRIBUTE_BEGIN

◆ SB_ATTRIBUTE_END

#define SB_ATTRIBUTE_END

This macro declares the end of an attributed description started with SB_ATTRIBUTE_BEGIN in the class interface.

See also
SB_ATTRIBUTE_BEGIN

◆ SB_ATTRIBUTE_GET

#define SB_ATTRIBUTE_GET (   TYPE,
  CLASS,
  FUNCTION_NAME 
)

This macro adds to the currently described attribute from class CLASS a function FUNCTION_NAME that gets the attribute's value of type TYPE

See also
SB_ATTRIBUTE_BEGIN

◆ SB_ATTRIBUTE_GET_CURRENT_INDEX

#define SB_ATTRIBUTE_GET_CURRENT_INDEX (   CLASS,
  FUNCTION_NAME 
)

This macro adds to the currently described attribute from class CLASS a function FUNCTION_NAME that returns the attribute's current index.

This is required if you would like to represent the attribute in the Inspector as a combo box.

See also
SB_ATTRIBUTE_BEGIN

◆ SB_ATTRIBUTE_HAS

#define SB_ATTRIBUTE_HAS (   CLASS,
  FUNCTION_NAME 
)

This macro adds to the currently described attribute from class CLASS a function FUNCTION_NAME that returns whether the attribute has a value when the attribute is clearable

See also
SB_ATTRIBUTE_BEGIN

◆ SB_ATTRIBUTE_ITEM_TEXT

#define SB_ATTRIBUTE_ITEM_TEXT (   CLASS,
  FUNCTION_NAME 
)

This macro adds to the currently described attribute from class CLASS a function FUNCTION_NAME that returns the attribute's text for the given index.

This is required if you would like to represent the attribute in the Inspector as a combo box - it is used to populate it with text items.

See also
SB_ATTRIBUTE_BEGIN

◆ SB_ATTRIBUTE_MAXIMUM

#define SB_ATTRIBUTE_MAXIMUM (   TYPE,
  CLASS,
  FUNCTION_NAME 
)

This macro adds to the currently described attribute from class CLASS a function FUNCTION_NAME that returns the attribute's maximum value.

This is required if you would like to represent the attribute in the Inspector as a spin box or a slider.

See also
SB_ATTRIBUTE_BEGIN

◆ SB_ATTRIBUTE_MINIMUM

#define SB_ATTRIBUTE_MINIMUM (   TYPE,
  CLASS,
  FUNCTION_NAME 
)

This macro adds to the currently described attribute from class CLASS a function FUNCTION_NAME that returns the attribute's minimum value.

This is required if you would like to represent the attribute in the Inspector as a spin box or a slider.

See also
SB_ATTRIBUTE_BEGIN

◆ SB_ATTRIBUTE_NON_CONST_GET

#define SB_ATTRIBUTE_NON_CONST_GET (   TYPE,
  CLASS,
  FUNCTION_NAME 
)

This macro adds to the currently described attribute from class CLASS a non-const function FUNCTION_NAME that gets the attribute's value of type TYPE

See also
SB_ATTRIBUTE_BEGIN

◆ SB_ATTRIBUTE_PUSH_BUTTON

#define SB_ATTRIBUTE_PUSH_BUTTON (   CLASS,
  TEXT,
  DESCRIPTION,
  GROUP,
  CLICKED_SLOT 
)

Declares a class function void CLASS::CLICKED_SLOT() that should be exposed and accessible for users in the Inspector in a group GROUP with a description DESCRIPTION.

The following functionality should be present in the CLASS:

  • void CLASS::CLICKED_SLOT();

Note that this macro also exposes the abovementioned function, so you do not need to expose them using e.g. SB_FUNCTION_0 macros.

Example: Let's say that we want to expose in the Inspector a function called "requestUpdate" from a class called "SEMyVisualModel" that forces the update of the visual model. You need to have the following functions implemented in the class CLASS:

  • void SEMyVisualModel::requestUpdate();

Then, in the class descriptor file, you can expose it as a push button in the Inspector as follows:

SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CONSTRUCTOR_0(SEMyVisualModel);
SB_ATTRIBUTE_PUSH_BUTTON(SEMyVisualModel, "Update", "Update", "Properties", requestUpdate);
SB_CLASS_END(SEMyVisualModel);
#define SB_ATTRIBUTE_PUSH_BUTTON(CLASS, TEXT, DESCRIPTION, GROUP, CLICKED_SLOT)
Definition: SBCClassInterface.hpp:1654
See also
SB_ATTRIBUTE_PUSH_BUTTON_CONST
SB_ATTRIBUTE_PUSH_BUTTON_STATIC
Introspection

◆ SB_ATTRIBUTE_PUSH_BUTTON_CONST

#define SB_ATTRIBUTE_PUSH_BUTTON_CONST (   CLASS,
  TEXT,
  DESCRIPTION,
  GROUP,
  CLICKED_SLOT 
)

Declares a const class function void CLASS::CLICKED_SLOT() const that should be exposed and accessible for users in the Inspector in a group GROUP with a description DESCRIPTION.

The following functionality should be present in the CLASS:

  • void CLASS::CLICKED_SLOT() const;

Note that this macro also exposes the abovementioned function, so you do not need to expose them using e.g. SB_CONST_FUNCTION_0 macros.

See also
SB_ATTRIBUTE_PUSH_BUTTON
SB_ATTRIBUTE_PUSH_BUTTON_STATIC
Introspection

◆ SB_ATTRIBUTE_PUSH_BUTTON_STATIC

#define SB_ATTRIBUTE_PUSH_BUTTON_STATIC (   CLASS,
  TEXT,
  DESCRIPTION,
  GROUP,
  CLICKED_SLOT 
)

Declares a static class function void CLASS::CLICKED_SLOT() that should be exposed and accessible for users in the Inspector in a group GROUP with a description DESCRIPTION.

The following functionality should be present in the CLASS:

  • static void CLASS::CLICKED_SLOT();

Note that this macro also exposes the abovementioned function, so you do not need to expose them using e.g. SB_STATIC_FUNCTION_0 macros.

See also
SB_ATTRIBUTE_PUSH_BUTTON
SB_ATTRIBUTE_PUSH_BUTTON_CONST
Introspection

◆ SB_ATTRIBUTE_READ_ONLY

#define SB_ATTRIBUTE_READ_ONLY (   TYPE,
  CLASS,
  NAME,
  DESCRIPTION,
  GROUP 
)

Declares a non-modifiable attribute NAME of type TYPE from a class CLASS which associated functionality should be exposed and which should also be accessible for users in the Inspector in a group GROUP with a description name DESCRIPTION. String or numeric attributes will be shown as a text in a label, pointer attributes (e.g. a pointer to a SBAtom node) will be represented as a button.

The following functionality should be present in the CLASS:

  • TYPE CLASS::getNAME() const; - returns the value.

Note that this macro also exposes the abovementioned functions associated with an attribute NAME, so you do not need to expose them using e.g. SB_CONST_FUNCTION_0 macros.

Example: Let's say that we want to expose in the Inspector an attribute called "NumberOfEdges" of type "unsigned int" from a class called "SEMyVisualModel". You need to have the following functions implemented in the class CLASS:

  • unsigned int SEMyVisualModel::getNumberOfEdges() const;

Then, in the class descriptor file, you can expose this functionality and the attribute in the Inspector as follows:

SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CONSTRUCTOR_0(SEMyVisualModel);
SB_ATTRIBUTE_READ_ONLY(unsigned int, SEMyVisualModel, NumberOfEdges, "Number of edges", "Properties");
SB_CLASS_END(SEMyVisualModel);
#define SB_ATTRIBUTE_READ_ONLY(TYPE, CLASS, NAME, DESCRIPTION, GROUP)
Definition: SBCClassInterface.hpp:843
See also
SB_ATTRIBUTE_READ_WRITE
SB_ATTRIBUTE_READ_WRITE_CLEAR
Introspection

◆ SB_ATTRIBUTE_READ_ONLY_NONCONST

#define SB_ATTRIBUTE_READ_ONLY_NONCONST (   TYPE,
  CLASS,
  NAME,
  DESCRIPTION,
  GROUP 
)

Declares a non-modifiable attribute NAME of type TYPE from a class CLASS which associated functionality should be exposed and which should also be accessible for users in the Inspector in a group GROUP with a description name DESCRIPTION. String or numeric attributes will be shown as a text in a label, pointer attributes (e.g. a pointer to a SBAtom node) will be represented as a button.

This is a non-const version of SB_ATTRIBUTE_READ_ONLY which is suitable for exposing attributes that can e.g. be lazily computed when needed.

The following functionality should be present in the CLASS:

  • TYPE CLASS::getNAME(); - returns the value.

Note that this macro also exposes the abovementioned functions associated with an attribute NAME, so you do not need to expose them using e.g. SB_FUNCTION_0 macros.

Example: Let's say that we want to expose in the Inspector an attribute called "NumberOfEdges" of type "unsigned int" from a class called "SEMyVisualModel". You need to have the following functions implemented in the class CLASS:

  • unsigned int SEMyVisualModel::getNumberOfEdges();

Then, in the class descriptor file, you can expose this functionality and the attribute in the Inspector as follows:

SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CONSTRUCTOR_0(SEMyVisualModel);
SB_ATTRIBUTE_READ_ONLY_NONCONST(unsigned int, SEMyVisualModel, NumberOfEdges, "Number of edges", "Properties");
SB_CLASS_END(SEMyVisualModel);
#define SB_ATTRIBUTE_READ_ONLY_NONCONST(TYPE, CLASS, NAME, DESCRIPTION, GROUP)
Definition: SBCClassInterface.hpp:895
See also
SB_ATTRIBUTE_READ_ONLY
SB_ATTRIBUTE_READ_WRITE
Introspection

◆ SB_ATTRIBUTE_READ_WRITE

#define SB_ATTRIBUTE_READ_WRITE (   TYPE,
  CLASS,
  NAME,
  DESCRIPTION,
  GROUP 
)

Declares a modifiable attribute NAME of type TYPE from a class CLASS which associated functionality should be exposed and which should also be accessible for users in the Inspector in a group GROUP with a description name DESCRIPTION and with the possibility to modify it using a line edit for numerical and string values, or a check box for boolean values.

The following functionality should be present in the CLASS:

  • TYPE CLASS::getNAME() const; - returns the value.
  • void CLASS::setNAME(TYPE value); - sets the value.

Note that this macro also exposes the abovementioned functions associated with an attribute NAME, so you do not need to expose them using e.g. SB_FUNCTION_1 macros.

Example: Let's say that we want to expose in the Inspector an attribute called "ShowLines" of type "bool" from a class called "SEMyVisualModel". You need to have the following functions implemented in the class CLASS:

  • bool SEMyVisualModel::getShowLines() const;
  • void SEMyVisualModel::setShowLines(bool value);

Then, in the class descriptor file, you can expose this functionality and the attribute in the Inspector as follows:

SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CONSTRUCTOR_0(SEMyVisualModel);
SB_ATTRIBUTE_READ_WRITE(bool, SEMyVisualModel, ShowLines, "Show lines", "Properties");
SB_CLASS_END(SEMyVisualModel);
#define SB_ATTRIBUTE_READ_WRITE(TYPE, CLASS, NAME, DESCRIPTION, GROUP)
Definition: SBCClassInterface.hpp:948
See also
SB_ATTRIBUTE_READ_ONLY
SB_ATTRIBUTE_READ_WRITE_RESET
SB_ATTRIBUTE_READ_WRITE_CLEAR
Introspection

◆ SB_ATTRIBUTE_READ_WRITE_CLEAR

#define SB_ATTRIBUTE_READ_WRITE_CLEAR (   TYPE,
  CLASS,
  NAME,
  DESCRIPTION,
  GROUP 
)

Declares a modifiable attribute NAME of type TYPE from a class CLASS which associated functionality should be exposed and which should also be accessible for users in the Inspector in a group GROUP with a description name DESCRIPTION and with the possibility to modify it using a line edit for numerical and string values, or a check box for boolean values.

The following functionality should be present in the CLASS:

  • TYPE CLASS::getNAME() const; - returns the value if set.
  • void CLASS::setNAME(TYPE value); - sets the value.
  • bool CLASS::hasNAME(); - returns true of the attribute is set.
  • void CLASS::clearNAME(); - clears the attribute.

Note that this macro also exposes the abovementioned functions associated with an attribute NAME, so you do not need to expose them using e.g. SB_FUNCTION_1 macros.

Example: Let's say that we want to expose in the Inspector an attribute called "Comment" of type "std::string" from a class called "SEMyVisualModel". You need to have the following functions implemented in the class CLASS:

  • const std::string& SEMyVisualModel::getComment() const;
  • void SEMyVisualModel::setComment(const std::string& value);
  • bool CLASS::hasComment();
  • void CLASS::clearComment();

Then, in the class descriptor file, you can expose this functionality and the attribute in the Inspector as follows:

SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CONSTRUCTOR_0(SEMyVisualModel);
SB_ATTRIBUTE_READ_WRITE_CLEAR(const std::string&, SEMyVisualModel, Comment, "Comment", "Information");
SB_CLASS_END(SEMyVisualModel);
#define SB_ATTRIBUTE_READ_WRITE_CLEAR(TYPE, CLASS, NAME, DESCRIPTION, GROUP)
Definition: SBCClassInterface.hpp:1062
See also
SB_ATTRIBUTE_READ_ONLY
SB_ATTRIBUTE_READ_WRITE
Introspection

◆ SB_ATTRIBUTE_READ_WRITE_CLEAR_ARRAY

#define SB_ATTRIBUTE_READ_WRITE_CLEAR_ARRAY (   TYPE,
  CLASS,
  NAME,
  DESCRIPTION,
  GROUP 
)

Declares a modifiable array attribute NAME of type TYPE from a class CLASS which associated functionality should be exposed and which should also be accessible for users in the Inspector in a group GROUP with a description name DESCRIPTION.

See also
SB_ATTRIBUTE_READ_WRITE_CLEAR
Introspection

◆ SB_ATTRIBUTE_READ_WRITE_LIST

#define SB_ATTRIBUTE_READ_WRITE_LIST (   CLASS,
  NAME,
  DESCRIPTION,
  GROUP 
)

Declares a modifiable attribute NAME from a class CLASS which associated functionality should be exposed and which should also be accessible for users in the Inspector in a group GROUP with a description name DESCRIPTION and with the possibility to choose from a list using a combo box.

The following functionality should be present in the CLASS:

  • int CLASS::getNAMECount() const; - returns the number of elements in the list.
  • int CLASS::getNAMECurrentIndex() const; - returns the current value's index in the list.
  • void CLASS::setNAMECurrentIndex(const int); - sets the current value based on the index in the list.
  • std::string CLASS::getNAMEItemText(const int) const; - returns a string representation of the list items.

Note that this macro also exposes the abovementioned functions associated with an attribute NAME, so you do not need to expose them using e.g. SB_FUNCTION_1 macros.

Example: Let's say that we want to expose in the Inspector an attribute called "VisualPreset" from a class called "SEMyVisualModel" and that has a limited number of variants. You need to have the following functions implemented in the class CLASS:

  • int SEMyVisualModel::getVisualPresetCount() const;
  • int SEMyVisualModel::getVisualPresetCurrentIndex() const;
  • void SEMyVisualModel::setVisualPresetCurrentIndex(const int);
  • std::string SEMyVisualModel::getVisualPresetItemText(const int) const;

Then, in the class descriptor file, you can expose this functionality and the attribute in the Inspector as follows:

SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CONSTRUCTOR_0(SEMyVisualModel);
SB_ATTRIBUTE_READ_WRITE_LIST(SEMyVisualModel, VisualPreset, "Visual preset", "Properties");
SB_CLASS_END(SEMyVisualModel);
#define SB_ATTRIBUTE_READ_WRITE_LIST(CLASS, NAME, DESCRIPTION, GROUP)
Definition: SBCClassInterface.hpp:1409
See also
SB_ATTRIBUTE_READ_WRITE_RESET_LIST
Introspection

◆ SB_ATTRIBUTE_READ_WRITE_RANGE

#define SB_ATTRIBUTE_READ_WRITE_RANGE (   TYPE,
  CLASS,
  NAME,
  DESCRIPTION,
  GROUP 
)

Declares a modifiable attribute NAME of type TYPE from a class CLASS which associated functionality should be exposed and which should also be accessible for users in the Inspector in a group GROUP with a description name DESCRIPTION and with the possibility to modify it using a spin box that changes from a given minimum value to a given maximum value with a given step size.

The following functionality should be present in the CLASS:

  • TYPE CLASS::getNAME() const; - returns the value.
  • void CLASS::setNAME(TYPE value); - sets the value.
  • TYPE CLASS::getMinimumNAME() const; - returns the minimum value.
  • TYPE CLASS::getMaximumNAME() const; - returns the maximum value.
  • TYPE CLASS::getNAMESingleStep() const; - returns the single step value.
  • std::string CLASS::getNAMESuffix() const; - returns a suffix string used for the representation of the current value if the TYPE is not of the SBQuantity type.

Note that this macro also exposes the abovementioned functions associated with an attribute NAME, so you do not need to expose them using e.g. SB_FUNCTION_1 macros.

Example: Let's say that we want to expose in the Inspector an attribute called "Radius" of type "SBQuantity::length" from a class called "SEMyVisualModel". You need to have the following functions implemented in the class CLASS:

  • const SBQuantity::length& SEMyVisualModel::getRadius() const;
  • void SEMyVisualModel::setRadius(const SBQuantity::length& value);
  • const SBQuantity::length& SEMyVisualModel::getMinimumRadius() const;
  • const SBQuantity::length& SEMyVisualModel::getMaximumRadius() const;
  • const SBQuantity::length& SEMyVisualModel::getRadiusSingleStep() const;
  • std::string SEMyVisualModel::getRadiusSuffix() const;

Then, in the class descriptor file, you can expose this functionality and the attribute in the Inspector as follows:

SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CONSTRUCTOR_0(SEMyVisualModel);
SB_ATTRIBUTE_READ_WRITE_RANGE(const SBQuantity::length&, SEMyVisualModel, Radius, "Radius", "Properties");
SB_CLASS_END(SEMyVisualModel);
#define SB_ATTRIBUTE_READ_WRITE_RANGE(TYPE, CLASS, NAME, DESCRIPTION, GROUP)
Definition: SBCClassInterface.hpp:1143
See also
SB_ATTRIBUTE_READ_WRITE_RESET_RANGE
SB_ATTRIBUTE_READ_WRITE_RANGE_SLIDER
Introspection

◆ SB_ATTRIBUTE_READ_WRITE_RANGE_SLIDER

#define SB_ATTRIBUTE_READ_WRITE_RANGE_SLIDER (   TYPE,
  CLASS,
  NAME,
  DESCRIPTION,
  GROUP 
)

Declares a modifiable attribute NAME of type TYPE from a class CLASS which associated functionality should be exposed and which should also be accessible for users in the Inspector in a group GROUP with a description name DESCRIPTION and with the possibility to modify it using a slider (QSlider) that changes from a given minimum value to a given maximum value with a given step size.

The following functionality should be present in the CLASS:

  • TYPE CLASS::getNAME() const; - returns the value.
  • void CLASS::setNAME(TYPE value); - sets the value.
  • TYPE CLASS::getMinimumNAME() const; - returns the minimum value.
  • TYPE CLASS::getMaximumNAME() const; - returns the maximum value.
  • TYPE CLASS::getNAMESingleStep() const; - returns the single step value.
  • std::string CLASS::getNAMESuffix() const; - returns a suffix string used for the representation of the current value if the TYPE is not of the SBQuantity type.

Note that this macro also exposes the abovementioned functions associated with an attribute NAME, so you do not need to expose them using e.g. SB_FUNCTION_1 macros.

Example: Let's say that we want to expose in the Inspector an attribute called "Opacity" of type "unsigned int" from a class called "SEMyVisualModel". And let's say that this Opacity attribute changes from 0 to 100% with a single step of 1%. You need to have the following functions implemented in the class CLASS:

  • unsigned int SEMyVisualModel::getOpacity();
  • void SEMyVisualModel::setOpacity(unsigned int value);
  • unsigned int SEMyVisualModel::getMinimumOpacity();
  • unsigned int SEMyVisualModel::getMaximumOpacity();
  • unsigned int SEMyVisualModel::getOpacitySingleStep();
  • std::string SEMyVisualModel::getOpacitySuffix();

Then, in the class descriptor file, you can expose this functionality and the attribute in the Inspector as follows:

SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CONSTRUCTOR_0(SEMyVisualModel);
SB_ATTRIBUTE_READ_WRITE_RANGE_SLIDER(unsigned int, SEMyVisualModel, Opacity, "Opacity", "Properties");
SB_CLASS_END(SEMyVisualModel);
#define SB_ATTRIBUTE_READ_WRITE_RANGE_SLIDER(TYPE, CLASS, NAME, DESCRIPTION, GROUP)
Definition: SBCClassInterface.hpp:1278
See also
SB_ATTRIBUTE_READ_WRITE_RANGE
SB_ATTRIBUTE_READ_WRITE_RESET_RANGE_SLIDER
Introspection

◆ SB_ATTRIBUTE_READ_WRITE_RESET

#define SB_ATTRIBUTE_READ_WRITE_RESET (   TYPE,
  CLASS,
  NAME,
  DESCRIPTION,
  GROUP 
)

Declares a modifiable and resettable attribute NAME of type TYPE from a class CLASS which associated functionality should be exposed and which should also be accessible for users in the Inspector in a group GROUP with a description name DESCRIPTION and with the possibility to modify it using a line edit for numerical and string values, or a check box for boolean values, and the possibility to reset it by double-clicking on its label.

The following functionality should be present in the CLASS:

  • TYPE CLASS::getNAME() const; - returns the value.
  • void CLASS::setNAME(TYPE value); - sets the value.
  • TYPE CLASS::getDefaultNAME() const; - returns the default value.

Note that this macro also exposes the abovementioned functions associated with an attribute NAME, so you do not need to expose them using e.g. SB_FUNCTION_1 macros.

Example: Let's say that we want to expose in the Inspector an attribute called "Scale" of type "float" from a class called "SEMyVisualModel". You need to have the following functions implemented in the class CLASS:

  • float SEMyVisualModel::getScale() const;
  • void SEMyVisualModel::setScale(float value);
  • float SEMyVisualModel::getDefaultScale() const;

Then, in the class descriptor file, you can expose this functionality and the attribute in the Inspector as follows:

SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CONSTRUCTOR_0(SEMyVisualModel);
SB_ATTRIBUTE_READ_WRITE_RESET(float, SEMyVisualModel, Scale, "Scale", "Properties");
SB_CLASS_END(SEMyVisualModel);
#define SB_ATTRIBUTE_READ_WRITE_RESET(TYPE, CLASS, NAME, DESCRIPTION, GROUP)
Definition: SBCClassInterface.hpp:1004
See also
SB_ATTRIBUTE_READ_ONLY
SB_ATTRIBUTE_READ_WRITE
Introspection

◆ SB_ATTRIBUTE_READ_WRITE_RESET_LIST

#define SB_ATTRIBUTE_READ_WRITE_RESET_LIST (   CLASS,
  NAME,
  DESCRIPTION,
  GROUP 
)

Declares a modifiable and resettable attribute NAME from a class CLASS which associated functionality should be exposed and which should also be accessible for users in the Inspector in a group GROUP with a description name DESCRIPTION and with the possibility to choose from a list using a combo box, and the possibility to reset it by double-clicking on its label.

The following functionality should be present in the CLASS:

  • int CLASS::getNAMECount() const; - returns the number of elements in the list.
  • int CLASS::getDefaultNAMEIndex() const; - returns the default value's index in the list.
  • int CLASS::getNAMECurrentIndex() const; - returns the current value's index in the list.
  • void CLASS::setNAMECurrentIndex(const int); - sets the current value based on the index in the list.
  • std::string CLASS::getNAMEItemText(const int) const; - returns a string representation of the list items.

Note that this macro also exposes the abovementioned functions associated with an attribute NAME, so you do not need to expose them using e.g. SB_FUNCTION_1 macros.

Example: Let's say that we want to expose in the Inspector an attribute called "VisualPreset" from a class called "SEMyVisualModel" and that has a limited number of variants. You need to have the following functions implemented in the class CLASS:

  • int SEMyVisualModel::getVisualPresetCount() const;
  • int SEMyVisualModel::getDefaultVisualPresetIndex() const;
  • int SEMyVisualModel::getVisualPresetCurrentIndex() const;
  • void SEMyVisualModel::setVisualPresetCurrentIndex(const int);
  • std::string SEMyVisualModel::getVisualPresetItemText(const int) const;

Then, in the class descriptor file, you can expose this functionality and the attribute in the Inspector as follows:

SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CONSTRUCTOR_0(SEMyVisualModel);
SB_ATTRIBUTE_READ_WRITE_RESET_LIST(SEMyVisualModel, VisualPreset, "Visual preset", "Properties");
SB_CLASS_END(SEMyVisualModel);
#define SB_ATTRIBUTE_READ_WRITE_RESET_LIST(CLASS, NAME, DESCRIPTION, GROUP)
Definition: SBCClassInterface.hpp:1471
See also
SB_ATTRIBUTE_READ_WRITE_LIST
Introspection

◆ SB_ATTRIBUTE_READ_WRITE_RESET_RANGE

#define SB_ATTRIBUTE_READ_WRITE_RESET_RANGE (   TYPE,
  CLASS,
  NAME,
  DESCRIPTION,
  GROUP 
)

Declares a modifiable and resettable attribute NAME of type TYPE from a class CLASS which associated functionality should be exposed and which should also be accessible for users in the Inspector in a group GROUP with a description name DESCRIPTION and with the possibility to modify it using a spin box that changes from a given minimum value to a given maximum value with a given step size, and the possibility to reset it by double-clicking on its label.

The following functionality should be present in the CLASS:

  • TYPE CLASS::getNAME() const; - returns the value.
  • void CLASS::setNAME(TYPE value); - sets the value.
  • TYPE CLASS::getDefaultNAME() const; - returns the default value.
  • TYPE CLASS::getMinimumNAME() const; - returns the minimum value.
  • TYPE CLASS::getMaximumNAME() const; - returns the maximum value.
  • TYPE CLASS::getNAMESingleStep() const; - returns the single step value.
  • std::string CLASS::getNAMESuffix() const; - returns a suffix string used for the representation of the current value if the TYPE is not of the SBQuantity type.

Note that this macro also exposes the abovementioned functions associated with an attribute NAME, so you do not need to expose them using e.g. SB_FUNCTION_1 macros.

Example: Let's say that we want to expose in the Inspector an attribute called "Radius" of type "SBQuantity::length" from a class called "SEMyVisualModel". You need to have the following functions implemented in the class CLASS:

  • const SBQuantity::length& SEMyVisualModel::getRadius() const;
  • void SEMyVisualModel::setRadius(const SBQuantity::length& value);
  • const SBQuantity::length& SEMyVisualModel::getDefaultRadius() const;
  • const SBQuantity::length& SEMyVisualModel::getMinimumRadius() const;
  • const SBQuantity::length& SEMyVisualModel::getMaximumRadius() const;
  • const SBQuantity::length& SEMyVisualModel::getRadiusSingleStep() const;
  • std::string SEMyVisualModel::getRadiusSuffix() const;

Then, in the class descriptor file, you can expose this functionality and the attribute in the Inspector as follows:

SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CONSTRUCTOR_0(SEMyVisualModel);
SB_ATTRIBUTE_READ_WRITE_RESET_RANGE(const SBQuantity::length&, SEMyVisualModel, Radius, "Radius", "Properties");
SB_CLASS_END(SEMyVisualModel);
#define SB_ATTRIBUTE_READ_WRITE_RESET_RANGE(TYPE, CLASS, NAME, DESCRIPTION, GROUP)
Definition: SBCClassInterface.hpp:1211
See also
SB_ATTRIBUTE_READ_WRITE_RANGE
SB_ATTRIBUTE_READ_WRITE_RESET_RANGE_SLIDER
Introspection

◆ SB_ATTRIBUTE_READ_WRITE_RESET_RANGE_SLIDER

#define SB_ATTRIBUTE_READ_WRITE_RESET_RANGE_SLIDER (   TYPE,
  CLASS,
  NAME,
  DESCRIPTION,
  GROUP 
)

Declares a modifiable and resettable attribute NAME of type TYPE from a class CLASS which associated functionality should be exposed and which should also be accessible for users in the Inspector in a group GROUP with a description name DESCRIPTION and with the possibility to modify it using a slider (QSlider) that changes from a given minimum value to a given maximum value with a given step size, and the possibility to reset it by double-clicking on its label.

The following functionality should be present in the CLASS:

  • TYPE CLASS::getNAME() const; - returns the value.
  • void CLASS::setNAME(TYPE value); - sets the value.
  • TYPE CLASS::getDefaultNAME() const; - returns the default value.
  • TYPE CLASS::getMinimumNAME() const; - returns the minimum value.
  • TYPE CLASS::getMaximumNAME() const; - returns the maximum value.
  • TYPE CLASS::getNAMESingleStep() const; - returns the single step value.
  • std::string CLASS::getNAMESuffix() const; - returns a suffix string used for the representation of the current value if the TYPE is not of the SBQuantity type.

Note that this macro also exposes the abovementioned functions associated with an attribute NAME, so you do not need to expose them using e.g. SB_FUNCTION_1 macros.

Example: Let's say that we want to expose in the Inspector an attribute called "Opacity" of type "unsigned int" from a class called "SEMyVisualModel". And let's say that this Opacity attribute changes from 0 to 100% with a single step of 1%. You need to have the following functions implemented in the class CLASS:

  • unsigned int SEMyVisualModel::getOpacity() const;
  • void SEMyVisualModel::setOpacity(unsigned int value);
  • unsigned int SEMyVisualModel::getDefaultOpacity() const;
  • unsigned int SEMyVisualModel::getMinimumOpacity() const;
  • unsigned int SEMyVisualModel::getMaximumOpacity() const;
  • unsigned int SEMyVisualModel::getOpacitySingleStep() const;
  • std::string SEMyVisualModel::getOpacitySuffix() const;

Then, in the class descriptor file, you can expose this functionality and the attribute in the Inspector as follows:

SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CONSTRUCTOR_0(SEMyVisualModel);
SB_ATTRIBUTE_READ_WRITE_RESET_RANGE_SLIDER(unsigned int, SEMyVisualModel, Opacity, "Opacity", "Properties");
SB_CLASS_END(SEMyVisualModel);
#define SB_ATTRIBUTE_READ_WRITE_RESET_RANGE_SLIDER(TYPE, CLASS, NAME, DESCRIPTION, GROUP)
Definition: SBCClassInterface.hpp:1347
See also
SB_ATTRIBUTE_READ_WRITE_RANGE_SLIDER
SB_ATTRIBUTE_READ_WRITE_RESET_RANGE
Introspection

◆ SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_ONLY

#define SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_ONLY (   CLASS,
  NAME,
  DESCRIPTION,
  GROUP 
)

Declares a non-modifiable rich text attribute NAME of type const std::string& from a class CLASS which associated functionality should be exposed and which should also be accessible for users in the Inspector in a group GROUP with a description name DESCRIPTION. The rich text will be shown in a text edit.

The following functionality should be present in the CLASS:

  • const std::string& CLASS::getNAME() const; - returns an std::string with rich text.

Note that this macro also exposes the abovementioned functions associated with an attribute NAME, so you do not need to expose them using e.g. SB_FUNCTION_1 macros.

Example: Let's say that we want to expose in the Inspector an attribute with a text description called "Description" from a class called "SEMyVisualModel". You need to have the following functions implemented in the class CLASS:

  • const std::string& SEMyVisualModel::getDescription() const;

Then, in the class descriptor file, you can expose this functionality and the attribute in the Inspector as follows:

SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CONSTRUCTOR_0(SEMyVisualModel);
SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_ONLY(SEMyVisualModel, Description, "Description", "Information");
SB_CLASS_END(SEMyVisualModel);
#define SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_ONLY(CLASS, NAME, DESCRIPTION, GROUP)
Definition: SBCClassInterface.hpp:1526
See also
SB_ATTRIBUTE_READ_ONLY
SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE_CLEAR
SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE_CLEAR
Introspection

◆ SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE

#define SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE (   CLASS,
  NAME,
  DESCRIPTION,
  GROUP 
)

Declares a modifiable rich text attribute NAME of type const std::string& from a class CLASS which associated functionality should be exposed and which should also be accessible for users in the Inspector in a group GROUP with a description name DESCRIPTION and with the possibility to modify it using a text edit.

The following functionality should be present in the CLASS:

  • const std::string& CLASS::getNAME() const; - returns an std::string with rich text.
  • void CLASS::setNAME(const std::string& value); - sets the text.

Note that this macro also exposes the abovementioned functions associated with an attribute NAME, so you do not need to expose them using e.g. SB_FUNCTION_1 macros.

Example: Let's say that we want to expose in the Inspector an attribute with rich text called "Notes" from a class called "SEMyVisualModel". You need to have the following functions implemented in the class CLASS:

  • const std::string& SEMyVisualModel::getNotes() const;
  • void SEMyVisualModel::setNotes(const std::string& value);

Then, in the class descriptor file, you can expose this functionality and the attribute in the Inspector as follows:

SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CONSTRUCTOR_0(SEMyVisualModel);
SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE(SEMyVisualModel, Notes, "Notes", "Information");
SB_CLASS_END(SEMyVisualModel);
#define SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE(CLASS, NAME, DESCRIPTION, GROUP)
Definition: SBCClassInterface.hpp:1579
See also
SB_ATTRIBUTE_READ_WRITE
SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_ONLY
SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE_CLEAR
Introspection

◆ SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE_CLEAR

#define SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE_CLEAR (   CLASS,
  NAME,
  DESCRIPTION,
  GROUP 
)

Declares a modifiable rich text attribute NAME of type const std::string& from a class CLASS which associated functionality should be exposed and which should also be accessible for users in the Inspector in a group GROUP with a description name DESCRIPTION and with the possibility to modify it using a text edit for numerical and string values, or a check box for boolean values.

See description for SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE and SB_ATTRIBUTE_READ_WRITE_CLEAR

See also
SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_ONLY
SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE
Introspection

◆ SB_ATTRIBUTE_SET

#define SB_ATTRIBUTE_SET (   TYPE,
  CLASS,
  FUNCTION_NAME 
)

This macro adds to the currently described attribute from class CLASS a function FUNCTION_NAME that sets the attribute's value of type TYPE

See also
SB_ATTRIBUTE_BEGIN

◆ SB_ATTRIBUTE_SET_CURRENT_INDEX

#define SB_ATTRIBUTE_SET_CURRENT_INDEX (   CLASS,
  FUNCTION_NAME 
)

This macro adds to the currently described attribute from class CLASS a function FUNCTION_NAME that sets the attribute's current index to a specific index.

This is required if you would like to represent the attribute in the Inspector as a combo box.

See also
SB_ATTRIBUTE_BEGIN

◆ SB_ATTRIBUTE_SINGLE_STEP

#define SB_ATTRIBUTE_SINGLE_STEP (   TYPE,
  CLASS,
  FUNCTION_NAME 
)

This macro adds to the currently described attribute from class CLASS a function FUNCTION_NAME that returns the attribute's single step value.

This is required if you would like to represent the attribute in the Inspector as a spin box or a slider.

See also
SB_ATTRIBUTE_BEGIN

◆ SB_ATTRIBUTE_SIZE

#define SB_ATTRIBUTE_SIZE (   CLASS,
  FUNCTION_NAME 
)

This macro adds to the currently described attribute from class CLASS a function FUNCTION_NAME that returns the size of the array attribute in an object when relevant

See also
SB_ATTRIBUTE_BEGIN

◆ SB_ATTRIBUTE_SUFFIX

#define SB_ATTRIBUTE_SUFFIX (   CLASS,
  FUNCTION_NAME 
)

This macro adds to the currently described attribute from class CLASS a function FUNCTION_NAME that returns the attribute's suffix string.

This is required if you would like to represent the attribute in the Inspector as a spin box or a slider.

See also
SB_ATTRIBUTE_BEGIN

◆ SB_ATTRIBUTE_TOOL_TIP

#define SB_ATTRIBUTE_TOOL_TIP (   CLASS,
  FUNCTION_NAME 
)

This macro adds to the currently described attribute from class CLASS a function FUNCTION_NAME that returns the attribute's tool tip.

See also
SB_ATTRIBUTE_BEGIN

◆ SB_ATTRIBUTE_VISIBILITY_FLAG

#define SB_ATTRIBUTE_VISIBILITY_FLAG (   CLASS,
  FUNCTION_NAME 
)

This macro adds to the currently described attribute from class CLASS a function FUNCTION_NAME that returns whether the attribute should be visible in the Inspector.

See also
SB_ATTRIBUTE_BEGIN