File SBCClassInterface.hpp#
FileList > Class > SBCClassInterface.hpp
#include "SBCClassExport.hpp"#include "SBCClassFunction.hpp"#include "SBCClassAttribute.hpp"#include "SBCClassConstFunction.hpp"#include "SBCClassStaticFunction.hpp"#include "SBCContainerHashMap.hpp"#include <string>
Classes#
| Type | Name |
|---|---|
| class | SBCClassInterface This class describes a class interface in a class proxy. |
Public Types#
| Type | Name |
|---|---|
| typedef SBCClassInterface | SBInterface The short name of SBCClassInterface . |
Macros#
| Type | Name |
|---|---|
| define | SB_ATTRIBUTE_BEGIN (ATTRIBUTE_ACCESS, ATTRIBUTE_TYPE, TYPE, NAME, DESCRIPTION, GROUP) A general and advanced way to declare an attribute. |
| define | SB_ATTRIBUTE_CLEAR (FUNCTION_NAME) This macro adds to the currently described attribute a function FUNCTION_NAME that clears the attribute's value, if possible. |
| define | SB_ATTRIBUTE_COMBO_BOX (NAME, DESCRIPTION, GROUP) An alias macro for SB_ATTRIBUTE_READ_WRITE_LIST. |
| define | SB_ATTRIBUTE_COMBO_BOX_RESET (NAME, DESCRIPTION, GROUP) An alias macro for SB_ATTRIBUTE_READ_WRITE_RESET_LIST. |
| define | SB_ATTRIBUTE_COUNT (FUNCTION_NAME) This macro adds to the currently described attribute a function FUNCTION_NAME that returns the number of items of the attribute. |
| define | SB_ATTRIBUTE_DEFAULT (TYPE, FUNCTION_NAME) This macro adds to the currently described attribute a function FUNCTION_NAME that returns the attribute's default value. |
| define | SB_ATTRIBUTE_ENABLED_FLAG (FUNCTION_NAME) This macro adds to the currently described attribute a function FUNCTION_NAME that returns whether the attribute should be enabled in theInspector . |
| define | SB_ATTRIBUTE_END This macro declares the end of an attributed description started with SB_ATTRIBUTE_BEGIN in the class interface (see Introspection ). |
| define | SB_ATTRIBUTE_GET (TYPE, FUNCTION_NAME) This macro adds to the currently described attribute a function FUNCTION_NAME that gets the attribute's value of typeTYPE . |
| define | SB_ATTRIBUTE_GET_CURRENT_INDEX (FUNCTION_NAME) This macro adds to the currently described attribute a function FUNCTION_NAME that returns the attribute's current index. |
| define | SB_ATTRIBUTE_HAS (FUNCTION_NAME) This macro adds to the currently described attribute a function FUNCTION_NAME that returns whether the attribute has a value when the attribute is clearable. |
| define | SB_ATTRIBUTE_ITEM_TEXT (FUNCTION_NAME) This macro adds to the currently described attribute a function FUNCTION_NAME that returns the attribute's text for the given index. |
| define | SB_ATTRIBUTE_MAXIMUM (TYPE, FUNCTION_NAME) This macro adds to the currently described attribute a function FUNCTION_NAME that returns the attribute's maximum value. |
| define | SB_ATTRIBUTE_MINIMUM (TYPE, FUNCTION_NAME) This macro adds to the currently described attribute a function FUNCTION_NAME that returns the attribute's minimum value. |
| define | SB_ATTRIBUTE_NON_CONST_GET (TYPE, FUNCTION_NAME) This macro adds to the currently described attribute a non-const function FUNCTION_NAME that gets the attribute's value of typeTYPE . |
| define | SB_ATTRIBUTE_PUSH_BUTTON (TEXT, DESCRIPTION, GROUP, CLICKED_SLOT) Declares a class function (see Introspection ) void CLICKED_SLOT() that should be exposed and accessible for users in theInspector in a groupGROUP with a descriptionDESCRIPTION . |
| define | SB_ATTRIBUTE_PUSH_BUTTON_CONST (TEXT, DESCRIPTION, GROUP, CLICKED_SLOT) Declares a const class function (see Introspection ) void CLICKED_SLOT() const that should be exposed and accessible for users in theInspector in a groupGROUP with a descriptionDESCRIPTION . |
| define | SB_ATTRIBUTE_PUSH_BUTTON_STATIC (TEXT, DESCRIPTION, GROUP, CLICKED_SLOT) Declares a static class function (see Introspection ) void CLICKED_SLOT() that should be exposed and accessible for users in theInspector in a groupGROUP with a descriptionDESCRIPTION . |
| define | SB_ATTRIBUTE_READ_ONLY (TYPE, NAME, DESCRIPTION, GROUP) Declares a non-modifiable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION . |
| define | SB_ATTRIBUTE_READ_ONLY_NONCONST (TYPE, NAME, DESCRIPTION, GROUP) Declares a non-modifiable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION . |
| define | SB_ATTRIBUTE_READ_WRITE (TYPE, NAME, DESCRIPTION, GROUP) Declares a modifiable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION and with the possibility to modify it using a line edit for numerical and string values, or a check box for boolean values. |
| define | SB_ATTRIBUTE_READ_WRITE_CLEAR (TYPE, NAME, DESCRIPTION, GROUP) Declares a modifiable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION and with the possibility to modify it using a line edit for numerical and string values, or a check box for boolean values. |
| define | SB_ATTRIBUTE_READ_WRITE_CLEAR_ARRAY (TYPE, NAME, DESCRIPTION, GROUP) Declares a modifiable array attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION . |
| define | SB_ATTRIBUTE_READ_WRITE_LIST (NAME, DESCRIPTION, GROUP) Declares a modifiable attribute NAME from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION and with the possibility to choose from a list using a combo box. |
| define | SB_ATTRIBUTE_READ_WRITE_RANGE (TYPE, NAME, DESCRIPTION, GROUP) Declares a modifiable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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. |
| define | SB_ATTRIBUTE_READ_WRITE_RANGE_SLIDER (TYPE, NAME, DESCRIPTION, GROUP) Declares a modifiable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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. |
| define | SB_ATTRIBUTE_READ_WRITE_RESET (TYPE, NAME, DESCRIPTION, GROUP) Declares a modifiable and resettable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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. |
| define | SB_ATTRIBUTE_READ_WRITE_RESET_LIST (NAME, DESCRIPTION, GROUP) Declares a modifiable and resettable attribute NAME from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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. |
| define | SB_ATTRIBUTE_READ_WRITE_RESET_RANGE (TYPE, NAME, DESCRIPTION, GROUP) Declares a modifiable and resettable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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. |
| define | SB_ATTRIBUTE_READ_WRITE_RESET_RANGE_SLIDER (TYPE, NAME, DESCRIPTION, GROUP) Declares a modifiable and resettable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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. |
| define | SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_ONLY (NAME, DESCRIPTION, GROUP) Declares a non-modifiable rich text attribute NAME of typeconst std::string& from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION . |
| define | SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE (NAME, DESCRIPTION, GROUP) Declares a modifiable rich text attribute NAME of typeconst std::string& from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION and with the possibility to modify it using a text edit. |
| define | SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE_CLEAR (NAME, DESCRIPTION, GROUP) Declares a modifiable rich text attribute NAME of typeconst std::string& from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION and with the possibility to modify it using a text edit for numerical and string values, or a check box for boolean values. |
| define | SB_ATTRIBUTE_SET (TYPE, FUNCTION_NAME) This macro adds to the currently described attribute a function FUNCTION_NAME that sets the attribute's value of typeTYPE . |
| define | SB_ATTRIBUTE_SET_CURRENT_INDEX (FUNCTION_NAME) This macro adds to the currently described attribute a function FUNCTION_NAME that sets the attribute's current index to a specific index. |
| define | SB_ATTRIBUTE_SINGLE_STEP (TYPE, FUNCTION_NAME) This macro adds to the currently described attribute a function FUNCTION_NAME that returns the attribute's single step value. |
| define | SB_ATTRIBUTE_SIZE (FUNCTION_NAME) This macro adds to the currently described attribute a function FUNCTION_NAME that returns the size of the array attribute in an object when relevant. |
| define | SB_ATTRIBUTE_SLIDER (TYPE, NAME, DESCRIPTION, GROUP) An alias macro for SB_ATTRIBUTE_READ_WRITE_RANGE_SLIDER. |
| define | SB_ATTRIBUTE_SLIDER_RESET (TYPE, NAME, DESCRIPTION, GROUP) An alias macro for SB_ATTRIBUTE_READ_WRITE_RESET_RANGE_SLIDER. |
| define | SB_ATTRIBUTE_SPIN_BOX (TYPE, NAME, DESCRIPTION, GROUP) An alias macro for SB_ATTRIBUTE_READ_WRITE_RANGE. |
| define | SB_ATTRIBUTE_SPIN_BOX_RESET (TYPE, NAME, DESCRIPTION, GROUP) An alias macro for SB_ATTRIBUTE_READ_WRITE_RESET_RANGE. |
| define | SB_ATTRIBUTE_SUFFIX (FUNCTION_NAME) This macro adds to the currently described attribute a function FUNCTION_NAME that returns the attribute's suffix string. |
| define | SB_ATTRIBUTE_TOOL_TIP (FUNCTION_NAME) This macro adds to the currently described attribute a static function FUNCTION_NAME that returns the attribute's tool tip. |
| define | SB_ATTRIBUTE_VISIBILITY_FLAG (FUNCTION_NAME) This macro adds to the currently described attribute a function FUNCTION_NAME that returns whether the attribute should be visible in theInspector . |
| define | SB_CONST_FUNCTION_0 (OUTPUT, FUNCTION) Declares a const class function (see Introspection ) OUTPUT FUNCTION() for the currently described class. |
| define | SB_CONST_FUNCTION_0_BEGIN (OUTPUT, FUNCTION) An advanced way to declare a const function that takes no arguments: OUTPUT FUNCTION() const . |
| define | SB_CONST_FUNCTION_1 (OUTPUT, FUNCTION, T0) Declares a const class function (see Introspection ) OUTPUT FUNCTION(T0) for the currently described class. |
| define | SB_CONST_FUNCTION_10 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) Declares a const class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9) for the currently described class. |
| define | SB_CONST_FUNCTION_11 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) Declares a const class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10) for the currently described class. |
| define | SB_CONST_FUNCTION_12 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) Declares a const class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11) for the currently described class. |
| define | SB_CONST_FUNCTION_13 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) Declares a const class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12) for the currently described class. |
| define | SB_CONST_FUNCTION_14 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) Declares a const class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13) for the currently described class. |
| define | SB_CONST_FUNCTION_15 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) Declares a const class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14) for the currently described class. |
| define | SB_CONST_FUNCTION_16 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) Declares a const class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15) for the currently described class. |
| define | SB_CONST_FUNCTION_2 (OUTPUT, FUNCTION, T0, T1) Declares a const class function (see Introspection ) OUTPUT FUNCTION(T0,T1) for the currently described class. |
| define | SB_CONST_FUNCTION_3 (OUTPUT, FUNCTION, T0, T1, T2) Declares a const class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2) for the currently described class. |
| define | SB_CONST_FUNCTION_4 (OUTPUT, FUNCTION, T0, T1, T2, T3) Declares a const class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3) for the currently described class. |
| define | SB_CONST_FUNCTION_5 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4) Declares a const class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4) for the currently described class. |
| define | SB_CONST_FUNCTION_6 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5) Declares a const class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5) for the currently described class. |
| define | SB_CONST_FUNCTION_7 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6) Declares a const class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6) for the currently described class. |
| define | SB_CONST_FUNCTION_8 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7) Declares a const class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7) for the currently described class. |
| define | SB_CONST_FUNCTION_9 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8) Declares a const class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8) for the currently described class. |
| define | SB_CONST_FUNCTION_END This macro declares the end of a const function description started with SB_CONST_FUNCTION_0_BEGIN or SB_CONST_FUNCTION_N_BEGIN in the class interface (see Introspection ). |
| define | SB_CONST_FUNCTION_N_BEGIN (OUTPUT, FUNCTION, N, ...) A general and advanced way to declare a const function that takes N arguments (at least 1 argument): OUTPUT FUNCTION(T0..TN) const . |
| define | SB_FUNCTION_0 (OUTPUT, FUNCTION) Declares a class function (see Introspection ) OUTPUT FUNCTION() for the currently described class. |
| define | SB_FUNCTION_0_BEGIN (OUTPUT, FUNCTION) An advanced way to declare a function that takes no arguments: OUTPUT FUNCTION() . |
| define | SB_FUNCTION_1 (OUTPUT, FUNCTION, T0) Declares a class function (see Introspection ) OUTPUT FUNCTION(T0) for the currently described class. |
| define | SB_FUNCTION_10 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) Declares a class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9) for the currently described class. |
| define | SB_FUNCTION_11 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) Declares a class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10) for the currently described class. |
| define | SB_FUNCTION_12 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) Declares a class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11) for the currently described class. |
| define | SB_FUNCTION_13 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) Declares a class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12) for the currently described class. |
| define | SB_FUNCTION_14 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) Declares a class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13) for the currently described class. |
| define | SB_FUNCTION_15 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) Declares a class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14) for the currently described class. |
| define | SB_FUNCTION_16 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) Declares a class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15) for the currently described class. |
| define | SB_FUNCTION_2 (OUTPUT, FUNCTION, T0, T1) Declares a class function (see Introspection ) OUTPUT FUNCTION(T0,T1) for the currently described class. |
| define | SB_FUNCTION_3 (OUTPUT, FUNCTION, T0, T1, T2) Declares a class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2) for the currently described class. |
| define | SB_FUNCTION_4 (OUTPUT, FUNCTION, T0, T1, T2, T3) Declares a class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3) for the currently described class. |
| define | SB_FUNCTION_5 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4) Declares a class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4) for the currently described class. |
| define | SB_FUNCTION_6 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5) Declares a class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5) for the currently described class. |
| define | SB_FUNCTION_7 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6) Declares a class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6) for the currently described class. |
| define | SB_FUNCTION_8 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7) Declares a class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7) for the currently described class. |
| define | SB_FUNCTION_9 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8) Declares a class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8) for the currently described class. |
| define | SB_FUNCTION_END This macro declares the end of a const function description started with SB_FUNCTION_0_BEGIN or SB_FUNCTION_N_BEGIN in the class interface (see Introspection ). |
| define | SB_FUNCTION_N_BEGIN (OUTPUT, FUNCTION, N, ...) A general and advanced way to declare a function that takes N arguments (at least 1 argument): OUTPUT FUNCTION(T0..TN) . |
| define | SB_INHERIT (INTERFACE, CLASS, CLASS_INTERFACE) |
| define | SB_INTERFACE_BEGIN Declares the beginning of the class interface (see Introspection ) |
| define | SB_INTERFACE_END Declares the end of the class interface (see Introspection ) |
| define | SB_STATIC_ATTRIBUTE_BEGIN (ATTRIBUTE_ACCESS, ATTRIBUTE_TYPE, TYPE, NAME, DESCRIPTION, GROUP) A general and advanced way to declare a static attribute. |
| define | SB_STATIC_ATTRIBUTE_CLEAR (FUNCTION_NAME) This macro adds to the currently described attribute a function FUNCTION_NAME that clears the static attribute's value, if possible. |
| define | SB_STATIC_ATTRIBUTE_COMBO_BOX (NAME, DESCRIPTION, GROUP) An alias macro for SB_STATIC_ATTRIBUTE_READ_WRITE_LIST. |
| define | SB_STATIC_ATTRIBUTE_COMBO_BOX_RESET (NAME, DESCRIPTION, GROUP) An alias macro for SB_STATIC_ATTRIBUTE_READ_WRITE_RESET_LIST. |
| define | SB_STATIC_ATTRIBUTE_COUNT (FUNCTION_NAME) This macro adds to the currently described attribute a static function FUNCTION_NAME that returns the number of items of the static attribute. |
| define | SB_STATIC_ATTRIBUTE_DEFAULT (TYPE, FUNCTION_NAME) This macro adds to the currently described attribute a static function FUNCTION_NAME that returns the static attribute's default value. |
| define | SB_STATIC_ATTRIBUTE_ENABLED_FLAG (FUNCTION_NAME) This macro adds to the currently described attribute a function FUNCTION_NAME that returns whether the static attribute should be enabled in theInspector . |
| define | SB_STATIC_ATTRIBUTE_END This macro declares the end of a static attributed description started with SB_STATIC_ATTRIBUTE_BEGIN in the class interface (see Introspection ). |
| define | SB_STATIC_ATTRIBUTE_GET (TYPE, FUNCTION_NAME) This macro adds to the currently described attribute a function FUNCTION_NAME that gets the static attribute's value of typeTYPE . |
| define | SB_STATIC_ATTRIBUTE_GET_CURRENT_INDEX (FUNCTION_NAME) This macro adds to the currently described attribute a function FUNCTION_NAME that returns the static attribute's current index. |
| define | SB_STATIC_ATTRIBUTE_HAS (FUNCTION_NAME) This macro adds to the currently described attribute a function FUNCTION_NAME that returns whether the static attribute has a value when the static attribute is clearable. |
| define | SB_STATIC_ATTRIBUTE_ITEM_TEXT (FUNCTION_NAME) This macro adds to the currently described attribute a static function FUNCTION_NAME that returns the static attribute's text for the given index. |
| define | SB_STATIC_ATTRIBUTE_MAXIMUM (TYPE, FUNCTION_NAME) This macro adds to the currently described attribute a static function FUNCTION_NAME that returns the static attribute's maximum value. |
| define | SB_STATIC_ATTRIBUTE_MINIMUM (TYPE, FUNCTION_NAME) This macro adds to the currently described attribute a static function FUNCTION_NAME that returns the static attribute's minimum value. |
| define | SB_STATIC_ATTRIBUTE_PUSH_BUTTON (TEXT, DESCRIPTION, GROUP, CLICKED_SLOT) Declares a class function (see Introspection ) void CLICKED_SLOT() that should be exposed and accessible for users in theInspector in a groupGROUP with a descriptionDESCRIPTION . |
| define | SB_STATIC_ATTRIBUTE_READ_ONLY (TYPE, NAME, DESCRIPTION, GROUP) Declares a non-modifiable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION . |
| define | SB_STATIC_ATTRIBUTE_READ_WRITE (TYPE, NAME, DESCRIPTION, GROUP) Declares a modifiable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION and with the possibility to modify it using a line edit for numerical and string values, or a check box for boolean values. |
| define | SB_STATIC_ATTRIBUTE_READ_WRITE_CLEAR (TYPE, NAME, DESCRIPTION, GROUP) Declares a modifiable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION and with the possibility to modify it using a line edit for numerical and string values, or a check box for boolean values. |
| define | SB_STATIC_ATTRIBUTE_READ_WRITE_CLEAR_ARRAY (TYPE, NAME, DESCRIPTION, GROUP) Declares a modifiable array attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION . |
| define | SB_STATIC_ATTRIBUTE_READ_WRITE_LIST (NAME, DESCRIPTION, GROUP) Declares a modifiable attribute NAME from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION and with the possibility to choose from a list using a combo box. |
| define | SB_STATIC_ATTRIBUTE_READ_WRITE_RANGE (TYPE, NAME, DESCRIPTION, GROUP) Declares a modifiable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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. |
| define | SB_STATIC_ATTRIBUTE_READ_WRITE_RANGE_SLIDER (TYPE, NAME, DESCRIPTION, GROUP) Declares a modifiable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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. |
| define | SB_STATIC_ATTRIBUTE_READ_WRITE_RESET (TYPE, NAME, DESCRIPTION, GROUP) Declares a modifiable and resettable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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. |
| define | SB_STATIC_ATTRIBUTE_READ_WRITE_RESET_LIST (NAME, DESCRIPTION, GROUP) Declares a modifiable and resettable attribute NAME from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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. |
| define | SB_STATIC_ATTRIBUTE_READ_WRITE_RESET_RANGE (TYPE, NAME, DESCRIPTION, GROUP) Declares a modifiable and resettable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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. |
| define | SB_STATIC_ATTRIBUTE_READ_WRITE_RESET_RANGE_SLIDER (TYPE, NAME, DESCRIPTION, GROUP) Declares a modifiable and resettable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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. |
| define | SB_STATIC_ATTRIBUTE_RICH_TEXT_EDIT_READ_ONLY (NAME, DESCRIPTION, GROUP) Declares a non-modifiable rich text attribute NAME of typeconst std::string& from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION . |
| define | SB_STATIC_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE (NAME, DESCRIPTION, GROUP) Declares a modifiable rich text attribute NAME of typeconst std::string& from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION and with the possibility to modify it using a text edit. |
| define | SB_STATIC_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE_CLEAR (NAME, DESCRIPTION, GROUP) Declares a modifiable rich text attribute NAME of typeconst std::string& from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION and with the possibility to modify it using a text edit for numerical and string values, or a check box for boolean values. |
| define | SB_STATIC_ATTRIBUTE_SET (TYPE, FUNCTION_NAME) This macro adds to the currently described attribute a function FUNCTION_NAME that sets the static attribute's value of typeTYPE . |
| define | SB_STATIC_ATTRIBUTE_SET_CURRENT_INDEX (FUNCTION_NAME) This macro adds to the currently described attribute a function FUNCTION_NAME that sets the static attribute's current index to a specific index. |
| define | SB_STATIC_ATTRIBUTE_SINGLE_STEP (TYPE, FUNCTION_NAME) This macro adds to the currently described attribute a static function FUNCTION_NAME that returns the static attribute's single step value. |
| define | SB_STATIC_ATTRIBUTE_SIZE (FUNCTION_NAME) This macro adds to the currently described attribute a function FUNCTION_NAME that returns the size of the array attribute in an object when relevant. |
| define | SB_STATIC_ATTRIBUTE_SLIDER (TYPE, NAME, DESCRIPTION, GROUP) An alias macro for SB_STATIC_ATTRIBUTE_READ_WRITE_RANGE_SLIDER. |
| define | SB_STATIC_ATTRIBUTE_SLIDER_RESET (TYPE, NAME, DESCRIPTION, GROUP) An alias macro for SB_STATIC_ATTRIBUTE_READ_WRITE_RESET_RANGE_SLIDER. |
| define | SB_STATIC_ATTRIBUTE_SPIN_BOX (TYPE, NAME, DESCRIPTION, GROUP) An alias macro for SB_STATIC_ATTRIBUTE_READ_WRITE_RANGE. |
| define | SB_STATIC_ATTRIBUTE_SPIN_BOX_RESET (TYPE, NAME, DESCRIPTION, GROUP) An alias macro for SB_STATIC_ATTRIBUTE_READ_WRITE_RESET_RANGE. |
| define | SB_STATIC_ATTRIBUTE_SUFFIX (FUNCTION_NAME) This macro adds to the currently described attribute a static function FUNCTION_NAME that returns the static attribute's suffix string. |
| define | SB_STATIC_ATTRIBUTE_TOOL_TIP (FUNCTION_NAME) This macro adds to the currently described attribute a static function FUNCTION_NAME that returns the static attribute's tool tip. |
| define | SB_STATIC_ATTRIBUTE_VISIBILITY_FLAG (FUNCTION_NAME) This macro adds to the currently described attribute a function FUNCTION_NAME that returns whether the static attribute should be visible in theInspector . |
| define | SB_STATIC_FUNCTION_0 (OUTPUT, FUNCTION) Declares a static class function (see Introspection ) OUTPUT FUNCTION() for the currently described class. |
| define | SB_STATIC_FUNCTION_0_BEGIN (OUTPUT, FUNCTION) An advanced way to declare a static function that takes no arguments: static OUTPUT FUNCTION() . |
| define | SB_STATIC_FUNCTION_1 (OUTPUT, FUNCTION, T0) Declares a static class function (see Introspection ) OUTPUT FUNCTION(T0) for the currently described class. |
| define | SB_STATIC_FUNCTION_10 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) Declares a static class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9) for the currently described class. |
| define | SB_STATIC_FUNCTION_11 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) Declares a static class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10) for the currently described class. |
| define | SB_STATIC_FUNCTION_12 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) Declares a static class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11) for the currently described class. |
| define | SB_STATIC_FUNCTION_13 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) Declares a static class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12) for the currently described class. |
| define | SB_STATIC_FUNCTION_14 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) Declares a static class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13) for the currently described class. |
| define | SB_STATIC_FUNCTION_15 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) Declares a static class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14) for the currently described class. |
| define | SB_STATIC_FUNCTION_16 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) Declares a static class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15) for the currently described class. |
| define | SB_STATIC_FUNCTION_2 (OUTPUT, FUNCTION, T0, T1) Declares a static class function (see Introspection ) OUTPUT FUNCTION(T0,T1) for the currently described class. |
| define | SB_STATIC_FUNCTION_3 (OUTPUT, FUNCTION, T0, T1, T2) Declares a static class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2) for the currently described class. |
| define | SB_STATIC_FUNCTION_4 (OUTPUT, FUNCTION, T0, T1, T2, T3) Declares a static class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3) for the currently described class. |
| define | SB_STATIC_FUNCTION_5 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4) Declares a static class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4) for the currently described class. |
| define | SB_STATIC_FUNCTION_6 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5) Declares a static class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5) for the currently described class. |
| define | SB_STATIC_FUNCTION_7 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6) Declares a static class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6) for the currently described class. |
| define | SB_STATIC_FUNCTION_8 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7) Declares a static class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7) for the currently described class. |
| define | SB_STATIC_FUNCTION_9 (OUTPUT, FUNCTION, T0, T1, T2, T3, T4, T5, T6, T7, T8) Declares a static class function (see Introspection ) OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8) for the currently described class. |
| define | SB_STATIC_FUNCTION_END This macro declares the end of a static function description started with SB_STATIC_FUNCTION_0_BEGIN or SB_STATIC_FUNCTION_N_BEGIN in the class interface (see Introspection ). |
| define | SB_STATIC_FUNCTION_N_BEGIN (OUTPUT, FUNCTION, N, ...) A general and advanced way to declare a static function that takes N arguments (at least 1 argument): static OUTPUT FUNCTION(T0..TN) . |
Public Types Documentation#
typedef SBInterface#
The short name of SBCClassInterface .
Macro Definition Documentation#
define SB_ATTRIBUTE_BEGIN#
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 the currently described 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 currently described 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 currently described class:
bool getShowSpheres() const;
void setShowSpheres(bool value);
bool getShowSpheresEnabledFlag() const;
std::string 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_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_ATTRIBUTE_BEGIN(SBAttribute::Access::ReadWrite, SBAttribute::Type::Scalar, bool, ShowSpheres, "Show spheres", "Properties");
SB_ATTRIBUTE_GET(bool, getShowSpheres);
SB_ATTRIBUTE_SET(bool, setShowSpheres);
SB_ATTRIBUTE_ENABLED_FLAG(getShowSpheresEnabledFlag);
SB_ATTRIBUTE_TOOL_TIP(getShowSpheresToolTip);
SB_ATTRIBUTE_END;
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
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 currently described class:
SBQuantity::length getSphereRadius() const;
void setSphereRadius(SBQuantity::length value);
SBQuantity::length getMinimumSphereRadius() const;
SBQuantity::length getMaximumSphereRadius() const;
SBQuantity::length getSphereRadiusSingleStep() const;
SBQuantity::length getDefaultSphereRadius() const;
std::string getSphereRadiusSuffix() const;
bool 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_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_ATTRIBUTE_BEGIN(SBAttribute::Access::ReadWrite, SBAttribute::Type::Range, SBQuantity::length, SphereRadius, "Sphere radius", "Properties");
SB_ATTRIBUTE_GET(SBQuantity::length, getSphereRadius);
SB_ATTRIBUTE_SET(SBQuantity::length, setSphereRadius);
SB_ATTRIBUTE_MINIMUM(SBQuantity::length, getMinimumSphereRadius);
SB_ATTRIBUTE_MAXIMUM(SBQuantity::length, getMaximumSphereRadius);
SB_ATTRIBUTE_SINGLE_STEP(SBQuantity::length, getSphereRadiusSingleStep);
SB_ATTRIBUTE_DEFAULT(SBQuantity::length, getDefaultSphereRadius);
SB_ATTRIBUTE_SUFFIX(getSphereRadiusSuffix);
SB_ATTRIBUTE_VISIBILITY_FLAG(getSphereRadiusVisibilityFlag);
SB_ATTRIBUTE_END;
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
If any of the functions that return minimum, maximum, default, or single step values, tool tip, suffix, item count and item text, are static then you can use the corresponding SB_STATIC_ATTRIBUTE_* macros that expose static functions: SB_STATIC_ATTRIBUTE_MINIMUM, SB_STATIC_ATTRIBUTE_MAXIMUM, SB_STATIC_ATTRIBUTE_DEFAULT, SB_STATIC_ATTRIBUTE_SINGLE_STEP, SB_STATIC_ATTRIBUTE_SUFFIX, SB_STATIC_ATTRIBUTE_TOOL_TIP, SB_STATIC_ATTRIBUTE_COUNT, SB_STATIC_ATTRIBUTE_ITEM_TEXT.
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".
define SB_ATTRIBUTE_CLEAR#
This macro adds to the currently described attribute a function FUNCTION_NAME that clears the attribute's value, if possible.
See also: SB_ATTRIBUTE_BEGIN
define SB_ATTRIBUTE_COMBO_BOX#
An alias macro for SB_ATTRIBUTE_READ_WRITE_LIST.
define SB_ATTRIBUTE_COMBO_BOX_RESET#
An alias macro for SB_ATTRIBUTE_READ_WRITE_RESET_LIST.
define SB_ATTRIBUTE_COUNT#
This macro adds to the currently described attribute 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_STATIC_ATTRIBUTE_COUNT
define SB_ATTRIBUTE_DEFAULT#
This macro adds to the currently described attribute 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_STATIC_ATTRIBUTE_DEFAULT
define SB_ATTRIBUTE_ENABLED_FLAG#
This macro adds to the currently described attribute a function FUNCTION_NAME that returns whether the attribute should be enabled in theInspector .
See also: SB_ATTRIBUTE_BEGIN
define SB_ATTRIBUTE_END#
This macro declares the end of an attributed description started with SB_ATTRIBUTE_BEGIN in the class interface (see Introspection ).
See also: SB_ATTRIBUTE_BEGIN
define SB_ATTRIBUTE_GET#
This macro adds to the currently described attribute a function FUNCTION_NAME that gets the attribute's value of typeTYPE .
See also: SB_ATTRIBUTE_BEGIN
define SB_ATTRIBUTE_GET_CURRENT_INDEX#
This macro adds to the currently described attribute 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
define SB_ATTRIBUTE_HAS#
This macro adds to the currently described attribute a function FUNCTION_NAME that returns whether the attribute has a value when the attribute is clearable.
See also: SB_ATTRIBUTE_BEGIN
define SB_ATTRIBUTE_ITEM_TEXT#
This macro adds to the currently described attribute 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_STATIC_ATTRIBUTE_ITEM_TEXT
define SB_ATTRIBUTE_MAXIMUM#
This macro adds to the currently described attribute 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_STATIC_ATTRIBUTE_MAXIMUM
define SB_ATTRIBUTE_MINIMUM#
This macro adds to the currently described attribute 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_STATIC_ATTRIBUTE_MINIMUM
define SB_ATTRIBUTE_NON_CONST_GET#
This macro adds to the currently described attribute a non-const function FUNCTION_NAME that gets the attribute's value of typeTYPE .
See also: SB_ATTRIBUTE_BEGIN
define SB_ATTRIBUTE_PUSH_BUTTON#
Declares a class function (see Introspection )void CLICKED_SLOT() that should be exposed and accessible for users in theInspector in a groupGROUP with a descriptionDESCRIPTION .
The following functionality should be present in the currently described class:
- void 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 currently described class:
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_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_ATTRIBUTE_PUSH_BUTTON("Update", "Update", "Properties", requestUpdate);
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
See also: SB_ATTRIBUTE_PUSH_BUTTON_CONST, SB_ATTRIBUTE_PUSH_BUTTON_STATIC
See also: Introspection
define SB_ATTRIBUTE_PUSH_BUTTON_CONST#
Declares a const class function (see Introspection )void CLICKED_SLOT() const that should be exposed and accessible for users in theInspector in a groupGROUP with a descriptionDESCRIPTION .
The following functionality should be present in the currently described class:
- void 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
See also: Introspection
define SB_ATTRIBUTE_PUSH_BUTTON_STATIC#
Declares a static class function (see Introspection )void CLICKED_SLOT() that should be exposed and accessible for users in theInspector in a groupGROUP with a descriptionDESCRIPTION .
The following functionality should be present in the currently described class:
- static void 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
See also: Introspection
define SB_ATTRIBUTE_READ_ONLY#
Declares a non-modifiable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION .
String or numeric attributes will be shown as a text in a label, pointer attributes (e.g. a pointer to a SBMStructuralModelNodeAtom node) will be represented as a button.
The following functionality should be present in the currently described class:
- TYPE 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 currently described class:
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_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_ATTRIBUTE_READ_ONLY(unsigned int, NumberOfEdges, "Number of edges", "Properties");
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
See also: SB_ATTRIBUTE_READ_WRITE, SB_ATTRIBUTE_READ_WRITE_CLEAR
See also: Introspection
define SB_ATTRIBUTE_READ_ONLY_NONCONST#
Declares a non-modifiable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION .
String or numeric attributes will be shown as a text in a label, pointer attributes (e.g. a pointer to a SBMStructuralModelNodeAtom 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 currently described class:
- TYPE 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 currently described class:
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_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_ATTRIBUTE_READ_ONLY_NONCONST(unsigned int, NumberOfEdges, "Number of edges", "Properties");
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
See also: SB_ATTRIBUTE_READ_ONLY, SB_ATTRIBUTE_READ_WRITE
See also: Introspection
define SB_ATTRIBUTE_READ_WRITE#
Declares a modifiable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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 currently described class:
- TYPE getNAME() const; - returns the value.
- void 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 currently described class:
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_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_ATTRIBUTE_READ_WRITE(bool, ShowLines, "Show lines", "Properties");
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
See also: SB_ATTRIBUTE_READ_ONLY, SB_ATTRIBUTE_READ_WRITE_RESET, SB_ATTRIBUTE_READ_WRITE_CLEAR
See also: Introspection
define SB_ATTRIBUTE_READ_WRITE_CLEAR#
Declares a modifiable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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 currently described class:
- TYPE getNAME() const; - returns the value if set.
- void setNAME(TYPE value); - sets the value.
- bool hasNAME(); - returns
trueof the attribute is set. - void 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 currently described class:
const std::string& getComment() const;
void setComment(const std::string& value);
bool hasComment();
void 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_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_ATTRIBUTE_READ_WRITE_CLEAR(const std::string&, Comment, "Comment", "Information");
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
See also: SB_ATTRIBUTE_READ_ONLY, SB_ATTRIBUTE_READ_WRITE
See also: Introspection
define SB_ATTRIBUTE_READ_WRITE_CLEAR_ARRAY#
Declares a modifiable array attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION .
See also: SB_ATTRIBUTE_READ_WRITE_CLEAR
See also: Introspection
define SB_ATTRIBUTE_READ_WRITE_LIST#
Declares a modifiable attribute NAME from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION and with the possibility to choose from a list using a combo box.
The following functionality should be present in the currently described class:
- int getNAMECount() const; - returns the number of elements in the list.
- int getNAMECurrentIndex() const; - returns the current value's index in the list.
- void setNAMECurrentIndex(const int); - sets the current value based on the index in the list.
- std::string 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 currently described class:
int getVisualPresetCount() const;
int getVisualPresetCurrentIndex() const;
void setVisualPresetCurrentIndex(const int);
std::string 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_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_ATTRIBUTE_READ_WRITE_LIST(VisualPreset, "Visual preset", "Properties");
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
See also: SB_ATTRIBUTE_READ_WRITE_RESET_LIST
See also: Introspection
define SB_ATTRIBUTE_READ_WRITE_RANGE#
Declares a modifiable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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 currently described class:
- TYPE getNAME() const; - returns the value.
- void setNAME(TYPE value); - sets the value.
- TYPE getMinimumNAME() const; - returns the minimum value.
- TYPE getMaximumNAME() const; - returns the maximum value.
- TYPE getNAMESingleStep() const; - returns the single step value.
- std::string getNAMESuffix() const; - returns a suffix string used for the representation of the current value if the
TYPEis 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 currently described class:
const SBQuantity::length& getRadius() const;
void setRadius(const SBQuantity::length& value);
const SBQuantity::length& getMinimumRadius() const;
const SBQuantity::length& getMaximumRadius() const;
const SBQuantity::length& getRadiusSingleStep() const;
std::string 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_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_ATTRIBUTE_READ_WRITE_RANGE(const SBQuantity::length&, Radius, "Radius", "Properties");
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
See also: SB_ATTRIBUTE_READ_WRITE_RESET_RANGE, SB_ATTRIBUTE_READ_WRITE_RANGE_SLIDER
See also: Introspection
define SB_ATTRIBUTE_READ_WRITE_RANGE_SLIDER#
Declares a modifiable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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 currently described class:
- TYPE getNAME() const; - returns the value.
- void setNAME(TYPE value); - sets the value.
- TYPE getMinimumNAME() const; - returns the minimum value.
- TYPE getMaximumNAME() const; - returns the maximum value.
- TYPE getNAMESingleStep() const; - returns the single step value.
- std::string getNAMESuffix() const; - returns a suffix string used for the representation of the current value if the
TYPEis 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 currently described class:
unsigned int getOpacity();
void setOpacity(unsigned int value);
unsigned int getMinimumOpacity();
unsigned int getMaximumOpacity();
unsigned int getOpacitySingleStep();
std::string 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_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_ATTRIBUTE_READ_WRITE_RANGE_SLIDER(unsigned int, Opacity, "Opacity", "Properties");
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
See also: SB_ATTRIBUTE_READ_WRITE_RANGE, SB_ATTRIBUTE_READ_WRITE_RESET_RANGE_SLIDER
See also: Introspection
define SB_ATTRIBUTE_READ_WRITE_RESET#
Declares a modifiable and resettable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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 currently described class:
- TYPE getNAME() const; - returns the value.
- void setNAME(TYPE value); - sets the value.
- TYPE 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 currently described class:
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_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_ATTRIBUTE_READ_WRITE_RESET(float, Scale, "Scale", "Properties");
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
See also: SB_ATTRIBUTE_READ_ONLY, SB_ATTRIBUTE_READ_WRITE
See also: Introspection
define SB_ATTRIBUTE_READ_WRITE_RESET_LIST#
Declares a modifiable and resettable attribute NAME from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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 currently described class:
- int getNAMECount() const; - returns the number of elements in the list.
- int getDefaultNAMEIndex() const; - returns the default value's index in the list.
- int getNAMECurrentIndex() const; - returns the current value's index in the list.
- void setNAMECurrentIndex(const int); - sets the current value based on the index in the list.
- std::string 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 currently described class:
int getVisualPresetCount() const;
int getDefaultVisualPresetIndex() const;
int getVisualPresetCurrentIndex() const;
void setVisualPresetCurrentIndex(const int);
std::string 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_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_ATTRIBUTE_READ_WRITE_RESET_LIST(VisualPreset, "Visual preset", "Properties");
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
See also: SB_ATTRIBUTE_READ_WRITE_LIST
See also: Introspection
define SB_ATTRIBUTE_READ_WRITE_RESET_RANGE#
Declares a modifiable and resettable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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 currently described class:
- TYPE getNAME() const; - returns the value.
- void setNAME(TYPE value); - sets the value.
- TYPE getDefaultNAME() const; - returns the default value.
- TYPE getMinimumNAME() const; - returns the minimum value.
- TYPE getMaximumNAME() const; - returns the maximum value.
- TYPE getNAMESingleStep() const; - returns the single step value.
- std::string getNAMESuffix() const; - returns a suffix string used for the representation of the current value if the
TYPEis 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 currently described class:
const SBQuantity::length& getRadius() const;
void setRadius(const SBQuantity::length& value);
const SBQuantity::length& getDefaultRadius() const;
const SBQuantity::length& getMinimumRadius() const;
const SBQuantity::length& getMaximumRadius() const;
const SBQuantity::length& getRadiusSingleStep() const;
std::string 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_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_ATTRIBUTE_READ_WRITE_RESET_RANGE(const SBQuantity::length&, Radius, "Radius", "Properties");
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
See also: SB_ATTRIBUTE_READ_WRITE_RANGE, SB_ATTRIBUTE_READ_WRITE_RESET_RANGE_SLIDER
See also: Introspection
define SB_ATTRIBUTE_READ_WRITE_RESET_RANGE_SLIDER#
Declares a modifiable and resettable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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 currently described class:
- TYPE getNAME() const; - returns the value.
- void setNAME(TYPE value); - sets the value.
- TYPE getDefaultNAME() const; - returns the default value.
- TYPE getMinimumNAME() const; - returns the minimum value.
- TYPE getMaximumNAME() const; - returns the maximum value.
- TYPE getNAMESingleStep() const; - returns the single step value.
- std::string getNAMESuffix() const; - returns a suffix string used for the representation of the current value if the
TYPEis 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 currently described class:
unsigned int getOpacity() const;
void setOpacity(unsigned int value);
unsigned int getDefaultOpacity() const;
unsigned int getMinimumOpacity() const;
unsigned int getMaximumOpacity() const;
unsigned int getOpacitySingleStep() const;
std::string 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_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_ATTRIBUTE_READ_WRITE_RESET_RANGE_SLIDER(unsigned int, Opacity, "Opacity", "Properties");
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
See also: SB_ATTRIBUTE_READ_WRITE_RANGE_SLIDER, SB_ATTRIBUTE_READ_WRITE_RESET_RANGE
See also: Introspection
define SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_ONLY#
Declares a non-modifiable rich text attribute NAME of typeconst std::string& from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION .
The rich text will be shown in a text edit.
The following functionality should be present in the currently described class:
- const std::string& 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 currently described class:
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_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_ONLY(Description, "Description", "Information");
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
See also: SB_ATTRIBUTE_READ_ONLY, SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE_CLEAR, SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE_CLEAR
See also: Introspection
define SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE#
Declares a modifiable rich text attribute NAME of typeconst std::string& from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION and with the possibility to modify it using a text edit.
The following functionality should be present in the currently described class:
- const std::string& getNAME() const; - returns an std::string with rich text.
- void 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 currently described class:
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_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE(Notes, "Notes", "Information");
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
See also: SB_ATTRIBUTE_READ_WRITE, SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_ONLY, SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE_CLEAR
See also: Introspection
define SB_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE_CLEAR#
Declares a modifiable rich text attribute NAME of typeconst std::string& from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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
See also: Introspection
define SB_ATTRIBUTE_SET#
This macro adds to the currently described attribute a function FUNCTION_NAME that sets the attribute's value of typeTYPE .
See also: SB_ATTRIBUTE_BEGIN
define SB_ATTRIBUTE_SET_CURRENT_INDEX#
This macro adds to the currently described attribute 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
define SB_ATTRIBUTE_SINGLE_STEP#
This macro adds to the currently described attribute 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_STATIC_ATTRIBUTE_SINGLE_STEP
define SB_ATTRIBUTE_SIZE#
This macro adds to the currently described attribute a function FUNCTION_NAME that returns the size of the array attribute in an object when relevant.
See also: SB_ATTRIBUTE_BEGIN
define SB_ATTRIBUTE_SLIDER#
An alias macro for SB_ATTRIBUTE_READ_WRITE_RANGE_SLIDER.
define SB_ATTRIBUTE_SLIDER_RESET#
An alias macro for SB_ATTRIBUTE_READ_WRITE_RESET_RANGE_SLIDER.
define SB_ATTRIBUTE_SPIN_BOX#
An alias macro for SB_ATTRIBUTE_READ_WRITE_RANGE.
define SB_ATTRIBUTE_SPIN_BOX_RESET#
An alias macro for SB_ATTRIBUTE_READ_WRITE_RESET_RANGE.
define SB_ATTRIBUTE_SUFFIX#
This macro adds to the currently described attribute 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_STATIC_ATTRIBUTE_BEGIN
define SB_ATTRIBUTE_TOOL_TIP#
This macro adds to the currently described attribute a static function FUNCTION_NAME that returns the attribute's tool tip.
See also: SB_ATTRIBUTE_BEGIN, SB_STATIC_ATTRIBUTE_TOOL_TIP
define SB_ATTRIBUTE_VISIBILITY_FLAG#
This macro adds to the currently described attribute a function FUNCTION_NAME that returns whether the attribute should be visible in theInspector .
See also: SB_ATTRIBUTE_BEGIN
define SB_CONST_FUNCTION_0#
Declares a const class function (see Introspection )OUTPUT FUNCTION() for the currently described class.
define SB_CONST_FUNCTION_0_BEGIN#
An advanced way to declare a const function that takes no arguments: OUTPUT FUNCTION() const .
This advanced declaration is used to provide documentation for a const function. If you don't need to provide documentation, then you can use the SB_CONST_FUNCTION_0 macro.
Let's say you have a class SEMyClass with a const function int getCurrentIndex() const, then, in the class descriptor file, you can expose it as follows:
SB_CLASS_BEGIN(SEMyClass);
// ...
SB_INTERFACE_BEGIN;
SB_CONST_FUNCTION_0_BEGIN(int, getCurrentIndex)
SB_CALLABLE_MEMBER_DOC_BRIEF("Returns the current index"),
SB_CONST_FUNCTION_END
SB_INTERFACE_END;
// ...
SB_CLASS_END(SEMyClass);
See: Introspection
See also: SB_CONST_FUNCTION_END, SB_CONST_FUNCTION_N_BEGIN, SB_FUNCTION_0_BEGIN, SB_STATIC_FUNCTION_0_BEGIN
define SB_CONST_FUNCTION_1#
Declares a const class function (see Introspection )OUTPUT FUNCTION(T0) for the currently described class.
define SB_CONST_FUNCTION_10#
Declares a const class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9) for the currently described class.
define SB_CONST_FUNCTION_11#
Declares a const class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10) for the currently described class.
define SB_CONST_FUNCTION_12#
Declares a const class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11) for the currently described class.
define SB_CONST_FUNCTION_13#
Declares a const class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12) for the currently described class.
#define SB_CONST_FUNCTION_13 (
OUTPUT,
FUNCTION,
T0,
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12
)
define SB_CONST_FUNCTION_14#
Declares a const class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13) for the currently described class.
#define SB_CONST_FUNCTION_14 (
OUTPUT,
FUNCTION,
T0,
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13
)
define SB_CONST_FUNCTION_15#
Declares a const class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14) for the currently described class.
#define SB_CONST_FUNCTION_15 (
OUTPUT,
FUNCTION,
T0,
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14
)
define SB_CONST_FUNCTION_16#
Declares a const class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15) for the currently described class.
#define SB_CONST_FUNCTION_16 (
OUTPUT,
FUNCTION,
T0,
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15
)
define SB_CONST_FUNCTION_2#
Declares a const class function (see Introspection )OUTPUT FUNCTION(T0,T1) for the currently described class.
define SB_CONST_FUNCTION_3#
Declares a const class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2) for the currently described class.
define SB_CONST_FUNCTION_4#
Declares a const class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3) for the currently described class.
define SB_CONST_FUNCTION_5#
Declares a const class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4) for the currently described class.
define SB_CONST_FUNCTION_6#
Declares a const class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5) for the currently described class.
define SB_CONST_FUNCTION_7#
Declares a const class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6) for the currently described class.
define SB_CONST_FUNCTION_8#
Declares a const class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7) for the currently described class.
define SB_CONST_FUNCTION_9#
Declares a const class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8) for the currently described class.
define SB_CONST_FUNCTION_END#
This macro declares the end of a const function description started with SB_CONST_FUNCTION_0_BEGIN or SB_CONST_FUNCTION_N_BEGIN in the class interface (see Introspection ).
See also: SB_CONST_FUNCTION_0_BEGIN, SB_CONST_FUNCTION_N_BEGIN
define SB_CONST_FUNCTION_N_BEGIN#
A general and advanced way to declare a const function that takes N arguments (at least 1 argument): OUTPUT FUNCTION(T0..TN) const .
Types of arguments are provided after N.
This advanced declaration is used to provide documentation for a const function. If you don't need to provide documentation, then you can use the SB_CONST_FUNCTION_N (change N to the actual number of parameters) macro.
Let's say you have a class SEMyClass with a const function double getValue(unsigned int i) const, then, in the class descriptor file, you can expose it as follows:
SB_CLASS_BEGIN(SEMyClass);
// ...
SB_INTERFACE_BEGIN;
SB_CONST_FUNCTION_N_BEGIN(double, getValue, 1, unsigned int)
SB_CALLABLE_MEMBER_DOC_BRIEF("Returns the i-th value"),
SB_CALLABLE_MEMBER_DOC_PARAM("i", "index")
SB_CONST_FUNCTION_END
SB_INTERFACE_END;
// ...
SB_CLASS_END(SEMyClass);
See Introspection
See also: SB_CONST_FUNCTION_END, SB_CONST_FUNCTION_0_BEGIN, SB_FUNCTION_N_BEGIN, SB_STATIC_FUNCTION_N_BEGIN
define SB_FUNCTION_0#
Declares a class function (see Introspection )OUTPUT FUNCTION() for the currently described class.
define SB_FUNCTION_0_BEGIN#
An advanced way to declare a function that takes no arguments: OUTPUT FUNCTION() .
This advanced declaration is used to provide documentation for a function. If you don't need to provide documentation, then you can use the SB_FUNCTION_0 macro.
Let's say you have a class SEMyClass with a function void update(), then, in the class descriptor file, you can expose it as follows:
SB_CLASS_BEGIN(SEMyClass);
// ...
SB_INTERFACE_BEGIN;
SB_FUNCTION_0_BEGIN(void, update)
SB_CALLABLE_MEMBER_DOC_BRIEF("Requests update"),
SB_FUNCTION_END
SB_INTERFACE_END;
// ...
SB_CLASS_END(SEMyClass);
See: Introspection
See also: SB_UNCTION_END, SB_FUNCTION_N_BEGIN, SB_CONST_FUNCTION_0_BEGIN, SB_STATIC_FUNCTION_0_BEGIN
define SB_FUNCTION_1#
Declares a class function (see Introspection )OUTPUT FUNCTION(T0) for the currently described class.
define SB_FUNCTION_10#
Declares a class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9) for the currently described class.
define SB_FUNCTION_11#
Declares a class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10) for the currently described class.
define SB_FUNCTION_12#
Declares a class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11) for the currently described class.
define SB_FUNCTION_13#
Declares a class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12) for the currently described class.
define SB_FUNCTION_14#
Declares a class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13) for the currently described class.
#define SB_FUNCTION_14 (
OUTPUT,
FUNCTION,
T0,
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13
)
define SB_FUNCTION_15#
Declares a class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14) for the currently described class.
#define SB_FUNCTION_15 (
OUTPUT,
FUNCTION,
T0,
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14
)
define SB_FUNCTION_16#
Declares a class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15) for the currently described class.
#define SB_FUNCTION_16 (
OUTPUT,
FUNCTION,
T0,
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15
)
define SB_FUNCTION_2#
Declares a class function (see Introspection )OUTPUT FUNCTION(T0,T1) for the currently described class.
define SB_FUNCTION_3#
Declares a class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2) for the currently described class.
define SB_FUNCTION_4#
Declares a class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3) for the currently described class.
define SB_FUNCTION_5#
Declares a class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4) for the currently described class.
define SB_FUNCTION_6#
Declares a class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5) for the currently described class.
define SB_FUNCTION_7#
Declares a class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6) for the currently described class.
define SB_FUNCTION_8#
Declares a class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7) for the currently described class.
define SB_FUNCTION_9#
Declares a class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8) for the currently described class.
define SB_FUNCTION_END#
This macro declares the end of a const function description started with SB_FUNCTION_0_BEGIN or SB_FUNCTION_N_BEGIN in the class interface (see Introspection ).
See also: SB_FUNCTION_0_BEGIN, SB_FUNCTION_N_BEGIN
define SB_FUNCTION_N_BEGIN#
A general and advanced way to declare a function that takes N arguments (at least 1 argument): OUTPUT FUNCTION(T0..TN) .
Types of arguments are provided after N.
This advanced declaration is used to provide documentation for a function. If you don't need to provide documentation, then you can use the SB_FUNCTION_N (change N to the actual number of parameters) macro.
Let's say you have a class SEMyClass with a function void applyTransform(const SBSpatialTransform& transform), then, in the class descriptor file, you can expose it as follows:
SB_CLASS_BEGIN(SEMyClass);
// ...
SB_INTERFACE_BEGIN;
SB_FUNCTION_N_BEGIN(void, applyTransform, 1, const SBSpatialTransform&)
SB_CALLABLE_MEMBER_DOC_BRIEF("Applies a spatial transform to internal data"),
SB_CALLABLE_MEMBER_DOC_PARAM("transform", "a spatial transform")
SB_FUNCTION_END
SB_INTERFACE_END;
// ...
SB_CLASS_END(SEMyClass);
See Introspection
See also: SB_FUNCTION_END, SB_FUNCTION_0_BEGIN, SB_CONST_FUNCTION_N_BEGIN, SB_STATIC_FUNCTION_N_BEGIN
define SB_INHERIT#
define SB_INTERFACE_BEGIN#
Declares the beginning of the class interface (see Introspection )
define SB_INTERFACE_END#
Declares the end of the class interface (see Introspection )
define SB_STATIC_ATTRIBUTE_BEGIN#
A general and advanced way to declare a static attribute.
#define SB_STATIC_ATTRIBUTE_BEGIN (
ATTRIBUTE_ACCESS,
ATTRIBUTE_TYPE,
TYPE,
NAME,
DESCRIPTION,
GROUP
)
Note: For a list of a single-line convenience descriptions of static attributes check the next section "Convenience descriptions of static attributes".
Declares a static attribute NAME of type TYPE from the currently described 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 static 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 static attribute should be present in the currently described 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 a static 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 currently described class:
static bool getShowSpheres();
static void setShowSpheres(bool value);
static bool getShowSpheresEnabledFlag();
static std::string getShowSpheresToolTip();
Then, in the class descriptor file, you can expose the static attribute with its functionality in the Inspector as follows:
SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_STATIC_ATTRIBUTE_BEGIN(SBAttribute::Access::ReadWrite, SBAttribute::Type::Scalar, bool, ShowSpheres, "Show spheres", "Properties");
SB_STATIC_ATTRIBUTE_GET(bool, getShowSpheres);
SB_STATIC_ATTRIBUTE_SET(bool, setShowSpheres);
SB_STATIC_ATTRIBUTE_ENABLED_FLAG(getShowSpheresEnabledFlag);
SB_STATIC_ATTRIBUTE_TOOL_TIP(getShowSpheresToolTip);
SB_STATIC_ATTRIBUTE_END;
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
Let's say that we now want to expose in the Inspector a static 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 currently described class:
static SBQuantity::length getSphereRadius();
static void setSphereRadius(SBQuantity::length value);
static SBQuantity::length getMinimumSphereRadius();
static SBQuantity::length getMaximumSphereRadius();
static SBQuantity::length getSphereRadiusSingleStep();
static SBQuantity::length getDefaultSphereRadius();
static std::string getSphereRadiusSuffix();
static bool getSphereRadiusVisibilityFlag();
And we want to expose it as a double spin box. Then, in the class descriptor file, you can expose the static attribute with its functionality in the Inspector as follows:
SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_STATIC_ATTRIBUTE_BEGIN(SBAttribute::Access::ReadWrite, SBAttribute::Type::Range, SBQuantity::length, SphereRadius, "Sphere radius", "Properties");
SB_STATIC_ATTRIBUTE_GET(SBQuantity::length, getSphereRadius);
SB_STATIC_ATTRIBUTE_SET(SBQuantity::length, setSphereRadius);
SB_STATIC_ATTRIBUTE_MINIMUM(SBQuantity::length, getMinimumSphereRadius);
SB_STATIC_ATTRIBUTE_MAXIMUM(SBQuantity::length, getMaximumSphereRadius);
SB_STATIC_ATTRIBUTE_SINGLE_STEP(SBQuantity::length, getSphereRadiusSingleStep);
SB_STATIC_ATTRIBUTE_DEFAULT(SBQuantity::length, getDefaultSphereRadius);
SB_STATIC_ATTRIBUTE_SUFFIX(getSphereRadiusSuffix);
SB_STATIC_ATTRIBUTE_VISIBILITY_FLAG(getSphereRadiusVisibilityFlag);
SB_STATIC_ATTRIBUTE_END;
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
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 static attributes".
define SB_STATIC_ATTRIBUTE_CLEAR#
This macro adds to the currently described attribute a function FUNCTION_NAME that clears the static attribute's value, if possible.
See also: SB_STATIC_ATTRIBUTE_BEGIN
define SB_STATIC_ATTRIBUTE_COMBO_BOX#
An alias macro for SB_STATIC_ATTRIBUTE_READ_WRITE_LIST.
define SB_STATIC_ATTRIBUTE_COMBO_BOX_RESET#
An alias macro for SB_STATIC_ATTRIBUTE_READ_WRITE_RESET_LIST.
define SB_STATIC_ATTRIBUTE_COUNT#
This macro adds to the currently described attribute a static function FUNCTION_NAME that returns the number of items of the static attribute.
This is required if you would like to represent the static attribute in the Inspector as a combo box.
See also: SB_STATIC_ATTRIBUTE_BEGIN
define SB_STATIC_ATTRIBUTE_DEFAULT#
This macro adds to the currently described attribute a static function FUNCTION_NAME that returns the static attribute's default value.
This is required if you would like to make it possible for the user to reset the static attribute's object value to a default one.
See also: SB_STATIC_ATTRIBUTE_BEGIN
define SB_STATIC_ATTRIBUTE_ENABLED_FLAG#
This macro adds to the currently described attribute a function FUNCTION_NAME that returns whether the static attribute should be enabled in theInspector .
See also: SB_STATIC_ATTRIBUTE_BEGIN
define SB_STATIC_ATTRIBUTE_END#
This macro declares the end of a static attributed description started with SB_STATIC_ATTRIBUTE_BEGIN in the class interface (see Introspection ).
See also: SB_STATIC_ATTRIBUTE_BEGIN
define SB_STATIC_ATTRIBUTE_GET#
This macro adds to the currently described attribute a function FUNCTION_NAME that gets the static attribute's value of typeTYPE .
See also: SB_STATIC_ATTRIBUTE_BEGIN
define SB_STATIC_ATTRIBUTE_GET_CURRENT_INDEX#
This macro adds to the currently described attribute a function FUNCTION_NAME that returns the static attribute's current index.
This is required if you would like to represent the static attribute in the Inspector as a combo box.
See also: SB_STATIC_ATTRIBUTE_BEGIN
define SB_STATIC_ATTRIBUTE_HAS#
This macro adds to the currently described attribute a function FUNCTION_NAME that returns whether the static attribute has a value when the static attribute is clearable.
See also: SB_STATIC_ATTRIBUTE_BEGIN
define SB_STATIC_ATTRIBUTE_ITEM_TEXT#
This macro adds to the currently described attribute a static function FUNCTION_NAME that returns the static attribute's text for the given index.
This is required if you would like to represent the static attribute in the Inspector as a combo box - it is used to populate it with text items.
See also: SB_STATIC_ATTRIBUTE_BEGIN
define SB_STATIC_ATTRIBUTE_MAXIMUM#
This macro adds to the currently described attribute a static function FUNCTION_NAME that returns the static attribute's maximum value.
This is required if you would like to represent the static attribute in the Inspector as a spin box or a slider.
See also: SB_STATIC_ATTRIBUTE_BEGIN
define SB_STATIC_ATTRIBUTE_MINIMUM#
This macro adds to the currently described attribute a static function FUNCTION_NAME that returns the static attribute's minimum value.
This is required if you would like to represent the static attribute in the Inspector as a spin box or a slider.
See also: SB_STATIC_ATTRIBUTE_BEGIN
define SB_STATIC_ATTRIBUTE_PUSH_BUTTON#
Declares a class function (see Introspection )void CLICKED_SLOT() that should be exposed and accessible for users in theInspector in a groupGROUP with a descriptionDESCRIPTION .
The following functionality should be present in the currently described class:
- static void 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.
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 currently described class:
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_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_STATIC_ATTRIBUTE_PUSH_BUTTON("Update", "Update", "Properties", requestUpdate);
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
See also: SB_STATIC_ATTRIBUTE_PUSH_BUTTON_CONST, SB_STATIC_ATTRIBUTE_PUSH_BUTTON_STATIC
See also: Introspection
define SB_STATIC_ATTRIBUTE_READ_ONLY#
Declares a non-modifiable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION .
String or numeric attributes will be shown as a text in a label, pointer attributes (e.g. a pointer to a SBMStructuralModelNodeAtom node) will be represented as a button.
The following functionality should be present in the currently described class:
- static TYPE getNAME(); - returns the value.
Note that this macro also exposes the abovementioned functions associated with a static attribute NAME, so you do not need to expose them using e.g. SB_STATIC_FUNCTION_0 macros.
Example:
Let's say that we want to expose in the Inspector a static attribute called "NumberOfEdges" of type "unsigned int" from a class called "SEMyVisualModel". You need to have the following functions implemented in the currently described class:
Then, in the class descriptor file, you can expose this functionality and the static attribute in the Inspector as follows:
SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_STATIC_ATTRIBUTE_READ_ONLY(unsigned int, NumberOfEdges, "Number of edges", "Properties");
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
See also: SB_STATIC_ATTRIBUTE_READ_WRITE, SB_STATIC_ATTRIBUTE_READ_WRITE_CLEAR
See also: Introspection
define SB_STATIC_ATTRIBUTE_READ_WRITE#
Declares a modifiable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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 currently described class:
- static TYPE getNAME(); - returns the value.
- static void setNAME(TYPE value); - sets the value.
Note that this macro also exposes the abovementioned functions associated with a static attribute NAME, so you do not need to expose them using e.g. SB_STATIC_FUNCTION_1 macros.
Example:
Let's say that we want to expose in the Inspector a static attribute called "ShowLines" of type "bool" from a class called "SEMyVisualModel". You need to have the following functions implemented in the currently described class:
Then, in the class descriptor file, you can expose this functionality and the static attribute in the Inspector as follows:
SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_STATIC_ATTRIBUTE_READ_WRITE(bool, ShowLines, "Show lines", "Properties");
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
See also: SB_STATIC_ATTRIBUTE_READ_ONLY, SB_STATIC_ATTRIBUTE_READ_WRITE_RESET, SB_STATIC_ATTRIBUTE_READ_WRITE_CLEAR
See also: Introspection
define SB_STATIC_ATTRIBUTE_READ_WRITE_CLEAR#
Declares a modifiable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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 currently described class:
- static TYPE getNAME(); - returns the value if set.
- static void setNAME(TYPE value); - sets the value.
- static bool hasNAME(); - returns
trueof the static attribute is set. - static void clearNAME(); - clears the static attribute.
Note that this macro also exposes the abovementioned functions associated with a static attribute NAME, so you do not need to expose them using e.g. SB_STATIC_FUNCTION_1 macros.
Example:
Let's say that we want to expose in the Inspector a static attribute called "Comment" of type std::string from a class called "SEMyVisualModel". You need to have the following functions implemented in the currently described class:
static const std::string& getComment();
static void setComment(const std::string& value);
static bool hasComment();
static void clearComment();
Then, in the class descriptor file, you can expose this functionality and the static attribute in the Inspector as follows:
SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_STATIC_ATTRIBUTE_READ_WRITE_CLEAR(const std::string&, Comment, "Comment", "Information");
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
See also: SB_STATIC_ATTRIBUTE_READ_ONLY, SB_STATIC_ATTRIBUTE_READ_WRITE
See also: Introspection
define SB_STATIC_ATTRIBUTE_READ_WRITE_CLEAR_ARRAY#
Declares a modifiable array attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION .
See also: SB_STATIC_ATTRIBUTE_READ_WRITE_CLEAR
See also: Introspection
define SB_STATIC_ATTRIBUTE_READ_WRITE_LIST#
Declares a modifiable attribute NAME from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION and with the possibility to choose from a list using a combo box.
The following functionality should be present in the currently described class:
- static int getNAMECount(); - returns the number of elements in the list.
- static int getNAMECurrentIndex(); - returns the current value's index in the list.
- static void setNAMECurrentIndex(const int); - sets the current value based on the index in the list.
- static std::string getNAMEItemText(const int); - returns a string representation of the list items.
Note that this macro also exposes the abovementioned functions associated with a static attribute NAME, so you do not need to expose them using e.g. SB_STATIC_FUNCTION_1 macros.
Example:
Let's say that we want to expose in the Inspector a static 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 currently described class:
static int getVisualPresetCount();
static int getVisualPresetCurrentIndex();
static void setVisualPresetCurrentIndex(const int);
static std::string getVisualPresetItemText(const int);
Then, in the class descriptor file, you can expose this functionality and the static attribute in the Inspector as follows:
SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_STATIC_ATTRIBUTE_READ_WRITE_LIST(VisualPreset, "Visual preset", "Properties");
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
See also: SB_STATIC_ATTRIBUTE_READ_WRITE_RESET_LIST
See also: Introspection
define SB_STATIC_ATTRIBUTE_READ_WRITE_RANGE#
Declares a modifiable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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 currently described class:
- static TYPE getNAME(); - returns the value.
- static void setNAME(TYPE value); - sets the value.
- static TYPE getMinimumNAME(); - returns the minimum value.
- static TYPE getMaximumNAME(); - returns the maximum value.
- static TYPE getNAMESingleStep(); - returns the single step value.
- static std::string getNAMESuffix(); - returns a suffix string used for the representation of the current value if the
TYPEis not of the SBQuantity type.
Note that this macro also exposes the abovementioned functions associated with a static attribute NAME, so you do not need to expose them using e.g. SB_STATIC_FUNCTION_1 macros.
Example:
Let's say that we want to expose in the Inspector a static attribute called "Radius" of type "SBQuantity::length" from a class called "SEMyVisualModel". You need to have the following functions implemented in the currently described class:
static const SBQuantity::length& getRadius();
static void setRadius(const SBQuantity::length& value);
static const SBQuantity::length& getMinimumRadius();
static const SBQuantity::length& getMaximumRadius();
static const SBQuantity::length& getRadiusSingleStep();
static std::string getRadiusSuffix();
Then, in the class descriptor file, you can expose this functionality and the static attribute in the Inspector as follows:
SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_STATIC_ATTRIBUTE_READ_WRITE_RANGE(const SBQuantity::length&, Radius, "Radius", "Properties");
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
See also: SB_STATIC_ATTRIBUTE_READ_WRITE_RESET_RANGE, SB_STATIC_ATTRIBUTE_READ_WRITE_RANGE_SLIDER
See also: Introspection
define SB_STATIC_ATTRIBUTE_READ_WRITE_RANGE_SLIDER#
Declares a modifiable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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 currently described class:
- static TYPE getNAME(); - returns the value.
- static void setNAME(TYPE value); - sets the value.
- static TYPE getMinimumNAME(); - returns the minimum value.
- static TYPE getMaximumNAME(); - returns the maximum value.
- static TYPE getNAMESingleStep(); - returns the single step value.
- static std::string getNAMESuffix(); - returns a suffix string used for the representation of the current value if the
TYPEis not of the SBQuantity type.
Note that this macro also exposes the abovementioned functions associated with a static attribute NAME, so you do not need to expose them using e.g. SB_STATIC_FUNCTION_1 macros.
Example:
Let's say that we want to expose in the Inspector a static 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 currently described class:
static unsigned int getOpacity();
static void setOpacity(unsigned int value);
static unsigned int getMinimumOpacity();
static unsigned int getMaximumOpacity();
static unsigned int getOpacitySingleStep();
static std::string getOpacitySuffix();
Then, in the class descriptor file, you can expose this functionality and the static attribute in the Inspector as follows:
SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_STATIC_ATTRIBUTE_READ_WRITE_RANGE_SLIDER(unsigned int, Opacity, "Opacity", "Properties");
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
See also: SB_STATIC_ATTRIBUTE_READ_WRITE_RANGE, SB_STATIC_ATTRIBUTE_READ_WRITE_RESET_RANGE_SLIDER
See also: Introspection
define SB_STATIC_ATTRIBUTE_READ_WRITE_RESET#
Declares a modifiable and resettable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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 currently described class:
- static TYPE getNAME(); - returns the value.
- static void setNAME(TYPE value); - sets the value.
- static TYPE getDefaultNAME(); - returns the default value.
Note that this macro also exposes the abovementioned functions associated with a static attribute NAME, so you do not need to expose them using e.g. SB_STATIC_FUNCTION_1 macros.
Example:
Let's say that we want to expose in the Inspector a static attribute called "Scale" of type "float" from a class called "SEMyVisualModel". You need to have the following functions implemented in the currently described class:
Then, in the class descriptor file, you can expose this functionality and the static attribute in the Inspector as follows:
SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_STATIC_ATTRIBUTE_READ_WRITE_RESET(float, Scale, "Scale", "Properties");
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
See also: SB_STATIC_ATTRIBUTE_READ_ONLY, SB_STATIC_ATTRIBUTE_READ_WRITE
See also: Introspection
define SB_STATIC_ATTRIBUTE_READ_WRITE_RESET_LIST#
Declares a modifiable and resettable attribute NAME from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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 currently described class:
- static int getNAMECount(); - returns the number of elements in the list.
- static int getDefaultNAMEIndex(); - returns the default value's index in the list.
- static int getNAMECurrentIndex(); - returns the current value's index in the list.
- static void setNAMECurrentIndex(const int); - sets the current value based on the index in the list.
- static std::string getNAMEItemText(const int); - returns a string representation of the list items.
Note that this macro also exposes the abovementioned functions associated with a static attribute NAME, so you do not need to expose them using e.g. SB_STATIC_FUNCTION_1 macros.
Example:
Let's say that we want to expose in the Inspector a static 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 currently described class:
static int getVisualPresetCount();
static int getDefaultVisualPresetIndex();
static int getVisualPresetCurrentIndex();
static void setVisualPresetCurrentIndex(const int);
static std::string getVisualPresetItemText(const int);
Then, in the class descriptor file, you can expose this functionality and the static attribute in the Inspector as follows:
SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_STATIC_ATTRIBUTE_READ_WRITE_RESET_LIST(VisualPreset, "Visual preset", "Properties");
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
See also: SB_STATIC_ATTRIBUTE_READ_WRITE_LIST
See also: Introspection
define SB_STATIC_ATTRIBUTE_READ_WRITE_RESET_RANGE#
Declares a modifiable and resettable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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 currently described class:
- static TYPE getNAME(); - returns the value.
- static void setNAME(TYPE value); - sets the value.
- static TYPE getDefaultNAME(); - returns the default value.
- static TYPE getMinimumNAME(); - returns the minimum value.
- static TYPE getMaximumNAME(); - returns the maximum value.
- static TYPE getNAMESingleStep(); - returns the single step value.
- static std::string getNAMESuffix(); - returns a suffix string used for the representation of the current value if the
TYPEis not of the SBQuantity type.
Note that this macro also exposes the abovementioned functions associated with a static attribute NAME, so you do not need to expose them using e.g. SB_STATIC_FUNCTION_1 macros.
Example:
Let's say that we want to expose in the Inspector a static attribute called "Radius" of type "SBQuantity::length" from a class called "SEMyVisualModel". You need to have the following functions implemented in the currently described class:
static const SBQuantity::length& getRadius();
static void setRadius(const SBQuantity::length& value);
static const SBQuantity::length& getDefaultRadius();
static const SBQuantity::length& getMinimumRadius();
static const SBQuantity::length& getMaximumRadius();
static const SBQuantity::length& getRadiusSingleStep();
static std::string getRadiusSuffix();
Then, in the class descriptor file, you can expose this functionality and the static attribute in the Inspector as follows:
SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_STATIC_ATTRIBUTE_READ_WRITE_RESET_RANGE(const SBQuantity::length&, Radius, "Radius", "Properties");
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
See also: SB_STATIC_ATTRIBUTE_READ_WRITE_RANGE, SB_STATIC_ATTRIBUTE_READ_WRITE_RESET_RANGE_SLIDER
See also: Introspection
define SB_STATIC_ATTRIBUTE_READ_WRITE_RESET_RANGE_SLIDER#
Declares a modifiable and resettable attribute NAME of typeTYPE from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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 currently described class:
- static TYPE getNAME(); - returns the value.
- static void setNAME(TYPE value); - sets the value.
- static TYPE getDefaultNAME(); - returns the default value.
- static TYPE getMinimumNAME(); - returns the minimum value.
- static TYPE getMaximumNAME(); - returns the maximum value.
- static TYPE getNAMESingleStep(); - returns the single step value.
- static std::string getNAMESuffix(); - returns a suffix string used for the representation of the current value if the
TYPEis not of the SBQuantity type.
Note that this macro also exposes the abovementioned functions associated with a static attribute NAME, so you do not need to expose them using e.g. SB_STATIC_FUNCTION_1 macros.
Example:
Let's say that we want to expose in the Inspector a static 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 currently described class:
static unsigned int getOpacity();
static void setOpacity(unsigned int value);
static unsigned int getDefaultOpacity();
static unsigned int getMinimumOpacity();
static unsigned int getMaximumOpacity();
static unsigned int getOpacitySingleStep();
static std::string getOpacitySuffix();
Then, in the class descriptor file, you can expose this functionality and the static attribute in the Inspector as follows:
SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_STATIC_ATTRIBUTE_READ_WRITE_RESET_RANGE_SLIDER(unsigned int, Opacity, "Opacity", "Properties");
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
See also: SB_STATIC_ATTRIBUTE_READ_WRITE_RANGE_SLIDER, SB_STATIC_ATTRIBUTE_READ_WRITE_RESET_RANGE
See also: Introspection
define SB_STATIC_ATTRIBUTE_RICH_TEXT_EDIT_READ_ONLY#
Declares a non-modifiable rich text attribute NAME of typeconst std::string& from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION .
The rich text will be shown in a text edit.
The following functionality should be present in the currently described class:
- static const std::string& getNAME(); - returns an std::string with rich text.
Note that this macro also exposes the abovementioned functions associated with a static attribute NAME, so you do not need to expose them using e.g. SB_STATIC_FUNCTION_1 macros.
Example:
Let's say that we want to expose in the Inspector a static attribute with a text description called "Description" from a class called "SEMyVisualModel". You need to have the following functions implemented in the currently described class:
Then, in the class descriptor file, you can expose this functionality and the static attribute in the Inspector as follows:
SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_STATIC_ATTRIBUTE_RICH_TEXT_EDIT_READ_ONLY(Description, "Description", "Information");
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
See also: SB_STATIC_ATTRIBUTE_READ_ONLY, SB_STATIC_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE_CLEAR, SB_STATIC_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE_CLEAR
See also: Introspection
define SB_STATIC_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE#
Declares a modifiable rich text attribute NAME of typeconst std::string& from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION and with the possibility to modify it using a text edit.
The following functionality should be present in the currently described class:
- static const std::string& getNAME(); - returns an std::string with rich text.
- static void setNAME(const std::string& value); - sets the text.
Note that this macro also exposes the abovementioned functions associated with a static attribute NAME, so you do not need to expose them using e.g. SB_STATIC_FUNCTION_1 macros.
Example:
Let's say that we want to expose in the Inspector a static attribute with rich text called "Notes" from a class called "SEMyVisualModel". You need to have the following functions implemented in the currently described class:
Then, in the class descriptor file, you can expose this functionality and the static attribute in the Inspector as follows:
SB_CLASS_BEGIN(SEMyVisualModel);
SB_CLASS_TYPE(SBCClass::VisualModel);
SB_CLASS_DESCRIPTION("MyVisualModel class description");
SB_CLASS_VERSION_NUMBER("0.1.0");
SB_FACTORY_BEGIN;
SB_CONSTRUCTOR_0();
SB_FACTORY_END;
SB_INTERFACE_BEGIN;
SB_STATIC_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE(Notes, "Notes", "Information");
SB_INTERFACE_END;
SB_CLASS_END(SEMyVisualModel);
See also: SB_STATIC_ATTRIBUTE_READ_WRITE, SB_STATIC_ATTRIBUTE_RICH_TEXT_EDIT_READ_ONLY, SB_STATIC_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE_CLEAR
See also: Introspection
define SB_STATIC_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE_CLEAR#
Declares a modifiable rich text attribute NAME of typeconst std::string& from the currently described class which associated functionality should be exposed and which should also be accessible for users in theInspector in a groupGROUP with a description nameDESCRIPTION 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_STATIC_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE and SB_STATIC_ATTRIBUTE_READ_WRITE_CLEAR
See also: SB_STATIC_ATTRIBUTE_RICH_TEXT_EDIT_READ_ONLY, SB_STATIC_ATTRIBUTE_RICH_TEXT_EDIT_READ_WRITE
See also: Introspection
define SB_STATIC_ATTRIBUTE_SET#
This macro adds to the currently described attribute a function FUNCTION_NAME that sets the static attribute's value of typeTYPE .
See also: SB_STATIC_ATTRIBUTE_BEGIN
define SB_STATIC_ATTRIBUTE_SET_CURRENT_INDEX#
This macro adds to the currently described attribute a function FUNCTION_NAME that sets the static attribute's current index to a specific index.
This is required if you would like to represent the static attribute in the Inspector as a combo box.
See also: SB_STATIC_ATTRIBUTE_BEGIN
define SB_STATIC_ATTRIBUTE_SINGLE_STEP#
This macro adds to the currently described attribute a static function FUNCTION_NAME that returns the static attribute's single step value.
This is required if you would like to represent the static attribute in the Inspector as a spin box or a slider.
See also: SB_STATIC_ATTRIBUTE_BEGIN
define SB_STATIC_ATTRIBUTE_SIZE#
This macro adds to the currently described attribute a function FUNCTION_NAME that returns the size of the array attribute in an object when relevant.
See also: SB_STATIC_ATTRIBUTE_BEGIN
define SB_STATIC_ATTRIBUTE_SLIDER#
An alias macro for SB_STATIC_ATTRIBUTE_READ_WRITE_RANGE_SLIDER.
define SB_STATIC_ATTRIBUTE_SLIDER_RESET#
An alias macro for SB_STATIC_ATTRIBUTE_READ_WRITE_RESET_RANGE_SLIDER.
define SB_STATIC_ATTRIBUTE_SPIN_BOX#
An alias macro for SB_STATIC_ATTRIBUTE_READ_WRITE_RANGE.
define SB_STATIC_ATTRIBUTE_SPIN_BOX_RESET#
An alias macro for SB_STATIC_ATTRIBUTE_READ_WRITE_RESET_RANGE.
define SB_STATIC_ATTRIBUTE_SUFFIX#
This macro adds to the currently described attribute a static function FUNCTION_NAME that returns the static attribute's suffix string.
This is required if you would like to represent the static attribute in the Inspector as a spin box or a slider.
See also: SB_STATIC_ATTRIBUTE_BEGIN
define SB_STATIC_ATTRIBUTE_TOOL_TIP#
This macro adds to the currently described attribute a static function FUNCTION_NAME that returns the static attribute's tool tip.
See also: SB_STATIC_ATTRIBUTE_BEGIN
define SB_STATIC_ATTRIBUTE_VISIBILITY_FLAG#
This macro adds to the currently described attribute a function FUNCTION_NAME that returns whether the static attribute should be visible in theInspector .
See also: SB_STATIC_ATTRIBUTE_BEGIN
define SB_STATIC_FUNCTION_0#
Declares a static class function (see Introspection )OUTPUT FUNCTION() for the currently described class.
define SB_STATIC_FUNCTION_0_BEGIN#
An advanced way to declare a static function that takes no arguments: static OUTPUT FUNCTION() .
This advanced declaration is used to provide documentation for a static function. If you don't need to provide documentation, then you can use the SB_STATIC_FUNCTION_0 macro.
Let's say you have a class SEMyClass with a static function static std::string getExePath(), then, in the class descriptor file, you can expose it as follows:
SB_CLASS_BEGIN(SEMyClass);
// ...
SB_INTERFACE_BEGIN;
SB_STATIC_FUNCTION_0_BEGIN(std::string, getExePath)
SB_CALLABLE_MEMBER_DOC_BRIEF("Returns a path to the executable"),
SB_STATIC_FUNCTION_END
SB_INTERFACE_END;
// ...
SB_CLASS_END(SEMyClass);
See: Introspection
See also: SB_STATIC_FUNCTION_END, SB_STATIC_FUNCTION_N_BEGIN, SB_FUNCTION_0_BEGIN, SB_CONST_FUNCTION_0_BEGIN
define SB_STATIC_FUNCTION_1#
Declares a static class function (see Introspection )OUTPUT FUNCTION(T0) for the currently described class.
define SB_STATIC_FUNCTION_10#
Declares a static class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9) for the currently described class.
define SB_STATIC_FUNCTION_11#
Declares a static class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10) for the currently described class.
define SB_STATIC_FUNCTION_12#
Declares a static class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11) for the currently described class.
#define SB_STATIC_FUNCTION_12 (
OUTPUT,
FUNCTION,
T0,
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11
)
define SB_STATIC_FUNCTION_13#
Declares a static class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12) for the currently described class.
#define SB_STATIC_FUNCTION_13 (
OUTPUT,
FUNCTION,
T0,
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12
)
define SB_STATIC_FUNCTION_14#
Declares a static class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13) for the currently described class.
#define SB_STATIC_FUNCTION_14 (
OUTPUT,
FUNCTION,
T0,
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13
)
define SB_STATIC_FUNCTION_15#
Declares a static class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14) for the currently described class.
#define SB_STATIC_FUNCTION_15 (
OUTPUT,
FUNCTION,
T0,
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14
)
define SB_STATIC_FUNCTION_16#
Declares a static class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15) for the currently described class.
#define SB_STATIC_FUNCTION_16 (
OUTPUT,
FUNCTION,
T0,
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15
)
define SB_STATIC_FUNCTION_2#
Declares a static class function (see Introspection )OUTPUT FUNCTION(T0,T1) for the currently described class.
define SB_STATIC_FUNCTION_3#
Declares a static class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2) for the currently described class.
define SB_STATIC_FUNCTION_4#
Declares a static class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3) for the currently described class.
define SB_STATIC_FUNCTION_5#
Declares a static class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4) for the currently described class.
define SB_STATIC_FUNCTION_6#
Declares a static class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5) for the currently described class.
define SB_STATIC_FUNCTION_7#
Declares a static class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6) for the currently described class.
define SB_STATIC_FUNCTION_8#
Declares a static class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7) for the currently described class.
define SB_STATIC_FUNCTION_9#
Declares a static class function (see Introspection )OUTPUT FUNCTION(T0,T1,T2,T3,T4,T5,T6,T7,T8) for the currently described class.
define SB_STATIC_FUNCTION_END#
This macro declares the end of a static function description started with SB_STATIC_FUNCTION_0_BEGIN or SB_STATIC_FUNCTION_N_BEGIN in the class interface (see Introspection ).
See also: SB_STATIC_FUNCTION_0_BEGIN, SB_STATIC_FUNCTION_N_BEGIN
define SB_STATIC_FUNCTION_N_BEGIN#
A general and advanced way to declare a static function that takes N arguments (at least 1 argument): static OUTPUT FUNCTION(T0..TN) .
Types of arguments are provided after N.
This advanced declaration is used to provide documentation for a static function. If you don't need to provide documentation, then you can use the SB_STATIC_FUNCTION_N (change N to the actual number of parameters) macro.
Let's say you have a class SEMyClass with a static function static float sum(float v1, float v2), then, in the class descriptor file, you can expose it as follows:
SB_CLASS_BEGIN(SEMyClass);
// ...
SB_INTERFACE_BEGIN;
SB_STATIC_FUNCTION_N_BEGIN(float, sum, 2, float, float)
SB_CALLABLE_MEMBER_DOC_BRIEF("Returns a sum of two floats"),
SB_CALLABLE_MEMBER_DOC_PARAM("v1", "first value"),
SB_CALLABLE_MEMBER_DOC_PARAM("v2", "second value")
SB_STATIC_FUNCTION_END
SB_INTERFACE_END;
// ...
SB_CLASS_END(SEMyClass);
See Introspection
See also: SB_STATIC_FUNCTION_END, SB_STATIC_FUNCTION_0_BEGIN, SB_FUNCTION_N_BEGIN, SB_CONST_FUNCTION_N_BEGIN