0027961: Visualization - remove unused and no more working OpenGl_AVIWriter
[occt.git] / src / RWStepBasic / RWStepBasic_RWMechanicalContext.cxx
1 // Created on: 1996-07-24
2 // Created by: Frederic MAUPAS
3 // Copyright (c) 1996-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
18 #include <Interface_Check.hxx>
19 #include <Interface_EntityIterator.hxx>
20 #include <RWStepBasic_RWMechanicalContext.hxx>
21 #include <StepBasic_ApplicationContext.hxx>
22 #include <StepBasic_MechanicalContext.hxx>
23 #include <StepData_StepReaderData.hxx>
24 #include <StepData_StepWriter.hxx>
25
26 RWStepBasic_RWMechanicalContext::RWStepBasic_RWMechanicalContext () {}
27
28 void RWStepBasic_RWMechanicalContext::ReadStep
29         (const Handle(StepData_StepReaderData)& data,
30          const Standard_Integer num,
31          Handle(Interface_Check)& ach,
32          const Handle(StepBasic_MechanicalContext)& ent) const
33 {
34
35
36         // --- Number of Parameter Control ---
37
38         if (!data->CheckNbParams(num,3,ach,"mechanical_context")) return;
39
40         // --- inherited field : name ---
41
42         Handle(TCollection_HAsciiString) aName;
43         //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
44         data->ReadString (num,1,"name",ach,aName);
45
46         // --- inherited field : frameOfReference ---
47
48         Handle(StepBasic_ApplicationContext) aFrameOfReference;
49         //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed
50         data->ReadEntity(num, 2,"frame_of_reference", ach, STANDARD_TYPE(StepBasic_ApplicationContext), aFrameOfReference);
51
52         // --- own field : disciplineType ---
53
54         Handle(TCollection_HAsciiString) aDisciplineType;
55         //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
56         data->ReadString (num,3,"discipline_type",ach,aDisciplineType);
57
58         //--- Initialisation of the read entity ---
59
60
61         ent->Init(aName, aFrameOfReference, aDisciplineType);
62 }
63
64
65 void RWStepBasic_RWMechanicalContext::WriteStep
66         (StepData_StepWriter& SW,
67          const Handle(StepBasic_MechanicalContext)& ent) const
68 {
69
70         // --- inherited field name ---
71
72         SW.Send(ent->Name());
73
74         // --- inherited field frameOfReference ---
75
76         SW.Send(ent->FrameOfReference());
77
78         // --- own field : disciplineType ---
79
80         SW.Send(ent->DisciplineType());
81 }
82
83
84 void RWStepBasic_RWMechanicalContext::Share(const Handle(StepBasic_MechanicalContext)& ent, Interface_EntityIterator& iter) const
85 {
86
87         iter.GetOneItem(ent->FrameOfReference());
88 }
89