Test for 0022778: Bug in BRepMesh
[occt.git] / src / XSDRAW / XSDRAW_Vars.cxx
1 // Copyright (c) 1999-2012 OPEN CASCADE SAS
2 //
3 // The content of this file is subject to the Open CASCADE Technology Public
4 // License Version 6.5 (the "License"). You may not use the content of this file
5 // except in compliance with the License. Please obtain a copy of the License
6 // at http://www.opencascade.org and read it completely before using this file.
7 //
8 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
10 //
11 // The Original Code and all software distributed under the License is
12 // distributed on an "AS IS" basis, without warranty of any kind, and the
13 // Initial Developer hereby disclaims all such warranties, including without
14 // limitation, any warranties of merchantability, fitness for a particular
15 // purpose or non-infringement. Please see the License for the specific terms
16 // and conditions governing the rights and limitations under the License.
17
18 #include <XSDRAW_Vars.ixx>
19 #include <Geom_Geometry.hxx>
20 #include <Geom2d_Curve.hxx>
21
22 #include <DrawTrSurf.hxx>
23 #include <DBRep.hxx>
24
25 #include <Interface_Macros.hxx>
26
27
28
29 XSDRAW_Vars::XSDRAW_Vars  ()    {  }
30
31 void  XSDRAW_Vars::Set
32   (const Standard_CString name,
33    const Handle(Standard_Transient)& val)
34 {
35   //char* nam = name;
36 // selon type
37   DeclareAndCast(Geom_Geometry,geom,val);
38   if (!geom.IsNull()) {
39     DrawTrSurf::Set(name,geom);
40     return;
41   }
42   DeclareAndCast(Geom2d_Curve,g2d,val);
43   if (!g2d.IsNull()) {
44     DrawTrSurf::Set(name,geom);
45     return;
46   }
47 //  ??
48 }
49
50 /*
51 Handle(Standard_Transient)  XSDRAW_Vars::Get (const Standard_CString name) const
52 {
53   Handle(Standard_Transient) val;
54   if (!thevars->GetItem (name,val)) val.Nullify();
55   return val;
56 }
57 */
58
59
60 Handle(Geom_Geometry)  XSDRAW_Vars::GetGeom (Standard_CString& name) const
61 {  //char* nam = name;  
62   return DrawTrSurf::Get(name);  
63 }
64
65 Handle(Geom2d_Curve)  XSDRAW_Vars::GetCurve2d (Standard_CString& name) const
66 {  //char* nam = name;  
67    return DrawTrSurf::GetCurve2d(name);  
68 }
69
70 Handle(Geom_Curve)  XSDRAW_Vars::GetCurve (Standard_CString& name) const
71 {  //char* nam = name;  
72    return DrawTrSurf::GetCurve(name);  
73 }
74
75 Handle(Geom_Surface)  XSDRAW_Vars::GetSurface (Standard_CString& name) const
76 {  //char* nam = name;  
77    return DrawTrSurf::GetSurface(name);  
78 }
79
80
81 void  XSDRAW_Vars::SetPoint (const Standard_CString name, const gp_Pnt& val)
82 {
83   //char* nam = name;
84   DrawTrSurf::Set (name, val);
85 }
86
87 Standard_Boolean  XSDRAW_Vars::GetPoint (Standard_CString& name, gp_Pnt& pnt) const
88 {  //char* nam = name;  
89    return DrawTrSurf::GetPoint (name,pnt);  }
90
91
92 void  XSDRAW_Vars::SetPoint2d (const Standard_CString name, const gp_Pnt2d& val)
93 {
94   //char* nam = name;
95   DrawTrSurf::Set (name, val);
96 }
97
98 Standard_Boolean  XSDRAW_Vars::GetPoint2d (Standard_CString& name, gp_Pnt2d& pnt) const
99 {  
100   //char* nam = name;  
101   return DrawTrSurf::GetPoint2d (name,pnt);  }
102
103
104 void  XSDRAW_Vars::SetShape (const Standard_CString name, const TopoDS_Shape& val)
105 {  
106   DBRep::Set (name, val); 
107 }
108
109 TopoDS_Shape  XSDRAW_Vars::GetShape (Standard_CString& name) const
110 {  
111   //char* nam = name;  
112   return DBRep::Get (name);  
113 }