1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
16 #include <DrawTrSurf.hxx>
17 #include <Geom2d_Curve.hxx>
18 #include <Geom_Curve.hxx>
19 #include <Geom_Geometry.hxx>
20 #include <Geom_Surface.hxx>
22 #include <gp_Pnt2d.hxx>
23 #include <Interface_Macros.hxx>
24 #include <Standard_Transient.hxx>
25 #include <Standard_Type.hxx>
26 #include <TopoDS_Shape.hxx>
27 #include <XSDRAW_Vars.hxx>
29 IMPLEMENT_STANDARD_RTTIEXT(XSDRAW_Vars,XSControl_Vars)
31 XSDRAW_Vars::XSDRAW_Vars () { }
34 (const Standard_CString name,
35 const Handle(Standard_Transient)& val)
39 DeclareAndCast(Geom_Geometry,geom,val);
41 DrawTrSurf::Set(name,geom);
44 DeclareAndCast(Geom2d_Curve,g2d,val);
46 DrawTrSurf::Set(name,geom);
53 Handle(Standard_Transient) XSDRAW_Vars::Get (const Standard_CString name) const
55 Handle(Standard_Transient) val;
56 if (!thevars->GetItem (name,val)) val.Nullify();
62 Handle(Geom_Geometry) XSDRAW_Vars::GetGeom (Standard_CString& name) const
64 return DrawTrSurf::Get(name);
67 Handle(Geom2d_Curve) XSDRAW_Vars::GetCurve2d (Standard_CString& name) const
69 return DrawTrSurf::GetCurve2d(name);
72 Handle(Geom_Curve) XSDRAW_Vars::GetCurve (Standard_CString& name) const
74 return DrawTrSurf::GetCurve(name);
77 Handle(Geom_Surface) XSDRAW_Vars::GetSurface (Standard_CString& name) const
79 return DrawTrSurf::GetSurface(name);
83 void XSDRAW_Vars::SetPoint (const Standard_CString name, const gp_Pnt& val)
86 DrawTrSurf::Set (name, val);
89 Standard_Boolean XSDRAW_Vars::GetPoint (Standard_CString& name, gp_Pnt& pnt) const
91 return DrawTrSurf::GetPoint (name,pnt); }
94 void XSDRAW_Vars::SetPoint2d (const Standard_CString name, const gp_Pnt2d& val)
97 DrawTrSurf::Set (name, val);
100 Standard_Boolean XSDRAW_Vars::GetPoint2d (Standard_CString& name, gp_Pnt2d& pnt) const
103 return DrawTrSurf::GetPoint2d (name,pnt); }
106 void XSDRAW_Vars::SetShape (const Standard_CString name, const TopoDS_Shape& val)
108 DBRep::Set (name, val);
111 TopoDS_Shape XSDRAW_Vars::GetShape (Standard_CString& name) const
114 return DBRep::Get (name);