Interface for adding params to your window. Wraps AntTweakBar. More...
#include <Params.h>
Classes | |
class | Options |
Provides chainable options, returned from addParam(). More... | |
class | OptionsBase |
Base class for chainable options. More... | |
Public Member Functions | |
InterfaceGl () | |
InterfaceGl (const std::string &title, const Vec2i &size, const ColorA &color=ColorA(0.3f, 0.3f, 0.3f, 0.4f)) | |
InterfaceGl (const cinder::app::WindowRef &window, const std::string &title, const Vec2i &size, const ColorA &color=ColorA(0.3f, 0.3f, 0.3f, 0.4f)) | |
void | draw () |
Draw the interface. More... | |
void | show (bool visible=true) |
Shows the interface. If visible is false , hides the interface. More... | |
void | hide () |
Hides the interface. More... | |
bool | isVisible () const |
Returns whether the interface is visible or not. More... | |
void | maximize (bool maximized=true) |
Maximizes the interface, making it visible in its default presentation mode. If maximized is false , minimizes the interface. More... | |
void | minimize () |
Minimizes the interface face to the bottom left corner of the window. More... | |
bool | isMaximized () const |
Returns whether the interface is maximized or not. More... | |
void | setPosition (const ci::Vec2i &pos) |
Sets the position of this interface instance. More... | |
template<typename T > | |
Options< T > | addParam (const std::string &name, T *target, bool readOnly=false) |
Adds target as a param to the interface, referring to it with name. More... | |
template<typename T > | |
Options< T > | addParam (const std::string &name, const std::function< void(T)> &setterFn, const std::function< T()> &getterFn) |
Adds a param to the interface with no target, but is instead accessed with setterFn and getterFn. More... | |
void | addParam (const std::string &name, const std::vector< std::string > &enumNames, int *param, const std::string &optionsStr="", bool readOnly=false) |
Adds enumerated parameter. The value corresponds to the indices of enumNames. More... | |
void | addSeparator (const std::string &name="", const std::string &optionsStr="") |
Adds a separator to the interface. More... | |
void | addText (const std::string &name="", const std::string &optionsStr="") |
Adds text to the interface. More... | |
void | addButton (const std::string &name, const std::function< void()> &callback, const std::string &optionsStr="") |
Adds a button that fires callback when clicked. More... | |
void | removeParam (const std::string &name) |
Removes the param referred to by name. More... | |
void | setOptions (const std::string &name="", const std::string &optionsStr="") |
Sets runtime options on the param referred to by name. More... | |
void | clear () |
Removes all the variables, buttons and separators previously added. More... | |
void | addParam (const std::string &name, bool *boolParam, const std::string &optionsStr, bool readOnly=false) |
void | addParam (const std::string &name, bool *boolParam, const char *optionsStr, bool readOnly=false) |
void | addParam (const std::string &name, float *floatParam, const std::string &optionsStr, bool readOnly=false) |
void | addParam (const std::string &name, float *floatParam, const char *optionsStr, bool readOnly=false) |
void | addParam (const std::string &name, double *doubleParam, const std::string &optionsStr, bool readOnly=false) |
void | addParam (const std::string &name, double *doubleParam, const char *optionsStr, bool readOnly=false) |
void | addParam (const std::string &name, int32_t *intParam, const std::string &optionsStr, bool readOnly=false) |
void | addParam (const std::string &name, int32_t *intParam, const char *optionsStr, bool readOnly=false) |
void | addParam (const std::string &name, Vec3f *vectorParam, const std::string &optionsStr, bool readOnly=false) |
void | addParam (const std::string &name, Vec3f *vectorParam, const char *optionsStr, bool readOnly=false) |
void | addParam (const std::string &name, Quatf *quatParam, const std::string &optionsStr, bool readOnly=false) |
void | addParam (const std::string &name, Quatf *quatParam, const char *optionsStr, bool readOnly=false) |
void | addParam (const std::string &name, Color *colorParam, const std::string &optionsStr, bool readOnly=false) |
void | addParam (const std::string &name, Color *colorParam, const char *optionsStr, bool readOnly=false) |
void | addParam (const std::string &name, ColorA *colorParam, const std::string &optionsStr, bool readOnly=false) |
void | addParam (const std::string &name, ColorA *colorParam, const char *optionsStr, bool readOnly=false) |
void | addParam (const std::string &name, std::string *strParam, const std::string &optionsStr, bool readOnly=false) |
void | addParam (const std::string &name, std::string *strParam, const char *optionsStr, bool readOnly=false) |
template<typename T > | |
void | addParamCallbackImpl (const function< void(T)> &setter, const function< T()> &getter, const Options< T > &options) |
template<> | |
InterfaceGl::Options< bool > | addParam (const std::string &name, bool *param, bool readOnly) |
template<> | |
InterfaceGl::Options< char > | addParam (const std::string &name, char *param, bool readOnly) |
template<> | |
InterfaceGl::Options< int8_t > | addParam (const std::string &name, int8_t *param, bool readOnly) |
template<> | |
InterfaceGl::Options< uint8_t > | addParam (const std::string &name, uint8_t *param, bool readOnly) |
template<> | |
InterfaceGl::Options< int16_t > | addParam (const std::string &name, int16_t *param, bool readOnly) |
template<> | |
InterfaceGl::Options< uint16_t > | addParam (const std::string &name, uint16_t *param, bool readOnly) |
template<> | |
InterfaceGl::Options< int32_t > | addParam (const std::string &name, int32_t *param, bool readOnly) |
template<> | |
InterfaceGl::Options< uint32_t > | addParam (const std::string &name, uint32_t *param, bool readOnly) |
template<> | |
InterfaceGl::Options< float > | addParam (const std::string &name, float *param, bool readOnly) |
template<> | |
InterfaceGl::Options< double > | addParam (const std::string &name, double *param, bool readOnly) |
template<> | |
InterfaceGl::Options< string > | addParam (const std::string &name, string *param, bool readOnly) |
template<> | |
InterfaceGl::Options< Color > | addParam (const std::string &name, Color *param, bool readOnly) |
template<> | |
InterfaceGl::Options< ColorA > | addParam (const std::string &name, ColorA *param, bool readOnly) |
template<> | |
InterfaceGl::Options< Quatf > | addParam (const std::string &name, Quatf *param, bool readOnly) |
template<> | |
InterfaceGl::Options< Quatd > | addParam (const std::string &name, Quatd *param, bool readOnly) |
template<> | |
InterfaceGl::Options< Vec3f > | addParam (const std::string &name, Vec3f *param, bool readOnly) |
template<> | |
InterfaceGl::Options< Vec3d > | addParam (const std::string &name, Vec3d *param, bool readOnly) |
Static Public Member Functions | |
static InterfaceGlRef | create (const std::string &title, const Vec2i &size, const ColorA &color=ColorA(0.3f, 0.3f, 0.3f, 0.4f)) |
Creates and returns an InterfaceGl referenced by title and with size dimensions. Optionally takes color. More... | |
static InterfaceGlRef | create (const cinder::app::WindowRef &window, const std::string &title, const Vec2i &size, const ColorA &color=ColorA(0.3f, 0.3f, 0.3f, 0.4f)) |
Creates and returns an InterfaceGl referenced by title that belongs to window, and with size dimensions. Optionally takes color. More... | |
Protected Member Functions | |
void | init (app::WindowRef window, const std::string &title, const Vec2i &size, const ColorA color) |
void | implAddParamDeprecated (const std::string &name, void *param, int type, const std::string &optionsStr, bool readOnly) |
template<typename T > | |
Options< T > | addParamImpl (const std::string &name, T *param, int type, bool readOnly) |
template<class T > | |
void | addParamCallbackImpl (const std::function< void(T)> &setter, const std::function< T()> &getter, const Options< T > &options) |
Protected Attributes | |
std::weak_ptr< app::Window > | mWindow |
std::shared_ptr< TwBar > | mBar |
int | mTwWindowId |
std::map< std::string, std::shared_ptr< void > > | mStoredCallbacks |
Interface for adding params to your window. Wraps AntTweakBar.
cinder::params::InterfaceGl::InterfaceGl | ( | ) |
cinder::params::InterfaceGl::InterfaceGl | ( | const std::string & | title, |
const Vec2i & | size, | ||
const ColorA & | color = ColorA( 0.3f, 0.3f, 0.3f, 0.4f ) |
||
) |
cinder::params::InterfaceGl::InterfaceGl | ( | const cinder::app::WindowRef & | window, |
const std::string & | title, | ||
const Vec2i & | size, | ||
const ColorA & | color = ColorA( 0.3f, 0.3f, 0.3f, 0.4f ) |
||
) |
|
static |
Creates and returns an InterfaceGl referenced by title and with size dimensions. Optionally takes color.
|
static |
Creates and returns an InterfaceGl referenced by title that belongs to window, and with size dimensions. Optionally takes color.
void cinder::params::InterfaceGl::draw | ( | ) |
Draw the interface.
void cinder::params::InterfaceGl::show | ( | bool | visible = true | ) |
Shows the interface. If visible is false
, hides the interface.
void cinder::params::InterfaceGl::hide | ( | ) |
Hides the interface.
bool cinder::params::InterfaceGl::isVisible | ( | ) | const |
void cinder::params::InterfaceGl::maximize | ( | bool | maximized = true | ) |
Maximizes the interface, making it visible in its default presentation mode. If maximized is false
, minimizes the interface.
void cinder::params::InterfaceGl::minimize | ( | ) |
Minimizes the interface face to the bottom left corner of the window.
bool cinder::params::InterfaceGl::isMaximized | ( | ) | const |
Returns whether the interface is maximized or not.
Sets the position of this interface instance.
Options<T> cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
T * | target, | ||
bool | readOnly = false |
||
) |
Adds target as a param to the interface, referring to it with name.
InterfaceGl::Options< T > cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
const std::function< void(T)> & | setterFn, | ||
const std::function< T()> & | getterFn | ||
) |
Adds a param to the interface with no target, but is instead accessed with setterFn and getterFn.
void cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
const std::vector< std::string > & | enumNames, | ||
int * | param, | ||
const std::string & | optionsStr = "" , |
||
bool | readOnly = false |
||
) |
Adds enumerated parameter. The value corresponds to the indices of enumNames.
void cinder::params::InterfaceGl::addSeparator | ( | const std::string & | name = "" , |
const std::string & | optionsStr = "" |
||
) |
Adds a separator to the interface.
void cinder::params::InterfaceGl::addText | ( | const std::string & | name = "" , |
const std::string & | optionsStr = "" |
||
) |
Adds text to the interface.
void cinder::params::InterfaceGl::addButton | ( | const std::string & | name, |
const std::function< void()> & | callback, | ||
const std::string & | optionsStr = "" |
||
) |
Adds a button that fires callback when clicked.
void cinder::params::InterfaceGl::removeParam | ( | const std::string & | name | ) |
Removes the param referred to by name.
void cinder::params::InterfaceGl::setOptions | ( | const std::string & | name = "" , |
const std::string & | optionsStr = "" |
||
) |
Sets runtime options on the param referred to by name.
void cinder::params::InterfaceGl::clear | ( | ) |
Removes all the variables, buttons and separators previously added.
void cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
bool * | boolParam, | ||
const std::string & | optionsStr, | ||
bool | readOnly = false |
||
) |
void cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
bool * | boolParam, | ||
const char * | optionsStr, | ||
bool | readOnly = false |
||
) |
void cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
float * | floatParam, | ||
const std::string & | optionsStr, | ||
bool | readOnly = false |
||
) |
void cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
float * | floatParam, | ||
const char * | optionsStr, | ||
bool | readOnly = false |
||
) |
void cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
double * | doubleParam, | ||
const std::string & | optionsStr, | ||
bool | readOnly = false |
||
) |
void cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
double * | doubleParam, | ||
const char * | optionsStr, | ||
bool | readOnly = false |
||
) |
void cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
int32_t * | intParam, | ||
const std::string & | optionsStr, | ||
bool | readOnly = false |
||
) |
void cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
int32_t * | intParam, | ||
const char * | optionsStr, | ||
bool | readOnly = false |
||
) |
void cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
Vec3f * | vectorParam, | ||
const std::string & | optionsStr, | ||
bool | readOnly = false |
||
) |
void cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
Vec3f * | vectorParam, | ||
const char * | optionsStr, | ||
bool | readOnly = false |
||
) |
void cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
Quatf * | quatParam, | ||
const std::string & | optionsStr, | ||
bool | readOnly = false |
||
) |
void cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
Quatf * | quatParam, | ||
const char * | optionsStr, | ||
bool | readOnly = false |
||
) |
void cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
Color * | colorParam, | ||
const std::string & | optionsStr, | ||
bool | readOnly = false |
||
) |
void cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
Color * | colorParam, | ||
const char * | optionsStr, | ||
bool | readOnly = false |
||
) |
void cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
ColorA * | colorParam, | ||
const std::string & | optionsStr, | ||
bool | readOnly = false |
||
) |
void cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
ColorA * | colorParam, | ||
const char * | optionsStr, | ||
bool | readOnly = false |
||
) |
void cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
std::string * | strParam, | ||
const std::string & | optionsStr, | ||
bool | readOnly = false |
||
) |
void cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
std::string * | strParam, | ||
const char * | optionsStr, | ||
bool | readOnly = false |
||
) |
|
protected |
|
protected |
|
protected |
|
protected |
void cinder::params::InterfaceGl::addParamCallbackImpl | ( | const function< void(T)> & | setter, |
const function< T()> & | getter, | ||
const Options< T > & | options | ||
) |
InterfaceGl::Options<bool> cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
bool * | param, | ||
bool | readOnly | ||
) |
InterfaceGl::Options<char> cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
char * | param, | ||
bool | readOnly | ||
) |
InterfaceGl::Options<int8_t> cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
int8_t * | param, | ||
bool | readOnly | ||
) |
InterfaceGl::Options<uint8_t> cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
uint8_t * | param, | ||
bool | readOnly | ||
) |
InterfaceGl::Options<int16_t> cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
int16_t * | param, | ||
bool | readOnly | ||
) |
InterfaceGl::Options<uint16_t> cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
uint16_t * | param, | ||
bool | readOnly | ||
) |
InterfaceGl::Options<int32_t> cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
int32_t * | param, | ||
bool | readOnly | ||
) |
InterfaceGl::Options<uint32_t> cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
uint32_t * | param, | ||
bool | readOnly | ||
) |
InterfaceGl::Options<float> cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
float * | param, | ||
bool | readOnly | ||
) |
InterfaceGl::Options<double> cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
double * | param, | ||
bool | readOnly | ||
) |
InterfaceGl::Options<string> cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
string * | param, | ||
bool | readOnly | ||
) |
InterfaceGl::Options<Color> cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
Color * | param, | ||
bool | readOnly | ||
) |
InterfaceGl::Options<ColorA> cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
ColorA * | param, | ||
bool | readOnly | ||
) |
InterfaceGl::Options<Quatf> cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
Quatf * | param, | ||
bool | readOnly | ||
) |
InterfaceGl::Options<Quatd> cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
Quatd * | param, | ||
bool | readOnly | ||
) |
InterfaceGl::Options<Vec3f> cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
Vec3f * | param, | ||
bool | readOnly | ||
) |
InterfaceGl::Options<Vec3d> cinder::params::InterfaceGl::addParam | ( | const std::string & | name, |
Vec3d * | param, | ||
bool | readOnly | ||
) |
|
protected |
|
protected |
|
protected |
|
protected |