0024624: Lost word in license statement in source files
[occt.git] / src / IGESAppli / IGESAppli_ToolFiniteElement.cxx
CommitLineData
b311480e 1// Created by: CKY / Contract Toubro-Larsen
2// Copyright (c) 1993-1999 Matra Datavision
973c2be1 3// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
7fd59977 6//
d5f74e42 7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 9// by the Free Software Foundation, with special exception defined in the file
10// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11// distribution for complete text of the license and disclaimer of any warranty.
7fd59977 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
b311480e 15
16//--------------------------------------------------------------------
7fd59977 17//--------------------------------------------------------------------
18
19#include <IGESAppli_ToolFiniteElement.ixx>
20#include <IGESData_ParamCursor.hxx>
21#include <IGESAppli_Node.hxx>
22#include <IGESAppli_HArray1OfNode.hxx>
23#include <TCollection_HAsciiString.hxx>
24#include <IGESData_Dump.hxx>
25#include <Interface_Macros.hxx>
26
27
28IGESAppli_ToolFiniteElement::IGESAppli_ToolFiniteElement () { }
29
30
31void IGESAppli_ToolFiniteElement::ReadOwnParams
32 (const Handle(IGESAppli_FiniteElement)& ent,
33 const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
34{
35 Standard_Integer tempTopology;
36 Handle(TCollection_HAsciiString) tempName;
37 Standard_Integer nbval = 0;
38 //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
39 Handle(IGESAppli_HArray1OfNode) tempData;
40
41 //szv#4:S4163:12Mar99 `st=` not needed
42 PR.ReadInteger(PR.Current(),"Topology type",tempTopology);
43 PR.ReadInteger(PR.Current(),"No. of nodes defining element",nbval);
44 tempData = new IGESAppli_HArray1OfNode(1,nbval);
45 for (Standard_Integer i = 1; i <= nbval; i ++)
46 {
47 Handle(IGESAppli_Node) tempNode;
48 //szv#4:S4163:12Mar99 moved in if
49 if (PR.ReadEntity (IR,PR.Current(),"Node defining element", STANDARD_TYPE(IGESAppli_Node),tempNode))
50 tempData->SetValue(i,tempNode);
51 }
52 PR.ReadText(PR.Current(),"Element type name",tempName); //szv#4:S4163:12Mar99 `st=` not needed
53
54 DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
55 ent->Init(tempTopology,tempData,tempName);
56}
57
58void IGESAppli_ToolFiniteElement::WriteOwnParams
59 (const Handle(IGESAppli_FiniteElement)& ent, IGESData_IGESWriter& IW) const
60{
61 Standard_Integer upper = ent->NbNodes();
62 IW.Send(ent->Topology());
63 IW.Send(upper);
64 for (Standard_Integer i= 1; i <= upper ; i ++)
65 IW.Send(ent->Node(i));
66 IW.Send(ent->Name());
67}
68
69void IGESAppli_ToolFiniteElement::OwnShared
70 (const Handle(IGESAppli_FiniteElement)& ent, Interface_EntityIterator& iter) const
71{
72 Standard_Integer upper = ent->NbNodes();
73 for (Standard_Integer i= 1; i <= upper ; i ++)
74 iter.GetOneItem(ent->Node(i));
75}
76
77void IGESAppli_ToolFiniteElement::OwnCopy
78 (const Handle(IGESAppli_FiniteElement)& another,
79 const Handle(IGESAppli_FiniteElement)& ent, Interface_CopyTool& TC) const
80{
81 Standard_Integer aTopology = another->Topology();
82 Handle(TCollection_HAsciiString) aName =
83 new TCollection_HAsciiString(another->Name());
84 Standard_Integer nbval = another->NbNodes();
85 Handle(IGESAppli_HArray1OfNode) aList = new
86 IGESAppli_HArray1OfNode(1,nbval);
87 for (Standard_Integer i=1;i <=nbval;i++)
88 {
89 DeclareAndCast(IGESAppli_Node,aEntity,TC.Transferred(another->Node(i)));
90 aList->SetValue(i,aEntity);
91 }
92 ent->Init(aTopology,aList,aName);
93}
94
95IGESData_DirChecker IGESAppli_ToolFiniteElement::DirChecker
96 (const Handle(IGESAppli_FiniteElement)& /* ent */ ) const
97{
98 IGESData_DirChecker DC(136,0); //Form no = 0 & Type = 136
99 DC.Structure(IGESData_DefVoid);
100 DC.LineFont(IGESData_DefAny);
101 DC.LineWeight(IGESData_DefVoid);
102 DC.Color(IGESData_DefAny);
103 DC.BlankStatusIgnored();
104 DC.SubordinateStatusIgnored();
105 DC.UseFlagIgnored();
106 DC.HierarchyStatusIgnored();
107 return DC;
108}
109
110void IGESAppli_ToolFiniteElement::OwnCheck
111 (const Handle(IGESAppli_FiniteElement)& /* ent */,
112 const Interface_ShareTool& , Handle(Interface_Check)& /* ach */) const
113{
114}
115
116void IGESAppli_ToolFiniteElement::OwnDump
117 (const Handle(IGESAppli_FiniteElement)& ent, const IGESData_IGESDumper& dumper,
118 const Handle(Message_Messenger)& S, const Standard_Integer level) const
119{
120 S << "IGESAppli_FiniteElement" << endl;
121
122 S << "Topology type : " << ent->Topology() << endl;
123 S << "Nodes : ";
124 IGESData_DumpEntities(S,dumper ,level,1, ent->NbNodes(),ent->Node);
125 S << endl << "Element Name : " << ent->Name();
126 S << endl;
127}