1 // Copyright (c) 1999-2012 OPEN CASCADE SAS
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.
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.
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.
18 #include <IFSelect_SignValidity.ixx>
19 #include <Interface_Check.hxx>
22 static Standard_CString nulsign = "";
25 //=======================================================================
26 //function : IFSelect_SignValidity
28 //=======================================================================
30 IFSelect_SignValidity::IFSelect_SignValidity() : IFSelect_Signature ("Validity")
34 AddCase ("Load-Error");
35 AddCase ("Data-Error");
36 AddCase ("Load-Warning");
37 AddCase ("Data-Warning");
42 //=======================================================================
45 //=======================================================================
47 Standard_CString IFSelect_SignValidity::CVal(const Handle(Standard_Transient)& ent,
48 const Handle(Interface_InterfaceModel)& model)
50 if (ent.IsNull() || model.IsNull()) return nulsign;
51 Standard_Integer num = model->Number(ent);
52 Standard_Integer cas = 0;
53 if (model->IsUnknownEntity(num)) return "UNKNOWN";
54 if (model->IsRedefinedContent(num)) return "UNLOADED";
56 const Handle(Interface_Check) ch1 = model->Check(num,Standard_True);
57 const Handle(Interface_Check) ch2 = model->Check(num,Standard_False);
58 if (ch1->NbFails() > 0) return "Load-Error";
59 else if (ch1->NbWarnings() > 0) cas = 1;
61 if (ch2->NbFails() > 0) return "Data-Error";
62 else if (cas == 1) return "Load-Warning";
63 else if (ch2->NbWarnings() > 0) return "Data-Warning";
69 //=======================================================================
72 //=======================================================================
74 Standard_CString IFSelect_SignValidity::Value
75 (const Handle(Standard_Transient)& ent,
76 const Handle(Interface_InterfaceModel)& model) const
78 return IFSelect_SignValidity::CVal(ent,model);