1 // Created on: 2000-10-27 2 // Created by: Peter KURNEV 3 // Copyright (c) 2000-2014 OPEN CASCADE SAS 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 _IntTools_CommonPrt_HeaderFile 17 #define _IntTools_CommonPrt_HeaderFile 18 19 #include <Standard.hxx> 20 #include <Standard_DefineAlloc.hxx> 21 #include <Standard_Handle.hxx> 22 23 #include <TopoDS_Edge.hxx> 24 #include <TopAbs_ShapeEnum.hxx> 25 #include <IntTools_Range.hxx> 26 #include <Standard_Real.hxx> 27 #include <IntTools_SequenceOfRanges.hxx> 28 #include <Standard_Boolean.hxx> 29 #include <gp_Pnt.hxx> 30 class TopoDS_Edge; 31 class IntTools_Range; 32 class gp_Pnt; 33 34 35 //! The class is to describe a common part 36 //! between two edges in 3-d space. 37 class IntTools_CommonPrt 38 { 39 public: 40 41 DEFINE_STANDARD_ALLOC 42 43 44 45 //! Empty constructor 46 Standard_EXPORT IntTools_CommonPrt(); 47 48 49 //! Copy constructor 50 Standard_EXPORT IntTools_CommonPrt(const IntTools_CommonPrt& aCPrt); 51 52 Standard_EXPORT IntTools_CommonPrt& Assign (const IntTools_CommonPrt& Other); operator =(const IntTools_CommonPrt & Other)53IntTools_CommonPrt& operator = (const IntTools_CommonPrt& Other) 54 { 55 return Assign(Other); 56 } 57 58 59 //! Sets the first edge. 60 Standard_EXPORT void SetEdge1 (const TopoDS_Edge& anE); 61 62 63 //! Sets the second edge. 64 Standard_EXPORT void SetEdge2 (const TopoDS_Edge& anE); 65 66 67 //! Sets the type of the common part 68 //! Vertex or Edge 69 Standard_EXPORT void SetType (const TopAbs_ShapeEnum aType); 70 71 72 //! Sets the range of first edge. 73 Standard_EXPORT void SetRange1 (const IntTools_Range& aR); 74 75 76 //! Sets the range of first edge. 77 Standard_EXPORT void SetRange1 (const Standard_Real tf, const Standard_Real tl); 78 79 80 //! Appends the range of second edge. 81 Standard_EXPORT void AppendRange2 (const IntTools_Range& aR); 82 83 84 //! Appends the range of second edge. 85 Standard_EXPORT void AppendRange2 (const Standard_Real tf, const Standard_Real tl); 86 87 88 //! Sets a parameter of first vertex 89 Standard_EXPORT void SetVertexParameter1 (const Standard_Real tV); 90 91 92 //! Sets a parameter of second vertex 93 Standard_EXPORT void SetVertexParameter2 (const Standard_Real tV); 94 95 96 //! Returns the first edge. 97 Standard_EXPORT const TopoDS_Edge& Edge1() const; 98 99 100 //! Returns the second edge 101 Standard_EXPORT const TopoDS_Edge& Edge2() const; 102 103 104 //! Returns the type of the common part 105 Standard_EXPORT TopAbs_ShapeEnum Type() const; 106 107 108 //! Returns the range of first edge 109 Standard_EXPORT const IntTools_Range& Range1() const; 110 111 112 //! Returns the range of first edge. 113 Standard_EXPORT void Range1 (Standard_Real& tf, Standard_Real& tl) const; 114 115 116 //! Returns the ranges of second edge. 117 Standard_EXPORT const IntTools_SequenceOfRanges& Ranges2() const; 118 119 120 //! Returns the ranges of second edge. 121 Standard_EXPORT IntTools_SequenceOfRanges& ChangeRanges2(); 122 123 124 //! Returns parameter of first vertex 125 Standard_EXPORT Standard_Real VertexParameter1() const; 126 127 128 //! Returns parameter of second vertex 129 Standard_EXPORT Standard_Real VertexParameter2() const; 130 131 132 //! Copies me to anOther 133 Standard_EXPORT void Copy (IntTools_CommonPrt& anOther) const; 134 135 136 //! Modifier 137 Standard_EXPORT Standard_Boolean AllNullFlag() const; 138 139 140 //! Selector 141 Standard_EXPORT void SetAllNullFlag (const Standard_Boolean aFlag); 142 143 144 //! Modifier 145 Standard_EXPORT void SetBoundingPoints (const gp_Pnt& aP1, const gp_Pnt& aP2); 146 147 148 //! Selector 149 Standard_EXPORT void BoundingPoints (gp_Pnt& aP1, gp_Pnt& aP2) const; 150 151 152 153 154 protected: 155 156 157 158 159 160 private: 161 162 163 164 TopoDS_Edge myEdge1; 165 TopoDS_Edge myEdge2; 166 TopAbs_ShapeEnum myType; 167 IntTools_Range myRange1; 168 Standard_Real myVertPar1; 169 Standard_Real myVertPar2; 170 IntTools_SequenceOfRanges myRanges2; 171 Standard_Boolean myAllNullFlag; 172 gp_Pnt myPnt1; 173 gp_Pnt myPnt2; 174 175 176 }; 177 178 179 180 181 182 183 184 #endif // _IntTools_CommonPrt_HeaderFile 185