Commit | Line | Data |
---|---|---|
b311480e | 1 | // Created on: 1995-03-13 |
2 | // Created by: Robert COUBLANC | |
3 | // Copyright (c) 1995-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 | // |
973c2be1 | 8 | // This library is free software; you can redistribute it and / or modify it |
9 | // under the terms of the GNU Lesser General Public 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. | |
b311480e | 13 | // |
973c2be1 | 14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. | |
7fd59977 | 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): | |
4269bd1b | 28 | SelectBasics_SensitiveEntity(OwnerId) |
7fd59977 | 29 | {} |
30 | ||
7fd59977 | 31 | //======================================================================= |
32 | //function : Matches | |
33 | //purpose : | |
34 | //======================================================================= | |
35 | ||
35e08fe8 | 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) | |
7fd59977 | 41 | { |
42 | return Standard_False; | |
43 | } | |
44 | ||
45 | //======================================================================= | |
46 | //function : Matches | |
47 | //purpose : | |
48 | //======================================================================= | |
49 | ||
35e08fe8 | 50 | Standard_Boolean Select3D_SensitiveEntity::Matches(const TColgp_Array1OfPnt2d&, |
51 | const Bnd_Box2d&, | |
52 | const Standard_Real) | |
7fd59977 | 53 | { |
54 | return Standard_False; | |
55 | } | |
56 | ||
57 | //======================================================================= | |
58 | //function : Dump | |
59 | //purpose : | |
60 | //======================================================================= | |
61 | ||
35e08fe8 | 62 | void Select3D_SensitiveEntity::Dump(Standard_OStream& S, const Standard_Boolean) const |
7fd59977 | 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 | { | |
ac04d101 SA |
74 | if(!b2d.IsVoid()) |
75 | { | |
7fd59977 | 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 | } | |
7fd59977 | 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); | |
ac04d101 SA |
111 | else |
112 | { | |
7fd59977 | 113 | TopLoc_Location compLoc = aLoc * Location(); |
ac04d101 SA |
114 | SetLocation(compLoc); |
115 | } | |
7fd59977 | 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 | ||
7fd59977 | 149 | //======================================================================= |
150 | //function : MaxBoxes | |
151 | //purpose : | |
152 | //======================================================================= | |
153 | ||
154 | Standard_Integer Select3D_SensitiveEntity::MaxBoxes() const | |
155 | {return 1;} | |
156 | ||
7fd59977 | 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 | } |