1 // Created on: 1994-05-26 2 // Created by: Jean Yves LEBEY 3 // Copyright (c) 1994-1999 Matra Datavision 4 // Copyright (c) 1999-2014 OPEN CASCADE SAS 5 // 6 // This file is part of Open CASCADE Technology software library. 7 // 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. 13 // 14 // Alternatively, this file may be used under the terms of Open CASCADE 15 // commercial license or contractual agreement. 16 17 #ifndef _TopOpeBRepDS_Transition_HeaderFile 18 #define _TopOpeBRepDS_Transition_HeaderFile 19 20 #include <Standard.hxx> 21 #include <Standard_DefineAlloc.hxx> 22 #include <Standard_Handle.hxx> 23 24 #include <TopAbs_State.hxx> 25 #include <TopAbs_ShapeEnum.hxx> 26 #include <Standard_Integer.hxx> 27 #include <TopAbs_Orientation.hxx> 28 #include <Standard_Boolean.hxx> 29 #include <Standard_OStream.hxx> 30 31 32 33 class TopOpeBRepDS_Transition 34 { 35 public: 36 37 DEFINE_STANDARD_ALLOC 38 39 40 Standard_EXPORT TopOpeBRepDS_Transition(); 41 42 Standard_EXPORT TopOpeBRepDS_Transition(const TopAbs_State StateBefore, const TopAbs_State StateAfter, const TopAbs_ShapeEnum ShapeBefore = TopAbs_FACE, const TopAbs_ShapeEnum ShapeAfter = TopAbs_FACE); 43 44 Standard_EXPORT TopOpeBRepDS_Transition(const TopAbs_Orientation O); 45 46 Standard_EXPORT void Set (const TopAbs_State StateBefore, const TopAbs_State StateAfter, const TopAbs_ShapeEnum ShapeBefore = TopAbs_FACE, const TopAbs_ShapeEnum ShapeAfter = TopAbs_FACE); 47 48 Standard_EXPORT void StateBefore (const TopAbs_State S); 49 50 Standard_EXPORT void StateAfter (const TopAbs_State S); 51 52 Standard_EXPORT void ShapeBefore (const TopAbs_ShapeEnum SE); 53 54 Standard_EXPORT void ShapeAfter (const TopAbs_ShapeEnum SE); 55 56 Standard_EXPORT void Before (const TopAbs_State S, const TopAbs_ShapeEnum ShapeBefore = TopAbs_FACE); 57 58 Standard_EXPORT void After (const TopAbs_State S, const TopAbs_ShapeEnum ShapeAfter = TopAbs_FACE); 59 60 Standard_EXPORT void Index (const Standard_Integer I); 61 62 Standard_EXPORT void IndexBefore (const Standard_Integer I); 63 64 Standard_EXPORT void IndexAfter (const Standard_Integer I); 65 66 Standard_EXPORT TopAbs_State Before() const; 67 68 Standard_EXPORT TopAbs_ShapeEnum ONBefore() const; 69 70 Standard_EXPORT TopAbs_State After() const; 71 72 Standard_EXPORT TopAbs_ShapeEnum ONAfter() const; 73 74 Standard_EXPORT TopAbs_ShapeEnum ShapeBefore() const; 75 76 Standard_EXPORT TopAbs_ShapeEnum ShapeAfter() const; 77 78 Standard_EXPORT Standard_Integer Index() const; 79 80 Standard_EXPORT Standard_Integer IndexBefore() const; 81 82 Standard_EXPORT Standard_Integer IndexAfter() const; 83 84 //! set the transition corresponding to orientation <O> 85 //! 86 //! O Before After 87 //! 88 //! FORWARD OUT IN 89 //! REVERSED IN OUT 90 //! INTERNAL IN IN 91 //! EXTERNAL OUT OUT 92 Standard_EXPORT void Set (const TopAbs_Orientation O); 93 94 //! returns the orientation corresponding to state <S> 95 //! 96 //! Before and After not equal TopAbs_ON : 97 //! -------------------------------------- 98 //! Before After Computed orientation 99 //! 100 //! S not S REVERSED (we leave state S) 101 //! not S S FORWARD (we enter state S) 102 //! S S INTERNAL (we stay in state S) 103 //! not S not S EXTERNAL (we stay outside state S) 104 Standard_EXPORT TopAbs_Orientation Orientation (const TopAbs_State S, const TopAbs_ShapeEnum T = TopAbs_FACE) const; 105 106 Standard_EXPORT TopOpeBRepDS_Transition Complement() const; 107 108 //! returns True if both states are UNKNOWN 109 Standard_EXPORT Standard_Boolean IsUnknown() const; 110 111 112 113 114 115 protected: 116 117 118 119 120 121 private: 122 123 124 //! returns the orientation corresponding to state <S> 125 //! (if one at least of the internal states is ON) 126 Standard_EXPORT TopAbs_Orientation OrientationON (const TopAbs_State S, const TopAbs_ShapeEnum T) const; 127 128 129 TopAbs_State myStateBefore; 130 TopAbs_State myStateAfter; 131 TopAbs_ShapeEnum myShapeBefore; 132 TopAbs_ShapeEnum myShapeAfter; 133 Standard_Integer myIndexBefore; 134 Standard_Integer myIndexAfter; 135 136 137 }; 138 139 140 141 142 143 144 145 #endif // _TopOpeBRepDS_Transition_HeaderFile 146