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 <Interface_Check.hxx>
16 #include <Interface_EntityIterator.hxx>
17 #include <RWStepShape_RWToleranceValue.hxx>
18 #include <StepBasic_MeasureWithUnit.hxx>
19 #include <StepData_StepReaderData.hxx>
20 #include <StepData_StepWriter.hxx>
21 #include <StepShape_ToleranceValue.hxx>
23 RWStepShape_RWToleranceValue::RWStepShape_RWToleranceValue () {}
25 void RWStepShape_RWToleranceValue::ReadStep
26 (const Handle(StepData_StepReaderData)& data,
27 const Standard_Integer num,
28 Handle(Interface_Check)& ach,
29 const Handle(StepShape_ToleranceValue)& ent) const
31 // --- Number of Parameter Control ---
33 if (!data->CheckNbParams(num,2,ach,"tolerance_value")) return;
35 // --- own field : lower_bound ---
37 Handle(StepBasic_MeasureWithUnit) LB;
38 data->ReadEntity (num,1,"lower_bound",ach,
39 STANDARD_TYPE(StepBasic_MeasureWithUnit),LB);
41 // --- own field : upper_bound ---
43 Handle(StepBasic_MeasureWithUnit) UB;
44 data->ReadEntity (num,2,"upper_bound",ach,
45 STANDARD_TYPE(StepBasic_MeasureWithUnit),UB);
47 //--- Initialisation of the read entity ---
53 void RWStepShape_RWToleranceValue::WriteStep
54 (StepData_StepWriter& SW,
55 const Handle(StepShape_ToleranceValue)& ent) const
57 SW.Send (ent->LowerBound());
58 SW.Send (ent->UpperBound());
62 void RWStepShape_RWToleranceValue::Share(const Handle(StepShape_ToleranceValue)& ent, Interface_EntityIterator& iter) const
64 iter.AddItem (ent->LowerBound());
65 iter.AddItem (ent->UpperBound());