0031687: Draw Harness, ViewerTest - extend command vrenderparams with option updating...
[occt.git] / src / Units / Units_Explorer.hxx
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
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_Explorer_HeaderFile
18 #define _Units_Explorer_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
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;
33
34
35 //! This class provides all the services to explore
36 //! UnitsSystem or UnitsDictionary.
37 class Units_Explorer 
38 {
39 public:
40
41   DEFINE_STANDARD_ALLOC
42
43   
44   //! Empty contructor of the class.
45   Standard_EXPORT Units_Explorer();
46   
47   //! Creates a new instance of the class, initialized with
48   //! the UnitsSystem <aunitssystem>.
49   Standard_EXPORT Units_Explorer(const Handle(Units_UnitsSystem)& aunitssystem);
50   
51   //! Creates a new instance of the class, initialized with
52   //! the UnitsDictionary <aunitsdictionary>.
53   Standard_EXPORT Units_Explorer(const Handle(Units_UnitsDictionary)& aunitsdictionary);
54   
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);
59   
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);
64   
65   //! Initializes  the  instance  of  the  class  with  the
66   //! UnitsSystem <aunitssystem>.
67   Standard_EXPORT void Init (const Handle(Units_UnitsSystem)& aunitssystem);
68   
69   //! Initializes  the  instance  of  the  class  with  the
70   //! UnitsDictionary <aunitsdictionary>.
71   Standard_EXPORT void Init (const Handle(Units_UnitsDictionary)& aunitsdictionary);
72   
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);
77   
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);
82   
83   //! Returns True if there is another Quantity to explore,
84   //! False otherwise.
85   Standard_EXPORT Standard_Boolean MoreQuantity() const;
86   
87   //! Sets the next Quantity current.
88   Standard_EXPORT void NextQuantity();
89   
90   //! Returns the name of the current Quantity.
91   Standard_EXPORT TCollection_AsciiString Quantity() const;
92   
93   //! Returns True if there is another Unit to explore,
94   //! False otherwise.
95   Standard_EXPORT Standard_Boolean MoreUnit() const;
96   
97   //! Sets the next Unit current.
98   Standard_EXPORT void NextUnit();
99   
100   //! Returns the name of the current unit.
101   Standard_EXPORT TCollection_AsciiString Unit() const;
102   
103   //! If the  units system  to  explore  is  a user  system,
104   //! returns True  if  the  current unit  is  active, False
105   //! otherwise.
106   //!
107   //! If   the   units  system  to  explore  is   the  units
108   //! dictionary,  returns True if the  current unit is  the
109   //! S.I. unit.
110   Standard_EXPORT Standard_Boolean IsActive() const;
111
112
113
114
115 protected:
116
117
118
119
120
121 private:
122
123
124
125   Standard_Integer thecurrentquantity;
126   Handle(Units_QuantitiesSequence) thequantitiessequence;
127   Standard_Integer thecurrentunit;
128   Handle(Units_UnitsSequence) theunitssequence;
129   Handle(TColStd_HSequenceOfInteger) theactiveunitssequence;
130
131
132 };
133
134
135
136
137
138
139
140 #endif // _Units_Explorer_HeaderFile