b311480e |
1 | // Created on: 1991-04-24 |
2 | // Created by: Arnaud BOUZY |
3 | // Copyright (c) 1991-1999 Matra Datavision |
973c2be1 |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | // |
973c2be1 |
6 | // This file is part of Open CASCADE Technology software library. |
b311480e |
7 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | // |
973c2be1 |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
7fd59977 |
16 | |
42cf5bc1 |
17 | |
18 | #include <Draw_Display.hxx> |
19 | #include <Draw_Drawable3D.hxx> |
20 | #include <Standard_Type.hxx> |
7fd59977 |
21 | |
25e59720 |
22 | IMPLEMENT_STANDARD_RTTIEXT(Draw_Drawable3D,Standard_Transient) |
92efcf78 |
23 | |
7fd59977 |
24 | //======================================================================= |
25 | //function : Draw_Drawable3D |
26 | //purpose : |
27 | //======================================================================= |
7fd59977 |
28 | Draw_Drawable3D::Draw_Drawable3D() : |
29 | isVisible(Standard_False), |
30 | isProtected(Standard_False), |
31 | myName(NULL) |
32 | { |
33 | } |
34 | |
35 | //======================================================================= |
36 | //function : PickReject |
37 | //purpose : |
38 | //======================================================================= |
39 | |
40 | Standard_Boolean Draw_Drawable3D::PickReject(const Standard_Real X, |
41 | const Standard_Real Y, |
42 | const Standard_Real Prec) const |
43 | { |
44 | return ((X+Prec < myXmin) || (X-Prec > myXmax) || |
45 | (Y+Prec < myYmin) || (Y-Prec > myYmax)); |
46 | } |
47 | |
48 | |
49 | //======================================================================= |
50 | //function : Copy |
51 | //purpose : |
52 | //======================================================================= |
53 | |
54 | Handle(Draw_Drawable3D) Draw_Drawable3D::Copy() const |
55 | { |
56 | return this; |
57 | } |
58 | |
59 | |
60 | //======================================================================= |
61 | //function : Dump |
62 | //purpose : |
63 | //======================================================================= |
64 | |
65 | void Draw_Drawable3D::Dump(Standard_OStream& S) const |
66 | { |
67 | S << myXmin << " " << myXmax << "\n"; |
68 | S << myYmin << " " << myYmax << "\n"; |
69 | } |
70 | |
71 | |
72 | //======================================================================= |
73 | //function : Whatis |
74 | //purpose : |
75 | //======================================================================= |
76 | |
77 | void Draw_Drawable3D::Whatis(Draw_Interpretor& S) const |
78 | { |
79 | S << "drawable 3d"; |
80 | } |
81 | |
82 | //======================================================================= |
83 | //function : Is3D |
84 | //purpose : |
85 | //======================================================================= |
86 | |
87 | Standard_Boolean Draw_Drawable3D::Is3D() const |
88 | { |
89 | return Standard_True; |
90 | } |
91 | |
92 | //======================================================================= |
93 | //function : SetBounds |
94 | //purpose : |
95 | //======================================================================= |
96 | |
97 | void Draw_Drawable3D::SetBounds(const Standard_Real xmin, |
98 | const Standard_Real xmax, |
99 | const Standard_Real ymin, |
100 | const Standard_Real ymax) |
101 | { |
102 | myXmin = xmin; |
103 | myXmax = xmax; |
104 | myYmin = ymin; |
105 | myYmax = ymax; |
106 | } |
107 | |
108 | |
109 | //======================================================================= |
110 | //function : Bounds |
111 | //purpose : |
112 | //======================================================================= |
113 | |
114 | void Draw_Drawable3D::Bounds(Standard_Real& xmin, |
115 | Standard_Real& xmax, |
116 | Standard_Real& ymin, |
117 | Standard_Real& ymax) const |
118 | { |
119 | xmin = myXmin; |
120 | xmax = myXmax; |
121 | ymin = myYmin; |
122 | ymax = myYmax; |
123 | } |
124 | |
125 | |