| 1 | // Created on: 1993-07-06 |
| 2 | // Created by: Remi LEQUETTE |
| 3 | // Copyright (c) 1993-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 | |
| 18 | #include <BRep_CurveOn2Surfaces.hxx> |
| 19 | #include <BRep_CurveRepresentation.hxx> |
| 20 | #include <Geom_Surface.hxx> |
| 21 | #include <gp_Pnt.hxx> |
| 22 | #include <Standard_NullObject.hxx> |
| 23 | #include <Standard_Type.hxx> |
| 24 | #include <TopLoc_Location.hxx> |
| 25 | |
| 26 | //======================================================================= |
| 27 | //function : BRep_CurveOn2Surfaces |
| 28 | //purpose : |
| 29 | //======================================================================= |
| 30 | BRep_CurveOn2Surfaces::BRep_CurveOn2Surfaces(const Handle(Geom_Surface)& S1, |
| 31 | const Handle(Geom_Surface)& S2, |
| 32 | const TopLoc_Location& L1, |
| 33 | const TopLoc_Location& L2, |
| 34 | const GeomAbs_Shape C) : |
| 35 | BRep_CurveRepresentation(L1), |
| 36 | mySurface(S1), |
| 37 | mySurface2(S2), |
| 38 | myLocation2(L2), |
| 39 | myContinuity(C) |
| 40 | { |
| 41 | } |
| 42 | |
| 43 | //======================================================================= |
| 44 | //function : D0 |
| 45 | //purpose : |
| 46 | //======================================================================= |
| 47 | |
| 48 | void BRep_CurveOn2Surfaces::D0(const Standard_Real , gp_Pnt& )const |
| 49 | { |
| 50 | Standard_NullObject::Raise("BRep_CurveOn2Surfaces::D0"); |
| 51 | } |
| 52 | |
| 53 | |
| 54 | //======================================================================= |
| 55 | //function : IsRegularity |
| 56 | //purpose : |
| 57 | //======================================================================= |
| 58 | |
| 59 | Standard_Boolean BRep_CurveOn2Surfaces::IsRegularity()const |
| 60 | { |
| 61 | return Standard_True; |
| 62 | } |
| 63 | |
| 64 | |
| 65 | //======================================================================= |
| 66 | //function : IsRegularity |
| 67 | //purpose : |
| 68 | //======================================================================= |
| 69 | |
| 70 | Standard_Boolean BRep_CurveOn2Surfaces::IsRegularity |
| 71 | (const Handle(Geom_Surface)& S1, |
| 72 | const Handle(Geom_Surface)& S2, |
| 73 | const TopLoc_Location& L1, |
| 74 | const TopLoc_Location& L2)const |
| 75 | { |
| 76 | return ((mySurface == S1 && mySurface2 == S2 && |
| 77 | myLocation == L1 && myLocation2 == L2) || |
| 78 | (mySurface == S2 && mySurface2 == S1 && |
| 79 | myLocation == L2 && myLocation2 == L1)); |
| 80 | } |
| 81 | |
| 82 | |
| 83 | //======================================================================= |
| 84 | //function : Surface |
| 85 | //purpose : |
| 86 | //======================================================================= |
| 87 | |
| 88 | const Handle(Geom_Surface)& BRep_CurveOn2Surfaces::Surface()const |
| 89 | { |
| 90 | return mySurface; |
| 91 | } |
| 92 | |
| 93 | //======================================================================= |
| 94 | //function : Surface2 |
| 95 | //purpose : |
| 96 | //======================================================================= |
| 97 | |
| 98 | const Handle(Geom_Surface)& BRep_CurveOn2Surfaces::Surface2()const |
| 99 | { |
| 100 | return mySurface2; |
| 101 | } |
| 102 | |
| 103 | |
| 104 | //======================================================================= |
| 105 | //function : Location2 |
| 106 | //purpose : |
| 107 | //======================================================================= |
| 108 | |
| 109 | const TopLoc_Location& BRep_CurveOn2Surfaces::Location2()const |
| 110 | { |
| 111 | return myLocation2; |
| 112 | } |
| 113 | |
| 114 | //======================================================================= |
| 115 | //function : Continuity |
| 116 | //purpose : |
| 117 | //======================================================================= |
| 118 | |
| 119 | const GeomAbs_Shape& BRep_CurveOn2Surfaces::Continuity()const |
| 120 | { |
| 121 | return myContinuity; |
| 122 | } |
| 123 | |
| 124 | //======================================================================= |
| 125 | //function : Continuity |
| 126 | //purpose : |
| 127 | //======================================================================= |
| 128 | |
| 129 | void BRep_CurveOn2Surfaces::Continuity(const GeomAbs_Shape C) |
| 130 | { |
| 131 | myContinuity = C; |
| 132 | } |
| 133 | |
| 134 | |
| 135 | //======================================================================= |
| 136 | //function : Copy |
| 137 | //purpose : |
| 138 | //======================================================================= |
| 139 | |
| 140 | Handle(BRep_CurveRepresentation) BRep_CurveOn2Surfaces::Copy() const |
| 141 | { |
| 142 | Handle(BRep_CurveOn2Surfaces) C = new |
| 143 | BRep_CurveOn2Surfaces(Surface(),Surface2(), |
| 144 | Location(),Location2(), |
| 145 | myContinuity); |
| 146 | return C; |
| 147 | } |