1 // Created on: 1994-03-28
2 // Created by: Remi LEQUETTE
3 // Copyright (c) 1994-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.
28 #elif defined(HAVE_IOS_H)
32 #include <DrawTrSurf_Point.ixx>
33 #include <Standard_Stream.hxx>
35 //=======================================================================
36 //function : DrawTrSurf_Point
38 //=======================================================================
40 DrawTrSurf_Point::DrawTrSurf_Point(const gp_Pnt& P,
41 const Draw_MarkerShape Shape,
42 const Draw_Color& Col) :
50 //=======================================================================
51 //function : DrawTrSurf_Point
53 //=======================================================================
55 DrawTrSurf_Point::DrawTrSurf_Point(const gp_Pnt2d& P,
56 const Draw_MarkerShape Shape,
57 const Draw_Color& Col) :
58 myPoint(P.X(),P.Y(),0.),
65 //=======================================================================
68 //=======================================================================
70 Standard_Boolean DrawTrSurf_Point::Is3D() const
75 //=======================================================================
78 //=======================================================================
80 void DrawTrSurf_Point::DrawOn(Draw_Display& dis) const
82 dis.SetColor(myColor);
84 dis.DrawMarker(myPoint,myShape);
86 dis.DrawMarker(Point2d(),myShape);
89 //=======================================================================
92 //=======================================================================
94 gp_Pnt DrawTrSurf_Point::Point() const
99 //=======================================================================
102 //=======================================================================
104 void DrawTrSurf_Point::Point(const gp_Pnt& P)
107 is3D = Standard_True;
110 //=======================================================================
113 //=======================================================================
115 gp_Pnt2d DrawTrSurf_Point::Point2d() const
117 return gp_Pnt2d(myPoint.X(),myPoint.Y());
120 //=======================================================================
123 //=======================================================================
125 void DrawTrSurf_Point::Point2d(const gp_Pnt2d& P)
127 myPoint.SetCoord(P.X(),P.Y(),0);
128 is3D = Standard_False;
131 //=======================================================================
134 //=======================================================================
136 void DrawTrSurf_Point::Color(const Draw_Color& aColor)
141 //=======================================================================
144 //=======================================================================
146 Draw_Color DrawTrSurf_Point::Color() const
151 //=======================================================================
154 //=======================================================================
156 void DrawTrSurf_Point::Shape(const Draw_MarkerShape S)
161 //=======================================================================
164 //=======================================================================
166 Draw_MarkerShape DrawTrSurf_Point::Shape() const
171 //=======================================================================
174 //=======================================================================
176 Handle(Draw_Drawable3D) DrawTrSurf_Point::Copy() const
178 Handle(DrawTrSurf_Point) P;
180 P = new DrawTrSurf_Point(myPoint,myShape,myColor);
182 P = new DrawTrSurf_Point(Point2d(),myShape,myColor);
187 //=======================================================================
190 //=======================================================================
192 void DrawTrSurf_Point::Dump(Standard_OStream& S) const
194 #if defined(HAVE_IOS) && !defined(__sgi) && !defined(IRIX)
195 ios::fmtflags F = S.flags();
196 S.setf(ios::scientific,ios::floatfield);
199 long form = S.setf(ios::scientific);
200 std::streamsize prec = S.precision(15);
203 S << "Point : " << myPoint.X() << ", " << myPoint.Y() << ", " << myPoint.Z() <<endl;
205 S << "Point 2d : " << myPoint.X() << ", " << myPoint.Y() <<endl;
206 #if defined(HAVE_IOS) && !defined(__sgi) && !defined(IRIX)
214 //=======================================================================
217 //=======================================================================
219 void DrawTrSurf_Point::Whatis(Draw_Interpretor& S) const