1 // Created on: 1995-03-10
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.
18 #include <Draw_Color.hxx>
19 #include <Draw_Display.hxx>
20 #include <Draw_Drawable3D.hxx>
21 #include <Draw_MarkerShape.hxx>
22 #include <DrawTrSurf_Polygon3D.hxx>
24 #include <Poly_Polygon3D.hxx>
25 #include <Standard_Type.hxx>
27 IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_Polygon3D,Draw_Drawable3D)
29 //=======================================================================
30 //function : DrawTrSurf_Polygon3D
32 //=======================================================================
33 DrawTrSurf_Polygon3D::DrawTrSurf_Polygon3D(const Handle(Poly_Polygon3D)& P):
35 myNodes(Standard_False)
40 //=======================================================================
41 //function : Polygon3D
43 //=======================================================================
45 Handle(Poly_Polygon3D) DrawTrSurf_Polygon3D::Polygon3D() const
50 //=======================================================================
51 //function : ShowNodes
53 //=======================================================================
55 void DrawTrSurf_Polygon3D::ShowNodes(const Standard_Boolean B)
60 //=======================================================================
61 //function : ShowNodes
63 //=======================================================================
65 Standard_Boolean DrawTrSurf_Polygon3D::ShowNodes() const
70 //=======================================================================
73 //=======================================================================
75 void DrawTrSurf_Polygon3D::DrawOn(Draw_Display& dis) const
77 dis.SetColor(Draw_jaune);
79 const TColgp_Array1OfPnt& Points = myPolygon3D->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_Polygon3D::Copy() const
101 return new DrawTrSurf_Polygon3D(myPolygon3D);
104 //=======================================================================
107 //=======================================================================
109 void DrawTrSurf_Polygon3D::Dump(Standard_OStream& S) const
111 Poly::Dump(myPolygon3D, S);
114 //=======================================================================
117 //=======================================================================
119 void DrawTrSurf_Polygon3D::Whatis(Draw_Interpretor& I) const