b311480e |
1 | // Created on: 1995-03-15 |
2 | // Created by: Laurent PAINNOT |
3 | // Copyright (c) 1995-1999 Matra Datavision |
973c2be1 |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | // |
973c2be1 |
6 | // This file is part of Open CASCADE Technology software library. |
b311480e |
7 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | // |
973c2be1 |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
7fd59977 |
16 | |
7fd59977 |
17 | |
42cf5bc1 |
18 | #include <BRep_CurveRepresentation.hxx> |
19 | #include <BRep_PolygonOnSurface.hxx> |
20 | #include <Geom_Surface.hxx> |
21 | #include <Poly_Polygon2D.hxx> |
22 | #include <Standard_DomainError.hxx> |
23 | #include <Standard_Type.hxx> |
24 | #include <TopLoc_Location.hxx> |
7fd59977 |
25 | |
26 | //======================================================================= |
27 | //function : BRep_PolygonOnSurface |
28 | //purpose : |
29 | //======================================================================= |
7fd59977 |
30 | BRep_PolygonOnSurface::BRep_PolygonOnSurface(const Handle(Poly_Polygon2D)& P, |
31 | const Handle(Geom_Surface)& S, |
32 | const TopLoc_Location& L): |
33 | BRep_CurveRepresentation(L), |
34 | myPolygon2D(P), |
35 | mySurface(S) |
36 | { |
37 | } |
38 | |
39 | //======================================================================= |
40 | //function : IsPolygonOnSurface |
41 | //purpose : |
42 | //======================================================================= |
43 | |
44 | Standard_Boolean BRep_PolygonOnSurface::IsPolygonOnSurface() const |
45 | { |
46 | return Standard_True; |
47 | } |
48 | |
49 | //======================================================================= |
50 | //function : IsPolygonOnSurface |
51 | //purpose : |
52 | //======================================================================= |
53 | |
54 | Standard_Boolean BRep_PolygonOnSurface::IsPolygonOnSurface(const Handle(Geom_Surface)& S, |
55 | const TopLoc_Location& L) const |
56 | { |
57 | return (S == mySurface) && (L == myLocation); |
58 | } |
59 | |
60 | //======================================================================= |
61 | //function : Surface |
62 | //purpose : |
63 | //======================================================================= |
64 | |
65 | const Handle(Geom_Surface)& BRep_PolygonOnSurface::Surface() const |
66 | { |
67 | return mySurface; |
68 | } |
69 | |
70 | //======================================================================= |
71 | //function : Polygon |
72 | //purpose : |
73 | //======================================================================= |
74 | |
75 | const Handle(Poly_Polygon2D)& BRep_PolygonOnSurface::Polygon() const |
76 | { |
77 | return myPolygon2D; |
78 | } |
79 | |
80 | //======================================================================= |
81 | //function : Polygon |
82 | //purpose : |
83 | //======================================================================= |
84 | |
85 | void BRep_PolygonOnSurface::Polygon(const Handle(Poly_Polygon2D)& P) |
86 | { |
87 | myPolygon2D = P; |
88 | } |
89 | |
90 | //======================================================================= |
91 | //function : Copy |
92 | //purpose : |
93 | //======================================================================= |
94 | |
95 | Handle(BRep_CurveRepresentation) BRep_PolygonOnSurface::Copy() const |
96 | { |
97 | Handle(BRep_PolygonOnSurface) P = new BRep_PolygonOnSurface(myPolygon2D, |
98 | mySurface, |
99 | Location()); |
100 | return P; |
101 | } |
102 | |