0026377: Passing Handle objects as arguments to functions as non-const reference...
[occt.git] / src / XSControl / XSControl_Vars.hxx
CommitLineData
42cf5bc1 1// Created on: 1998-07-22
2// Created by: Christian CAILLET
3// Copyright (c) 1998-1999 Matra Datavision
4// Copyright (c) 1999-2014 OPEN CASCADE SAS
5//
6// This file is part of Open CASCADE Technology software library.
7//
8// This library is free software; you can redistribute it and/or modify it under
9// the terms of the GNU Lesser General Public License version 2.1 as published
10// by the Free Software Foundation, with special exception defined in the file
11// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12// distribution for complete text of the license and disclaimer of any warranty.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
17#ifndef _XSControl_Vars_HeaderFile
18#define _XSControl_Vars_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
22
23#include <MMgt_TShared.hxx>
24#include <Standard_CString.hxx>
25#include <Standard_Boolean.hxx>
26class Dico_DictionaryOfTransient;
27class Standard_Transient;
28class Geom_Geometry;
29class Geom2d_Curve;
30class Geom_Curve;
31class Geom_Surface;
32class gp_Pnt;
33class gp_Pnt2d;
34class TopoDS_Shape;
35
36
37class XSControl_Vars;
38DEFINE_STANDARD_HANDLE(XSControl_Vars, MMgt_TShared)
39
40//! Defines a receptacle for externally defined variables, each
41//! one has a name
42//!
43//! I.E. a WorkSession for XSTEP is generally used inside a
44//! context, which brings variables, especially shapes and
45//! geometries. For instance DRAW or an application engine
46//!
47//! This class provides a common form for this. It also provides
48//! a default implementation (locally recorded variables in a
49//! dictionary), but which is aimed to be redefined
50class XSControl_Vars : public MMgt_TShared
51{
52
53public:
54
55
56 Standard_EXPORT XSControl_Vars();
57
58 Standard_EXPORT virtual void Set (const Standard_CString name, const Handle(Standard_Transient)& val);
59
60 Standard_EXPORT virtual Handle(Standard_Transient) Get (Standard_CString& name) const;
61
62 Standard_EXPORT virtual Handle(Geom_Geometry) GetGeom (Standard_CString& name) const;
63
64 Standard_EXPORT virtual Handle(Geom2d_Curve) GetCurve2d (Standard_CString& name) const;
65
66 Standard_EXPORT virtual Handle(Geom_Curve) GetCurve (Standard_CString& name) const;
67
68 Standard_EXPORT virtual Handle(Geom_Surface) GetSurface (Standard_CString& name) const;
69
70 Standard_EXPORT virtual void SetPoint (const Standard_CString name, const gp_Pnt& val);
71
72 Standard_EXPORT virtual void SetPoint2d (const Standard_CString name, const gp_Pnt2d& val);
73
74 Standard_EXPORT virtual Standard_Boolean GetPoint (Standard_CString& name, gp_Pnt& pnt) const;
75
76 Standard_EXPORT virtual Standard_Boolean GetPoint2d (Standard_CString& name, gp_Pnt2d& pnt) const;
77
78 Standard_EXPORT virtual void SetShape (const Standard_CString name, const TopoDS_Shape& val);
79
80 Standard_EXPORT virtual TopoDS_Shape GetShape (Standard_CString& name) const;
81
82
83
84
92efcf78 85 DEFINE_STANDARD_RTTIEXT(XSControl_Vars,MMgt_TShared)
42cf5bc1 86
87protected:
88
89
90
91
92private:
93
94
95 Handle(Dico_DictionaryOfTransient) thevars;
96
97
98};
99
100
101
102
103
104
105
106#endif // _XSControl_Vars_HeaderFile