7fd59977 |
1 | //-------------------------------------------------------------------- |
2 | // |
3 | // File Name : IGESAppli_FiniteElement.cxx |
4 | // Date : |
5 | // Author : CKY / Contract Toubro-Larsen |
6 | // Copyright : MATRA-DATAVISION 1993 |
7 | // |
8 | //-------------------------------------------------------------------- |
9 | |
10 | #include <IGESAppli_ToolFiniteElement.ixx> |
11 | #include <IGESData_ParamCursor.hxx> |
12 | #include <IGESAppli_Node.hxx> |
13 | #include <IGESAppli_HArray1OfNode.hxx> |
14 | #include <TCollection_HAsciiString.hxx> |
15 | #include <IGESData_Dump.hxx> |
16 | #include <Interface_Macros.hxx> |
17 | |
18 | |
19 | IGESAppli_ToolFiniteElement::IGESAppli_ToolFiniteElement () { } |
20 | |
21 | |
22 | void IGESAppli_ToolFiniteElement::ReadOwnParams |
23 | (const Handle(IGESAppli_FiniteElement)& ent, |
24 | const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const |
25 | { |
26 | Standard_Integer tempTopology; |
27 | Handle(TCollection_HAsciiString) tempName; |
28 | Standard_Integer nbval = 0; |
29 | //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed |
30 | Handle(IGESAppli_HArray1OfNode) tempData; |
31 | |
32 | //szv#4:S4163:12Mar99 `st=` not needed |
33 | PR.ReadInteger(PR.Current(),"Topology type",tempTopology); |
34 | PR.ReadInteger(PR.Current(),"No. of nodes defining element",nbval); |
35 | tempData = new IGESAppli_HArray1OfNode(1,nbval); |
36 | for (Standard_Integer i = 1; i <= nbval; i ++) |
37 | { |
38 | Handle(IGESAppli_Node) tempNode; |
39 | //szv#4:S4163:12Mar99 moved in if |
40 | if (PR.ReadEntity (IR,PR.Current(),"Node defining element", STANDARD_TYPE(IGESAppli_Node),tempNode)) |
41 | tempData->SetValue(i,tempNode); |
42 | } |
43 | PR.ReadText(PR.Current(),"Element type name",tempName); //szv#4:S4163:12Mar99 `st=` not needed |
44 | |
45 | DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); |
46 | ent->Init(tempTopology,tempData,tempName); |
47 | } |
48 | |
49 | void IGESAppli_ToolFiniteElement::WriteOwnParams |
50 | (const Handle(IGESAppli_FiniteElement)& ent, IGESData_IGESWriter& IW) const |
51 | { |
52 | Standard_Integer upper = ent->NbNodes(); |
53 | IW.Send(ent->Topology()); |
54 | IW.Send(upper); |
55 | for (Standard_Integer i= 1; i <= upper ; i ++) |
56 | IW.Send(ent->Node(i)); |
57 | IW.Send(ent->Name()); |
58 | } |
59 | |
60 | void IGESAppli_ToolFiniteElement::OwnShared |
61 | (const Handle(IGESAppli_FiniteElement)& ent, Interface_EntityIterator& iter) const |
62 | { |
63 | Standard_Integer upper = ent->NbNodes(); |
64 | for (Standard_Integer i= 1; i <= upper ; i ++) |
65 | iter.GetOneItem(ent->Node(i)); |
66 | } |
67 | |
68 | void IGESAppli_ToolFiniteElement::OwnCopy |
69 | (const Handle(IGESAppli_FiniteElement)& another, |
70 | const Handle(IGESAppli_FiniteElement)& ent, Interface_CopyTool& TC) const |
71 | { |
72 | Standard_Integer aTopology = another->Topology(); |
73 | Handle(TCollection_HAsciiString) aName = |
74 | new TCollection_HAsciiString(another->Name()); |
75 | Standard_Integer nbval = another->NbNodes(); |
76 | Handle(IGESAppli_HArray1OfNode) aList = new |
77 | IGESAppli_HArray1OfNode(1,nbval); |
78 | for (Standard_Integer i=1;i <=nbval;i++) |
79 | { |
80 | DeclareAndCast(IGESAppli_Node,aEntity,TC.Transferred(another->Node(i))); |
81 | aList->SetValue(i,aEntity); |
82 | } |
83 | ent->Init(aTopology,aList,aName); |
84 | } |
85 | |
86 | IGESData_DirChecker IGESAppli_ToolFiniteElement::DirChecker |
87 | (const Handle(IGESAppli_FiniteElement)& /* ent */ ) const |
88 | { |
89 | IGESData_DirChecker DC(136,0); //Form no = 0 & Type = 136 |
90 | DC.Structure(IGESData_DefVoid); |
91 | DC.LineFont(IGESData_DefAny); |
92 | DC.LineWeight(IGESData_DefVoid); |
93 | DC.Color(IGESData_DefAny); |
94 | DC.BlankStatusIgnored(); |
95 | DC.SubordinateStatusIgnored(); |
96 | DC.UseFlagIgnored(); |
97 | DC.HierarchyStatusIgnored(); |
98 | return DC; |
99 | } |
100 | |
101 | void IGESAppli_ToolFiniteElement::OwnCheck |
102 | (const Handle(IGESAppli_FiniteElement)& /* ent */, |
103 | const Interface_ShareTool& , Handle(Interface_Check)& /* ach */) const |
104 | { |
105 | } |
106 | |
107 | void IGESAppli_ToolFiniteElement::OwnDump |
108 | (const Handle(IGESAppli_FiniteElement)& ent, const IGESData_IGESDumper& dumper, |
109 | const Handle(Message_Messenger)& S, const Standard_Integer level) const |
110 | { |
111 | S << "IGESAppli_FiniteElement" << endl; |
112 | |
113 | S << "Topology type : " << ent->Topology() << endl; |
114 | S << "Nodes : "; |
115 | IGESData_DumpEntities(S,dumper ,level,1, ent->NbNodes(),ent->Node); |
116 | S << endl << "Element Name : " << ent->Name(); |
117 | S << endl; |
118 | } |