0024057: Eliminate compiler warning C4100 in MSVC++ with warning level 4
[occt.git] / src / IGESSelect / IGESSelect_SignStatus.cxx
CommitLineData
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 <IGESSelect_SignStatus.ixx>
19#include <IGESData_IGESEntity.hxx>
20#include <stdio.h>
21
22
23static char theval[10];
24
25 IGESSelect_SignStatus::IGESSelect_SignStatus ()
26 : IFSelect_Signature ("D.E. Status") { }
27
28 Standard_CString IGESSelect_SignStatus::Value
29 (const Handle(Standard_Transient)& ent,
35e08fe8 30 const Handle(Interface_InterfaceModel)& /*model*/) const
7fd59977 31{
32 Handle(IGESData_IGESEntity) igesent = Handle(IGESData_IGESEntity)::DownCast(ent);
33 if (igesent.IsNull()) return "";
34 Standard_Integer i,j,k,l;
35 i = igesent->BlankStatus ();
36 j = igesent->SubordinateStatus ();
37 k = igesent->UseFlag ();
38 l = igesent->HierarchyStatus ();
39 sprintf (theval,"%d,%d,%d,%d",i,j,k,l);
40 return theval;
41}
42
43 Standard_Boolean IGESSelect_SignStatus::Matches
44 (const Handle(Standard_Transient)& ent,
35e08fe8 45 const Handle(Interface_InterfaceModel)& /*model*/,
7fd59977 46 const TCollection_AsciiString& text, const Standard_Boolean exact) const
47{
48 Handle(IGESData_IGESEntity) igesent = Handle(IGESData_IGESEntity)::DownCast(ent);
49 if (igesent.IsNull()) return Standard_False;
50 Standard_Integer i,j,k,l;
51 i = igesent->BlankStatus ();
52 j = igesent->SubordinateStatus ();
53 k = igesent->UseFlag ();
54 l = igesent->HierarchyStatus ();
55 Standard_Integer n,nb = text.Length();
56 if (nb > 9) nb = 9;
57 for (n = 1; n <= nb; n ++) theval[n-1] = text.Value(n);
58 theval[nb] = '\0';
59
60 Standard_Integer vir = 0, val = 0;
61 for (n = 0; n < nb; n ++) {
62 char car = theval[n];
63 if (car == ',') { vir ++; continue; }
64 val = Standard_Integer (car-48);
65 if (car == 'V' && vir == 0) val = 0;
66 if (car == 'B' && vir == 0) val = 1;
67 if (car == 'I' && vir == 1) val = 0;
68 if (car == 'P' && vir == 1) val = 1;
69 if (car == 'L' && vir == 1) val = 2;
70 if (car == 'D' && vir == 1) val = 3;
71// Matches ?
72 if (vir == 0) { // Blank
73 if (i == val && !exact) return Standard_True;
74 if (i != val && exact) return Standard_False;
75 }
76 if (vir == 1) { // Subord.
77 if (j == val && !exact) return Standard_True;
78 if (j != val && exact) return Standard_False;
79 }
80 if (vir == 2) { // UseFlag
81 if (k == val && !exact) return Standard_True;
82 if (k != val && exact) return Standard_False;
83 }
84 if (vir == 3) { // Hierarchy
85 if (l == val && !exact) return Standard_True;
86 if (l != val && exact) return Standard_False;
87 }
88 }
89 return exact; // un brin de reflexion pour arriver
90}