mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
License statement text corrected; compiler warnings caused by Bison 2.41 disabled for MSVC; a few other compiler warnings on 54-bit Windows eliminated by appropriate type cast Wrong license statements corrected in several files. Copyright and license statements added in XSD and GLSL files. Copyright year updated in some files. Obsolete documentation files removed from DrawResources.
181 lines
5.1 KiB
C++
181 lines
5.1 KiB
C++
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
|
//
|
|
// This file is part of Open CASCADE Technology software library.
|
|
//
|
|
// This library is free software; you can redistribute it and/or modify it under
|
|
// the terms of the GNU Lesser General Public License version 2.1 as published
|
|
// by the Free Software Foundation, with special exception defined in the file
|
|
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
|
// distribution for complete text of the license and disclaimer of any warranty.
|
|
//
|
|
// Alternatively, this file may be used under the terms of Open CASCADE
|
|
// commercial license or contractual agreement.
|
|
|
|
#include <IGESDefs_ReadWriteModule.ixx>
|
|
#include <Interface_Macros.hxx>
|
|
|
|
#include <IGESDefs_AssociativityDef.hxx>
|
|
#include <IGESDefs_AttributeDef.hxx>
|
|
#include <IGESDefs_AttributeTable.hxx>
|
|
#include <IGESDefs_GenericData.hxx>
|
|
#include <IGESDefs_MacroDef.hxx>
|
|
#include <IGESDefs_TabularData.hxx>
|
|
#include <IGESDefs_UnitsData.hxx>
|
|
|
|
#include <IGESDefs_ToolAssociativityDef.hxx>
|
|
#include <IGESDefs_ToolAttributeDef.hxx>
|
|
#include <IGESDefs_ToolAttributeTable.hxx>
|
|
#include <IGESDefs_ToolGenericData.hxx>
|
|
#include <IGESDefs_ToolMacroDef.hxx>
|
|
#include <IGESDefs_ToolTabularData.hxx>
|
|
#include <IGESDefs_ToolUnitsData.hxx>
|
|
|
|
|
|
|
|
// Each Module is attached to a Protocol : it must interprete Case Numbers
|
|
// (arguments <CN> of various methods) in accordance to values returned by
|
|
// the method TypeNumber from this Protocol
|
|
|
|
|
|
IGESDefs_ReadWriteModule::IGESDefs_ReadWriteModule () { }
|
|
|
|
|
|
Standard_Integer IGESDefs_ReadWriteModule::CaseIGES
|
|
(const Standard_Integer typenum, const Standard_Integer formnum) const
|
|
{
|
|
switch (typenum) {
|
|
case 302 : return 1;
|
|
case 306 : return 5;
|
|
case 316 : return 7;
|
|
case 322 : return 2;
|
|
case 406 :
|
|
switch (formnum) {
|
|
case 11 : return 6;
|
|
case 27 : return 4;
|
|
default : break;
|
|
}
|
|
break;
|
|
case 422 : return 3;
|
|
default : break;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
void IGESDefs_ReadWriteModule::ReadOwnParams
|
|
(const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
|
|
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
|
|
{
|
|
switch (CN) {
|
|
case 1 : {
|
|
DeclareAndCast(IGESDefs_AssociativityDef,anent,ent);
|
|
if (anent.IsNull()) return;
|
|
IGESDefs_ToolAssociativityDef tool;
|
|
tool.ReadOwnParams(anent,IR,PR);
|
|
}
|
|
break;
|
|
case 2 : {
|
|
DeclareAndCast(IGESDefs_AttributeDef,anent,ent);
|
|
if (anent.IsNull()) return;
|
|
IGESDefs_ToolAttributeDef tool;
|
|
tool.ReadOwnParams(anent,IR,PR);
|
|
}
|
|
break;
|
|
case 3 : {
|
|
DeclareAndCast(IGESDefs_AttributeTable,anent,ent);
|
|
if (anent.IsNull()) return;
|
|
IGESDefs_ToolAttributeTable tool;
|
|
tool.ReadOwnParams(anent,IR,PR);
|
|
}
|
|
break;
|
|
case 4 : {
|
|
DeclareAndCast(IGESDefs_GenericData,anent,ent);
|
|
if (anent.IsNull()) return;
|
|
IGESDefs_ToolGenericData tool;
|
|
tool.ReadOwnParams(anent,IR,PR);
|
|
}
|
|
break;
|
|
case 5 : {
|
|
DeclareAndCast(IGESDefs_MacroDef,anent,ent);
|
|
if (anent.IsNull()) return;
|
|
IGESDefs_ToolMacroDef tool;
|
|
tool.ReadOwnParams(anent,IR,PR);
|
|
}
|
|
break;
|
|
case 6 : {
|
|
DeclareAndCast(IGESDefs_TabularData,anent,ent);
|
|
if (anent.IsNull()) return;
|
|
IGESDefs_ToolTabularData tool;
|
|
tool.ReadOwnParams(anent,IR,PR);
|
|
}
|
|
break;
|
|
case 7 : {
|
|
DeclareAndCast(IGESDefs_UnitsData,anent,ent);
|
|
if (anent.IsNull()) return;
|
|
IGESDefs_ToolUnitsData tool;
|
|
tool.ReadOwnParams(anent,IR,PR);
|
|
}
|
|
break;
|
|
default : break;
|
|
}
|
|
}
|
|
|
|
|
|
void IGESDefs_ReadWriteModule::WriteOwnParams
|
|
(const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
|
|
IGESData_IGESWriter& IW) const
|
|
{
|
|
switch (CN) {
|
|
case 1 : {
|
|
DeclareAndCast(IGESDefs_AssociativityDef,anent,ent);
|
|
if (anent.IsNull()) return;
|
|
IGESDefs_ToolAssociativityDef tool;
|
|
tool.WriteOwnParams(anent,IW);
|
|
}
|
|
break;
|
|
case 2 : {
|
|
DeclareAndCast(IGESDefs_AttributeDef,anent,ent);
|
|
if (anent.IsNull()) return;
|
|
IGESDefs_ToolAttributeDef tool;
|
|
tool.WriteOwnParams(anent,IW);
|
|
}
|
|
break;
|
|
case 3 : {
|
|
DeclareAndCast(IGESDefs_AttributeTable,anent,ent);
|
|
if (anent.IsNull()) return;
|
|
IGESDefs_ToolAttributeTable tool;
|
|
tool.WriteOwnParams(anent,IW);
|
|
}
|
|
break;
|
|
case 4 : {
|
|
DeclareAndCast(IGESDefs_GenericData,anent,ent);
|
|
if (anent.IsNull()) return;
|
|
IGESDefs_ToolGenericData tool;
|
|
tool.WriteOwnParams(anent,IW);
|
|
}
|
|
break;
|
|
case 5 : {
|
|
DeclareAndCast(IGESDefs_MacroDef,anent,ent);
|
|
if (anent.IsNull()) return;
|
|
IGESDefs_ToolMacroDef tool;
|
|
tool.WriteOwnParams(anent,IW);
|
|
}
|
|
break;
|
|
case 6 : {
|
|
DeclareAndCast(IGESDefs_TabularData,anent,ent);
|
|
if (anent.IsNull()) return;
|
|
IGESDefs_ToolTabularData tool;
|
|
tool.WriteOwnParams(anent,IW);
|
|
}
|
|
break;
|
|
case 7 : {
|
|
DeclareAndCast(IGESDefs_UnitsData,anent,ent);
|
|
if (anent.IsNull()) return;
|
|
IGESDefs_ToolUnitsData tool;
|
|
tool.WriteOwnParams(anent,IW);
|
|
}
|
|
break;
|
|
default : break;
|
|
}
|
|
}
|