1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
//--------------------------------------------------------------------
//
// File Name : IGESBasic_OrderedGroup.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESBasic_ToolOrderedGroup.ixx>
#include <IGESData_ParamCursor.hxx>
#include <IGESData_IGESEntity.hxx>
#include <IGESData_HArray1OfIGESEntity.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
IGESBasic_ToolOrderedGroup::IGESBasic_ToolOrderedGroup () { }
void IGESBasic_ToolOrderedGroup::ReadOwnParams
(const Handle(IGESBasic_OrderedGroup)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
Standard_Integer nbval = 0;
Handle(IGESData_HArray1OfIGESEntity) EntArray;
if (PR.ReadInteger( PR.Current(), "Count of Entities", nbval)) { //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadEnts (IR,PR.CurrentList(nbval),"Entities",EntArray); //szv#4:S4163:12Mar99 `st=` not needed
/*
EntArray = new IGESData_HArray1OfIGESEntity(1,nbval);
for (Standard_Integer i = 1;i <= nbval;i++)
{
Handle(IGESData_IGESEntity) anent;
st = PR.ReadEntity (IR,PR.Current(),"Element of the Group",anent,Standard_True);
if (st) EntArray->SetValue(i,anent);
}
*/
}
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(EntArray);
}
void IGESBasic_ToolOrderedGroup::WriteOwnParams
(const Handle(IGESBasic_OrderedGroup)& ent, IGESData_IGESWriter& IW) const
{
Standard_Integer upper = ent->NbEntities();
IW.Send(upper);
for (Standard_Integer i = 1; i <= upper;i++)
IW.Send(ent->Entity(i));
}
void IGESBasic_ToolOrderedGroup::OwnShared
(const Handle(IGESBasic_OrderedGroup)& ent, Interface_EntityIterator& iter) const
{
Standard_Integer upper = ent->NbEntities();
for (Standard_Integer i = 1; i <= upper;i++)
iter.GetOneItem(ent->Entity(i));
}
void IGESBasic_ToolOrderedGroup::OwnCopy
(const Handle(IGESBasic_OrderedGroup)& another,
const Handle(IGESBasic_OrderedGroup)& ent, Interface_CopyTool& TC) const
{
Standard_Integer lower,upper;
lower = 1;
upper = another->NbEntities();
Handle(IGESData_HArray1OfIGESEntity) EntArray = new
IGESData_HArray1OfIGESEntity(lower,upper);
for (Standard_Integer i = lower;i <= upper;i++)
{
DeclareAndCast
(IGESData_IGESEntity,myentity,TC.Transferred(another->Entity(i)));
EntArray->SetValue(i,myentity);
}
ent->Init(EntArray);
}
Standard_Boolean IGESBasic_ToolOrderedGroup::OwnCorrect
(const Handle(IGESBasic_OrderedGroup)& ent ) const
{
Standard_Integer ianul = 0;
Standard_Integer i, nbtrue = 0, nb = ent->NbEntities();
for (i = 1; i <= nb; i ++) {
Handle(IGESData_IGESEntity) val = ent->Entity(i);
if (val.IsNull()) ianul ++;
else if (val->TypeNumber() == 0) ianul ++;
}
if (ianul == 0) return Standard_False;
Handle(IGESData_HArray1OfIGESEntity) EntArray;
if (ianul < nb) EntArray = new IGESData_HArray1OfIGESEntity(1,nb-ianul);
for (i = 1; i <= nb; i ++) {
Handle(IGESData_IGESEntity) val = ent->Entity(i);
if (val.IsNull()) continue;
else if (val->TypeNumber() == 0) continue;
nbtrue ++;
EntArray->SetValue (nbtrue,ent->Entity(i));
}
ent->Init(EntArray);
return Standard_True;
}
IGESData_DirChecker IGESBasic_ToolOrderedGroup::DirChecker
(const Handle(IGESBasic_OrderedGroup)& /* ent */ ) const
{
IGESData_DirChecker DC(402,14); //TypeNo. 402, Form no. 14
DC.Structure(IGESData_DefVoid);
DC.GraphicsIgnored();
DC.BlankStatusIgnored();
DC.HierarchyStatusIgnored();
return DC;
}
void IGESBasic_ToolOrderedGroup::OwnCheck
(const Handle(IGESBasic_OrderedGroup)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
Standard_Boolean ianul = Standard_False;
Standard_Integer i, nb = ent->NbEntities();
for (i = 1; i <= nb; i ++) {
Handle(IGESData_IGESEntity) val = ent->Entity(i);
if (val.IsNull()) ianul = Standard_True;
else if (val->TypeNumber() == 0) ianul = Standard_True;
if (ianul) {
ach->AddWarning ("At least one element is Null");
break;
}
}
}
void IGESBasic_ToolOrderedGroup::OwnDump
(const Handle(IGESBasic_OrderedGroup)& ent, const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
S << "IGESBasic_OrderedGroup" << endl;
S << "Entries in the Group : ";
IGESData_DumpEntities(S,dumper ,level,1, ent->NbEntities(),ent->Entity);
S << endl;
}
|