1 // Created on: 1994-07-19
2 // Created by: Guest Kernel
3 // Copyright (c) 1994-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 _Quantity_Convert_HeaderFile
18 #define _Quantity_Convert_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Quantity_PhysicalQuantity.hxx>
25 #include <Quantity_Coefficient.hxx>
26 #include <Standard_Real.hxx>
27 #include <Standard_Boolean.hxx>
28 class TCollection_AsciiString;
31 //! Services to manage units conversion between Front-ends and Engines.
32 //! This conversion is managed by a table of correspondance between the quantities
33 //! and their "conversion coefficient".
34 //! This table is implemented like an external array (TCollection_Array1) regarding
35 //! to the quantities enumeration.
36 class Quantity_Convert
43 //! Creates an object;
44 Standard_EXPORT Quantity_Convert();
46 //! Updates the conversion table (correspondances between
47 //! Quantities and conversion coefficients).
48 static void SetQuantity (const Quantity_PhysicalQuantity aQuantity, const Quantity_Coefficient aCoef);
50 //! Converts, from the conversion table, the value <aVal>
51 //! from the user system to the SI system.
52 static Standard_Real ConvertUserToSI (const Quantity_PhysicalQuantity aQuantity, const Standard_Real aVal);
54 //! Converts, from the conversion table, the value <aVal>
55 //! from the SI system to the user system.
56 static Standard_Real ConvertSIToUser (const Quantity_PhysicalQuantity aQuantity, const Standard_Real aVal);
59 //! if (aType is a physical quantity)
60 //! returns True and the name of the associated PhysicalQuantity .
63 Standard_EXPORT static Standard_Boolean IsPhysicalQuantity (const TCollection_AsciiString& aTypeName, TCollection_AsciiString& anEnum);
83 #include <Quantity_Convert.lxx>
89 #endif // _Quantity_Convert_HeaderFile