File indexing completed on 2025-01-18 10:05:29
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _Units_Measurement_HeaderFile
0018 #define _Units_Measurement_HeaderFile
0019
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023
0024 class Units_Token;
0025
0026
0027
0028
0029 class Units_Measurement
0030 {
0031 public:
0032
0033 DEFINE_STANDARD_ALLOC
0034
0035
0036
0037 Standard_EXPORT Units_Measurement();
0038
0039
0040
0041
0042 Standard_EXPORT Units_Measurement(const Standard_Real avalue, const Handle(Units_Token)& atoken);
0043
0044
0045
0046
0047 Standard_EXPORT Units_Measurement(const Standard_Real avalue, const Standard_CString aunit);
0048
0049
0050
0051
0052
0053 Standard_EXPORT void Convert (const Standard_CString aunit);
0054
0055
0056
0057 Standard_EXPORT Units_Measurement Integer() const;
0058
0059
0060
0061 Standard_EXPORT Units_Measurement Fractional() const;
0062
0063
0064 Standard_EXPORT Standard_Real Measurement() const;
0065
0066
0067 Standard_EXPORT Handle(Units_Token) Token() const;
0068
0069
0070
0071
0072 Standard_EXPORT Units_Measurement Add (const Units_Measurement& ameasurement) const;
0073 Units_Measurement operator + (const Units_Measurement& ameasurement) const
0074 {
0075 return Add(ameasurement);
0076 }
0077
0078
0079
0080
0081 Standard_EXPORT Units_Measurement Subtract (const Units_Measurement& ameasurement) const;
0082 Units_Measurement operator - (const Units_Measurement& ameasurement) const
0083 {
0084 return Subtract(ameasurement);
0085 }
0086
0087
0088
0089 Standard_EXPORT Units_Measurement Multiply (const Units_Measurement& ameasurement) const;
0090 Units_Measurement operator * (const Units_Measurement& ameasurement) const
0091 {
0092 return Multiply(ameasurement);
0093 }
0094
0095
0096
0097 Standard_EXPORT Units_Measurement Multiply (const Standard_Real avalue) const;
0098 Units_Measurement operator * (const Standard_Real avalue) const
0099 {
0100 return Multiply(avalue);
0101 }
0102
0103
0104
0105 Standard_EXPORT Units_Measurement Divide (const Units_Measurement& ameasurement) const;
0106 Units_Measurement operator / (const Units_Measurement& ameasurement) const
0107 {
0108 return Divide(ameasurement);
0109 }
0110
0111
0112
0113 Standard_EXPORT Units_Measurement Divide (const Standard_Real avalue) const;
0114 Units_Measurement operator / (const Standard_Real avalue) const
0115 {
0116 return Divide(avalue);
0117 }
0118
0119
0120
0121 Standard_EXPORT Units_Measurement Power (const Standard_Real anexponent) const;
0122
0123 Standard_EXPORT Standard_Boolean HasToken() const;
0124
0125
0126 Standard_EXPORT void Dump() const;
0127
0128
0129
0130
0131 protected:
0132
0133
0134
0135
0136
0137 private:
0138
0139
0140
0141 Standard_Real themeasurement;
0142 Handle(Units_Token) thetoken;
0143 Standard_Boolean myHasToken;
0144
0145
0146 };
0147
0148
0149
0150
0151
0152
0153
0154 #endif