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 <Interface_Check.hxx>
16 #include <Interface_Graph.hxx>
17 #include <Interface_Protocol.hxx>
18 #include <Standard_Type.hxx>
19 #include <StepData_FileProtocol.hxx>
20 #include <StepData_Protocol.hxx>
22 IMPLEMENT_STANDARD_RTTIEXT(StepData_FileProtocol,StepData_Protocol)
24 //static TCollection_AsciiString thename("");
25 static Standard_CString thename = "";
27 // Protocol fabrique a la demande avec d autres Protocoles
30 StepData_FileProtocol::StepData_FileProtocol () { }
32 void StepData_FileProtocol::Add (const Handle(StepData_Protocol)& protocol)
34 if (protocol.IsNull()) return;
35 Handle(Standard_Type) ptype = protocol->DynamicType();
36 Standard_Integer nb = thecomps.Length();
37 for (Standard_Integer i = 1; i <= nb; i ++) {
38 if (thecomps.Value(i)->IsInstance(ptype)) return;
40 thecomps.Append(protocol);
44 Standard_Integer StepData_FileProtocol::NbResources () const
45 { return thecomps.Length(); }
47 Handle(Interface_Protocol) StepData_FileProtocol::Resource
48 (const Standard_Integer num) const
49 { return Handle(Interface_Protocol)::DownCast(thecomps.Value(num)); }
52 Standard_Integer StepData_FileProtocol::TypeNumber
53 (const Handle(Standard_Type)& /*atype*/) const
57 Standard_Boolean StepData_FileProtocol::GlobalCheck(const Interface_Graph& G,
58 Handle(Interface_Check)& ach) const
60 Standard_Boolean res = Standard_False;
61 Standard_Integer i,nb = NbResources();
62 for (i = 1; i <= nb; i ++) res |= Resource(i)->GlobalCheck (G,ach);
67 Standard_CString StepData_FileProtocol::SchemaName () const