Classes | Defines | Enumerations | Functions

units.h File Reference

This reference page is linked to from the following overview topics: Time Functions, Units of Measurement.


#include "maxheap.h"
#include "strclass.h"
#include "maxtypes.h"

Go to the source code of this file.

Classes

struct   DispInfo
  This is the display information structure. More...

Defines

#define  UNITS_INCHES   0
#define  UNITS_FEET   1
#define  UNITS_MILES   2
#define  UNITS_MILLIMETERS   3
#define  UNITS_CENTIMETERS   4
#define  UNITS_METERS   5
#define  UNITS_KILOMETERS   6
#define  MAX_UNIT_TYPES   7
#define  UNITDISP_GENERIC   0
#define  UNITDISP_METRIC   1
#define  UNITDISP_US   2
#define  UNITDISP_CUSTOM   3
#define  MAX_UNITDISP_TYPES   4
#define  UNIT_METRIC_DISP_MM   0
#define  UNIT_METRIC_DISP_CM   1
#define  UNIT_METRIC_DISP_M   2
#define  UNIT_METRIC_DISP_KM   3
#define  MAX_METRIC_DISP_TYPES   4
#define  UNIT_US_DISP_FRAC_IN   0
#define  UNIT_US_DISP_DEC_IN   1
#define  UNIT_US_DISP_FRAC_FT   2
#define  UNIT_US_DISP_DEC_FT   3
#define  UNIT_US_DISP_FT_FRAC_IN   4
#define  UNIT_US_DISP_FT_DEC_IN   5
#define  MAX_US_DISP_TYPES   6
#define  UNIT_FRAC_1_1   0
#define  UNIT_FRAC_1_2   1
#define  UNIT_FRAC_1_4   2
#define  UNIT_FRAC_1_8   3
#define  UNIT_FRAC_1_10   4
#define  UNIT_FRAC_1_16   5
#define  UNIT_FRAC_1_32   6
#define  UNIT_FRAC_1_64   7
#define  UNIT_FRAC_1_100   8
#define  MAX_FRAC_TYPES   9
#define  UNIT_DESIG_MM   0
#define  UNIT_DESIG_CM   1
#define  UNIT_DESIG_M   2
#define  UNIT_DESIG_KM   3
#define  UNIT_DESIG_IN   4
#define  UNIT_DESIG_FT   5
#define  UNIT_DESIG_CUSTOM   6
#define  UNIT_DESIG_TYPES   7
#define  US_UNIT_DEFAULT_FEET   0
#define  US_UNIT_DEFAULT_INCHES   1

Enumerations

enum   TimeDisp { DISPTIME_FRAMES, DISPTIME_SMPTE, DISPTIME_FRAMETICKS, DISPTIME_TIMETICKS }

Functions

CoreExport double  GetMasterScale (int type)
CoreExport double  GetRelativeScale (int fromType, float fromScale, int toType, float toScale)
  Computes a scaling factor for going from given System Units to others.
CoreExport void  GetMasterUnitInfo (int *type, float *scale)
CoreExport int  SetMasterUnitInfo (int type, float scale)
CoreExport void  GetUnitDisplayInfo (DispInfo *info)
CoreExport int  SetUnitDisplayInfo (DispInfo *info)
CoreExport int  GetUnitDisplayType ()
CoreExport int  SetUnitDisplayType (int type)
CoreExport BOOL  IsValidUnitCharacter (int ch)
CoreExport void  SetUSDefaultUnit (int type)
CoreExport int  GetUSDefaultUnit ()
CoreExport MCHAR *  GetFirstUnitName ()
CoreExport MCHAR *  GetNextUnitName ()
CoreExport MCHAR *  GetFirstMetricDisp ()
CoreExport MCHAR *  GetNextMetricDisp ()
CoreExport MCHAR *  GetFirstUSDisp ()
CoreExport MCHAR *  GetNextUSDisp ()
CoreExport MCHAR *  GetFirstFraction ()
CoreExport MCHAR *  GetNextFraction ()
CoreExport MCHAR *  FormatUniverseValue (float value)
CoreExport float  DecodeUniverseValue (MCHAR *string, BOOL *valid=NULL)
CoreExport void  TimeToString (TimeValue t, MSTR &string)
CoreExport BOOL  StringToTime (MSTR string, TimeValue &t)
CoreExport int  GetFrameRate ()
CoreExport void  SetFrameRate (int rate)
CoreExport int  GetTicksPerFrame ()
CoreExport void  SetTicksPerFrame (int ticks)
CoreExport TimeDisp  GetTimeDisplayMode ()
CoreExport void  SetTimeDisplayMode (TimeDisp m)
CoreExport int  LegalFrameRate (int r)
CoreExport void  RegisterDistanceDefault (MCHAR *section, MCHAR *key, float inchesDefault, float metersDefault)
CoreExport void  RestoreDistanceDefault (MCHAR *section, MCHAR *key, float inchesDefault, float metersDefault)
CoreExport float  GetDistanceDefault (MCHAR *section, MCHAR *key)
CoreExport void  SetDistanceDefault (MCHAR *section, MCHAR *key, float value)

Define Documentation

#define UNITS_INCHES   0

Definition at line 20 of file units.h.

#define UNITS_FEET   1

Definition at line 21 of file units.h.

#define UNITS_MILES   2

Definition at line 22 of file units.h.

#define UNITS_MILLIMETERS   3

Definition at line 23 of file units.h.

#define UNITS_CENTIMETERS   4

Definition at line 24 of file units.h.

#define UNITS_METERS   5

Definition at line 25 of file units.h.

#define UNITS_KILOMETERS   6

Definition at line 26 of file units.h.

#define MAX_UNIT_TYPES   7

Definition at line 28 of file units.h.

#define UNITDISP_GENERIC   0

Definition at line 31 of file units.h.

#define UNITDISP_METRIC   1

Definition at line 32 of file units.h.

#define UNITDISP_US   2

Definition at line 33 of file units.h.

#define UNITDISP_CUSTOM   3

Definition at line 34 of file units.h.

#define MAX_UNITDISP_TYPES   4

Definition at line 36 of file units.h.

#define UNIT_METRIC_DISP_MM   0

Definition at line 39 of file units.h.

#define UNIT_METRIC_DISP_CM   1

Definition at line 40 of file units.h.

#define UNIT_METRIC_DISP_M   2

Definition at line 41 of file units.h.

#define UNIT_METRIC_DISP_KM   3

Definition at line 42 of file units.h.

#define MAX_METRIC_DISP_TYPES   4

Definition at line 44 of file units.h.

#define UNIT_US_DISP_FRAC_IN   0

Definition at line 47 of file units.h.

#define UNIT_US_DISP_DEC_IN   1

Definition at line 48 of file units.h.

#define UNIT_US_DISP_FRAC_FT   2

Definition at line 49 of file units.h.

#define UNIT_US_DISP_DEC_FT   3

Definition at line 50 of file units.h.

#define UNIT_US_DISP_FT_FRAC_IN   4

Definition at line 51 of file units.h.

#define UNIT_US_DISP_FT_DEC_IN   5

Definition at line 52 of file units.h.

#define MAX_US_DISP_TYPES   6

Definition at line 54 of file units.h.

#define UNIT_FRAC_1_1   0

Definition at line 57 of file units.h.

#define UNIT_FRAC_1_2   1

Definition at line 58 of file units.h.

#define UNIT_FRAC_1_4   2

Definition at line 59 of file units.h.

#define UNIT_FRAC_1_8   3

Definition at line 60 of file units.h.

#define UNIT_FRAC_1_10   4

Definition at line 61 of file units.h.

#define UNIT_FRAC_1_16   5

Definition at line 62 of file units.h.

#define UNIT_FRAC_1_32   6

Definition at line 63 of file units.h.

#define UNIT_FRAC_1_64   7

Definition at line 64 of file units.h.

#define UNIT_FRAC_1_100   8

Definition at line 65 of file units.h.

#define MAX_FRAC_TYPES   9

Definition at line 67 of file units.h.

#define UNIT_DESIG_MM   0

Definition at line 70 of file units.h.

#define UNIT_DESIG_CM   1

Definition at line 71 of file units.h.

#define UNIT_DESIG_M   2

Definition at line 72 of file units.h.

#define UNIT_DESIG_KM   3

Definition at line 73 of file units.h.

#define UNIT_DESIG_IN   4

Definition at line 74 of file units.h.

#define UNIT_DESIG_FT   5

Definition at line 75 of file units.h.

#define UNIT_DESIG_CUSTOM   6

Definition at line 76 of file units.h.

#define UNIT_DESIG_TYPES   7

Definition at line 78 of file units.h.

#define US_UNIT_DEFAULT_FEET   0

Definition at line 157 of file units.h.

#define US_UNIT_DEFAULT_INCHES   1

Definition at line 158 of file units.h.


Enumeration Type Documentation

enum TimeDisp

Function Documentation

CoreExport double GetMasterScale ( int  type )
CoreExport double GetRelativeScale ( int  fromType,
float  fromScale,
int  toType,
float  toScale 
)

Computes a scaling factor for going from given System Units to others.

Parameters:
[in] fromType - type of System Units from which we start (a value going from UNITS_INCHES to UNITS_KILOMETERS).
[in] fromScale - scale of System Units from which we start.
[in] toType - type of System Units into which we want to rescale (a value going from UNITS_INCHES to UNITS_KILOMETERS).
[in] toScale - scale of System Units into which we want to rescale.
Returns:
- The scale factor that is needed to scale from given System Units to others.
CoreExport void GetMasterUnitInfo ( int *  type,
float *  scale 
)
CoreExport int SetMasterUnitInfo ( int  type,
float  scale 
)
CoreExport void GetUnitDisplayInfo ( DispInfo info )
CoreExport int SetUnitDisplayInfo ( DispInfo info )
CoreExport int GetUnitDisplayType ( )
CoreExport int SetUnitDisplayType ( int  type )
CoreExport BOOL IsValidUnitCharacter ( int  ch )
CoreExport void SetUSDefaultUnit ( int  type )
CoreExport int GetUSDefaultUnit ( )
CoreExport MCHAR* GetFirstUnitName ( )
CoreExport MCHAR* GetNextUnitName ( )
CoreExport MCHAR* GetFirstMetricDisp ( )
CoreExport MCHAR* GetNextMetricDisp ( )
CoreExport MCHAR* GetFirstUSDisp ( )
CoreExport MCHAR* GetNextUSDisp ( )
CoreExport MCHAR* GetFirstFraction ( )
CoreExport MCHAR* GetNextFraction ( )
CoreExport MCHAR* FormatUniverseValue ( float  value )
CoreExport float DecodeUniverseValue ( MCHAR *  string,
BOOL *  valid = NULL 
)
CoreExport void TimeToString ( TimeValue  t,
MSTR string 
)
CoreExport BOOL StringToTime ( MSTR  string,
TimeValue t 
)
CoreExport int GetFrameRate ( )
CoreExport void SetFrameRate ( int  rate )
CoreExport int GetTicksPerFrame ( )
CoreExport void SetTicksPerFrame ( int  ticks )
CoreExport TimeDisp GetTimeDisplayMode ( )
CoreExport void SetTimeDisplayMode ( TimeDisp  m )
CoreExport int LegalFrameRate ( int  r )
CoreExport void RegisterDistanceDefault ( MCHAR *  section,
MCHAR *  key,
float  inchesDefault,
float  metersDefault 
)
CoreExport void RestoreDistanceDefault ( MCHAR *  section,
MCHAR *  key,
float  inchesDefault,
float  metersDefault 
)
CoreExport float GetDistanceDefault ( MCHAR *  section,
MCHAR *  key 
)
CoreExport void SetDistanceDefault ( MCHAR *  section,
MCHAR *  key,
float  value 
)