973c2be1 |
1 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
2 | // |
973c2be1 |
3 | // This file is part of Open CASCADE Technology software library. |
b311480e |
4 | // |
d5f74e42 |
5 | // This library is free software; you can redistribute it and/or modify it under |
6 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
7 | // by the Free Software Foundation, with special exception defined in the file |
8 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
9 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
10 | // |
973c2be1 |
11 | // Alternatively, this file may be used under the terms of Open CASCADE |
12 | // commercial license or contractual agreement. |
b311480e |
13 | |
7fd59977 |
14 | #include <StepBasic_SiUnit.ixx> |
15 | |
16 | |
17 | StepBasic_SiUnit::StepBasic_SiUnit () {} |
18 | |
19 | void StepBasic_SiUnit::Init( |
20 | const Handle(StepBasic_DimensionalExponents)& aDimensions) |
21 | { |
22 | StepBasic_NamedUnit::Init(aDimensions); |
23 | } |
24 | |
25 | void StepBasic_SiUnit::Init(const Standard_Boolean hasAprefix, |
26 | const StepBasic_SiPrefix aPrefix, |
27 | const StepBasic_SiUnitName aName) |
28 | { |
29 | // --- classe own fields --- |
30 | hasPrefix = hasAprefix; |
31 | prefix = aPrefix; |
32 | name = aName; |
33 | // --- classe inherited fields --- |
34 | Handle(StepBasic_DimensionalExponents) aDimensions; |
35 | aDimensions.Nullify(); |
36 | StepBasic_NamedUnit::Init(aDimensions); |
37 | } |
38 | |
39 | |
40 | void StepBasic_SiUnit::SetPrefix(const StepBasic_SiPrefix aPrefix) |
41 | { |
42 | prefix = aPrefix; |
43 | hasPrefix = Standard_True; |
44 | } |
45 | |
46 | |
47 | void StepBasic_SiUnit::UnSetPrefix() |
48 | { |
49 | hasPrefix = Standard_False; |
50 | } |
51 | |
52 | |
53 | StepBasic_SiPrefix StepBasic_SiUnit::Prefix() const |
54 | { |
55 | return prefix; |
56 | } |
57 | |
58 | |
59 | Standard_Boolean StepBasic_SiUnit::HasPrefix() const |
60 | { |
61 | return hasPrefix; |
62 | } |
63 | |
64 | |
65 | void StepBasic_SiUnit::SetName(const StepBasic_SiUnitName aName) |
66 | { |
67 | name = aName; |
68 | } |
69 | |
70 | |
71 | StepBasic_SiUnitName StepBasic_SiUnit::Name() const |
72 | { |
73 | return name; |
74 | } |
75 | |
76 | |
302f96fb |
77 | void StepBasic_SiUnit::SetDimensions(const Handle(StepBasic_DimensionalExponents)& /*aDimensions*/) |
7fd59977 |
78 | { |
79 | // WARNING : the field is redefined. |
80 | // field set up forbidden. |
63c629aa |
81 | #ifdef STEPBASIC_DEB |
7fd59977 |
82 | cout << "Field is redefined, SetUp Forbidden" << endl; |
83 | #endif |
84 | } |
85 | |
86 | |
87 | Handle(StepBasic_DimensionalExponents) StepBasic_SiUnit::Dimensions() const |
88 | { |
89 | // WARNING : the field is redefined. |
90 | // method body is not yet automaticly wrote |
91 | |
92 | // attention : dimensional exponent retourne incorrect (pointeur NULL). |
93 | // on devrait, en fonction du nom de l unite SI, construire un dimensional |
94 | // exponents coherent. (du style .METRE. => (1,0,0,0,0,0) ... ) |
95 | |
96 | Handle(StepBasic_DimensionalExponents) aDimensions; |
97 | aDimensions.Nullify(); |
98 | return aDimensions; |
99 | |
100 | } |