b311480e |
1 | // Copyright (c) 1999-2012 OPEN CASCADE SAS |
2 | // |
3 | // The content of this file is subject to the Open CASCADE Technology Public |
4 | // License Version 6.5 (the "License"). You may not use the content of this file |
5 | // except in compliance with the License. Please obtain a copy of the License |
6 | // at http://www.opencascade.org and read it completely before using this file. |
7 | // |
8 | // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
9 | // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
10 | // |
11 | // The Original Code and all software distributed under the License is |
12 | // distributed on an "AS IS" basis, without warranty of any kind, and the |
13 | // Initial Developer hereby disclaims all such warranties, including without |
14 | // limitation, any warranties of merchantability, fitness for a particular |
15 | // purpose or non-infringement. Please see the License for the specific terms |
16 | // and conditions governing the rights and limitations under the License. |
17 | |
7fd59977 |
18 | #include <StepData_FileProtocol.ixx> |
19 | |
20 | |
21 | //static TCollection_AsciiString thename(""); |
22 | static Standard_CString thename = ""; |
23 | |
24 | // Protocol fabrique a la demande avec d autres Protocoles |
25 | |
26 | |
27 | StepData_FileProtocol::StepData_FileProtocol () { } |
28 | |
29 | void StepData_FileProtocol::Add (const Handle(StepData_Protocol)& protocol) |
30 | { |
31 | if (protocol.IsNull()) return; |
32 | Handle(Standard_Type) ptype = protocol->DynamicType(); |
33 | Standard_Integer nb = thecomps.Length(); |
34 | for (Standard_Integer i = 1; i <= nb; i ++) { |
35 | if (thecomps.Value(i)->IsInstance(ptype)) return; |
36 | } |
37 | thecomps.Append(protocol); |
38 | } |
39 | |
40 | |
41 | Standard_Integer StepData_FileProtocol::NbResources () const |
42 | { return thecomps.Length(); } |
43 | |
44 | Handle(Interface_Protocol) StepData_FileProtocol::Resource |
45 | (const Standard_Integer num) const |
46 | { return Handle(Interface_Protocol)::DownCast(thecomps.Value(num)); } |
47 | |
48 | |
49 | Standard_Integer StepData_FileProtocol::TypeNumber |
35e08fe8 |
50 | (const Handle(Standard_Type)& /*atype*/) const |
7fd59977 |
51 | { return 0; } |
52 | |
53 | |
54 | Standard_Boolean StepData_FileProtocol::GlobalCheck(const Interface_Graph& G, |
55 | Handle(Interface_Check)& ach) const |
56 | { |
57 | Standard_Boolean res = Standard_False; |
58 | Standard_Integer i,nb = NbResources(); |
59 | for (i = 1; i <= nb; i ++) res |= Resource(i)->GlobalCheck (G,ach); |
60 | return res; |
61 | } |
62 | |
63 | |
64 | Standard_CString StepData_FileProtocol::SchemaName () const |
65 | { return thename; } |