1 // Created on: 1992-06-22 2 // Created by: Gilles DEBARBOUILLE 3 // Copyright (c) 1992-1999 Matra Datavision 4 // Copyright (c) 1999-2014 OPEN CASCADE SAS 5 // 6 // This file is part of Open CASCADE Technology software library. 7 // 8 // This library is free software; you can redistribute it and/or modify it under 9 // the terms of the GNU Lesser General Public License version 2.1 as published 10 // by the Free Software Foundation, with special exception defined in the file 11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT 12 // distribution for complete text of the license and disclaimer of any warranty. 13 // 14 // Alternatively, this file may be used under the terms of Open CASCADE 15 // commercial license or contractual agreement. 16 17 #ifndef _Units_Quantity_HeaderFile 18 #define _Units_Quantity_HeaderFile 19 20 #include <Standard.hxx> 21 #include <Standard_Type.hxx> 22 23 #include <Units_UnitsSequence.hxx> 24 #include <Standard_Transient.hxx> 25 #include <Standard_CString.hxx> 26 #include <TCollection_AsciiString.hxx> 27 #include <Standard_Boolean.hxx> 28 #include <Standard_Integer.hxx> 29 class TCollection_HAsciiString; 30 class Units_Dimensions; 31 32 33 class Units_Quantity; 34 DEFINE_STANDARD_HANDLE(Units_Quantity, Standard_Transient) 35 36 //! This class stores in its field all the possible 37 //! units of all the unit systems for a given physical 38 //! quantity. Each unit's value is expressed in the 39 //! S.I. unit system. 40 class Units_Quantity : public Standard_Transient 41 { 42 43 public: 44 45 46 //! Creates a new Quantity object with <aname> which is 47 //! the name of the physical quantity, <adimensions> which 48 //! is the physical dimensions, and <aunitssequence> which 49 //! describes all the units known for this quantity. 50 Units_Quantity(const Standard_CString aname, const Handle(Units_Dimensions)& adimensions, const Handle(Units_UnitsSequence)& aunitssequence); 51 52 //! Returns in a AsciiString from TCollection the name of the quantity. 53 TCollection_AsciiString Name() const; 54 55 //! Returns the physical dimensions of the quantity. 56 Handle(Units_Dimensions) Dimensions() const; 57 58 //! Returns <theunitssequence>, which is the sequence of 59 //! all the units stored for this physical quantity. 60 Handle(Units_UnitsSequence) Sequence() const; 61 62 //! Returns True if the name of the Quantity <me> is equal 63 //! to <astring>, False otherwise. 64 Standard_EXPORT Standard_Boolean IsEqual (const Standard_CString astring) const; 65 66 //! Useful for debugging. 67 Standard_EXPORT void Dump (const Standard_Integer ashift, const Standard_Integer alevel) const; 68 69 70 71 72 DEFINE_STANDARD_RTTIEXT(Units_Quantity,Standard_Transient) 73 74 protected: 75 76 77 78 79 private: 80 81 82 Handle(TCollection_HAsciiString) thename; 83 Handle(Units_Dimensions) thedimensions; 84 Handle(Units_UnitsSequence) theunitssequence; 85 86 87 }; 88 89 90 #include <Units_Quantity.lxx> 91 92 93 94 95 96 #endif // _Units_Quantity_HeaderFile 97