1 // Created on: 1995-03-14
2 // Created by: Laurent PAINNOT
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #include <DrawTrSurf_Polygon2D.ixx>
19 #include <Draw_Color.hxx>
20 #include <Draw_MarkerShape.hxx>
22 //=======================================================================
23 //function : DrawTrSurf_Polygon2D
25 //=======================================================================
27 DrawTrSurf_Polygon2D::DrawTrSurf_Polygon2D(const Handle(Poly_Polygon2D)& P):
29 myNodes(Standard_False)
33 //=======================================================================
34 //function : Polygon2D
36 //=======================================================================
38 Handle(Poly_Polygon2D) DrawTrSurf_Polygon2D::Polygon2D() const
43 //=======================================================================
44 //function : ShowNodes
46 //=======================================================================
48 void DrawTrSurf_Polygon2D::ShowNodes(const Standard_Boolean B)
53 //=======================================================================
54 //function : ShowNodes
56 //=======================================================================
58 Standard_Boolean DrawTrSurf_Polygon2D::ShowNodes() const
63 //=======================================================================
66 //=======================================================================
68 void DrawTrSurf_Polygon2D::DrawOn(Draw_Display& dis) const
70 dis.SetColor(Draw_jaune);
73 const TColgp_Array1OfPnt2d& Points = myPolygon2D->Nodes();
75 for (Standard_Integer i = Points.Lower(); i <= Points.Upper()-1; i++) {
76 dis.Draw(Points(i), Points(i+1));
81 for (Standard_Integer i = Points.Lower(); i <= Points.Upper(); i++) {
82 dis.DrawMarker(Points(i), Draw_X);
88 //=======================================================================
91 //=======================================================================
93 Handle(Draw_Drawable3D) DrawTrSurf_Polygon2D::Copy() const
95 return new DrawTrSurf_Polygon2D(myPolygon2D);
98 //=======================================================================
101 //=======================================================================
103 void DrawTrSurf_Polygon2D::Dump(Standard_OStream& S) const
105 Poly::Dump(myPolygon2D, S);
108 //=======================================================================
111 //=======================================================================
113 void DrawTrSurf_Polygon2D::Whatis(Draw_Interpretor& I) const