3DCoat
3D-COAT 4.9.xx
3DCoat is the one application that has all the tools you need to take your 3D idea from a block of digital clay all the way to a production ready, fully textured organic or hard surface model.
|
The document describes macro definitions used to register members using BaseClass approach. More...
Macros | |
#define | SERIALIZE() |
SERIALIZE() { ... } used to register variables and functions in the class. There are no input parameters. More... | |
#define | SERIALIZE_LATER() |
SERIALIZE_LATER() used to register variables and functions in the class. . More... | |
#define | SERIALIZE_NOW(x) |
SERIALIZE_NOW(classname) { ... } used to register variables and functions in the class if SERIALIZE_LATER() was declared in the class. More... | |
#define | FUNCTION_CALL(...) |
FUNCTION_CALL(method[,name,function_parameters]) used to register any function calls. More... | |
#define | LAMBDA_CALL(...) |
LAMBDA_CALL(method[,name,function_parameters]) used to register any function calls. More... | |
#define | ICON_BUTTON(...) |
Register function call as button. More... | |
#define | LAMBDA_ICON_BUTTON(...) |
Register function call as button. More... | |
#define | STATE_BUTTON(name, variable, value) REG_TYPE_ANYTHING(variable, __state, name, (void*)cPtrDiff(value)) |
STATE_BUTTON(var_name, int_variable_ref, ethalon_value) used to register state button. More... | |
#define | REG_AUTO(...) REG_AUTO_MACRO_CHOOSER(__VA_ARGS__) |
REG_AUTO(variable[,name]) used to register variables in the class. More... | |
#define | _EACH(bcptr, be) |
_EACH(bcptr, be) - Walk through class members using the macro. It is most time effective method of access to all class fields. More... | |
#define | _EACH_END |
_EACH_END - End of _EACH ... _EACH_END cycle More... | |
#define | _EACH_FAST_END |
_EACH_FAST_END - In case when you don't need stringual name of member you may walk faster, in this case use _EACH ... _EACH_FAST_END cycle. More... | |
#define | BCPrintf(...) ((ForEachElem || (result && required_index == 0)) ? comms::cStr::Format(__VA_ARGS__) : comms::cStr::Empty) |
BCPrintf(...) - Use it if you want to compose name of object using printf - like syntax. Don't use sprintf directly, because BCPrintf makes string only when it is required, not each time when function called. More... | |
#define | DELIMITER |
DELIMITER adds the delimiter in UI. More... | |
#define | REG_DROPLIST(fieldID, name, EnumID) |
REG_DROPLIST(fieldID, name, EnumID) adds the droplist to UI, list into XML. The referred variable should be int. More... | |
#define | MAKE_ENUMERATOR(name, content) |
Make Enumerator in just one line. More... | |
#define | UI_LAYOUT(str) |
UI_LAYOUT(str) splits ui elements to several columns with proportional or fixed width. More... | |
#define | UI_ONLY |
UI_ONLY and SAVE_ONLY used if you want to register UI section and Serialization sections separately . More... | |
#define | SAVE_ONLY |
SAVE_ONLY used to start serialization (only) definition section. Look UI_ONLY for details and example. More... | |
#define | SAVE_OR_UI(save, ui) |
SAVE_OR_UI used to start conditional serialization or UI definition section. More... | |
#define | SLIDER(var, name, minvalue, maxvalue) |
SLIDER(var,name,minvalue,maxvalue) to add integer/float slider in UI. Only float and int supported. More... | |
#define | FSLIDER(var, name, minvalue, maxvalue, VisModulator, Inverse) |
FSLIDER(var,name,minvalue,maxvalue,scale,inversion) to add float slider in UI. It has a bit extended syntax, allows scaling and inversion. More... | |
#define | FILEPATH(str, name, mask) |
use FILEPATH(str, name, mask) to add file selection control in UI. Only comms::cStr supported More... | |
#define | REG_TEXTURE_2(x, y) |
use REG_TEXTURE(var[,name]) to register texture image in UI/XML More... | |
#define | REG_VECTOR2D(vec) {INVISIBLE REG_MEMBER(_float,vec.x);INVISIBLE REG_MEMBER(_float,vec.y);} |
register cVec2 More... | |
#define | REG_RCT(R) {REG_MEMBER(_float,R.x);REG_MEMBER(_float,R.y);REG_MEMBER(_float,R.w);REG_MEMBER(_float,R.h);} |
register Rct More... | |
#define | REG_VECTOR3D(vec) {INVISIBLE REG_MEMBER(_float,vec.x);INVISIBLE REG_MEMBER(_float,vec.y);INVISIBLE REG_MEMBER(_float,vec.z);} |
register Vector3D More... | |
#define | REG_VECTOR4D(vec) {INVISIBLE REG_MEMBER(_float,vec.x);INVISIBLE REG_MEMBER(_float,vec.y);INVISIBLE REG_MEMBER(_float,vec.z);INVISIBLE REG_MEMBER(_float,vec.w);} |
register Vector4D More... | |
#define | REG_MATRIX4D(mat) {for(int i=0;i<4;i++)for(int j=0;j<4;j++){INVISIBLE REG_MEMBER_EX2(_float,mat.Elem(i,j),BCPrintf("%s%d%d",#mat,i,j));}} |
register Matrix4D More... | |
#define | REG_MATRIX3D(mat) {for(int i=0;i<3;i++)for(int j=0;j<3;j++){INVISIBLE REG_MEMBER_EX2(_float,mat.Elem(i,j),BCPrintf("%s%d%d",#mat,i,j));}} |
register Matrix3D More... | |
#define | NOHASH if(!hash) |
Don't use fields in hash calculations. More... | |
#define | INVISIBLE __FIELD(Visible,false); |
An element which invisible in UI, but use in serialization. More... | |
#define | READONLY __FIELD(ReadOnly,true); |
An unediting element. More... | |
#define | NOSAVE __FIELD(Serialize,false); |
An element which visible in UI, but not use in serialization. More... | |
#define | NORESET __FIELD(Noreset,true); |
Element will not be initialised during reset_class. More... | |
#define | NONAME __FIELD(Noname,true); |
ID of the element is invisible in UI. More... | |
#define | RENAME(id) __ADDREG(cStr("[NAME ") + cStr(id) + cStr("]")); |
assign other ID in UI for the control More... | |
#define | ICON(path) __ADDREG("[ICON "##path##"]"); |
Insert icon if control supports. More... | |
#define | CHK_GROUP(g) __ADDREG("[GROUP "#g"]"); |
specify group for checkbox. More... | |
#define | APPLYSCALE __ADDREG("[APPLYSCALE]"); |
apply scene scale to this control More... | |
#define | SKIPHINT __ADDREG("[NOHINT]"); |
suppress hint for this element More... | |
#define | DEFHOTKEY(combo) __ADDREG("[HOTKEY "##combo"]"); |
assign default hotkey to the UI element, like HOTKEY("CTRL E") More... | |
#define | LEFTALIGN __ADDREG("[LALIGN]"); |
force left-align to the control More... | |
#define | REG_OPT(x) __ADDREG(x); |
#define | REG_COORD(x, y, z) |
Place 3 lines of code in correspondence with current coordinate system - Y-up or Z-up. More... | |
#define | _MAKE_ONCE |
_MAKE_ONCE - Make some action within brackets {...} once More... | |
#define | DEFINE_SECTION(x) DEFINE_SECTION_SR(x, true) |
Define the collapsable section of parameters. More... | |
The document describes macro definitions used to register members using BaseClass approach.
#define _EACH | ( | bcptr, | |
be | |||
) |
_EACH(bcptr, be) - Walk through class members using the macro. It is most time effective method of access to all class fields.
bcptr | BaseClass pointer |
be | BaseClassElement to be referred within the cycle. |
#define _EACH_END |
_EACH_END - End of _EACH ... _EACH_END cycle
#define _EACH_FAST_END |
_EACH_FAST_END - In case when you don't need stringual name of member you may walk faster, in this case use _EACH ... _EACH_FAST_END cycle.
#define _MAKE_ONCE |
_MAKE_ONCE - Make some action within brackets {...} once
#define APPLYSCALE __ADDREG("[APPLYSCALE]"); |
apply scene scale to this control
#define BCPrintf | ( | ... | ) | ((ForEachElem || (result && required_index == 0)) ? comms::cStr::Format(__VA_ARGS__) : comms::cStr::Empty) |
BCPrintf(...) - Use it if you want to compose name of object using printf - like syntax. Don't use sprintf directly, because BCPrintf makes string only when it is required, not each time when function called.
#define CHK_GROUP | ( | g | ) | __ADDREG("[GROUP "#g"]"); |
specify group for checkbox.
#define DEFHOTKEY | ( | combo | ) | __ADDREG("[HOTKEY "##combo"]"); |
assign default hotkey to the UI element, like HOTKEY("CTRL E")
#define DEFINE_SECTION | ( | x | ) | DEFINE_SECTION_SR(x, true) |
Define the collapsable section of parameters.
#define DELIMITER |
#define FILEPATH | ( | str, | |
name, | |||
mask | |||
) |
use FILEPATH(str, name, mask) to add file selection control in UI. Only comms::cStr supported
str | - string variable reference |
name | - name in UI |
mask | - mask for files, like "save:*.tif;*.tiff;*.exr;*.tga;*.bmp;*.png" (save dialog) or "load:*.tif;*.tiff;*.exr;*.tga;*.bmp;*.png" (open dialog) |
Example:
#define FSLIDER | ( | var, | |
name, | |||
minvalue, | |||
maxvalue, | |||
VisModulator, | |||
Inverse | |||
) |
FSLIDER(var,name,minvalue,maxvalue,scale,inversion) to add float slider in UI. It has a bit extended syntax, allows scaling and inversion.
var | variable ref |
name | name in UI |
minvalue | minimal value |
maxvalue | maximal value |
scale | scaling value (100 if percents expected) |
inversion | true if value inverted, scale/value will be displayed |
Example:
#define FUNCTION_CALL | ( | ... | ) |
FUNCTION_CALL(method[,name,function_parameters]) used to register any function calls.
method | name of the function to call. |
name | Optional identifier in UI for this function. The identifier there can't be result of calculation, you can't pass the string there, only literal identifier. If you want to pass string as identifier use RENAME(string) FUNCTION_CALL(function); |
function_parameters | if function has parameters, pass it there |
Example:
#define ICON | ( | path | ) | __ADDREG("[ICON "##path##"]"); |
Insert icon if control supports.
#define ICON_BUTTON | ( | ... | ) |
Register function call as button.
icon | All icons are placed in material.io/icons/black/ folder. Place new icons there, black icons on transparent |
name | The hint in UIbackground. Keep material.io style. |
method | The function name to call |
Usually this method used to create bottom toolset for the class like in VoxTree, Layers, Retopo groups.
Class registration looks like:
#define INVISIBLE __FIELD(Visible,false); |
An element which invisible in UI, but use in serialization.
#define LAMBDA_CALL | ( | ... | ) |
LAMBDA_CALL(method[,name,function_parameters]) used to register any function calls.
method | name of the function to call. |
name | Optional identifier in UI for this function. The identifier there can't be result of calculation, you can't pass the string there, only literal identifier. If you want to pass string as identifier use RENAME(string) FUNCTION_CALL(function); |
function_parameters | if function has parameters, pass it there |
Example:
#define LAMBDA_ICON_BUTTON | ( | ... | ) |
Register function call as button.
icon | All icons are placed in material.io/icons/black/ folder. Place new icons there, black icons on transparent |
name | The hint in UIbackground. Keep material.io style. |
method | The function name to call |
Usually this method used to create bottom toolset for the class like in VoxTree, Layers, Retopo groups.
Class registration looks like:
#define LEFTALIGN __ADDREG("[LALIGN]"); |
force left-align to the control
#define MAKE_ENUMERATOR | ( | name, | |
content | |||
) |
Make Enumerator in just one line.
name | Enumerator name |
content | List of items "Item1,Item2,...." |
#define NOHASH if(!hash) |
Don't use fields in hash calculations.
#define NONAME __FIELD(Noname,true); |
ID of the element is invisible in UI.
#define NORESET __FIELD(Noreset,true); |
Element will not be initialised during reset_class.
#define NOSAVE __FIELD(Serialize,false); |
An element which visible in UI, but not use in serialization.
#define READONLY __FIELD(ReadOnly,true); |
An unediting element.
#define REG_AUTO | ( | ... | ) | REG_AUTO_MACRO_CHOOSER(__VA_ARGS__) |
REG_AUTO(variable[,name]) used to register variables in the class.
method | name of the function to call if you want to rename it for UI/XML add second parameter |
name | optional, if present, used as identifier in UI for this variable, othervice variable name used. |
Example:
#define REG_COORD | ( | x, | |
y, | |||
z | |||
) |
Place 3 lines of code in correspondence with current coordinate system - Y-up or Z-up.
x | X - related item |
y | Y - related item |
z | Z - related item |
#define REG_DROPLIST | ( | fieldID, | |
name, | |||
EnumID | |||
) |
REG_DROPLIST(fieldID, name, EnumID) adds the droplist to UI, list into XML. The referred variable should be int.
fieldID | - variable reference, should be int |
name | - name in UI/XML |
EnumID | - enumerator reference. Maybe identifier like "enum_name" or explicit list of items like "Item1|Item2|Item3". See example for details. |
Example:
#define REG_MATRIX3D | ( | mat | ) | {for(int i=0;i<3;i++)for(int j=0;j<3;j++){INVISIBLE REG_MEMBER_EX2(_float,mat.Elem(i,j),BCPrintf("%s%d%d",#mat,i,j));}} |
register Matrix3D
#define REG_MATRIX4D | ( | mat | ) | {for(int i=0;i<4;i++)for(int j=0;j<4;j++){INVISIBLE REG_MEMBER_EX2(_float,mat.Elem(i,j),BCPrintf("%s%d%d",#mat,i,j));}} |
register Matrix4D
#define REG_OPT | ( | x | ) | __ADDREG(x); |
Use REG_OPT to pass different settings to Class Editor. All settings should be quoted with "". We recommend using the individual defines above instead of REG_OPT for the prettiness of the code.
Possible options:
Value | Description |
---|---|
[NAME NewName] | assign other ID/Name for this control |
[COLOR 0xXX...] | specify color for the control. |
[FONTCOLOR 0xXX....] | specify font color. |
[NOHINT] | don't use hint for the control. |
[LALIGN] | force left align. |
[TRIAL] | not allowed in trial mode. |
[TABMASK MaskValue] | mask for tabs (like in settings). |
[SPLIT] | insert split icon for formatting. |
[ICON PathToIcon] | insert icon if control supports. |
[HOTKEY keycombo] | default hotkeys combination. |
[write something except keywords] | just something to make identifier unique and don't show the tag in UI. |
#define REG_RCT | ( | R | ) | {REG_MEMBER(_float,R.x);REG_MEMBER(_float,R.y);REG_MEMBER(_float,R.w);REG_MEMBER(_float,R.h);} |
register Rct
#define REG_TEXTURE_2 | ( | x, | |
y | |||
) |
use REG_TEXTURE(var[,name]) to register texture image in UI/XML
x | - int variable reference |
name | - name in UI/XML, optional parameter, if not present the variable name used |
#define REG_VECTOR2D | ( | vec | ) | {INVISIBLE REG_MEMBER(_float,vec.x);INVISIBLE REG_MEMBER(_float,vec.y);} |
register cVec2
#define REG_VECTOR3D | ( | vec | ) | {INVISIBLE REG_MEMBER(_float,vec.x);INVISIBLE REG_MEMBER(_float,vec.y);INVISIBLE REG_MEMBER(_float,vec.z);} |
register Vector3D
#define REG_VECTOR4D | ( | vec | ) | {INVISIBLE REG_MEMBER(_float,vec.x);INVISIBLE REG_MEMBER(_float,vec.y);INVISIBLE REG_MEMBER(_float,vec.z);INVISIBLE REG_MEMBER(_float,vec.w);} |
register Vector4D
#define RENAME | ( | id | ) | __ADDREG(cStr("[NAME ") + cStr(id) + cStr("]")); |
assign other ID in UI for the control
#define SAVE_ONLY |
SAVE_ONLY used to start serialization (only) definition section. Look UI_ONLY for details and example.
If you are using UI_ONLY or SAVE_ONLY, all commands like NOSAVE and INVISIBLE are ignored
If you are using UI_ONLY or SAVE_ONLY, all commands like NOSAVE and INVISIBLE are ignored
Example:
#define SAVE_OR_UI | ( | save, | |
ui | |||
) |
SAVE_OR_UI used to start conditional serialization or UI definition section.
Example:
#define SERIALIZE | ( | ) |
SERIALIZE() { ... } used to register variables and functions in the class. There are no input parameters.
Example:
#define SERIALIZE_LATER | ( | ) |
SERIALIZE_LATER() used to register variables and functions in the class.
.
The registration should be placed separately in cpp file using SERIALIZE_NOW(Classname) { ... }
Example:
#define SERIALIZE_NOW | ( | x | ) |
SERIALIZE_NOW(classname) { ... } used to register variables and functions in the class if SERIALIZE_LATER() was declared in the class.
classname | the name of the class to register |
Example:
#define SKIPHINT __ADDREG("[NOHINT]"); |
suppress hint for this element
#define SLIDER | ( | var, | |
name, | |||
minvalue, | |||
maxvalue | |||
) |
SLIDER(var,name,minvalue,maxvalue) to add integer/float slider in UI. Only float and int supported.
var | variable ref |
name | name in UI |
minvalue | minimal value |
maxvalue | maximal value |
Example:
#define STATE_BUTTON | ( | name, | |
variable, | |||
value | |||
) | REG_TYPE_ANYTHING(variable, __state, name, (void*)cPtrDiff(value)) |
STATE_BUTTON(var_name, int_variable_ref, ethalon_value) used to register state button.
method | name of the function to call if you want to rename it for UI/XML add second parameter |
name | optional, if present, used as identifier in UI for this variable, othervice variable name used. |
Example:
#define UI_LAYOUT | ( | str | ) |
UI_LAYOUT(str) splits ui elements to several columns with proportional or fixed width.
str | text that defines relation between controls width. Use [value_in_pixels] to define absolute width. |
UI_LAYOUT may use two additional keywords: TOP and BOTTOM. TOP moves controls to the tor of the window frame (header -like)
BOTTOM moves elements to the bottom of the frame, like toolset buttons. It is recommended to use ICON_BUTTON/3/4 for bottom toolset.
Example:
#define UI_ONLY |
UI_ONLY and SAVE_ONLY used if you want to register UI section and Serialization sections separately
.
If you are using UI_ONLY or SAVE_ONLY, all commands like NOSAVE and INVISIBLE are ignored
Example: