1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
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
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.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
15 #include <Standard_Type.hxx>
16 #include <StepBasic_MeasureValueMember.hxx>
17 #include <StepBasic_MeasureWithUnit.hxx>
18 #include <StepBasic_Unit.hxx>
20 IMPLEMENT_STANDARD_RTTIEXT(StepBasic_MeasureWithUnit,Standard_Transient)
22 //=======================================================================
23 //function : StepBasic_MeasureWithUnit
25 //=======================================================================
26 StepBasic_MeasureWithUnit::StepBasic_MeasureWithUnit () {}
28 //=======================================================================
31 //=======================================================================
33 void StepBasic_MeasureWithUnit::Init(
34 const Handle(StepBasic_MeasureValueMember)& aValueComponent,
35 const StepBasic_Unit &aUnitComponent)
37 // --- classe own fields ---
38 valueComponent = aValueComponent;
39 unitComponent = aUnitComponent;
43 //=======================================================================
44 //function : SetValueComponent
46 //=======================================================================
48 void StepBasic_MeasureWithUnit::SetValueComponent(const Standard_Real aValueComponent)
50 if (valueComponent.IsNull()) valueComponent = new StepBasic_MeasureValueMember;
51 valueComponent->SetReal(aValueComponent);
54 //=======================================================================
55 //function : ValueComponent
57 //=======================================================================
59 Standard_Real StepBasic_MeasureWithUnit::ValueComponent() const
61 return (valueComponent.IsNull() ? 0.0 : valueComponent->Real());
64 //=======================================================================
65 //function : ValueComponentMember
67 //=======================================================================
69 Handle(StepBasic_MeasureValueMember) StepBasic_MeasureWithUnit::ValueComponentMember () const
70 { return valueComponent; }
72 //=======================================================================
73 //function : SetValueComponentMember
75 //=======================================================================
77 void StepBasic_MeasureWithUnit::SetValueComponentMember (const Handle(StepBasic_MeasureValueMember)& val)
78 { valueComponent = val; }
80 //=======================================================================
81 //function : SetUnitComponent
83 //=======================================================================
85 void StepBasic_MeasureWithUnit::SetUnitComponent(const StepBasic_Unit& aUnitComponent)
87 unitComponent = aUnitComponent;
90 //=======================================================================
91 //function : UnitComponent
93 //=======================================================================
95 StepBasic_Unit StepBasic_MeasureWithUnit::UnitComponent() const