1 // Created on: 1994-05-09
2 // Created by: Gilles DEBARBOUILLE
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 _Units_Explorer_HeaderFile
18 #define _Units_Explorer_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Integer.hxx>
25 #include <Units_QuantitiesSequence.hxx>
26 #include <Units_UnitsSequence.hxx>
27 #include <TColStd_HSequenceOfInteger.hxx>
28 #include <Standard_CString.hxx>
29 #include <Standard_Boolean.hxx>
30 class Units_UnitsSystem;
31 class Units_UnitsDictionary;
32 class TCollection_AsciiString;
35 //! This class provides all the services to explore
36 //! UnitsSystem or UnitsDictionary.
44 //! Empty contructor of the class.
45 Standard_EXPORT Units_Explorer();
47 //! Creates a new instance of the class, initialized with
48 //! the UnitsSystem <aunitssystem>.
49 Standard_EXPORT Units_Explorer(const Handle(Units_UnitsSystem)& aunitssystem);
51 //! Creates a new instance of the class, initialized with
52 //! the UnitsDictionary <aunitsdictionary>.
53 Standard_EXPORT Units_Explorer(const Handle(Units_UnitsDictionary)& aunitsdictionary);
55 //! Creates a new instance of the class, initialized with
56 //! the UnitsSystem <aunitssystem> and positioned at the
57 //! quantity <aquantity>.
58 Standard_EXPORT Units_Explorer(const Handle(Units_UnitsSystem)& aunitssystem, const Standard_CString aquantity);
60 //! Creates a new instance of the class, initialized with
61 //! the UnitsDictionary <aunitsdictionary> and positioned
62 //! at the quantity <aquantity>.
63 Standard_EXPORT Units_Explorer(const Handle(Units_UnitsDictionary)& aunitsdictionary, const Standard_CString aquantity);
65 //! Initializes the instance of the class with the
66 //! UnitsSystem <aunitssystem>.
67 Standard_EXPORT void Init (const Handle(Units_UnitsSystem)& aunitssystem);
69 //! Initializes the instance of the class with the
70 //! UnitsDictionary <aunitsdictionary>.
71 Standard_EXPORT void Init (const Handle(Units_UnitsDictionary)& aunitsdictionary);
73 //! Initializes the instance of the class with the
74 //! UnitsSystem <aunitssystem> and positioned at the
75 //! quantity <aquantity>.
76 Standard_EXPORT void Init (const Handle(Units_UnitsSystem)& aunitssystem, const Standard_CString aquantity);
78 //! Initializes the instance of the class with the
79 //! UnitsDictionary <aunitsdictionary> and positioned at
80 //! the quantity <aquantity>.
81 Standard_EXPORT void Init (const Handle(Units_UnitsDictionary)& aunitsdictionary, const Standard_CString aquantity);
83 //! Returns True if there is another Quantity to explore,
85 Standard_EXPORT Standard_Boolean MoreQuantity() const;
87 //! Sets the next Quantity current.
88 Standard_EXPORT void NextQuantity();
90 //! Returns the name of the current Quantity.
91 Standard_EXPORT TCollection_AsciiString Quantity() const;
93 //! Returns True if there is another Unit to explore,
95 Standard_EXPORT Standard_Boolean MoreUnit() const;
97 //! Sets the next Unit current.
98 Standard_EXPORT void NextUnit();
100 //! Returns the name of the current unit.
101 Standard_EXPORT TCollection_AsciiString Unit() const;
103 //! If the units system to explore is a user system,
104 //! returns True if the current unit is active, False
107 //! If the units system to explore is the units
108 //! dictionary, returns True if the current unit is the
110 Standard_EXPORT Standard_Boolean IsActive() const;
125 Standard_Integer thecurrentquantity;
126 Handle(Units_QuantitiesSequence) thequantitiessequence;
127 Standard_Integer thecurrentunit;
128 Handle(Units_UnitsSequence) theunitssequence;
129 Handle(TColStd_HSequenceOfInteger) theactiveunitssequence;
140 #endif // _Units_Explorer_HeaderFile