0024070: OpenGL capped object-level clipping planes
[occt.git] / src / Select3D / Select3D_SensitiveEntity.cxx
1 // Created on: 1995-03-13
2 // Created by: Robert COUBLANC
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2012 OPEN CASCADE SAS
5 //
6 // The content of this file is subject to the Open CASCADE Technology Public
7 // License Version 6.5 (the "License"). You may not use the content of this file
8 // except in compliance with the License. Please obtain a copy of the License
9 // at http://www.opencascade.org and read it completely before using this file.
10 //
11 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 //
14 // The Original Code and all software distributed under the License is
15 // distributed on an "AS IS" basis, without warranty of any kind, and the
16 // Initial Developer hereby disclaims all such warranties, including without
17 // limitation, any warranties of merchantability, fitness for a particular
18 // purpose or non-infringement. Please see the License for the specific terms
19 // and conditions governing the rights and limitations under the License.
20
21
22
23
24
25 #include <Select3D_SensitiveEntity.ixx>
26 #include <Precision.hxx>
27 #include <SelectBasics_EntityOwner.hxx>
28 #include <Select3D_Macro.hxx>
29
30 //=======================================================================
31 //function : Select3D_SensitiveEntity
32 //purpose  : 
33 //=======================================================================
34
35 Select3D_SensitiveEntity::Select3D_SensitiveEntity(const Handle(SelectBasics_EntityOwner)& OwnerId):
36 SelectBasics_SensitiveEntity(OwnerId)
37 {}
38
39 //=======================================================================
40 //function : Matches
41 //purpose  : 
42 //=======================================================================
43
44 Standard_Boolean Select3D_SensitiveEntity::Matches(const Standard_Real,
45                                                    const Standard_Real,
46                                                    const Standard_Real,
47                                                    const Standard_Real,
48                                                    const Standard_Real)
49 {
50   return Standard_False;
51 }
52
53 //=======================================================================
54 //function : Matches
55 //purpose  : 
56 //=======================================================================
57
58 Standard_Boolean Select3D_SensitiveEntity::Matches(const TColgp_Array1OfPnt2d&,
59                                                    const Bnd_Box2d&,
60                                                    const Standard_Real)
61 {
62   return Standard_False;
63 }
64
65 //=======================================================================
66 //function : Dump
67 //purpose  : 
68 //=======================================================================
69
70 void Select3D_SensitiveEntity::Dump(Standard_OStream& S, const Standard_Boolean) const
71 {
72   S<<"\tSensitive Entity 3D"<<endl;
73 }
74
75 //=======================================================================
76 //function : DumpBox
77 //purpose  : 
78 //=======================================================================
79
80 void Select3D_SensitiveEntity::DumpBox(Standard_OStream& S,const Bnd_Box2d& b2d) 
81 {
82   if(!b2d.IsVoid())
83   {
84     Standard_Real xmin,ymin,xmax,ymax;
85     b2d.Get(xmin,ymin,xmax,ymax);
86     S<<"\t\t\tBox2d: PMIN ["<<xmin<<" , "<<ymin<<"]"<<endl;
87     S<<"\t\t\t       PMAX ["<<xmax<<" , "<<ymax<<"]"<<endl;
88   }
89 }
90
91 //=======================================================================
92 //function : ResetLocation
93 //purpose  : 
94 //=======================================================================
95
96 void Select3D_SensitiveEntity::ResetLocation()
97 {
98 }
99
100 //=======================================================================
101 //function : SetLocation
102 //purpose  : 
103 //=======================================================================
104
105 void Select3D_SensitiveEntity::SetLocation(const TopLoc_Location&)
106 {
107 }
108
109 //=======================================================================
110 //function : UpdateLocation
111 //purpose  : 
112 //=======================================================================
113
114 void Select3D_SensitiveEntity::UpdateLocation(const TopLoc_Location& aLoc)
115 {
116   if(aLoc.IsIdentity() || aLoc == Location()) return;
117   if(!HasLocation())
118     SetLocation(aLoc);
119   else 
120   {
121     TopLoc_Location compLoc = aLoc * Location();
122     SetLocation(compLoc);
123   }
124 }
125
126 //=======================================================================
127 //function : Location
128 //purpose  : 
129 //=======================================================================
130
131 const TopLoc_Location& Select3D_SensitiveEntity::Location() const 
132 {
133   static TopLoc_Location anIdentity;    
134   Handle(SelectBasics_EntityOwner) anOwner = OwnerId();
135   return anOwner.IsNull() ? anIdentity : anOwner->Location();
136 }
137
138 //=======================================================================
139 //function : HasLocation
140 //purpose  : 
141 //=======================================================================
142
143 Standard_Boolean Select3D_SensitiveEntity::HasLocation() const
144
145   Handle(SelectBasics_EntityOwner) anOwner = OwnerId();
146   return (!anOwner.IsNull() && anOwner->HasLocation());
147 }
148
149 //=======================================================================
150 //function : Is3D
151 //purpose  : 
152 //=======================================================================
153
154 Standard_Boolean Select3D_SensitiveEntity::Is3D() const
155 {return Standard_True;}
156
157 //=======================================================================
158 //function : MaxBoxes
159 //purpose  : 
160 //=======================================================================
161
162 Standard_Integer Select3D_SensitiveEntity::MaxBoxes() const 
163 {return 1;}
164
165 //=======================================================================
166 //function : GetConnected
167 //purpose  : 
168 //=======================================================================
169
170 Handle(Select3D_SensitiveEntity) Select3D_SensitiveEntity::GetConnected(const TopLoc_Location&)  
171 {
172   Handle(Select3D_SensitiveEntity) NiouEnt;
173   return NiouEnt;
174 }