0028832: MMgt_TShared can be replaced by Standard_Transient
[occt.git] / src / DDataStd / DDataStd_DrawDriver.hxx
1 // Created on: 1998-09-07
2 // Created by: Denis PASCAL
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 _DDataStd_DrawDriver_HeaderFile
18 #define _DDataStd_DrawDriver_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <Standard_Transient.hxx>
24 #include <Draw_ColorKind.hxx>
25 #include <Standard_Boolean.hxx>
26 class Draw_Drawable3D;
27 class TDF_Label;
28 class TDataXtd_Constraint;
29 class TopoDS_Shape;
30
31
32 class DDataStd_DrawDriver;
33 DEFINE_STANDARD_HANDLE(DDataStd_DrawDriver, Standard_Transient)
34
35 //! Root class of drivers to build draw variables from TDF_Label.
36 //! Priority rule to display standard attributes is :
37 //! * 1 Constraint
38 //! * 2 Object
39 //! * 3 Datum      (Point,Axis,Plane)
40 //! * 4 Geometry
41 //! * 5 NamedShape
42 class DDataStd_DrawDriver : public Standard_Transient
43 {
44
45 public:
46
47   
48   //! access to the current DrawDriver
49   //! ================================
50   Standard_EXPORT static void Set (const Handle(DDataStd_DrawDriver)& DD);
51   
52   Standard_EXPORT static Handle(DDataStd_DrawDriver) Get();
53   
54   //! next method is called by DrawPresentation (may be redefined)
55   //! ============================================================
56   Standard_EXPORT DDataStd_DrawDriver();
57   
58   //! reusable methods (may used when redefined <Drawable>)
59   //! =====================================================
60   Standard_EXPORT virtual Handle(Draw_Drawable3D) Drawable (const TDF_Label& L) const;
61   
62   Standard_EXPORT Handle(Draw_Drawable3D) DrawableConstraint (const Handle(TDataXtd_Constraint)& C) const;
63   
64   Standard_EXPORT Handle(Draw_Drawable3D) DrawableShape (const TDF_Label& L, const Draw_ColorKind color, const Standard_Boolean current = Standard_True) const;
65   
66   //! May be used for temporary display of a shape
67   Standard_EXPORT static Handle(Draw_Drawable3D) DrawableShape (const TopoDS_Shape& s, const Draw_ColorKind color);
68
69
70
71
72   DEFINE_STANDARD_RTTIEXT(DDataStd_DrawDriver,Standard_Transient)
73
74 protected:
75
76
77
78
79 private:
80
81
82
83
84 };
85
86
87
88
89
90
91
92 #endif // _DDataStd_DrawDriver_HeaderFile