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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _Units_Quantity_HeaderFile
18 #define _Units_Quantity_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
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;
34 DEFINE_STANDARD_HANDLE(Units_Quantity, Standard_Transient)
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
40 class Units_Quantity : public Standard_Transient
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);
52 //! Returns in a AsciiString from TCollection the name of the quantity.
53 TCollection_AsciiString Name() const;
55 //! Returns the physical dimensions of the quantity.
56 Handle(Units_Dimensions) Dimensions() const;
58 //! Returns <theunitssequence>, which is the sequence of
59 //! all the units stored for this physical quantity.
60 Handle(Units_UnitsSequence) Sequence() const;
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;
66 //! Useful for debugging.
67 Standard_EXPORT void Dump (const Standard_Integer ashift, const Standard_Integer alevel) const;
72 DEFINE_STANDARD_RTTIEXT(Units_Quantity,Standard_Transient)
82 Handle(TCollection_HAsciiString) thename;
83 Handle(Units_Dimensions) thedimensions;
84 Handle(Units_UnitsSequence) theunitssequence;
90 #include <Units_Quantity.lxx>
96 #endif // _Units_Quantity_HeaderFile