973c2be1 |
1 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
2 | // |
973c2be1 |
3 | // This file is part of Open CASCADE Technology software library. |
b311480e |
4 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
10 | // |
973c2be1 |
11 | // Alternatively, this file may be used under the terms of Open CASCADE |
12 | // commercial license or contractual agreement. |
b311480e |
13 | |
42cf5bc1 |
14 | |
15 | #include <Interface_Check.hxx> |
16 | #include <Interface_CopyTool.hxx> |
17 | #include <Interface_EntityIterator.hxx> |
7fd59977 |
18 | #include <Interface_GeneralLib.hxx> |
7fd59977 |
19 | #include <Interface_Macros.hxx> |
20 | #include <Interface_ParamType.hxx> |
42cf5bc1 |
21 | #include <Interface_ShareTool.hxx> |
22 | #include <Interface_UndefinedContent.hxx> |
23 | #include <Standard_Transient.hxx> |
24 | #include <Standard_Type.hxx> |
25 | #include <StepData.hxx> |
26 | #include <StepData_DefaultGeneral.hxx> |
27 | #include <StepData_Protocol.hxx> |
28 | #include <StepData_UndefinedEntity.hxx> |
7fd59977 |
29 | |
30 | // DefaultGeneral de StepData reconnait UN SEUL TYPE : UndefinedEntity |
b311480e |
31 | StepData_DefaultGeneral::StepData_DefaultGeneral () |
7fd59977 |
32 | { |
33 | Interface_GeneralLib::SetGlobal (this, StepData::Protocol()); |
34 | } |
35 | |
36 | void StepData_DefaultGeneral::FillSharedCase |
37 | (const Standard_Integer casenum, const Handle(Standard_Transient)& ent, |
38 | Interface_EntityIterator& iter) const |
39 | { |
40 | if (casenum != 1) return; |
41 | DeclareAndCast(StepData_UndefinedEntity,undf,ent); |
42 | Handle(Interface_UndefinedContent) cont = undf->UndefinedContent(); |
43 | Standard_Integer nb = cont->NbParams(); |
44 | for (Standard_Integer i = 1; i <= nb; i ++) { |
45 | Interface_ParamType ptype = cont->ParamType(i); |
46 | if (ptype == Interface_ParamSub) { |
47 | DeclareAndCast(StepData_UndefinedEntity,subent,cont->ParamEntity(i)); |
48 | FillSharedCase(casenum,cont->ParamEntity(i),iter); |
49 | } else if (ptype == Interface_ParamIdent) { |
50 | iter.GetOneItem(cont->ParamEntity(i)); |
51 | } |
52 | } |
53 | } |
54 | |
55 | |
35e08fe8 |
56 | void StepData_DefaultGeneral::CheckCase(const Standard_Integer, |
57 | const Handle(Standard_Transient)&, |
58 | const Interface_ShareTool&, |
59 | Handle(Interface_Check)&) const |
7fd59977 |
60 | { |
61 | } // pas de Check sur une UndefinedEntity |
62 | |
63 | |
64 | Standard_Boolean StepData_DefaultGeneral::NewVoid |
65 | (const Standard_Integer CN, Handle(Standard_Transient)& ent) const |
66 | { |
67 | if (CN != 1) return Standard_False; |
68 | ent = new StepData_UndefinedEntity; |
69 | return Standard_True; |
70 | } |
71 | |
72 | void StepData_DefaultGeneral::CopyCase |
73 | (const Standard_Integer casenum, const Handle(Standard_Transient)& entfrom, |
74 | const Handle(Standard_Transient)& entto, Interface_CopyTool& TC) const |
75 | { |
76 | if (casenum != 1) return; |
77 | DeclareAndCast(StepData_UndefinedEntity,undfrom,entfrom); |
78 | DeclareAndCast(StepData_UndefinedEntity,undto,entto); |
79 | undto->GetFromAnother(undfrom,TC); // On pourrait rapatrier cela |
80 | } |