Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/BKE_unit.h
| Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
| bool bUnit_ReplaceString( | bool bUnit_ReplaceString( | ||||
| char *str, int len_max, const char *str_prev, double scale_pref, int system, int type); | char *str, int len_max, const char *str_prev, double scale_pref, int system, int type); | ||||
| /* return true if the string contains any valid unit for the given type */ | /* return true if the string contains any valid unit for the given type */ | ||||
| bool bUnit_ContainsUnit(const char *str, int type); | bool bUnit_ContainsUnit(const char *str, int type); | ||||
| /* if user does not specify a unit, multiply with this value */ | /* if user does not specify a unit, multiply with this value */ | ||||
| double bUnit_PreferredInputUnitScalar(const struct UnitSettings *settings, int type); | double bUnit_PreferredInputUnitScalar(const struct UnitSettings *settings, int type); | ||||
JacquesLucke: That's a weird way to continue the sentence in the comment. Might be better to just have one… | |||||
| /* make string keyboard-friendly: 10µm --> 10um */ | /* make string keyboard-friendly: 10µm --> 10um */ | ||||
| void bUnit_ToUnitAltName(char *str, int len_max, const char *orig_str, int system, int type); | void bUnit_ToUnitAltName(char *str, int len_max, const char *orig_str, int system, int type); | ||||
| /* the size of the unit used for this value (used for calculating the ckickstep) */ | /* the size of the unit used for this value (used for calculating the ckickstep) */ | ||||
| double bUnit_ClosestScalar(double value, int system, int type); | double bUnit_ClosestScalar(double value, int system, int type); | ||||
| /* base scale for these units */ | /* base scale for these units */ | ||||
| double bUnit_BaseScalar(int system, int type); | double bUnit_BaseScalar(int system, int type); | ||||
| Show All 21 Lines | enum { | ||||
| B_UNIT_VOLUME = 3, | B_UNIT_VOLUME = 3, | ||||
| B_UNIT_MASS = 4, | B_UNIT_MASS = 4, | ||||
| B_UNIT_ROTATION = 5, | B_UNIT_ROTATION = 5, | ||||
| B_UNIT_TIME = 6, | B_UNIT_TIME = 6, | ||||
| B_UNIT_VELOCITY = 7, | B_UNIT_VELOCITY = 7, | ||||
| B_UNIT_ACCELERATION = 8, | B_UNIT_ACCELERATION = 8, | ||||
| B_UNIT_CAMERA = 9, | B_UNIT_CAMERA = 9, | ||||
| B_UNIT_POWER = 10, | B_UNIT_POWER = 10, | ||||
| B_UNIT_TYPE_TOT = 11, | B_UNIT_TEMPERATURE = 11, | ||||
| B_UNIT_TYPE_TOT = 12, | |||||
| }; | }; | ||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| } | } | ||||
| #endif | #endif | ||||
That's a weird way to continue the sentence in the comment. Might be better to just have one function that returns both. Then you also cannot forget to cal one or the other.