1 // Created on: 1997-10-22
2 // Created by: Jean Yves LEBEY
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
19 #include <TopOpeBRepTool_STATE.hxx>
21 TopOpeBRepTool_STATE::TopOpeBRepTool_STATE
22 (const char* name, const Standard_Boolean b) :
23 myin(Standard_False),myout(Standard_False),
24 myon(Standard_False),myunknown(Standard_False),
25 myonetrue(Standard_False)
31 void TopOpeBRepTool_STATE::Set(const Standard_Boolean b)
36 Set(TopAbs_UNKNOWN,b);
39 void TopOpeBRepTool_STATE::Set
40 (const TopAbs_State S,const Standard_Boolean b)
43 case TopAbs_IN : myin = b; break;
44 case TopAbs_OUT : myout = b; break;
45 case TopAbs_ON : myon = b; break;
46 case TopAbs_UNKNOWN : myunknown = b; break;
48 myonetrue = myin || myout || myon || myunknown;
51 void TopOpeBRepTool_STATE::Set(const Standard_Boolean b,
52 Standard_Integer n, char** a)
57 for (Standard_Integer i=0; i < n; i++) {
59 if ( !strcmp(p,"IN") ) Set(TopAbs_IN,b);
60 else if ( !strcmp(p,"OUT") ) Set(TopAbs_OUT,b);
61 else if ( !strcmp(p,"ON") ) Set(TopAbs_ON,b);
62 else if ( !strcmp(p,"UNKNOWN") ) Set(TopAbs_UNKNOWN,b);
68 Standard_Boolean TopOpeBRepTool_STATE::Get(const TopAbs_State S)
70 Standard_Boolean b = Standard_False;
72 case TopAbs_IN : b = myin; break;
73 case TopAbs_OUT : b = myout; break;
74 case TopAbs_ON : b = myon; break;
75 case TopAbs_UNKNOWN : b = myunknown; break;
80 void TopOpeBRepTool_STATE::Print()
82 std::cout<<myname<<" : ";
83 std::cout<<"IN/OUT/ON/UNKNOWN = ";
84 std::cout<<Get(TopAbs_IN)<<Get(TopAbs_OUT)<<Get(TopAbs_ON)<<Get(TopAbs_UNKNOWN);