1 // Created on: 1995-03-14
2 // Created by: Laurent PAINNOT
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2012 OPEN CASCADE SAS
6 // The content of this file is subject to the Open CASCADE Technology Public
7 // License Version 6.5 (the "License"). You may not use the content of this file
8 // except in compliance with the License. Please obtain a copy of the License
9 // at http://www.opencascade.org and read it completely before using this file.
11 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 // The Original Code and all software distributed under the License is
15 // distributed on an "AS IS" basis, without warranty of any kind, and the
16 // Initial Developer hereby disclaims all such warranties, including without
17 // limitation, any warranties of merchantability, fitness for a particular
18 // purpose or non-infringement. Please see the License for the specific terms
19 // and conditions governing the rights and limitations under the License.
23 #include <DrawTrSurf_Polygon2D.ixx>
25 #include <Draw_Color.hxx>
26 #include <Draw_MarkerShape.hxx>
28 //=======================================================================
29 //function : DrawTrSurf_Polygon2D
31 //=======================================================================
33 DrawTrSurf_Polygon2D::DrawTrSurf_Polygon2D(const Handle(Poly_Polygon2D)& P):
35 myNodes(Standard_False)
39 //=======================================================================
40 //function : Polygon2D
42 //=======================================================================
44 Handle(Poly_Polygon2D) DrawTrSurf_Polygon2D::Polygon2D() const
49 //=======================================================================
50 //function : ShowNodes
52 //=======================================================================
54 void DrawTrSurf_Polygon2D::ShowNodes(const Standard_Boolean B)
59 //=======================================================================
60 //function : ShowNodes
62 //=======================================================================
64 Standard_Boolean DrawTrSurf_Polygon2D::ShowNodes() const
69 //=======================================================================
72 //=======================================================================
74 void DrawTrSurf_Polygon2D::DrawOn(Draw_Display& dis) const
76 dis.SetColor(Draw_jaune);
79 const TColgp_Array1OfPnt2d& Points = myPolygon2D->Nodes();
81 for (Standard_Integer i = Points.Lower(); i <= Points.Upper()-1; i++) {
82 dis.Draw(Points(i), Points(i+1));
87 for (Standard_Integer i = Points.Lower(); i <= Points.Upper(); i++) {
88 dis.DrawMarker(Points(i), Draw_X);
94 //=======================================================================
97 //=======================================================================
99 Handle(Draw_Drawable3D) DrawTrSurf_Polygon2D::Copy() const
101 return new DrawTrSurf_Polygon2D(myPolygon2D);
104 //=======================================================================
107 //=======================================================================
109 void DrawTrSurf_Polygon2D::Dump(Standard_OStream& S) const
111 Poly::Dump(myPolygon2D, S);
114 //=======================================================================
117 //=======================================================================
119 void DrawTrSurf_Polygon2D::Whatis(Draw_Interpretor& I) const