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
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.
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.
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.
25 #include <Select3D_SensitiveEntity.ixx>
26 #include <Precision.hxx>
27 #include <SelectBasics_EntityOwner.hxx>
28 #include <Select3D_Macro.hxx>
30 //=======================================================================
31 //function : Select3D_SensitiveEntity
33 //=======================================================================
35 Select3D_SensitiveEntity::Select3D_SensitiveEntity(const Handle(SelectBasics_EntityOwner)& OwnerId):
36 SelectBasics_SensitiveEntity(OwnerId)
39 //=======================================================================
42 //=======================================================================
44 Standard_Boolean Select3D_SensitiveEntity::Matches(const Standard_Real,
50 return Standard_False;
53 //=======================================================================
56 //=======================================================================
58 Standard_Boolean Select3D_SensitiveEntity::Matches(const TColgp_Array1OfPnt2d&,
62 return Standard_False;
65 //=======================================================================
68 //=======================================================================
70 void Select3D_SensitiveEntity::Dump(Standard_OStream& S, const Standard_Boolean) const
72 S<<"\tSensitive Entity 3D"<<endl;
75 //=======================================================================
78 //=======================================================================
80 void Select3D_SensitiveEntity::DumpBox(Standard_OStream& S,const Bnd_Box2d& b2d)
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;
91 //=======================================================================
92 //function : ResetLocation
94 //=======================================================================
96 void Select3D_SensitiveEntity::ResetLocation()
100 //=======================================================================
101 //function : SetLocation
103 //=======================================================================
105 void Select3D_SensitiveEntity::SetLocation(const TopLoc_Location&)
109 //=======================================================================
110 //function : UpdateLocation
112 //=======================================================================
114 void Select3D_SensitiveEntity::UpdateLocation(const TopLoc_Location& aLoc)
116 if(aLoc.IsIdentity() || aLoc == Location()) return;
121 TopLoc_Location compLoc = aLoc * Location();
122 SetLocation(compLoc);
126 //=======================================================================
127 //function : Location
129 //=======================================================================
131 const TopLoc_Location& Select3D_SensitiveEntity::Location() const
133 static TopLoc_Location anIdentity;
134 Handle(SelectBasics_EntityOwner) anOwner = OwnerId();
135 return anOwner.IsNull() ? anIdentity : anOwner->Location();
138 //=======================================================================
139 //function : HasLocation
141 //=======================================================================
143 Standard_Boolean Select3D_SensitiveEntity::HasLocation() const
145 Handle(SelectBasics_EntityOwner) anOwner = OwnerId();
146 return (!anOwner.IsNull() && anOwner->HasLocation());
149 //=======================================================================
152 //=======================================================================
154 Standard_Boolean Select3D_SensitiveEntity::Is3D() const
155 {return Standard_True;}
157 //=======================================================================
158 //function : MaxBoxes
160 //=======================================================================
162 Standard_Integer Select3D_SensitiveEntity::MaxBoxes() const
165 //=======================================================================
166 //function : GetConnected
168 //=======================================================================
170 Handle(Select3D_SensitiveEntity) Select3D_SensitiveEntity::GetConnected(const TopLoc_Location&)
172 Handle(Select3D_SensitiveEntity) NiouEnt;