mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-06 18:26:22 +03:00
0030081: Visualization - selection does not work when two clipping planes cut object from opposite sides
Fixed combining independent clipping planes into single range within SelectMgr_RectangularFrustum::computeClippingRange().
This commit is contained in:
parent
65bb82f241
commit
e2a47b0cd2
@ -710,11 +710,11 @@ void SelectMgr_RectangularFrustum::computeClippingRange (const Graphic3d_Sequenc
|
|||||||
{
|
{
|
||||||
if (aDotProduct < 0.0)
|
if (aDotProduct < 0.0)
|
||||||
{
|
{
|
||||||
theRange.ChangeMain().Add (Bnd_Range (aDistToPln, RealLast()));
|
theRange.ChangeUnclipRange().TrimTo (aDistToPln);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
theRange.ChangeMain().Add (Bnd_Range (RealFirst(), aDistToPln));
|
theRange.ChangeUnclipRange().TrimFrom (aDistToPln);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -733,7 +733,7 @@ void SelectMgr_RectangularFrustum::computeClippingRange (const Graphic3d_Sequenc
|
|||||||
if (!aSubRange.IsVoid()
|
if (!aSubRange.IsVoid()
|
||||||
&& aClipPlane->IsChain())
|
&& aClipPlane->IsChain())
|
||||||
{
|
{
|
||||||
theRange.AddSubRange (aSubRange);
|
theRange.AddClipSubRange (aSubRange);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,9 +35,13 @@ public:
|
|||||||
//! e.g. TRUE means depth is clipped.
|
//! e.g. TRUE means depth is clipped.
|
||||||
Standard_Boolean IsClipped (const Standard_Real theDepth) const
|
Standard_Boolean IsClipped (const Standard_Real theDepth) const
|
||||||
{
|
{
|
||||||
for (size_t aRangeIter = 0; aRangeIter < myRanges.size(); ++aRangeIter)
|
if (myUnclipRange.IsOut (theDepth))
|
||||||
{
|
{
|
||||||
if (!myRanges[aRangeIter].IsOut (theDepth))
|
return Standard_True;
|
||||||
|
}
|
||||||
|
for (size_t aRangeIter = 0; aRangeIter < myClipRanges.size(); ++aRangeIter)
|
||||||
|
{
|
||||||
|
if (!myClipRanges[aRangeIter].IsOut (theDepth))
|
||||||
{
|
{
|
||||||
return Standard_True;
|
return Standard_True;
|
||||||
}
|
}
|
||||||
@ -48,19 +52,20 @@ public:
|
|||||||
//! Clears clipping range.
|
//! Clears clipping range.
|
||||||
void SetVoid()
|
void SetVoid()
|
||||||
{
|
{
|
||||||
myRanges.resize (1);
|
myClipRanges.resize (0);
|
||||||
myRanges[0].SetVoid();
|
myUnclipRange = Bnd_Range (RealFirst(), RealLast());
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns the main range.
|
//! Returns the main unclipped range; [-inf, inf] by default.
|
||||||
Bnd_Range& ChangeMain() { return myRanges[0]; }
|
Bnd_Range& ChangeUnclipRange() { return myUnclipRange; }
|
||||||
|
|
||||||
//! Adds a sub-range.
|
//! Adds a clipping sub-range (for clipping chains).
|
||||||
void AddSubRange (const Bnd_Range& theRange) { myRanges.push_back (theRange); }
|
void AddClipSubRange (const Bnd_Range& theRange) { myClipRanges.push_back (theRange); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
std::vector<Bnd_Range> myRanges;
|
std::vector<Bnd_Range> myClipRanges;
|
||||||
|
Bnd_Range myUnclipRange;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user