0024157: Parallelization of assembly part of BO
[occt.git] / src / IFSelect / IFSelect_SignValidity.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 <IFSelect_SignValidity.ixx>
19#include <Interface_Check.hxx>
20
21
22static Standard_CString nulsign = "";
23
24
25//=======================================================================
26//function : IFSelect_SignValidity
27//purpose :
28//=======================================================================
29
30IFSelect_SignValidity::IFSelect_SignValidity() : IFSelect_Signature ("Validity")
31{
32 AddCase ("UNKNOWN");
33 AddCase ("UNLOADED");
34 AddCase ("Load-Error");
35 AddCase ("Data-Error");
36 AddCase ("Load-Warning");
37 AddCase ("Data-Warning");
38 AddCase ("OK");
39}
40
41
42//=======================================================================
43//function : CVal
44//purpose :
45//=======================================================================
46
47Standard_CString IFSelect_SignValidity::CVal(const Handle(Standard_Transient)& ent,
48 const Handle(Interface_InterfaceModel)& model)
49{
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";
55
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;
60
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";
64
65 return "OK";
66}
67
68
69//=======================================================================
70//function : Value
71//purpose :
72//=======================================================================
73
74Standard_CString IFSelect_SignValidity::Value
75 (const Handle(Standard_Transient)& ent,
76 const Handle(Interface_InterfaceModel)& model) const
77{
78 return IFSelect_SignValidity::CVal(ent,model);
79}