2017-11-16 12:20:21 +01:00
|
|
|
#pragma once
|
|
|
|
#include "sync.hh"
|
|
|
|
|
|
|
|
namespace sov {
|
|
|
|
|
2017-11-16 23:15:44 +01:00
|
|
|
/*= FLOATING POINT DRAGGERS/SLIDERS ============================================*/
|
2017-11-16 12:20:21 +01:00
|
|
|
|
2017-11-16 23:15:44 +01:00
|
|
|
// Float values, common
|
|
|
|
class A_Float : public A_SyncOverride
|
2017-11-16 12:20:21 +01:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
T_Optional< float > min_;
|
|
|
|
T_Optional< float > max_;
|
|
|
|
T_Optional< float > step_;
|
|
|
|
T_Optional< ebcl::T_StaticArray< char , 12 > > decimals_;
|
|
|
|
T_Optional< float > power_;
|
2017-11-16 23:15:44 +01:00
|
|
|
bool slider_;
|
2017-11-16 12:20:21 +01:00
|
|
|
|
|
|
|
protected:
|
2017-11-16 23:15:44 +01:00
|
|
|
A_Float( char const* const type ,
|
|
|
|
T_String const& title ) noexcept
|
|
|
|
: A_SyncOverride( type , title )
|
|
|
|
{}
|
2017-11-16 12:20:21 +01:00
|
|
|
|
|
|
|
public:
|
2017-11-16 23:15:44 +01:00
|
|
|
A_Float( T_String const& input ,
|
2017-11-16 12:20:21 +01:00
|
|
|
T_String const& title ) noexcept;
|
|
|
|
|
|
|
|
bool setMin( const float v ) noexcept;
|
|
|
|
bool setMax( const float v ) noexcept;
|
|
|
|
bool setStep( const float v ) noexcept;
|
|
|
|
bool setDecimals( const uint32_t n ) noexcept;
|
|
|
|
bool setPower( const float v ) noexcept;
|
2017-11-16 23:15:44 +01:00
|
|
|
void setSlider( ) noexcept;
|
2017-11-16 12:20:21 +01:00
|
|
|
|
|
|
|
float min( ) const noexcept { return min_ ? *min_ : 0.0f; }
|
|
|
|
float max( ) const noexcept { return max_ ? *max_ : 0.0f; }
|
|
|
|
float step( ) const noexcept { return step_ ? *step_ : .001f; }
|
|
|
|
char const* decimals( ) const noexcept { return decimals_ ? &(*decimals_)[ 0 ] : "%.3f"; }
|
|
|
|
float power( ) const noexcept { return power_ ? *power_ : 1.0f; }
|
2017-11-16 23:15:44 +01:00
|
|
|
bool slider( ) const noexcept { return slider_; }
|
|
|
|
};
|
|
|
|
|
|
|
|
// Single float values
|
|
|
|
class T_Float : public A_Float
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
void makeEditWidgets( ) noexcept override;
|
|
|
|
public:
|
|
|
|
T_Float( T_String const& input ,
|
|
|
|
T_String const& title ) noexcept;
|
|
|
|
};
|
|
|
|
|
|
|
|
// 2 float values
|
|
|
|
class T_Float2 : public A_Float
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
void makeEditWidgets( ) noexcept override;
|
|
|
|
public:
|
|
|
|
T_Float2( T_String const& input0 ,
|
|
|
|
T_String const& input1 ,
|
|
|
|
T_String const& title ) noexcept;
|
|
|
|
};
|
|
|
|
|
|
|
|
// 3 float values
|
|
|
|
class T_Float3 : public A_Float
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
void makeEditWidgets( ) noexcept override;
|
|
|
|
public:
|
|
|
|
T_Float3( T_String const& input0 ,
|
|
|
|
T_String const& input1 ,
|
|
|
|
T_String const& input2 ,
|
|
|
|
T_String const& title ) noexcept;
|
2017-11-16 12:20:21 +01:00
|
|
|
};
|
|
|
|
|
2017-11-16 23:15:44 +01:00
|
|
|
// 4 float values
|
|
|
|
class T_Float4 : public A_Float
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
void makeEditWidgets( ) noexcept override;
|
|
|
|
public:
|
|
|
|
T_Float4( T_String const& input0 ,
|
|
|
|
T_String const& input1 ,
|
|
|
|
T_String const& input2 ,
|
|
|
|
T_String const& input3 ,
|
|
|
|
T_String const& title ) noexcept;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2017-11-17 14:09:36 +01:00
|
|
|
/*= PARSER CONFIGURATION =======================================================*/
|
|
|
|
|
|
|
|
// Get a parser configuration that will be able to parse UI override definitions.
|
|
|
|
ebcl::T_SRDParserConfig GetParserConfig( );
|
|
|
|
|
2017-11-16 12:20:21 +01:00
|
|
|
|
|
|
|
} // namespace
|