// purpose :
//=======================================================================
void SelectMgr_SelectingVolumeManager::SetViewClipping (const Handle(Graphic3d_SequenceOfHClipPlane)& theViewPlanes,
- const Handle(Graphic3d_SequenceOfHClipPlane)& theObjPlanes)
+ const Handle(Graphic3d_SequenceOfHClipPlane)& theObjPlanes,
+ const SelectMgr_SelectingVolumeManager* theWorldSelMgr)
{
myViewClipPlanes = theViewPlanes;
myObjectClipPlanes = theObjPlanes;
if (myActiveSelectionType != Point)
return;
- const SelectMgr_RectangularFrustum* aFrustum = reinterpret_cast<const SelectMgr_RectangularFrustum*>(mySelectingVolumes[Frustum].get());
+ const SelectMgr_SelectingVolumeManager* aWorldSelMgr = theWorldSelMgr != NULL ? theWorldSelMgr : this;
+ const SelectMgr_RectangularFrustum* aFrustum = reinterpret_cast<const SelectMgr_RectangularFrustum*>(aWorldSelMgr->mySelectingVolumes[Frustum].get());
myViewClipRange.SetVoid();
if (!theViewPlanes.IsNull()
&& !theViewPlanes->IsEmpty())
//! Valid for point selection only!
//! Computes depth range for clipping planes.
- //! @param theViewPlanes global view planes
- //! @param theObjPlanes object planes
+ //! @param theViewPlanes [in] global view planes
+ //! @param theObjPlanes [in] object planes
+ //! @param theWorldSelMgr [in] selection volume in world space for computing clipping plane ranges
Standard_EXPORT void SetViewClipping (const Handle(Graphic3d_SequenceOfHClipPlane)& theViewPlanes,
- const Handle(Graphic3d_SequenceOfHClipPlane)& theObjPlanes);
+ const Handle(Graphic3d_SequenceOfHClipPlane)& theObjPlanes,
+ const SelectMgr_SelectingVolumeManager* theWorldSelMgr);
//! Copy clipping planes from another volume manager.
Standard_EXPORT void SetViewClipping (const SelectMgr_SelectingVolumeManager& theOther);
if (!theObject->ClipPlanes().IsNull()
&& theObject->ClipPlanes()->ToOverrideGlobal())
{
- aMgr.SetViewClipping (Handle(Graphic3d_SequenceOfHClipPlane)(), theObject->ClipPlanes());
+ aMgr.SetViewClipping (Handle(Graphic3d_SequenceOfHClipPlane)(), theObject->ClipPlanes(), &theMgr);
}
else if (!theObject->TransformPersistence().IsNull())
{
}
}
- aMgr.SetViewClipping (Handle(Graphic3d_SequenceOfHClipPlane)(), theObject->ClipPlanes());
+ aMgr.SetViewClipping (Handle(Graphic3d_SequenceOfHClipPlane)(), theObject->ClipPlanes(), &theMgr);
}
else if (!theObject->ClipPlanes().IsNull()
&& !theObject->ClipPlanes()->IsEmpty())
{
- aMgr.SetViewClipping (theMgr.ViewClipping(), theObject->ClipPlanes());
+ aMgr.SetViewClipping (theMgr.ViewClipping(), theObject->ClipPlanes(), &theMgr);
}
if (!theMgr.ViewClipping().IsNull() &&
gp_Pnt2d aMousePos (static_cast<Standard_Real> (theXPix),
static_cast<Standard_Real> (theYPix));
mySelectingVolumeMgr.BuildSelectingVolume (aMousePos);
- mySelectingVolumeMgr.SetViewClipping (theView->ClipPlanes(), Handle(Graphic3d_SequenceOfHClipPlane)());
+ mySelectingVolumeMgr.SetViewClipping (theView->ClipPlanes(), Handle(Graphic3d_SequenceOfHClipPlane)(), NULL);
TraverseSensitives();
}
mySelectingVolumeMgr.BuildSelectingVolume (aMinMousePos,
aMaxMousePos);
- mySelectingVolumeMgr.SetViewClipping (theView->ClipPlanes(), Handle(Graphic3d_SequenceOfHClipPlane)());
+ mySelectingVolumeMgr.SetViewClipping (theView->ClipPlanes(), Handle(Graphic3d_SequenceOfHClipPlane)(), NULL);
TraverseSensitives();
}
mySelectingVolumeMgr.SetWindowSize (aWidth, aHeight);
mySelectingVolumeMgr.BuildSelectingVolume (thePolyline);
- mySelectingVolumeMgr.SetViewClipping (theView->ClipPlanes(), Handle(Graphic3d_SequenceOfHClipPlane)());
+ mySelectingVolumeMgr.SetViewClipping (theView->ClipPlanes(), Handle(Graphic3d_SequenceOfHClipPlane)(), NULL);
TraverseSensitives();
}
--- /dev/null
+puts "============"
+puts "0031650: Visualization - invalid picking of object with local transformation and per-object clipping plane"
+puts "============"
+puts ""
+
+pload XDE MODELING VISUALIZATION
+vclear
+vinit View1
+vaxo
+box b -28 -11 -35 20 20 42
+vdisplay -dispMode 1 -highMode 1 b
+vsetlocation b 0 0 20
+vfit
+catch {vclipplane -delete p}
+
+# global clipping
+vclipplane p -equation 0 0 -1 -10 -set
+vmoveto 205 205
+if { [vreadpixel 205 320 -name -rgb] != "DARKGOLDENROD" } { puts "Error" }
+
+# local clipping
+vclipplane p -equation 0 0 -1 -10 -set b
+vmoveto 205 205
+if { [vreadpixel 205 320 -name -rgb] != "DARKGOLDENROD" } { puts "Error" }
+
+vdump ${imagedir}/${casename}.png