Clarisse 5.0 SP8 SDK  5.0.5.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Public Types | Static Public Member Functions | List of all members
GMathUnits Class Reference

Classes

class  UnitSystem
 
class  UnitType
 
class  UnitValue
 

Public Types

enum  Format {
  FORMAT_FLOAT,
  FORMAT_INTEGER
}
 
enum  UnitSystemTime {
  UNIT_SYSTEM_TIME_FRAME,
  UNIT_SYSTEM_TIME_SECOND,
  UNIT_SYSTEM_TIME_CODE,
  UNIT_SYSTEM_TIME_COUNT
}
 

Static Public Member Functions

static CoreString get_unit_system_time_name (const UnitSystemTime &unit_system)
 
static UnitSystemTime get_unit_system_time_from_name (const CoreString &system_name)
 
static CoreString get_value_with_unit_from_value (const CoreVector< GMathUnits::UnitType > &data, const double &value, const float &fps, const CoreString &type_name, const CoreString &system_name, const CoreString &base="", const Format &format=FORMAT_FLOAT, const int &float_precision=3)
 
static double get_value_from_str_with_unit (const CoreVector< GMathUnits::UnitType > &data, const CoreString &str, const float &fps, const CoreString &type_name, const CoreString &system_name, const CoreString &base="", const Format &format=FORMAT_FLOAT)
 Converts input string to a numeric value, with respect to the current units.
 
static CoreString get_time_from_value (const double &value, const float &fps, const int &unit_system=UNIT_SYSTEM_TIME_FRAME, const Format &format=FORMAT_FLOAT, const int &float_precision=3)
 
static CoreString get_formated_time_value_from_milliseconds (const unsigned long &value)
 
static CoreString stringify_float (const double &d, const int &precision)
 
static CoreString stringify_int (const double &d)
 
static void add_unit (CoreVector< GMathUnits::UnitType > &data, const CoreString &type_name, const CoreString &system_name, const CoreString &name, const double &factor, const CoreString &unit)
 
static void set_internal_factor_unit (CoreVector< GMathUnits::UnitType > &data, const CoreString &type_name, const CoreString &system_name, const float &internal_factor)
 
static float get_internal_factor_unit (const CoreVector< GMathUnits::UnitType > &data, const CoreString &type_name, const CoreString &system_name)
 
static void set_format_unit (CoreVector< GMathUnits::UnitType > &data, const CoreString &type_name, const CoreString &system_name, const CoreString &format)
 
static CoreString get_format_unit (const CoreVector< GMathUnits::UnitType > &data, const CoreString &type_name, const CoreString &system_name)
 
static void set_display_format_unit (CoreVector< GMathUnits::UnitType > &data, const CoreString &type_name, const CoreString &system_name, const CoreString &format)
 
static CoreString get_display_format_unit (const CoreVector< GMathUnits::UnitType > &data, const CoreString &type_name, const CoreString &system_name)
 
static void set_used_fps_unit (CoreVector< GMathUnits::UnitType > &data, const CoreString &type_name, const CoreString &system_name, const bool &value)
 
static bool get_used_fps_unit (const CoreVector< GMathUnits::UnitType > &data, const CoreString &type_name, const CoreString &system_name)
 
static void set_editable_unit (CoreVector< GMathUnits::UnitType > &data, const CoreString &type_name, const CoreString &system_name, const bool &value)
 
static bool get_editable_unit (const CoreVector< GMathUnits::UnitType > &data, const CoreString &type_name, const CoreString &system_name)
 
static void set_displayed (CoreVector< GMathUnits::UnitType > &data, const CoreString &type_name, const bool &value)
 
static bool get_displayed (const CoreVector< GMathUnits::UnitType > &data, const CoreString &type_name)
 
static void to_string_debug (const CoreVector< GMathUnits::UnitType > &data)
 
static CoreArray< CoreStringget_all_type_names (const CoreVector< GMathUnits::UnitType > &data)
 
static CoreArray< CoreStringget_all_system_unit_names (const CoreVector< GMathUnits::UnitType > &data, const CoreString &type_name)
 
static const GMathUnits::UnitTypeget_unit_type (const CoreVector< GMathUnits::UnitType > &data, const CoreString &type_name)
 
static GMathUnits::UnitTypeget_unit_type (CoreVector< GMathUnits::UnitType > &data, const CoreString &type_name)
 
static GMathUnits::UnitSystemget_unit_system (CoreVector< GMathUnits::UnitType > &data, const CoreString &type_name, const CoreString &system_name)
 
static const
GMathUnits::UnitSystem
get_unit_system (const CoreVector< GMathUnits::UnitType > &data, const CoreString &type_name, const CoreString &system_name)
 
static GMathUnits::UnitSystemget_unit_system (GMathUnits::UnitType *unit_type, const CoreString &system_name)
 
static const
GMathUnits::UnitSystem
get_unit_system (const GMathUnits::UnitType *unit_type, const CoreString &system_name)
 
static void set_unit_base (CoreVector< GMathUnits::UnitType > &data, const CoreString &type_name, const CoreString &system_name, const CoreString &unit_base)
 
static CoreString get_unit_base (const CoreVector< GMathUnits::UnitType > &data, const CoreString &type_name, const CoreString &system_name)
 
static bool split_value_and_unit_from_str (const CoreString &str, CoreString &str_value, CoreString &str_unit)
 

Class Documentation

class GMathUnits::UnitValue
Class Members
double factor
CoreString name
CoreString unit

Member Function Documentation

double GMathUnits::get_value_from_str_with_unit ( const CoreVector< GMathUnits::UnitType > &  data,
const CoreString str,
const float &  fps,
const CoreString type_name,
const CoreString system_name,
const CoreString base = "",
const Format &  format = FORMAT_FLOAT 
)
static

Converts input string to a numeric value, with respect to the current units.

Parameters
[in]datacurrent unit definition ( namely get_application().get_units().get_units_data() )
[in]strstring to convert
[in]fpscurrent frame rate
[in]type_nameunit type ( ex: "distance", "time" )
[in]system_namemetric ( ex: "metric", "imperial" )
[in]baseunit (ex: "cm" )
[in]formatconversion mode ( FORMAT_FLOAT or FORMAT_INTEGER )
Returns
the value as double, gmath_infinity in case of error