0028403: Avoid useless calls to BRepTools::Write()
[occt.git] / src / XSDRAW / XSDRAW_Vars.cxx
CommitLineData
973c2be1 1// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 2//
973c2be1 3// This file is part of Open CASCADE Technology software library.
b311480e 4//
d5f74e42 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
973c2be1 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.
b311480e 10//
973c2be1 11// Alternatively, this file may be used under the terms of Open CASCADE
12// commercial license or contractual agreement.
b311480e 13
7fd59977 14
7fd59977 15#include <DBRep.hxx>
42cf5bc1 16#include <DrawTrSurf.hxx>
17#include <Geom2d_Curve.hxx>
18#include <Geom_Curve.hxx>
19#include <Geom_Geometry.hxx>
20#include <Geom_Surface.hxx>
21#include <gp_Pnt.hxx>
22#include <gp_Pnt2d.hxx>
7fd59977 23#include <Interface_Macros.hxx>
42cf5bc1 24#include <Standard_Transient.hxx>
25#include <Standard_Type.hxx>
26#include <TopoDS_Shape.hxx>
27#include <XSDRAW_Vars.hxx>
7fd59977 28
92efcf78 29IMPLEMENT_STANDARD_RTTIEXT(XSDRAW_Vars,XSControl_Vars)
30
7fd59977 31XSDRAW_Vars::XSDRAW_Vars () { }
32
33void XSDRAW_Vars::Set
34 (const Standard_CString name,
35 const Handle(Standard_Transient)& val)
36{
37 //char* nam = name;
38// selon type
39 DeclareAndCast(Geom_Geometry,geom,val);
40 if (!geom.IsNull()) {
41 DrawTrSurf::Set(name,geom);
42 return;
43 }
44 DeclareAndCast(Geom2d_Curve,g2d,val);
45 if (!g2d.IsNull()) {
46 DrawTrSurf::Set(name,geom);
47 return;
48 }
49// ??
50}
51
52/*
53Handle(Standard_Transient) XSDRAW_Vars::Get (const Standard_CString name) const
54{
55 Handle(Standard_Transient) val;
56 if (!thevars->GetItem (name,val)) val.Nullify();
57 return val;
58}
59*/
60
61
62Handle(Geom_Geometry) XSDRAW_Vars::GetGeom (Standard_CString& name) const
63{ //char* nam = name;
64 return DrawTrSurf::Get(name);
65}
66
67Handle(Geom2d_Curve) XSDRAW_Vars::GetCurve2d (Standard_CString& name) const
68{ //char* nam = name;
69 return DrawTrSurf::GetCurve2d(name);
70}
71
72Handle(Geom_Curve) XSDRAW_Vars::GetCurve (Standard_CString& name) const
73{ //char* nam = name;
74 return DrawTrSurf::GetCurve(name);
75}
76
77Handle(Geom_Surface) XSDRAW_Vars::GetSurface (Standard_CString& name) const
78{ //char* nam = name;
79 return DrawTrSurf::GetSurface(name);
80}
81
82
83void XSDRAW_Vars::SetPoint (const Standard_CString name, const gp_Pnt& val)
84{
85 //char* nam = name;
86 DrawTrSurf::Set (name, val);
87}
88
89Standard_Boolean XSDRAW_Vars::GetPoint (Standard_CString& name, gp_Pnt& pnt) const
90{ //char* nam = name;
91 return DrawTrSurf::GetPoint (name,pnt); }
92
93
94void XSDRAW_Vars::SetPoint2d (const Standard_CString name, const gp_Pnt2d& val)
95{
96 //char* nam = name;
97 DrawTrSurf::Set (name, val);
98}
99
100Standard_Boolean XSDRAW_Vars::GetPoint2d (Standard_CString& name, gp_Pnt2d& pnt) const
101{
102 //char* nam = name;
103 return DrawTrSurf::GetPoint2d (name,pnt); }
104
105
106void XSDRAW_Vars::SetShape (const Standard_CString name, const TopoDS_Shape& val)
107{
108 DBRep::Set (name, val);
109}
110
111TopoDS_Shape XSDRAW_Vars::GetShape (Standard_CString& name) const
112{
113 //char* nam = name;
114 return DBRep::Get (name);
115}