0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / BRep / BRep_PolygonOnClosedSurface.cxx
1 // Created on: 1995-03-15
2 // Created by: Laurent PAINNOT
3 // Copyright (c) 1995-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_CurveRepresentation.hxx>
19 #include <BRep_PolygonOnClosedSurface.hxx>
20 #include <Geom_Surface.hxx>
21 #include <Poly_Polygon2D.hxx>
22 #include <Standard_Type.hxx>
23 #include <TopLoc_Location.hxx>
24
25 IMPLEMENT_STANDARD_RTTIEXT(BRep_PolygonOnClosedSurface,BRep_PolygonOnSurface)
26
27 //=======================================================================
28 //function : BRep_PolygonOnClosedSurface
29 //purpose  : 
30 //=======================================================================
31 BRep_PolygonOnClosedSurface::BRep_PolygonOnClosedSurface(const Handle(Poly_Polygon2D)& P1, 
32                                                          const Handle(Poly_Polygon2D)& P2, 
33                                                          const Handle(Geom_Surface)&   S, 
34                                                          const TopLoc_Location&        L):
35                                                          BRep_PolygonOnSurface(P1, S, L),
36                                                          myPolygon2(P2)
37 {
38 }
39
40 //=======================================================================
41 //function : IsPolygonOnClosedSurface
42 //purpose  : 
43 //=======================================================================
44
45 Standard_Boolean BRep_PolygonOnClosedSurface::IsPolygonOnClosedSurface() const 
46 {
47   return Standard_True;
48 }
49
50 //=======================================================================
51 //function : Polygon2
52 //purpose  : 
53 //=======================================================================
54
55 const Handle(Poly_Polygon2D)& BRep_PolygonOnClosedSurface::Polygon2() const 
56 {
57   return myPolygon2;
58 }
59
60 //=======================================================================
61 //function : Polygon2
62 //purpose  : 
63 //=======================================================================
64
65 void BRep_PolygonOnClosedSurface::Polygon2(const Handle(Poly_Polygon2D)& P)
66 {
67   myPolygon2 = P;
68 }
69
70 //=======================================================================
71 //function : Copy
72 //purpose  : 
73 //=======================================================================
74
75 Handle(BRep_CurveRepresentation) BRep_PolygonOnClosedSurface::Copy() const 
76 {
77   Handle(BRep_PolygonOnClosedSurface) P = 
78     new BRep_PolygonOnClosedSurface(Polygon(), myPolygon2, Surface(), Location());
79   return P;
80 }
81
82 //=======================================================================
83 //function : DumpJson
84 //purpose  : 
85 //=======================================================================
86 void BRep_PolygonOnClosedSurface::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
87 {
88   OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
89
90   OCCT_DUMP_BASE_CLASS (theOStream, theDepth, BRep_PolygonOnSurface)
91
92   OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myPolygon2.get())
93 }
94