7bd071ed |
1 | // Created on: 2016-06-23 |
2 | // Copyright (c) 2016 OPEN CASCADE SAS |
3 | // Created by: Oleg AGASHIN |
4 | // |
5 | // This file is part of Open CASCADE Technology software library. |
6 | // |
7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published |
9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | // distribution for complete text of the license and disclaimer of any warranty. |
12 | // |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
15 | |
16 | #ifndef _IMeshData_StatusOwner_HeaderFile |
17 | #define _IMeshData_StatusOwner_HeaderFile |
18 | |
19 | #include <IMeshData_Status.hxx> |
20 | #include <Standard_Transient.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | //! Extension interface class providing status functionality. |
24 | class IMeshData_StatusOwner |
25 | { |
26 | public: |
27 | |
28 | //! Destructor. |
29 | Standard_EXPORT virtual ~IMeshData_StatusOwner() |
30 | { |
31 | } |
32 | |
33 | //! Returns true in case if status is strictly equal to the given value. |
34 | inline Standard_Boolean IsEqual(const IMeshData_Status theValue) const |
35 | { |
36 | return (myStatus == theValue); |
37 | } |
38 | |
39 | //! Returns true in case if status is set. |
40 | inline Standard_Boolean IsSet(const IMeshData_Status theValue) const |
41 | { |
42 | return (myStatus & theValue) != 0; |
43 | } |
44 | |
45 | //! Adds status to status flags of a face. |
46 | inline void SetStatus(const IMeshData_Status theValue) |
47 | { |
48 | myStatus |= theValue; |
49 | } |
50 | |
51 | //! Adds status to status flags of a face. |
52 | inline void UnsetStatus(const IMeshData_Status theValue) |
53 | { |
54 | myStatus &= ~theValue; |
55 | } |
56 | |
57 | //! Returns complete status mask. |
58 | inline Standard_Integer GetStatusMask() const |
59 | { |
60 | return myStatus; |
61 | } |
62 | |
63 | protected: |
64 | |
65 | //! Constructor. Initializes default status. |
66 | Standard_EXPORT IMeshData_StatusOwner() |
67 | : myStatus(IMeshData_NoError) |
68 | { |
69 | } |
70 | |
71 | private: |
72 | |
73 | Standard_Integer myStatus; |
74 | }; |
75 | |
76 | #endif |