0030895: Coding Rules - specify std namespace explicitly for std::cout and streams
[occt.git] / src / StepBasic / StepBasic_SiUnit.cxx
CommitLineData
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
42cf5bc1 15#include <Standard_Type.hxx>
16#include <StepBasic_DimensionalExponents.hxx>
17#include <StepBasic_SiUnit.hxx>
7fd59977 18
92efcf78 19IMPLEMENT_STANDARD_RTTIEXT(StepBasic_SiUnit,StepBasic_NamedUnit)
20
7fd59977 21StepBasic_SiUnit::StepBasic_SiUnit () {}
22
7fd59977 23void StepBasic_SiUnit::Init(const Standard_Boolean hasAprefix,
24 const StepBasic_SiPrefix aPrefix,
25 const StepBasic_SiUnitName aName)
26{
27 // --- classe own fields ---
28 hasPrefix = hasAprefix;
29 prefix = aPrefix;
30 name = aName;
31 // --- classe inherited fields ---
32 Handle(StepBasic_DimensionalExponents) aDimensions;
33 aDimensions.Nullify();
34 StepBasic_NamedUnit::Init(aDimensions);
35}
36
37
38void StepBasic_SiUnit::SetPrefix(const StepBasic_SiPrefix aPrefix)
39{
40 prefix = aPrefix;
41 hasPrefix = Standard_True;
42}
43
44
45void StepBasic_SiUnit::UnSetPrefix()
46{
47 hasPrefix = Standard_False;
48}
49
50
51StepBasic_SiPrefix StepBasic_SiUnit::Prefix() const
52{
53 return prefix;
54}
55
56
57Standard_Boolean StepBasic_SiUnit::HasPrefix() const
58{
59 return hasPrefix;
60}
61
62
63void StepBasic_SiUnit::SetName(const StepBasic_SiUnitName aName)
64{
65 name = aName;
66}
67
68
69StepBasic_SiUnitName StepBasic_SiUnit::Name() const
70{
71 return name;
72}
73
74
302f96fb 75void StepBasic_SiUnit::SetDimensions(const Handle(StepBasic_DimensionalExponents)& /*aDimensions*/)
7fd59977 76{
77 // WARNING : the field is redefined.
78 // field set up forbidden.
0797d9d3 79#ifdef OCCT_DEBUG
04232180 80 std::cout << "Field is redefined, SetUp Forbidden" << std::endl;
7fd59977 81#endif
82}
83
84
85Handle(StepBasic_DimensionalExponents) StepBasic_SiUnit::Dimensions() const
86{
87 // WARNING : the field is redefined.
88 // method body is not yet automaticly wrote
89
90 // attention : dimensional exponent retourne incorrect (pointeur NULL).
91 // on devrait, en fonction du nom de l unite SI, construire un dimensional
92 // exponents coherent. (du style .METRE. => (1,0,0,0,0,0) ... )
93
94 Handle(StepBasic_DimensionalExponents) aDimensions;
95 aDimensions.Nullify();
96 return aDimensions;
97
98}