0024624: Lost word in license statement in source files
[occt.git] / src / ShapeExtend / ShapeExtend.cxx
CommitLineData
b311480e 1// Created on: 1998-06-10
2// Created by: data exchange team
3// Copyright (c) 1998-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
d5f74e42 8// This library is free software; you can redistribute it and/or modify it under
9// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 10// by the Free Software Foundation, with special exception defined in the file
11// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12// distribution for complete text of the license and disclaimer of any warranty.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
17#include <ShapeExtend.ixx>
18#include <Message_MsgFile.hxx>
19
20//=======================================================================
21//function : Init
22//purpose :
23//=======================================================================
24
25void ShapeExtend::Init()
26{
27 static Standard_Boolean init = Standard_False;
28 if (init) return;
29
30 init = Standard_True;
31
32 // load Message File for Shape Healing
33 Message_MsgFile::LoadFromEnv ("CSF_SHMessage", "SHAPE");
34}
35
36//=======================================================================
37//function : EncodeStatus
38//purpose :
39//=======================================================================
40
41Standard_Integer ShapeExtend::EncodeStatus (const ShapeExtend_Status status)
42{
43 switch ( status ) {
44 case ShapeExtend_OK : return 0x0000;
45 case ShapeExtend_DONE1: return 0x0001;
46 case ShapeExtend_DONE2: return 0x0002;
47 case ShapeExtend_DONE3: return 0x0004;
48 case ShapeExtend_DONE4: return 0x0008;
49 case ShapeExtend_DONE5: return 0x0010;
50 case ShapeExtend_DONE6: return 0x0020;
51 case ShapeExtend_DONE7: return 0x0040;
52 case ShapeExtend_DONE8: return 0x0080;
53 case ShapeExtend_DONE : return 0x00ff;
54 case ShapeExtend_FAIL1: return 0x0100;
55 case ShapeExtend_FAIL2: return 0x0200;
56 case ShapeExtend_FAIL3: return 0x0400;
57 case ShapeExtend_FAIL4: return 0x0800;
58 case ShapeExtend_FAIL5: return 0x1000;
59 case ShapeExtend_FAIL6: return 0x2000;
60 case ShapeExtend_FAIL7: return 0x4000;
61 case ShapeExtend_FAIL8: return 0x8000;
62 case ShapeExtend_FAIL : return 0xff00;
63 }
64 return 0;
65}
66
67//=======================================================================
68//function : DecodeStatus
69//purpose :
70//=======================================================================
71
72Standard_Boolean ShapeExtend::DecodeStatus (const Standard_Integer flag,
73 const ShapeExtend_Status status)
74{
75 if ( status == ShapeExtend_OK ) return ( flag == 0 );
76 return ( flag & ShapeExtend::EncodeStatus ( status ) ? Standard_True : Standard_False );
77}