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.
23 #elif defined(HAVE_IOS_H)
27 #include <DrawTrSurf_Point.ixx>
28 #include <Standard_Stream.hxx>
30 //=======================================================================
31 //function : DrawTrSurf_Point
33 //=======================================================================
35 DrawTrSurf_Point::DrawTrSurf_Point(const gp_Pnt& P,
36 const Draw_MarkerShape Shape,
37 const Draw_Color& Col) :
45 //=======================================================================
46 //function : DrawTrSurf_Point
48 //=======================================================================
50 DrawTrSurf_Point::DrawTrSurf_Point(const gp_Pnt2d& P,
51 const Draw_MarkerShape Shape,
52 const Draw_Color& Col) :
53 myPoint(P.X(),P.Y(),0.),
60 //=======================================================================
63 //=======================================================================
65 Standard_Boolean DrawTrSurf_Point::Is3D() const
70 //=======================================================================
73 //=======================================================================
75 void DrawTrSurf_Point::DrawOn(Draw_Display& dis) const
77 dis.SetColor(myColor);
79 dis.DrawMarker(myPoint,myShape);
81 dis.DrawMarker(Point2d(),myShape);
84 //=======================================================================
87 //=======================================================================
89 gp_Pnt DrawTrSurf_Point::Point() const
94 //=======================================================================
97 //=======================================================================
99 void DrawTrSurf_Point::Point(const gp_Pnt& P)
102 is3D = Standard_True;
105 //=======================================================================
108 //=======================================================================
110 gp_Pnt2d DrawTrSurf_Point::Point2d() const
112 return gp_Pnt2d(myPoint.X(),myPoint.Y());
115 //=======================================================================
118 //=======================================================================
120 void DrawTrSurf_Point::Point2d(const gp_Pnt2d& P)
122 myPoint.SetCoord(P.X(),P.Y(),0);
123 is3D = Standard_False;
126 //=======================================================================
129 //=======================================================================
131 void DrawTrSurf_Point::Color(const Draw_Color& aColor)
136 //=======================================================================
139 //=======================================================================
141 Draw_Color DrawTrSurf_Point::Color() const
146 //=======================================================================
149 //=======================================================================
151 void DrawTrSurf_Point::Shape(const Draw_MarkerShape S)
156 //=======================================================================
159 //=======================================================================
161 Draw_MarkerShape DrawTrSurf_Point::Shape() const
166 //=======================================================================
169 //=======================================================================
171 Handle(Draw_Drawable3D) DrawTrSurf_Point::Copy() const
173 Handle(DrawTrSurf_Point) P;
175 P = new DrawTrSurf_Point(myPoint,myShape,myColor);
177 P = new DrawTrSurf_Point(Point2d(),myShape,myColor);
182 //=======================================================================
185 //=======================================================================
187 void DrawTrSurf_Point::Dump(Standard_OStream& S) const
189 #if defined(HAVE_IOS) && !defined(__sgi) && !defined(IRIX)
190 ios::fmtflags F = S.flags();
191 S.setf(ios::scientific,ios::floatfield);
194 long form = S.setf(ios::scientific);
195 std::streamsize prec = S.precision(15);
198 S << "Point : " << myPoint.X() << ", " << myPoint.Y() << ", " << myPoint.Z() <<endl;
200 S << "Point 2d : " << myPoint.X() << ", " << myPoint.Y() <<endl;
201 #if defined(HAVE_IOS) && !defined(__sgi) && !defined(IRIX)
209 //=======================================================================
212 //=======================================================================
214 void DrawTrSurf_Point::Whatis(Draw_Interpretor& S) const