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.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
coat::ui Class Reference

operate over the Coat's ui More...

#include <CoreAPI.h>

Static Public Member Functions

static bool cmd (const char *id, std::function< void()> process_in_modal_dialog=0)
 perform some command in UI. The ID may be taken from the UI by clicking RMB+MMB, then the ID will appear in the clipboard (look Edit->Prferences->General->Script info type). If the element triggers modal dialog, the execution will be paused till the modal dialog will be closed, but the callback will be called each frame in modal dialog, so you will be able to control what happens in the modal dialog. More...
 
static bool wait (const char *id, float max_seconds)
 wait till the element id will appear in the UI. The element will not be clicked. The max wait time is max_seconds. More...
 
static bool setSliderValue (const char *id, float value)
 Set the value for the the slider (if exists in UI) More...
 
static float getSliderValue (const char *id)
 get the value of the slider More...
 
static bool setEditBoxValue (const char *id, const char *value)
 set the edit box value More...
 
static bool setEditBoxValue (const char *id, int value)
 set the edit box value More...
 
static bool setEditBoxValue (const char *id, float value)
 set the edit box value More...
 
static bool getEditBoxValue (const char *id, str &result)
 get the edit box value More...
 
static void apply ()
 pess ENTER, acts as Apply usually More...
 
static void setFileForFileDialog (const char *filename)
 Set the file for the next file dialog that will be triggered by user. If you will use coat::ui:cmd(...) to trigger some command that shows the file dialog this command allows to substitute the filename for that dialog instead of showing the dialog. This acts only for ONE next dialog. More...
 
static bool getBoolField (const char *id)
 Get the bool field from the checkbox in UI. More...
 
static bool setBoolValue (const char *id, bool value)
 Set the value for the checkbox in UI. More...
 
static const char * currentRoom ()
 get the current room name More...
 
static void toRoom (const char *name)
 switch to the room More...
 
static int roomsCount ()
 returns the rooms count More...
 
static const char * roomName (int index)
 get the room name by index More...
 
static const char * roomID (int index)
 get the text identifier of the room More...
 

Detailed Description

operate over the Coat's ui

Member Function Documentation

void coat::ui::apply ( )
static

pess ENTER, acts as Apply usually

bool coat::ui::cmd ( const char *  id,
std::function< void()>  process_in_modal_dialog = 0 
)
static

perform some command in UI. The ID may be taken from the UI by clicking RMB+MMB, then the ID will appear in the clipboard (look Edit->Prferences->General->Script info type). If the element triggers modal dialog, the execution will be paused till the modal dialog will be closed, but the callback will be called each frame in modal dialog, so you will be able to control what happens in the modal dialog.

Parameters
idthe identifier taken from the UI
process_in_modal_dialogthe callback/lambda that will be called each frame till you are within the modal dialog
Returns
true if the element found and the operation executed
const char * coat::ui::currentRoom ( )
static

get the current room name

Returns
the name
bool coat::ui::getBoolField ( const char *  id)
static

Get the bool field from the checkbox in UI.

Parameters
idthe element identifier
Returns
the checkbox value
bool coat::ui::getEditBoxValue ( const char *  id,
str result 
)
static

get the edit box value

Parameters
idthe ID of the element
resultthe string the will get the result
Returns
true if the element exists
float coat::ui::getSliderValue ( const char *  id)
static

get the value of the slider

Parameters
idthe ID of the element
Returns
the value
const char * coat::ui::roomID ( int  index)
static

get the text identifier of the room

Parameters
indexthe room index
Returns
"" if index outside the range or the room identifier if the index is valid
const char * coat::ui::roomName ( int  index)
static

get the room name by index

Parameters
indexthe room index
Returns
"" if index outside the range or the room name if the index is valid
int coat::ui::roomsCount ( )
static

returns the rooms count

Returns
the number
bool coat::ui::setBoolValue ( const char *  id,
bool  value 
)
static

Set the value for the checkbox in UI.

Parameters
idthe element identifier
valuethe value to set
Returns
true if successful and the element exists
bool coat::ui::setEditBoxValue ( const char *  id,
const char *  value 
)
static

set the edit box value

Parameters
idthe ID of the element
valuethe value to set
Returns
true if the element exists
bool coat::ui::setEditBoxValue ( const char *  id,
int  value 
)
static

set the edit box value

Parameters
idthe ID of the element
valuethe value to set
Returns
true if the element exists
bool coat::ui::setEditBoxValue ( const char *  id,
float  value 
)
static

set the edit box value

Parameters
idthe ID of the element
valuethe value to set
Returns
true if the element exists
void coat::ui::setFileForFileDialog ( const char *  filename)
static

Set the file for the next file dialog that will be triggered by user. If you will use coat::ui:cmd(...) to trigger some command that shows the file dialog this command allows to substitute the filename for that dialog instead of showing the dialog. This acts only for ONE next dialog.

Parameters
filenamethe filename to substitute.
bool coat::ui::setSliderValue ( const char *  id,
float  value 
)
static

Set the value for the the slider (if exists in UI)

Parameters
idthe ID of the element
valuethe value to set
Returns
true if successful
void coat::ui::toRoom ( const char *  name)
static

switch to the room

Parameters
namethe room name. Pay attention, you may pass the name or identifier, but name has bigger priory.
bool coat::ui::wait ( const char *  id,
float  max_seconds 
)
static

wait till the element id will appear in the UI. The element will not be clicked. The max wait time is max_seconds.

Parameters
idThe ID we wait to appear
max_secondsthe max wait time (seconds)
Returns
true if the element appeared

References coat::io::step().


The documentation for this class was generated from the following files: