MeshVS_SensitivePolyhedron( const Handle( SelectBasics_EntityOwner )& Owner,
const TColgp_Array1OfPnt& Nodes,
const Handle( MeshVS_HArray1OfSequenceOfInteger )& Topo )
-: Select3D_SensitiveEntity( Owner ),
+: Select3D_SensitiveEntity( Owner ),
myTopo( Topo )
{
Standard_Integer low = Nodes.Lower(), up = Nodes.Upper(), i;
//================================================================
void MeshVS_SensitivePolyhedron::Project( const Handle(Select3D_Projector)& aProjector )
{
- Select3D_SensitiveEntity::Project( aProjector );
-
if( myNodes.IsNull() || myNodes2d.IsNull() )
return;
// Function : Matches
// Purpose :
//================================================================
-Standard_Boolean MeshVS_SensitivePolyhedron::Matches( const Standard_Real X,
- const Standard_Real Y,
- const Standard_Real aTol,
- Standard_Real& DMin )
+Standard_Boolean MeshVS_SensitivePolyhedron::Matches( const SelectBasics_PickArgs& thePickArgs,
+ Standard_Real& /*theMatchDMin*/,
+ Standard_Real& theMatchDepth )
{
if( myNodes2d.IsNull() || myTopo.IsNull() )
return Standard_False;
R2 = myTopo->Upper(),
low = myNodes2d->Lower();
- Standard_Real rTol = aTol*SensitivityFactor();
+ Standard_Real rTol = thePickArgs.Tolerance() * SensitivityFactor();
Standard_Boolean inside = Standard_False;
y2 = myNodes2d->Value( low+next ).Y();
if( Abs( x2-x1 )<Precision::Confusion() )
- {
+ {
//vertical edge!!!
sort( y1, y2 );
- if( Y>=y1-rTol && Y<=y2+rTol && x1>X-rTol )
+ if ( thePickArgs.Y() >= y1 - rTol && thePickArgs.Y() <= y2 + rTol && x1 > thePickArgs.X() - rTol )
intersect++;
}
else
- {
+ {
//inclined edge!!!
k = ( y2-y1 ) / ( x2-x1 );
if( Abs( k )>Precision::Confusion() )
{
- xp = ( Y-b ) / k; // absciss of point of intersection
+ xp = ( thePickArgs.Y() - b ) / k; // absciss of point of intersection
sort( x1, x2 );
- if( xp>=x1 && xp<=x2 && xp>X-rTol )
+ if( xp >= x1 && xp <= x2 && xp > thePickArgs.X() - rTol )
intersect++;
}
}
if( inside )
{
- return Select3D_SensitiveEntity::Matches( X, Y, aTol, DMin );
+ theMatchDepth = ComputeDepth (thePickArgs.PickLine());
+
+ return !thePickArgs.IsClipped(theMatchDepth);
}
+
return Standard_False;
}
{
Standard_Real val( Precision::Infinite() );
for( Standard_Integer i=1, n=NodesIndices.Length(); i<=n; i++ )
- val = Min( val, ElCLib::Parameter(
+ val = Min( val, ElCLib::Parameter(
EyeLine, myNodes->Value( myNodes->Lower()+NodesIndices.Value( i ) ) ) );
return val;
// Function : Areas
// Purpose :
//================================================================
-void MeshVS_SensitivePolyhedron::Areas( SelectBasics_ListOfBox2d& aResult )
+void MeshVS_SensitivePolyhedron::Areas( SelectBasics_ListOfBox2d& aResult )
{
Bnd_Box2d aBox;
GetBox2d( aBox );