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.
15 #include <Geom2d_CartesianPoint.hxx>
16 #include <Geom2d_Curve.hxx>
17 #include <Geom_CartesianPoint.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_HShape.hxx>
27 #include <TopoDS_Shape.hxx>
28 #include <XSControl_Vars.hxx>
30 IMPLEMENT_STANDARD_RTTIEXT(XSControl_Vars,Standard_Transient)
32 XSControl_Vars::XSControl_Vars() { }
34 void XSControl_Vars::Set
35 (const Standard_CString name,
36 const Handle(Standard_Transient)& val)
38 thevars.Bind(name,val);
41 Handle(Standard_Transient) XSControl_Vars::Get ( Standard_CString& name) const
43 Handle(Standard_Transient) val;
44 if (!thevars.Find(name, val))
49 Handle(Geom_Geometry) XSControl_Vars::GetGeom ( Standard_CString& name) const
50 { return GetCasted(Geom_Geometry,Get(name)); }
52 Handle(Geom2d_Curve) XSControl_Vars::GetCurve2d ( Standard_CString& name) const
53 { return GetCasted(Geom2d_Curve,Get(name)); }
55 Handle(Geom_Curve) XSControl_Vars::GetCurve ( Standard_CString& name) const
56 { return GetCasted(Geom_Curve,Get(name)); }
58 Handle(Geom_Surface) XSControl_Vars::GetSurface ( Standard_CString& name) const
59 { return GetCasted(Geom_Surface,Get(name)); }
62 void XSControl_Vars::SetPoint (const Standard_CString name, const gp_Pnt& val)
63 { Set (name, new Geom_CartesianPoint(val)); }
65 Standard_Boolean XSControl_Vars::GetPoint (Standard_CString& name, gp_Pnt& pnt) const
67 DeclareAndCast(Geom_CartesianPoint,val,Get(name));
68 if (val.IsNull()) return Standard_False;
74 void XSControl_Vars::SetPoint2d (const Standard_CString name, const gp_Pnt2d& val)
75 { Set (name, new Geom2d_CartesianPoint(val)); }
77 Standard_Boolean XSControl_Vars::GetPoint2d (Standard_CString& name, gp_Pnt2d& pnt) const
79 DeclareAndCast(Geom2d_CartesianPoint,val,Get(name));
80 if (val.IsNull()) return Standard_False;
86 void XSControl_Vars::SetShape (const Standard_CString name, const TopoDS_Shape& val)
87 { Set (name, new TopoDS_HShape(val)); }
89 TopoDS_Shape XSControl_Vars::GetShape (Standard_CString& name) const
92 DeclareAndCast(TopoDS_HShape,val,Get(name));
93 if (!val.IsNull()) sh = val->Shape();