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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #include <Select3D_SensitiveEntity.ixx>
18 #include <Precision.hxx>
19 #include <SelectBasics_EntityOwner.hxx>
20 #include <Select3D_Macro.hxx>
22 //=======================================================================
23 //function : Select3D_SensitiveEntity
25 //=======================================================================
27 Select3D_SensitiveEntity::Select3D_SensitiveEntity(const Handle(SelectBasics_EntityOwner)& OwnerId):
28 SelectBasics_SensitiveEntity(OwnerId)
31 //=======================================================================
34 //=======================================================================
36 Standard_Boolean Select3D_SensitiveEntity::Matches(const Standard_Real,
42 return Standard_False;
45 //=======================================================================
48 //=======================================================================
50 Standard_Boolean Select3D_SensitiveEntity::Matches(const TColgp_Array1OfPnt2d&,
54 return Standard_False;
57 //=======================================================================
60 //=======================================================================
62 void Select3D_SensitiveEntity::Dump(Standard_OStream& S, const Standard_Boolean) const
64 S<<"\tSensitive Entity 3D"<<endl;
67 //=======================================================================
70 //=======================================================================
72 void Select3D_SensitiveEntity::DumpBox(Standard_OStream& S,const Bnd_Box2d& b2d)
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;
83 //=======================================================================
84 //function : ResetLocation
86 //=======================================================================
88 void Select3D_SensitiveEntity::ResetLocation()
92 //=======================================================================
93 //function : SetLocation
95 //=======================================================================
97 void Select3D_SensitiveEntity::SetLocation(const TopLoc_Location&)
101 //=======================================================================
102 //function : UpdateLocation
104 //=======================================================================
106 void Select3D_SensitiveEntity::UpdateLocation(const TopLoc_Location& aLoc)
108 if(aLoc.IsIdentity() || aLoc == Location()) return;
113 TopLoc_Location compLoc = aLoc * Location();
114 SetLocation(compLoc);
118 //=======================================================================
119 //function : Location
121 //=======================================================================
123 const TopLoc_Location& Select3D_SensitiveEntity::Location() const
125 static TopLoc_Location anIdentity;
126 Handle(SelectBasics_EntityOwner) anOwner = OwnerId();
127 return anOwner.IsNull() ? anIdentity : anOwner->Location();
130 //=======================================================================
131 //function : HasLocation
133 //=======================================================================
135 Standard_Boolean Select3D_SensitiveEntity::HasLocation() const
137 Handle(SelectBasics_EntityOwner) anOwner = OwnerId();
138 return (!anOwner.IsNull() && anOwner->HasLocation());
141 //=======================================================================
144 //=======================================================================
146 Standard_Boolean Select3D_SensitiveEntity::Is3D() const
147 {return Standard_True;}
149 //=======================================================================
150 //function : MaxBoxes
152 //=======================================================================
154 Standard_Integer Select3D_SensitiveEntity::MaxBoxes() const
157 //=======================================================================
158 //function : GetConnected
160 //=======================================================================
162 Handle(Select3D_SensitiveEntity) Select3D_SensitiveEntity::GetConnected(const TopLoc_Location&)
164 Handle(Select3D_SensitiveEntity) NiouEnt;