}
Graphic3d_ClipState aState = aPlane->ProbeBox (aBBox);
- if (aState == Graphic3d_ClipState_Out)
- {
- return;
- }
- if (aState == Graphic3d_ClipState_On && !mySelectingVolumeMgr.IsOverlapAllowed()) // partially clipped
+ if (aState == Graphic3d_ClipState_Out) // do not process only whole trees, next check on the tree node
{
return;
}
+ //if (aState == Graphic3d_ClipState_On && !mySelectingVolumeMgr.IsOverlapAllowed()) // partially clipped
+ //{
+ // return;
+ //}
}
}
}
else
{
- Standard_Integer aStartIdx = aSensitivesTree->BegPrimitive (aNode);
- Standard_Integer anEndIdx = aSensitivesTree->EndPrimitive (aNode);
- for (Standard_Integer anIdx = aStartIdx; anIdx <= anEndIdx; ++anIdx)
+ bool aClipped = false;
+ if (!theMgr.ViewClipping().IsNull() &&
+ theMgr.GetActiveSelectionType() == SelectBasics_SelectingVolumeManager::Box)
+ //&& theMgr.GetActiveSelectionType() != SelectBasics_SelectingVolumeManager::Polyline))
{
- const Handle(SelectMgr_SensitiveEntity)& aSensitive = anEntitySet->GetSensitiveById (anIdx);
- if (aSensitive->IsActiveForSelection())
+ Graphic3d_BndBox3d aBBox (aSensitivesTree->MinPoint (aNode), aSensitivesTree->MaxPoint (aNode));
+ // If box selection is active, and the whole sensitive tree is out of the clip planes
+ // selection is empty for this object
+ const Handle(Graphic3d_SequenceOfHClipPlane)& aViewPlanes = theMgr.ViewClipping();
+
+ for (Graphic3d_SequenceOfHClipPlane::Iterator aPlaneIt (*aViewPlanes); aPlaneIt.More(); aPlaneIt.Next())
{
const Handle(SelectBasics_SensitiveEntity)& anEnt = aSensitive->BaseSensitive();
SelectMgr_SelectingVolumeManager aTmpMgr = aMgr;
computeFrustum (anEnt, theMgr, aInversedTrsf, aScaledTrnsfFrustums, aTmpMgr);
checkOverlap (anEnt, aInversedTrsf, aTmpMgr);
+ const Handle(Graphic3d_ClipPlane)& aPlane = aPlaneIt.Value();
+ if (!aPlane->IsOn())
+ {
+ continue;
+ }
+ Graphic3d_ClipState aState = aPlane->ProbeBox (aBBox);
+ if (aState == Graphic3d_ClipState_Out)
+ {
+ aClipped = true;
+ break;
+ }
+ if (aState == Graphic3d_ClipState_On && !mySelectingVolumeMgr.IsOverlapAllowed()) // partially clipped
+ {
+ aClipped = true;
+ break;
+ }
+ }
+ }
+ if (!aClipped)
+ {
+ Standard_Integer aStartIdx = aSensitivesTree->BegPrimitive (aNode);
+ Standard_Integer anEndIdx = aSensitivesTree->EndPrimitive (aNode);
+ for (Standard_Integer anIdx = aStartIdx; anIdx <= anEndIdx; ++anIdx)
+ {
+ const Handle(SelectMgr_SensitiveEntity)& aSensitive = anEntitySet->GetSensitiveById (anIdx);
+ if (aSensitive->IsActiveForSelection())
+ {
+ const Handle(SelectBasics_SensitiveEntity)& anEnt = aSensitive->BaseSensitive();
+ SelectMgr_SelectingVolumeManager aTmpMgr = aMgr;
+ computeFrustum (anEnt, theMgr, aInversedTrsf, aScaledTrnsfFrustums, aTmpMgr);
+ checkOverlap (anEnt, aInversedTrsf, aTmpMgr);
+ }
}
}
if (aHead < 0)