1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
15 #include <IGESData_IGESDumper.hxx>
16 #include <IGESData_IGESEntity.hxx>
17 #include <IGESDraw_CircArraySubfigure.hxx>
18 #include <IGESDraw_ConnectPoint.hxx>
19 #include <IGESDraw_Drawing.hxx>
20 #include <IGESDraw_DrawingWithRotation.hxx>
21 #include <IGESDraw_LabelDisplay.hxx>
22 #include <IGESDraw_NetworkSubfigure.hxx>
23 #include <IGESDraw_NetworkSubfigureDef.hxx>
24 #include <IGESDraw_PerspectiveView.hxx>
25 #include <IGESDraw_Planar.hxx>
26 #include <IGESDraw_RectArraySubfigure.hxx>
27 #include <IGESDraw_SegmentedViewsVisible.hxx>
28 #include <IGESDraw_SpecificModule.hxx>
29 #include <IGESDraw_ToolCircArraySubfigure.hxx>
30 #include <IGESDraw_ToolConnectPoint.hxx>
31 #include <IGESDraw_ToolDrawing.hxx>
32 #include <IGESDraw_ToolDrawingWithRotation.hxx>
33 #include <IGESDraw_ToolLabelDisplay.hxx>
34 #include <IGESDraw_ToolNetworkSubfigure.hxx>
35 #include <IGESDraw_ToolNetworkSubfigureDef.hxx>
36 #include <IGESDraw_ToolPerspectiveView.hxx>
37 #include <IGESDraw_ToolPlanar.hxx>
38 #include <IGESDraw_ToolRectArraySubfigure.hxx>
39 #include <IGESDraw_ToolSegmentedViewsVisible.hxx>
40 #include <IGESDraw_ToolView.hxx>
41 #include <IGESDraw_ToolViewsVisible.hxx>
42 #include <IGESDraw_ToolViewsVisibleWithAttr.hxx>
43 #include <IGESDraw_View.hxx>
44 #include <IGESDraw_ViewsVisible.hxx>
45 #include <IGESDraw_ViewsVisibleWithAttr.hxx>
46 #include <Interface_Macros.hxx>
47 #include <Message_Messenger.hxx>
48 #include <Standard_Type.hxx>
50 IMPLEMENT_STANDARD_RTTIEXT(IGESDraw_SpecificModule,IGESData_SpecificModule)
52 // Each Module is attached to a Protocol : it must interprete Case Numbers
53 // (arguments <CN> of various methods) in accordance to values returned by
54 // the method TypeNumber from this Protocol
55 IGESDraw_SpecificModule::IGESDraw_SpecificModule() { }
58 void IGESDraw_SpecificModule::OwnDump
59 (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
60 const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S,
61 const Standard_Integer own) const
65 DeclareAndCast(IGESDraw_CircArraySubfigure,anent,ent);
66 if (anent.IsNull()) return;
67 IGESDraw_ToolCircArraySubfigure tool;
68 tool.OwnDump(anent,dumper,S,own);
72 DeclareAndCast(IGESDraw_ConnectPoint,anent,ent);
73 if (anent.IsNull()) return;
74 IGESDraw_ToolConnectPoint tool;
75 tool.OwnDump(anent,dumper,S,own);
79 DeclareAndCast(IGESDraw_Drawing,anent,ent);
80 if (anent.IsNull()) return;
81 IGESDraw_ToolDrawing tool;
82 tool.OwnDump(anent,dumper,S,own);
86 DeclareAndCast(IGESDraw_DrawingWithRotation,anent,ent);
87 if (anent.IsNull()) return;
88 IGESDraw_ToolDrawingWithRotation tool;
89 tool.OwnDump(anent,dumper,S,own);
93 DeclareAndCast(IGESDraw_LabelDisplay,anent,ent);
94 if (anent.IsNull()) return;
95 IGESDraw_ToolLabelDisplay tool;
96 tool.OwnDump(anent,dumper,S,own);
100 DeclareAndCast(IGESDraw_NetworkSubfigure,anent,ent);
101 if (anent.IsNull()) return;
102 IGESDraw_ToolNetworkSubfigure tool;
103 tool.OwnDump(anent,dumper,S,own);
107 DeclareAndCast(IGESDraw_NetworkSubfigureDef,anent,ent);
108 if (anent.IsNull()) return;
109 IGESDraw_ToolNetworkSubfigureDef tool;
110 tool.OwnDump(anent,dumper,S,own);
114 DeclareAndCast(IGESDraw_PerspectiveView,anent,ent);
115 if (anent.IsNull()) return;
116 IGESDraw_ToolPerspectiveView tool;
117 tool.OwnDump(anent,dumper,S,own);
121 DeclareAndCast(IGESDraw_Planar,anent,ent);
122 if (anent.IsNull()) return;
123 IGESDraw_ToolPlanar tool;
124 tool.OwnDump(anent,dumper,S,own);
128 DeclareAndCast(IGESDraw_RectArraySubfigure,anent,ent);
129 if (anent.IsNull()) return;
130 IGESDraw_ToolRectArraySubfigure tool;
131 tool.OwnDump(anent,dumper,S,own);
135 DeclareAndCast(IGESDraw_SegmentedViewsVisible,anent,ent);
136 if (anent.IsNull()) return;
137 IGESDraw_ToolSegmentedViewsVisible tool;
138 tool.OwnDump(anent,dumper,S,own);
142 DeclareAndCast(IGESDraw_View,anent,ent);
143 if (anent.IsNull()) return;
144 IGESDraw_ToolView tool;
145 tool.OwnDump(anent,dumper,S,own);
149 DeclareAndCast(IGESDraw_ViewsVisible,anent,ent);
150 if (anent.IsNull()) return;
151 IGESDraw_ToolViewsVisible tool;
152 tool.OwnDump(anent,dumper,S,own);
156 DeclareAndCast(IGESDraw_ViewsVisibleWithAttr,anent,ent);
157 if (anent.IsNull()) return;
158 IGESDraw_ToolViewsVisibleWithAttr tool;
159 tool.OwnDump(anent,dumper,S,own);
167 Standard_Boolean IGESDraw_SpecificModule::OwnCorrect
168 (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const
170 // Applies only on some types
173 DeclareAndCast(IGESDraw_Drawing,anent,ent);
174 if (anent.IsNull()) break;
175 IGESDraw_ToolDrawing tool;
176 return tool.OwnCorrect(anent);
179 DeclareAndCast(IGESDraw_DrawingWithRotation,anent,ent);
180 if (anent.IsNull()) break;
181 IGESDraw_ToolDrawingWithRotation tool;
182 return tool.OwnCorrect(anent);
185 DeclareAndCast(IGESDraw_Planar,anent,ent);
186 if (anent.IsNull()) break;
187 IGESDraw_ToolPlanar tool;
188 return tool.OwnCorrect(anent);
191 DeclareAndCast(IGESDraw_ViewsVisible,anent,ent);
192 if (anent.IsNull()) break;
193 IGESDraw_ToolViewsVisible tool;
194 return tool.OwnCorrect(anent);
197 DeclareAndCast(IGESDraw_ViewsVisibleWithAttr,anent,ent);
198 if (anent.IsNull()) break;
199 IGESDraw_ToolViewsVisibleWithAttr tool;
200 return tool.OwnCorrect(anent);
204 return Standard_False;