0024624: Lost word in license statement in source files
[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-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 #include <Select3D_SensitiveEntity.ixx>
18 #include <Precision.hxx>
19 #include <SelectBasics_EntityOwner.hxx>
20 #include <Select3D_Macro.hxx>
21
22 //=======================================================================
23 //function : Select3D_SensitiveEntity
24 //purpose  : 
25 //=======================================================================
26
27 Select3D_SensitiveEntity::Select3D_SensitiveEntity(const Handle(SelectBasics_EntityOwner)& OwnerId):
28 SelectBasics_SensitiveEntity(OwnerId)
29 {}
30
31 //=======================================================================
32 //function : Matches
33 //purpose  : 
34 //=======================================================================
35
36 Standard_Boolean Select3D_SensitiveEntity::Matches(const Standard_Real,
37                                                    const Standard_Real,
38                                                    const Standard_Real,
39                                                    const Standard_Real,
40                                                    const Standard_Real)
41 {
42   return Standard_False;
43 }
44
45 //=======================================================================
46 //function : Matches
47 //purpose  : 
48 //=======================================================================
49
50 Standard_Boolean Select3D_SensitiveEntity::Matches(const TColgp_Array1OfPnt2d&,
51                                                    const Bnd_Box2d&,
52                                                    const Standard_Real)
53 {
54   return Standard_False;
55 }
56
57 //=======================================================================
58 //function : Dump
59 //purpose  : 
60 //=======================================================================
61
62 void Select3D_SensitiveEntity::Dump(Standard_OStream& S, const Standard_Boolean) const
63 {
64   S<<"\tSensitive Entity 3D"<<endl;
65 }
66
67 //=======================================================================
68 //function : DumpBox
69 //purpose  : 
70 //=======================================================================
71
72 void Select3D_SensitiveEntity::DumpBox(Standard_OStream& S,const Bnd_Box2d& b2d) 
73 {
74   if(!b2d.IsVoid())
75   {
76     Standard_Real xmin,ymin,xmax,ymax;
77     b2d.Get(xmin,ymin,xmax,ymax);
78     S<<"\t\t\tBox2d: PMIN ["<<xmin<<" , "<<ymin<<"]"<<endl;
79     S<<"\t\t\t       PMAX ["<<xmax<<" , "<<ymax<<"]"<<endl;
80   }
81 }
82
83 //=======================================================================
84 //function : ResetLocation
85 //purpose  : 
86 //=======================================================================
87
88 void Select3D_SensitiveEntity::ResetLocation()
89 {
90 }
91
92 //=======================================================================
93 //function : SetLocation
94 //purpose  : 
95 //=======================================================================
96
97 void Select3D_SensitiveEntity::SetLocation(const TopLoc_Location&)
98 {
99 }
100
101 //=======================================================================
102 //function : UpdateLocation
103 //purpose  : 
104 //=======================================================================
105
106 void Select3D_SensitiveEntity::UpdateLocation(const TopLoc_Location& aLoc)
107 {
108   if(aLoc.IsIdentity() || aLoc == Location()) return;
109   if(!HasLocation())
110     SetLocation(aLoc);
111   else 
112   {
113     TopLoc_Location compLoc = aLoc * Location();
114     SetLocation(compLoc);
115   }
116 }
117
118 //=======================================================================
119 //function : Location
120 //purpose  : 
121 //=======================================================================
122
123 const TopLoc_Location& Select3D_SensitiveEntity::Location() const 
124 {
125   static TopLoc_Location anIdentity;    
126   Handle(SelectBasics_EntityOwner) anOwner = OwnerId();
127   return anOwner.IsNull() ? anIdentity : anOwner->Location();
128 }
129
130 //=======================================================================
131 //function : HasLocation
132 //purpose  : 
133 //=======================================================================
134
135 Standard_Boolean Select3D_SensitiveEntity::HasLocation() const
136
137   Handle(SelectBasics_EntityOwner) anOwner = OwnerId();
138   return (!anOwner.IsNull() && anOwner->HasLocation());
139 }
140
141 //=======================================================================
142 //function : Is3D
143 //purpose  : 
144 //=======================================================================
145
146 Standard_Boolean Select3D_SensitiveEntity::Is3D() const
147 {return Standard_True;}
148
149 //=======================================================================
150 //function : MaxBoxes
151 //purpose  : 
152 //=======================================================================
153
154 Standard_Integer Select3D_SensitiveEntity::MaxBoxes() const 
155 {return 1;}
156
157 //=======================================================================
158 //function : GetConnected
159 //purpose  : 
160 //=======================================================================
161
162 Handle(Select3D_SensitiveEntity) Select3D_SensitiveEntity::GetConnected(const TopLoc_Location&)  
163 {
164   Handle(Select3D_SensitiveEntity) NiouEnt;
165   return NiouEnt;
166 }