1 // Created on: 1994-03-28
2 // Created by: Remi LEQUETTE
3 // Copyright (c) 1994-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_Point.ixx>
18 #include <Standard_Stream.hxx>
20 //=======================================================================
21 //function : DrawTrSurf_Point
23 //=======================================================================
25 DrawTrSurf_Point::DrawTrSurf_Point(const gp_Pnt& P,
26 const Draw_MarkerShape Shape,
27 const Draw_Color& Col) :
35 //=======================================================================
36 //function : DrawTrSurf_Point
38 //=======================================================================
40 DrawTrSurf_Point::DrawTrSurf_Point(const gp_Pnt2d& P,
41 const Draw_MarkerShape Shape,
42 const Draw_Color& Col) :
43 myPoint(P.X(),P.Y(),0.),
50 //=======================================================================
53 //=======================================================================
55 Standard_Boolean DrawTrSurf_Point::Is3D() const
60 //=======================================================================
63 //=======================================================================
65 void DrawTrSurf_Point::DrawOn(Draw_Display& dis) const
67 dis.SetColor(myColor);
69 dis.DrawMarker(myPoint,myShape);
71 dis.DrawMarker(Point2d(),myShape);
74 //=======================================================================
77 //=======================================================================
79 gp_Pnt DrawTrSurf_Point::Point() const
84 //=======================================================================
87 //=======================================================================
89 void DrawTrSurf_Point::Point(const gp_Pnt& P)
95 //=======================================================================
98 //=======================================================================
100 gp_Pnt2d DrawTrSurf_Point::Point2d() const
102 return gp_Pnt2d(myPoint.X(),myPoint.Y());
105 //=======================================================================
108 //=======================================================================
110 void DrawTrSurf_Point::Point2d(const gp_Pnt2d& P)
112 myPoint.SetCoord(P.X(),P.Y(),0);
113 is3D = Standard_False;
116 //=======================================================================
119 //=======================================================================
121 void DrawTrSurf_Point::Color(const Draw_Color& aColor)
126 //=======================================================================
129 //=======================================================================
131 Draw_Color DrawTrSurf_Point::Color() const
136 //=======================================================================
139 //=======================================================================
141 void DrawTrSurf_Point::Shape(const Draw_MarkerShape S)
146 //=======================================================================
149 //=======================================================================
151 Draw_MarkerShape DrawTrSurf_Point::Shape() const
156 //=======================================================================
159 //=======================================================================
161 Handle(Draw_Drawable3D) DrawTrSurf_Point::Copy() const
163 Handle(DrawTrSurf_Point) P;
165 P = new DrawTrSurf_Point(myPoint,myShape,myColor);
167 P = new DrawTrSurf_Point(Point2d(),myShape,myColor);
172 //=======================================================================
175 //=======================================================================
177 void DrawTrSurf_Point::Dump(Standard_OStream& S) const
179 #if !defined(_WIN32) && !defined(__sgi) && !defined(IRIX)
180 ios::fmtflags F = S.flags();
181 S.setf(ios::scientific,ios::floatfield);
184 long form = S.setf(ios::scientific);
185 std::streamsize prec = S.precision(15);
188 S << "Point : " << myPoint.X() << ", " << myPoint.Y() << ", " << myPoint.Z() <<endl;
190 S << "Point 2d : " << myPoint.X() << ", " << myPoint.Y() <<endl;
191 #if !defined(_WIN32) && !defined(__sgi) && !defined(IRIX)
199 //=======================================================================
202 //=======================================================================
204 void DrawTrSurf_Point::Whatis(Draw_Interpretor& S) const