b311480e |
1 | // Created by: CKY / Contract Toubro-Larsen |
2 | // Copyright (c) 1993-1999 Matra Datavision |
3 | // Copyright (c) 1999-2012 OPEN CASCADE SAS |
4 | // |
5 | // The content of this file is subject to the Open CASCADE Technology Public |
6 | // License Version 6.5 (the "License"). You may not use the content of this file |
7 | // except in compliance with the License. Please obtain a copy of the License |
8 | // at http://www.opencascade.org and read it completely before using this file. |
7fd59977 |
9 | // |
b311480e |
10 | // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
11 | // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
7fd59977 |
12 | // |
b311480e |
13 | // The Original Code and all software distributed under the License is |
14 | // distributed on an "AS IS" basis, without warranty of any kind, and the |
15 | // Initial Developer hereby disclaims all such warranties, including without |
16 | // limitation, any warranties of merchantability, fitness for a particular |
17 | // purpose or non-infringement. Please see the License for the specific terms |
18 | // and conditions governing the rights and limitations under the License. |
19 | |
20 | //-------------------------------------------------------------------- |
7fd59977 |
21 | //-------------------------------------------------------------------- |
22 | |
23 | #include <IGESGeom_ToolCompositeCurve.ixx> |
24 | #include <IGESData_ParamCursor.hxx> |
25 | #include <IGESData_IGESEntity.hxx> |
26 | #include <IGESData_HArray1OfIGESEntity.hxx> |
27 | #include <IGESData_Dump.hxx> |
28 | #include <Interface_Macros.hxx> |
29 | |
30 | // MGE 28/07/98 |
31 | #include <Message_Msg.hxx> |
32 | |
33 | IGESGeom_ToolCompositeCurve::IGESGeom_ToolCompositeCurve () { } |
34 | |
35 | |
36 | void IGESGeom_ToolCompositeCurve::ReadOwnParams |
37 | (const Handle(IGESGeom_CompositeCurve)& ent, |
38 | const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const |
39 | { |
40 | // MGE 28/07/98 |
41 | // Building of messages |
42 | //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down |
43 | Handle(IGESData_HArray1OfIGESEntity) tempEntities; |
44 | |
45 | Standard_Integer num; //szv#4:S4163:12Mar99 i not needed |
46 | |
47 | Standard_Boolean st = PR.ReadInteger(PR.Current(), num); |
48 | // st = PR.ReadInteger(PR.Current(), "Number of Components", num); |
49 | if (st && (num > 0)){ |
50 | Message_Msg Msg80("XSTEP_80"); |
51 | PR.ReadEnts (IR,PR.CurrentList(num),Msg80,tempEntities); //szv#4:S4163:12Mar99 `st=` not needed |
52 | //else st = PR.ReadEnts (IR,PR.CurrentList(num),"List of Components",tempEntities); |
53 | } |
54 | //if (st && num <= 0) PR.SendFail(Msg79); |
55 | else{ |
56 | Message_Msg Msg79("XSTEP_79"); |
57 | PR.SendFail(Msg79); |
58 | } |
59 | |
60 | DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); |
61 | ent->Init(tempEntities); |
62 | } |
63 | |
64 | void IGESGeom_ToolCompositeCurve::WriteOwnParams |
65 | (const Handle(IGESGeom_CompositeCurve)& ent, IGESData_IGESWriter& IW) const |
66 | { |
67 | Standard_Integer num = ent->NbCurves(); Standard_Integer i; |
68 | IW.Send(num); |
69 | for ( num = ent->NbCurves(), i = 1; i <= num; i++ ) |
70 | IW.Send(ent->Curve(i)); |
71 | } |
72 | |
73 | void IGESGeom_ToolCompositeCurve::OwnShared |
74 | (const Handle(IGESGeom_CompositeCurve)& ent, Interface_EntityIterator& iter) const |
75 | { |
76 | Standard_Integer num = ent->NbCurves(); |
77 | for ( Standard_Integer i = 1; i <= num; i++ ) |
78 | iter.GetOneItem(ent->Curve(i)); |
79 | } |
80 | |
81 | void IGESGeom_ToolCompositeCurve::OwnCopy |
82 | (const Handle(IGESGeom_CompositeCurve)& another, |
83 | const Handle(IGESGeom_CompositeCurve)& ent, Interface_CopyTool& TC) const |
84 | { |
85 | Standard_Integer i, num = another->NbCurves(); |
86 | Handle(IGESData_HArray1OfIGESEntity) tempEntities = |
87 | new IGESData_HArray1OfIGESEntity(1, num); |
88 | for ( i = 1; i <= num; i++ ) |
89 | { |
90 | DeclareAndCast(IGESData_IGESEntity, new_ent, |
91 | TC.Transferred(another->Curve(i))); |
92 | tempEntities->SetValue(i, new_ent); |
93 | } |
94 | ent->Init(tempEntities); |
95 | } |
96 | |
97 | IGESData_DirChecker IGESGeom_ToolCompositeCurve::DirChecker |
98 | (const Handle(IGESGeom_CompositeCurve)& /* ent */ ) const |
99 | { |
100 | IGESData_DirChecker DC(102, 0); |
101 | DC.Structure(IGESData_DefVoid); |
102 | DC.GraphicsIgnored(); |
103 | DC.LineFont(IGESData_DefAny); |
104 | // DC.LineWeight(IGESData_DefValue); |
105 | DC.Color(IGESData_DefAny); |
106 | return DC; |
107 | } |
108 | |
109 | void IGESGeom_ToolCompositeCurve::OwnCheck |
110 | (const Handle(IGESGeom_CompositeCurve)& /* ent */, |
111 | const Interface_ShareTool& , Handle(Interface_Check)& /* ach */) const |
112 | { |
113 | } |
114 | |
115 | void IGESGeom_ToolCompositeCurve::OwnDump |
116 | (const Handle(IGESGeom_CompositeCurve)& ent, const IGESData_IGESDumper& dumper, |
117 | const Handle(Message_Messenger)& S, const Standard_Integer level) const |
118 | { |
119 | S << "IGESGeom_CompositeCurve" << endl; |
120 | S << "Curve Entities : " << endl; |
121 | IGESData_DumpEntities(S,dumper ,level,1, ent->NbCurves(),ent->Curve); |
122 | S << endl; |
123 | } |