0031687: Draw Harness, ViewerTest - extend command vrenderparams with option updating...
[occt.git] / src / Draw / Draw_Drawable3D.cxx
1 // Created on: 1991-04-24
2 // Created by: Arnaud BOUZY
3 // Copyright (c) 1991-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
18 #include <Draw_Display.hxx>
19 #include <Draw_Drawable3D.hxx>
20 #include <Standard_Type.hxx>
21
22 IMPLEMENT_STANDARD_RTTIEXT(Draw_Drawable3D,Standard_Transient)
23
24 //=======================================================================
25 //function : Draw_Drawable3D
26 //purpose  : 
27 //=======================================================================
28 Draw_Drawable3D::Draw_Drawable3D() :
29   myXmin(0.0),
30   myXmax(0.0),
31   myYmin(0.0),
32   myYmax(0.0),
33   isVisible(Standard_False),
34   isProtected(Standard_False),
35   myName(NULL)
36 {
37 }
38
39 //=======================================================================
40 //function : PickReject
41 //purpose  : 
42 //=======================================================================
43
44 Standard_Boolean Draw_Drawable3D::PickReject(const Standard_Real X,
45                                              const Standard_Real Y,
46                                              const Standard_Real Prec) const
47 {
48   return ((X+Prec < myXmin) || (X-Prec > myXmax) ||
49           (Y+Prec < myYmin) || (Y-Prec > myYmax));
50 }
51  
52
53 //=======================================================================
54 //function : Copy
55 //purpose  : 
56 //=======================================================================
57
58 Handle(Draw_Drawable3D)  Draw_Drawable3D::Copy() const
59 {
60   return this;
61 }
62
63
64 //=======================================================================
65 //function : Dump
66 //purpose  : 
67 //=======================================================================
68
69 void  Draw_Drawable3D::Dump(Standard_OStream& S) const
70 {
71   S << myXmin << " " << myXmax << "\n";
72   S << myYmin << " " << myYmax << "\n";
73 }
74
75
76 //=======================================================================
77 //function : Whatis
78 //purpose  : 
79 //=======================================================================
80
81 void  Draw_Drawable3D::Whatis(Draw_Interpretor& S) const
82 {
83   S << "drawable 3d";
84 }
85
86 //=======================================================================
87 //function : Is3D
88 //purpose  : 
89 //=======================================================================
90
91 Standard_Boolean Draw_Drawable3D::Is3D() const
92 {
93   return Standard_True;
94 }
95
96 //=======================================================================
97 //function : SetBounds
98 //purpose  : 
99 //=======================================================================
100
101 void  Draw_Drawable3D::SetBounds(const Standard_Real xmin, 
102                                  const Standard_Real xmax, 
103                                  const Standard_Real ymin, 
104                                  const Standard_Real ymax)
105 {
106   myXmin = xmin;
107   myXmax = xmax;
108   myYmin = ymin;
109   myYmax = ymax;
110 }
111
112
113 //=======================================================================
114 //function : Bounds
115 //purpose  : 
116 //=======================================================================
117
118 void  Draw_Drawable3D::Bounds(Standard_Real& xmin, 
119                               Standard_Real& xmax, 
120                               Standard_Real& ymin, 
121                               Standard_Real& ymax) const
122 {
123   xmin = myXmin;
124   xmax = myXmax;
125   ymin = myYmin;
126   ymax = myYmax;
127 }
128
129