mysensitive.Append(aSensitive);
else
mysensitive.Append(aSensitive->GetConnected(Location()));
-
+
}
}
//=======================================================================
//function : SetLocation
-//purpose :
+//purpose :
//=======================================================================
void Select3D_SensitiveWire::SetLocation(const TopLoc_Location& aLoc)
if(HasLocation())
if(aLoc == Location()) return;
-
+
Select3D_SensitiveEntity::SetLocation(aLoc);
for(Standard_Integer i=1;i<=mysensitive.Length();i++){
if(mysensitive(i)->HasLocation()){
}
else
mysensitive(i)->SetLocation(aLoc);
-
+
}
}
//=======================================================================
//function : ResetLocation
-//purpose :
+//purpose :
//=======================================================================
void Select3D_SensitiveWire::ResetLocation()
mysensitive(i)->SetLocation(mysensitive(i)->Location()*Location().Inverted());
else
mysensitive(i)->ResetLocation();
-
+
}
Select3D_SensitiveEntity::ResetLocation();
}
// Purpose :
//=====================================================
void Select3D_SensitiveWire
-::Project(const Select3D_Projector& aProj)
+::Project(const Handle(Select3D_Projector)& aProj)
{
- for ( Standard_Integer i=1; i<=mysensitive.Length(); i++)
+ for ( Standard_Integer i=1; i<=mysensitive.Length(); i++)
mysensitive(i)->Project(aProj);
Select3D_SensitiveEntity::Project(aProj);
}
Standard_Integer i;
for (i=1; i<=mysensitive.Length(); i++)
mysensitive.Value(i)->Areas(BidL);
-
+
for(SelectBasics_ListIteratorOfListOfBox2d it(BidL);it.More();it.Next())
BB.Add(it.Value());
-
+
theareas.Append(BB);
-
+
}
//=====================================================
}
}
}
-// Select3D_SensitiveEntity::Matches(X,Y,aTol,DMin);
-
- return IsTouched;
+ if ( ! IsTouched )
+ return Standard_False;
+
+ // compute and validate the depth (::Depth()) along the eyeline
+ return Select3D_SensitiveEntity::Matches(X,Y,aTol,DMin);
}
//=====================================================
{
Standard_Integer i;
for (i=1; i<=mysensitive.Length(); i++) {
- if (!(mysensitive.Value(i)->Matches(XMin,YMin,XMax,YMax,aTol)))
+ if (!(mysensitive.Value(i)->Matches(XMin,YMin,XMax,YMax,aTol)))
return Standard_False;
}
return Standard_True;
//=======================================================================
//function : Matches
-//purpose :
+//purpose :
//=======================================================================
Standard_Boolean Select3D_SensitiveWire::
Matches (const TColgp_Array1OfPnt2d& aPoly,
const Bnd_Box2d& aBox,
const Standard_Real aTol)
-{
+{
Standard_Integer i;
for (i=1; i<=mysensitive.Length(); i++) {
- if (!(mysensitive.Value(i)->Matches(aPoly, aBox, aTol)))
+ if (!(mysensitive.Value(i)->Matches(aPoly, aBox, aTol)))
return Standard_False;
}
return Standard_True;
//=======================================================================
//function : GetConnected
-//purpose :
+//purpose :
//=======================================================================
-Handle(Select3D_SensitiveEntity) Select3D_SensitiveWire::GetConnected(const TopLoc_Location& aLoc)
+Handle(Select3D_SensitiveEntity) Select3D_SensitiveWire::GetConnected(const TopLoc_Location& aLoc)
{
Handle(Select3D_SensitiveWire) SWIR = new Select3D_SensitiveWire(myOwnerId);
for(Standard_Integer i=1;i<=mysensitive.Length();i++)
SWIR->Add(mysensitive(i));
-
+
if(HasLocation())
SWIR->SetLocation(Location()*aLoc);
else
//=======================================================================
//function : Dump
-//purpose :
+//purpose :
//=======================================================================
void Select3D_SensitiveWire::Dump(Standard_OStream& S,const Standard_Boolean FullDump) const
//=======================================================================
//function : ComputeDepth
-//purpose :
+//purpose :
//=======================================================================
-Standard_Real Select3D_SensitiveWire::ComputeDepth(const gp_Lin& EyeLine) const
+Standard_Real Select3D_SensitiveWire::ComputeDepth(const gp_Lin& EyeLine) const
{
-
+
if(myDetectedIndex==-1)
// should be never called...
return Precision::Infinite();
return mysensitive(myDetectedIndex)->ComputeDepth(EyeLine);
-
+
}
//=======================================================================
//function : SetLastPrj
-//purpose :
+//purpose :
//=======================================================================
-void Select3D_SensitiveWire::SetLastPrj(const Select3D_Projector& Prj)
+void Select3D_SensitiveWire::SetLastPrj(const Handle(Select3D_Projector)& Prj)
{
Select3D_SensitiveEntity::SetLastPrj(Prj);
for(Standard_Integer i=1;i<=mysensitive.Length();i++)
//=======================================================================
//function : GetEdges
-//purpose : returns the sensitive edges stored in this wire
+//purpose : returns the sensitive edges stored in this wire
//=======================================================================
void Select3D_SensitiveWire::GetEdges( Select3D_SensitiveEntitySequence& theEdges )
{
//=============================================================================
// Function : GetLastDetected
-// Purpose :
+// Purpose :
//=============================================================================
Handle(Select3D_SensitiveEntity) Select3D_SensitiveWire::GetLastDetected() const
{