1 // Created on: 2017-06-16
2 // Created by: Natalia ERMOLAEVA
3 // Copyright (c) 2017 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #include <GeometryTest_DrawableQualifiedCurve2d.hxx>
19 #include <Geom2d_Circle.hxx>
20 #include <Geom2d_Curve.hxx>
21 #include <Geom2d_Line.hxx>
23 IMPLEMENT_STANDARD_RTTIEXT(GeometryTest_DrawableQualifiedCurve2d, DrawTrSurf_Curve2d)
25 //=======================================================================
26 //function : GeometryTest_DrawableQualifiedCurve2d
28 //=======================================================================
30 GeometryTest_DrawableQualifiedCurve2d::GeometryTest_DrawableQualifiedCurve2d (const Handle(Geom2d_Curve)& theCurve,
31 const GccEnt_Position thePosition,
32 const Standard_Boolean theDispOrigin)
33 : DrawTrSurf_Curve2d (theCurve, theDispOrigin), myPosition (thePosition)
38 //=======================================================================
39 //function : GeometryTest_DrawableQualifiedCurve2d
41 //=======================================================================
43 GeometryTest_DrawableQualifiedCurve2d::GeometryTest_DrawableQualifiedCurve2d (const Handle(Geom2d_Curve)& theCurve,
44 const Draw_Color& theColor,
45 const Standard_Integer theDiscret,
46 const GccEnt_Position thePosition,
47 const Standard_Boolean theDispOrigin,
48 const Standard_Boolean theDispCurvRadius,
49 const Standard_Real theRadiusMax,
50 const Standard_Real theRatioOfRadius)
51 : DrawTrSurf_Curve2d (theCurve, theColor, theDiscret, theDispOrigin, theDispCurvRadius, theRadiusMax, theRatioOfRadius),
52 myPosition (thePosition)
57 //=======================================================================
60 //=======================================================================
62 void GeometryTest_DrawableQualifiedCurve2d::DrawOn (Draw_Display& theDisplay) const
64 DrawTrSurf_Curve2d::DrawOn (theDisplay);
67 //=======================================================================
70 //=======================================================================
72 void GeometryTest_DrawableQualifiedCurve2d::Dump (Standard_OStream& theStream) const
74 theStream << "Qualified curve 2D: \n";
75 theStream << "Position :" << GccEnt::PositionToString (myPosition) << "\n";
76 DrawTrSurf_Curve2d::Dump (theStream);
79 //=======================================================================
82 //=======================================================================
84 void GeometryTest_DrawableQualifiedCurve2d::Whatis (Draw_Interpretor& theDI)const
86 Handle(Standard_Type) aType = GetCurve()->DynamicType();
88 if (aType == STANDARD_TYPE (Geom2d_Circle))
90 theDI << "qualified 2d Circle";
92 else if (aType == STANDARD_TYPE (Geom2d_Line))
94 theDI << "qualified 2d Line";