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 <IGESDraw_CircArraySubfigure.hxx>
17 #include <IGESDraw_Drawing.hxx>
18 #include <IGESDraw_DrawingWithRotation.hxx>
19 #include <IGESDraw_LabelDisplay.hxx>
20 #include <IGESDraw_NetworkSubfigure.hxx>
21 #include <IGESDraw_NetworkSubfigureDef.hxx>
22 #include <IGESDraw_PerspectiveView.hxx>
23 #include <IGESDraw_Planar.hxx>
24 #include <IGESDraw_RectArraySubfigure.hxx>
25 #include <IGESDraw_SegmentedViewsVisible.hxx>
26 #include <IGESDraw_SpecificModule.hxx>
27 #include <IGESDraw_ToolCircArraySubfigure.hxx>
28 #include <IGESDraw_ToolConnectPoint.hxx>
29 #include <IGESDraw_ToolDrawing.hxx>
30 #include <IGESDraw_ToolDrawingWithRotation.hxx>
31 #include <IGESDraw_ToolLabelDisplay.hxx>
32 #include <IGESDraw_ToolNetworkSubfigure.hxx>
33 #include <IGESDraw_ToolNetworkSubfigureDef.hxx>
34 #include <IGESDraw_ToolPerspectiveView.hxx>
35 #include <IGESDraw_ToolPlanar.hxx>
36 #include <IGESDraw_ToolRectArraySubfigure.hxx>
37 #include <IGESDraw_ToolSegmentedViewsVisible.hxx>
38 #include <IGESDraw_ToolView.hxx>
39 #include <IGESDraw_ToolViewsVisible.hxx>
40 #include <IGESDraw_ToolViewsVisibleWithAttr.hxx>
41 #include <IGESDraw_View.hxx>
42 #include <IGESDraw_ViewsVisible.hxx>
43 #include <IGESDraw_ViewsVisibleWithAttr.hxx>
44 #include <Interface_Macros.hxx>
45 #include <Standard_Type.hxx>
47 IMPLEMENT_STANDARD_RTTIEXT(IGESDraw_SpecificModule,IGESData_SpecificModule)
49 // Each Module is attached to a Protocol : it must interpret Case Numbers
50 // (arguments <CN> of various methods) in accordance to values returned by
51 // the method TypeNumber from this Protocol
52 IGESDraw_SpecificModule::IGESDraw_SpecificModule() { }
55 void IGESDraw_SpecificModule::OwnDump
56 (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
57 const IGESData_IGESDumper& dumper, Standard_OStream& S,
58 const Standard_Integer own) const
62 DeclareAndCast(IGESDraw_CircArraySubfigure,anent,ent);
63 if (anent.IsNull()) return;
64 IGESDraw_ToolCircArraySubfigure tool;
65 tool.OwnDump(anent,dumper,S,own);
69 DeclareAndCast(IGESDraw_ConnectPoint,anent,ent);
70 if (anent.IsNull()) return;
71 IGESDraw_ToolConnectPoint tool;
72 tool.OwnDump(anent,dumper,S,own);
76 DeclareAndCast(IGESDraw_Drawing,anent,ent);
77 if (anent.IsNull()) return;
78 IGESDraw_ToolDrawing tool;
79 tool.OwnDump(anent,dumper,S,own);
83 DeclareAndCast(IGESDraw_DrawingWithRotation,anent,ent);
84 if (anent.IsNull()) return;
85 IGESDraw_ToolDrawingWithRotation tool;
86 tool.OwnDump(anent,dumper,S,own);
90 DeclareAndCast(IGESDraw_LabelDisplay,anent,ent);
91 if (anent.IsNull()) return;
92 IGESDraw_ToolLabelDisplay tool;
93 tool.OwnDump(anent,dumper,S,own);
97 DeclareAndCast(IGESDraw_NetworkSubfigure,anent,ent);
98 if (anent.IsNull()) return;
99 IGESDraw_ToolNetworkSubfigure tool;
100 tool.OwnDump(anent,dumper,S,own);
104 DeclareAndCast(IGESDraw_NetworkSubfigureDef,anent,ent);
105 if (anent.IsNull()) return;
106 IGESDraw_ToolNetworkSubfigureDef tool;
107 tool.OwnDump(anent,dumper,S,own);
111 DeclareAndCast(IGESDraw_PerspectiveView,anent,ent);
112 if (anent.IsNull()) return;
113 IGESDraw_ToolPerspectiveView tool;
114 tool.OwnDump(anent,dumper,S,own);
118 DeclareAndCast(IGESDraw_Planar,anent,ent);
119 if (anent.IsNull()) return;
120 IGESDraw_ToolPlanar tool;
121 tool.OwnDump(anent,dumper,S,own);
125 DeclareAndCast(IGESDraw_RectArraySubfigure,anent,ent);
126 if (anent.IsNull()) return;
127 IGESDraw_ToolRectArraySubfigure tool;
128 tool.OwnDump(anent,dumper,S,own);
132 DeclareAndCast(IGESDraw_SegmentedViewsVisible,anent,ent);
133 if (anent.IsNull()) return;
134 IGESDraw_ToolSegmentedViewsVisible tool;
135 tool.OwnDump(anent,dumper,S,own);
139 DeclareAndCast(IGESDraw_View,anent,ent);
140 if (anent.IsNull()) return;
141 IGESDraw_ToolView tool;
142 tool.OwnDump(anent,dumper,S,own);
146 DeclareAndCast(IGESDraw_ViewsVisible,anent,ent);
147 if (anent.IsNull()) return;
148 IGESDraw_ToolViewsVisible tool;
149 tool.OwnDump(anent,dumper,S,own);
153 DeclareAndCast(IGESDraw_ViewsVisibleWithAttr,anent,ent);
154 if (anent.IsNull()) return;
155 IGESDraw_ToolViewsVisibleWithAttr tool;
156 tool.OwnDump(anent,dumper,S,own);
164 Standard_Boolean IGESDraw_SpecificModule::OwnCorrect
165 (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const
167 // Applies only on some types
170 DeclareAndCast(IGESDraw_Drawing,anent,ent);
171 if (anent.IsNull()) break;
172 IGESDraw_ToolDrawing tool;
173 return tool.OwnCorrect(anent);
176 DeclareAndCast(IGESDraw_DrawingWithRotation,anent,ent);
177 if (anent.IsNull()) break;
178 IGESDraw_ToolDrawingWithRotation tool;
179 return tool.OwnCorrect(anent);
182 DeclareAndCast(IGESDraw_Planar,anent,ent);
183 if (anent.IsNull()) break;
184 IGESDraw_ToolPlanar tool;
185 return tool.OwnCorrect(anent);
188 DeclareAndCast(IGESDraw_ViewsVisible,anent,ent);
189 if (anent.IsNull()) break;
190 IGESDraw_ToolViewsVisible tool;
191 return tool.OwnCorrect(anent);
194 DeclareAndCast(IGESDraw_ViewsVisibleWithAttr,anent,ent);
195 if (anent.IsNull()) break;
196 IGESDraw_ToolViewsVisibleWithAttr tool;
197 return tool.OwnCorrect(anent);
201 return Standard_False;