mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-08 18:40:55 +03:00
0032978: Visualization - AIS_ViewController::PickPoint() includes objects invisible in current View
SelectMgr_ViewerSelector::TraverseSensitives() now takes into account object's view affinity. AIS_InteractiveContext::moveTo() - dropped code SelectMgr_AndOrFilter::SetDisabledObjects() as filtering is now done by selector itself. ViewAffinity property has been moved to PrsMgr_PresentableObject for simplicity. Removed redundant map Graphic3d_CView::HiddenObjects().
This commit is contained in:
parent
84d39c06fa
commit
86d6c284c2
src
AIS
Graphic3d
IVtkOCC
PrsMgr
SelectMgr
tests/v3d/bugs
@ -362,7 +362,7 @@ void AIS_InteractiveContext::ObjectsForView (AIS_ListOfInteractive& theListOfIO
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle(Graphic3d_ViewAffinity) anAffinity = myMainVwr->StructureManager()->ObjectAffinity (anObjIter.Key());
|
Handle(Graphic3d_ViewAffinity) anAffinity = anObjIter.Key()->ViewAffinity();
|
||||||
const Standard_Boolean isVisible = anAffinity->IsVisible (aViewId);
|
const Standard_Boolean isVisible = anAffinity->IsVisible (aViewId);
|
||||||
if (isVisible == theIsVisibleInView)
|
if (isVisible == theIsVisibleInView)
|
||||||
{
|
{
|
||||||
@ -402,17 +402,9 @@ void AIS_InteractiveContext::SetViewAffinity (const Handle(AIS_InteractiveObject
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle(Graphic3d_ViewAffinity) anAffinity = myMainVwr->StructureManager()->ObjectAffinity (theIObj);
|
Handle(Graphic3d_ViewAffinity) anAffinity = theIObj->ViewAffinity();
|
||||||
Handle(Graphic3d_CView) aViewImpl = theView->View();
|
Handle(Graphic3d_CView) aViewImpl = theView->View();
|
||||||
anAffinity->SetVisible (aViewImpl->Identification(), theIsVisible == Standard_True);
|
anAffinity->SetVisible (aViewImpl->Identification(), theIsVisible == Standard_True);
|
||||||
if (theIsVisible)
|
|
||||||
{
|
|
||||||
theView->View()->ChangeHiddenObjects()->Remove (theIObj.get());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
theView->View()->ChangeHiddenObjects()->Add (theIObj.get());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -445,7 +437,8 @@ void AIS_InteractiveContext::Display (const Handle(AIS_InteractiveObject)& theIO
|
|||||||
if (!myObjects.IsBound (theIObj))
|
if (!myObjects.IsBound (theIObj))
|
||||||
{
|
{
|
||||||
setObjectStatus (theIObj, PrsMgr_DisplayStatus_Displayed, theDispMode, theSelectionMode);
|
setObjectStatus (theIObj, PrsMgr_DisplayStatus_Displayed, theDispMode, theSelectionMode);
|
||||||
myMainVwr->StructureManager()->RegisterObject (theIObj);
|
theIObj->ViewAffinity()->SetVisible (true); // reset view affinity mask
|
||||||
|
myMainVwr->StructureManager()->RegisterObject (theIObj, theIObj->ViewAffinity());
|
||||||
myMainPM->Display(theIObj, theDispMode);
|
myMainPM->Display(theIObj, theDispMode);
|
||||||
if (theSelectionMode != -1)
|
if (theSelectionMode != -1)
|
||||||
{
|
{
|
||||||
@ -521,7 +514,8 @@ void AIS_InteractiveContext::Load (const Handle(AIS_InteractiveObject)& theIObj,
|
|||||||
Standard_Integer aDispMode, aHiMod, aSelModeDef;
|
Standard_Integer aDispMode, aHiMod, aSelModeDef;
|
||||||
GetDefModes (theIObj, aDispMode, aHiMod, aSelModeDef);
|
GetDefModes (theIObj, aDispMode, aHiMod, aSelModeDef);
|
||||||
setObjectStatus (theIObj, PrsMgr_DisplayStatus_Erased, aDispMode, theSelMode != -1 ? theSelMode : aSelModeDef);
|
setObjectStatus (theIObj, PrsMgr_DisplayStatus_Erased, aDispMode, theSelMode != -1 ? theSelMode : aSelModeDef);
|
||||||
myMainVwr->StructureManager()->RegisterObject (theIObj);
|
theIObj->ViewAffinity()->SetVisible (true); // reset view affinity mask
|
||||||
|
myMainVwr->StructureManager()->RegisterObject (theIObj, theIObj->ViewAffinity());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Register theIObj in the selection manager to prepare further activation of selection
|
// Register theIObj in the selection manager to prepare further activation of selection
|
||||||
@ -1900,13 +1894,9 @@ void AIS_InteractiveContext::ClearGlobal (const Handle(AIS_InteractiveObject)& t
|
|||||||
mgrSelector->Remove (anObj);
|
mgrSelector->Remove (anObj);
|
||||||
|
|
||||||
setObjectStatus (theIObj, PrsMgr_DisplayStatus_None, -1, -1);
|
setObjectStatus (theIObj, PrsMgr_DisplayStatus_None, -1, -1);
|
||||||
|
theIObj->ViewAffinity()->SetVisible (true); // reset view affinity mask
|
||||||
myMainVwr->StructureManager()->UnregisterObject (theIObj);
|
myMainVwr->StructureManager()->UnregisterObject (theIObj);
|
||||||
|
|
||||||
for (V3d_ListOfViewIterator aDefViewIter (myMainVwr->DefinedViewIterator()); aDefViewIter.More(); aDefViewIter.Next())
|
|
||||||
{
|
|
||||||
aDefViewIter.Value()->View()->ChangeHiddenObjects()->Remove (theIObj.get());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!myLastPicked.IsNull())
|
if (!myLastPicked.IsNull())
|
||||||
{
|
{
|
||||||
if (myLastPicked->IsSameSelectable (theIObj))
|
if (myLastPicked->IsSameSelectable (theIObj))
|
||||||
@ -2228,7 +2218,7 @@ Bnd_Box AIS_InteractiveContext::BoundingBoxOfSelection (const Handle(V3d_View)&
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle(Graphic3d_ViewAffinity) anAffinity = myMainVwr->StructureManager()->ObjectAffinity (anObj);
|
Handle(Graphic3d_ViewAffinity) anAffinity = anObj->ViewAffinity();
|
||||||
const Standard_Boolean isVisible = aViewId == -1 || anAffinity->IsVisible (aViewId);
|
const Standard_Boolean isVisible = aViewId == -1 || anAffinity->IsVisible (aViewId);
|
||||||
if (!isVisible)
|
if (!isVisible)
|
||||||
{
|
{
|
||||||
@ -2682,12 +2672,10 @@ AIS_StatusOfDetection AIS_InteractiveContext::moveTo (const Handle(V3d_View)& th
|
|||||||
myDetectedSeq.Clear();
|
myDetectedSeq.Clear();
|
||||||
myLastActiveView = theView.get();
|
myLastActiveView = theView.get();
|
||||||
|
|
||||||
// preliminaires
|
// preliminaries
|
||||||
AIS_StatusOfDetection aStatus = AIS_SOD_Nothing;
|
AIS_StatusOfDetection aStatus = AIS_SOD_Nothing;
|
||||||
Standard_Boolean toUpdateViewer = Standard_False;
|
Standard_Boolean toUpdateViewer = Standard_False;
|
||||||
|
|
||||||
myFilters->SetDisabledObjects (theView->View()->HiddenObjects());
|
|
||||||
|
|
||||||
// filling of myAISDetectedSeq sequence storing information about detected AIS objects
|
// filling of myAISDetectedSeq sequence storing information about detected AIS objects
|
||||||
// (the objects must be AIS_Shapes)
|
// (the objects must be AIS_Shapes)
|
||||||
const Standard_Integer aDetectedNb = MainSelector()->NbPicked();
|
const Standard_Integer aDetectedNb = MainSelector()->NbPicked();
|
||||||
|
@ -1071,7 +1071,7 @@ void AIS_Manipulator::HilightOwnerWithColor (const Handle(PrsMgr_PresentationMan
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
aPresentation->CStructure()->ViewAffinity = thePM->StructureManager()->ObjectAffinity (Handle(Standard_Transient) (this));
|
aPresentation->CStructure()->ViewAffinity = myViewAffinity;
|
||||||
|
|
||||||
if (anOwner->Mode() == AIS_MM_TranslationPlane)
|
if (anOwner->Mode() == AIS_MM_TranslationPlane)
|
||||||
{
|
{
|
||||||
|
@ -1016,7 +1016,7 @@ void AIS_ViewCube::HilightOwnerWithColor (const Handle(PrsMgr_PresentationManage
|
|||||||
|
|
||||||
Handle(Prs3d_Presentation) aHiPrs = GetHilightPresentation (thePrsMgr);
|
Handle(Prs3d_Presentation) aHiPrs = GetHilightPresentation (thePrsMgr);
|
||||||
aHiPrs->Clear();
|
aHiPrs->Clear();
|
||||||
aHiPrs->CStructure()->ViewAffinity = thePrsMgr->StructureManager()->ObjectAffinity (Handle(Standard_Transient)(this));
|
aHiPrs->CStructure()->ViewAffinity = myViewAffinity;
|
||||||
aHiPrs->SetTransformPersistence (TransformPersistence());
|
aHiPrs->SetTransformPersistence (TransformPersistence());
|
||||||
aHiPrs->SetZLayer (aLayer);
|
aHiPrs->SetZLayer (aLayer);
|
||||||
|
|
||||||
|
@ -36,7 +36,6 @@ Graphic3d_CView::Graphic3d_CView (const Handle(Graphic3d_StructureManager)& theM
|
|||||||
//
|
//
|
||||||
myStructureManager (theMgr),
|
myStructureManager (theMgr),
|
||||||
myCamera (new Graphic3d_Camera()),
|
myCamera (new Graphic3d_Camera()),
|
||||||
myHiddenObjects (new Graphic3d_NMapOfTransient()),
|
|
||||||
myIsInComputedMode (Standard_False),
|
myIsInComputedMode (Standard_False),
|
||||||
myIsActive (Standard_False),
|
myIsActive (Standard_False),
|
||||||
myIsRemoved (Standard_False),
|
myIsRemoved (Standard_False),
|
||||||
|
@ -134,12 +134,6 @@ public:
|
|||||||
//! Returns number of displayed structures in the view.
|
//! Returns number of displayed structures in the view.
|
||||||
virtual Standard_Integer NumberOfDisplayedStructures() const { return myStructsDisplayed.Extent(); }
|
virtual Standard_Integer NumberOfDisplayedStructures() const { return myStructsDisplayed.Extent(); }
|
||||||
|
|
||||||
//! Returns map of objects hidden within this specific view (not viewer-wise).
|
|
||||||
const Handle(Graphic3d_NMapOfTransient)& HiddenObjects() const { return myHiddenObjects; }
|
|
||||||
|
|
||||||
//! Returns map of objects hidden within this specific view (not viewer-wise).
|
|
||||||
Handle(Graphic3d_NMapOfTransient)& ChangeHiddenObjects() { return myHiddenObjects; }
|
|
||||||
|
|
||||||
//! Returns Standard_True in case if the structure with the given <theStructId> is
|
//! Returns Standard_True in case if the structure with the given <theStructId> is
|
||||||
//! in list of structures to be computed and stores computed struct to <theComputedStruct>.
|
//! in list of structures to be computed and stores computed struct to <theComputedStruct>.
|
||||||
Standard_EXPORT Standard_Boolean IsComputed (const Standard_Integer theStructId,
|
Standard_EXPORT Standard_Boolean IsComputed (const Standard_Integer theStructId,
|
||||||
@ -649,7 +643,6 @@ protected:
|
|||||||
Graphic3d_SequenceOfStructure myStructsToCompute;
|
Graphic3d_SequenceOfStructure myStructsToCompute;
|
||||||
Graphic3d_SequenceOfStructure myStructsComputed;
|
Graphic3d_SequenceOfStructure myStructsComputed;
|
||||||
Graphic3d_MapOfStructure myStructsDisplayed;
|
Graphic3d_MapOfStructure myStructsDisplayed;
|
||||||
Handle(Graphic3d_NMapOfTransient) myHiddenObjects;
|
|
||||||
Standard_Boolean myIsInComputedMode;
|
Standard_Boolean myIsInComputedMode;
|
||||||
Standard_Boolean myIsActive;
|
Standard_Boolean myIsActive;
|
||||||
Standard_Boolean myIsRemoved;
|
Standard_Boolean myIsRemoved;
|
||||||
|
@ -182,29 +182,45 @@ void Graphic3d_StructureManager::RecomputeStructures (const NCollection_Map<Grap
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle(Graphic3d_ViewAffinity) Graphic3d_StructureManager::RegisterObject (const Handle(Standard_Transient)& theObject)
|
// ========================================================================
|
||||||
|
// function : RegisterObject
|
||||||
|
// purpose :
|
||||||
|
// ========================================================================
|
||||||
|
void Graphic3d_StructureManager::RegisterObject (const Handle(Standard_Transient)& theObject,
|
||||||
|
const Handle(Graphic3d_ViewAffinity)& theAffinity)
|
||||||
{
|
{
|
||||||
Handle(Graphic3d_ViewAffinity) aResult;
|
Handle(Graphic3d_ViewAffinity) aResult;
|
||||||
if (myRegisteredObjects.Find (theObject.operator->(), aResult))
|
if (myRegisteredObjects.Find (theObject.operator->(), aResult)
|
||||||
|
&& aResult == theAffinity)
|
||||||
{
|
{
|
||||||
return aResult;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
aResult = new Graphic3d_ViewAffinity();
|
myRegisteredObjects.Bind (theObject.operator->(), theAffinity);
|
||||||
myRegisteredObjects.Bind (theObject.operator->(), aResult);
|
|
||||||
return aResult;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ========================================================================
|
||||||
|
// function : UnregisterObject
|
||||||
|
// purpose :
|
||||||
|
// ========================================================================
|
||||||
void Graphic3d_StructureManager::UnregisterObject (const Handle(Standard_Transient)& theObject)
|
void Graphic3d_StructureManager::UnregisterObject (const Handle(Standard_Transient)& theObject)
|
||||||
{
|
{
|
||||||
myRegisteredObjects.UnBind (theObject.operator->());
|
myRegisteredObjects.UnBind (theObject.operator->());
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle(Graphic3d_ViewAffinity) Graphic3d_StructureManager::ObjectAffinity (const Handle(Standard_Transient)& theObject) const
|
// ========================================================================
|
||||||
|
// function : ObjectAffinity
|
||||||
|
// purpose :
|
||||||
|
// ========================================================================
|
||||||
|
const Handle(Graphic3d_ViewAffinity)& Graphic3d_StructureManager::ObjectAffinity (const Handle(Standard_Transient)& theObject) const
|
||||||
{
|
{
|
||||||
Handle(Graphic3d_ViewAffinity) aResult;
|
const Handle(Graphic3d_ViewAffinity)* aResult = myRegisteredObjects.Seek (theObject.operator->());
|
||||||
myRegisteredObjects.Find (theObject.operator->(), aResult);
|
if (aResult == nullptr)
|
||||||
return aResult;
|
{
|
||||||
|
static const Handle(Graphic3d_ViewAffinity) aDummy;
|
||||||
|
return aDummy;
|
||||||
|
}
|
||||||
|
return *aResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
@ -151,11 +151,12 @@ public:
|
|||||||
//! Recomputes all structures from theStructures.
|
//! Recomputes all structures from theStructures.
|
||||||
Standard_EXPORT void RecomputeStructures (const NCollection_Map<Graphic3d_Structure*>& theStructures);
|
Standard_EXPORT void RecomputeStructures (const NCollection_Map<Graphic3d_Structure*>& theStructures);
|
||||||
|
|
||||||
Standard_EXPORT Handle(Graphic3d_ViewAffinity) RegisterObject (const Handle(Standard_Transient)& theObject);
|
Standard_EXPORT void RegisterObject (const Handle(Standard_Transient)& theObject,
|
||||||
|
const Handle(Graphic3d_ViewAffinity)& theAffinity);
|
||||||
|
|
||||||
Standard_EXPORT void UnregisterObject (const Handle(Standard_Transient)& theObject);
|
Standard_EXPORT void UnregisterObject (const Handle(Standard_Transient)& theObject);
|
||||||
|
|
||||||
Standard_EXPORT Handle(Graphic3d_ViewAffinity) ObjectAffinity (const Handle(Standard_Transient)& theObject) const;
|
Standard_EXPORT const Handle(Graphic3d_ViewAffinity)& ObjectAffinity (const Handle(Standard_Transient)& theObject) const;
|
||||||
|
|
||||||
//! Returns TRUE if Device Lost flag has been set and presentation data should be reuploaded onto graphics driver.
|
//! Returns TRUE if Device Lost flag has been set and presentation data should be reuploaded onto graphics driver.
|
||||||
Standard_Boolean IsDeviceLost() const { return myDeviceLostFlag; }
|
Standard_Boolean IsDeviceLost() const { return myDeviceLostFlag; }
|
||||||
|
@ -114,7 +114,7 @@ void IVtkOCC_ViewerSelector::Pick (const Standard_Integer theXPix,
|
|||||||
|
|
||||||
mySelectingVolumeMgr.BuildSelectingVolume();
|
mySelectingVolumeMgr.BuildSelectingVolume();
|
||||||
|
|
||||||
TraverseSensitives();
|
TraverseSensitives (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
@ -160,7 +160,7 @@ void IVtkOCC_ViewerSelector::Pick (const Standard_Integer theXMin,
|
|||||||
|
|
||||||
mySelectingVolumeMgr.BuildSelectingVolume();
|
mySelectingVolumeMgr.BuildSelectingVolume();
|
||||||
|
|
||||||
TraverseSensitives();
|
TraverseSensitives (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
@ -207,7 +207,7 @@ void IVtkOCC_ViewerSelector::Pick (double** thePoly,
|
|||||||
|
|
||||||
mySelectingVolumeMgr.BuildSelectingVolume();
|
mySelectingVolumeMgr.BuildSelectingVolume();
|
||||||
|
|
||||||
TraverseSensitives();
|
TraverseSensitives (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
@ -45,6 +45,7 @@ const gp_Trsf& PrsMgr_PresentableObject::getIdentityTrsf()
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
PrsMgr_PresentableObject::PrsMgr_PresentableObject (const PrsMgr_TypeOfPresentation3d theType)
|
PrsMgr_PresentableObject::PrsMgr_PresentableObject (const PrsMgr_TypeOfPresentation3d theType)
|
||||||
: myParent (NULL),
|
: myParent (NULL),
|
||||||
|
myViewAffinity (new Graphic3d_ViewAffinity()),
|
||||||
myDrawer (new Prs3d_Drawer()),
|
myDrawer (new Prs3d_Drawer()),
|
||||||
myTypeOfPresentation3d (theType),
|
myTypeOfPresentation3d (theType),
|
||||||
myDisplayStatus (PrsMgr_DisplayStatus_None),
|
myDisplayStatus (PrsMgr_DisplayStatus_None),
|
||||||
|
@ -74,6 +74,9 @@ public:
|
|||||||
//! This method should be called before object displaying to take effect.
|
//! This method should be called before object displaying to take effect.
|
||||||
Standard_EXPORT virtual void SetMutable (const Standard_Boolean theIsMutable);
|
Standard_EXPORT virtual void SetMutable (const Standard_Boolean theIsMutable);
|
||||||
|
|
||||||
|
//! Return view affinity mask.
|
||||||
|
const Handle(Graphic3d_ViewAffinity)& ViewAffinity() const { return myViewAffinity; }
|
||||||
|
|
||||||
//! Returns true if the Interactive Object has display mode setting overriding global setting (within Interactive Context).
|
//! Returns true if the Interactive Object has display mode setting overriding global setting (within Interactive Context).
|
||||||
Standard_Boolean HasDisplayMode() const { return myDrawer->DisplayMode() != -1; }
|
Standard_Boolean HasDisplayMode() const { return myDrawer->DisplayMode() != -1; }
|
||||||
|
|
||||||
@ -522,6 +525,7 @@ protected:
|
|||||||
|
|
||||||
PrsMgr_PresentableObject* myParent; //!< pointer to the parent object
|
PrsMgr_PresentableObject* myParent; //!< pointer to the parent object
|
||||||
PrsMgr_Presentations myPresentations; //!< list of presentations
|
PrsMgr_Presentations myPresentations; //!< list of presentations
|
||||||
|
Handle(Graphic3d_ViewAffinity) myViewAffinity; //!< view affinity mask
|
||||||
Handle(Graphic3d_SequenceOfHClipPlane) myClipPlanes; //!< sequence of object-specific clipping planes
|
Handle(Graphic3d_SequenceOfHClipPlane) myClipPlanes; //!< sequence of object-specific clipping planes
|
||||||
Handle(Prs3d_Drawer) myDrawer; //!< main presentation attributes
|
Handle(Prs3d_Drawer) myDrawer; //!< main presentation attributes
|
||||||
Handle(Prs3d_Drawer) myHilightDrawer; //!< (optional) custom presentation attributes for highlighting selected object
|
Handle(Prs3d_Drawer) myHilightDrawer; //!< (optional) custom presentation attributes for highlighting selected object
|
||||||
|
@ -519,7 +519,7 @@ Handle(PrsMgr_Presentation) PrsMgr_PresentationManager::Presentation (const Hand
|
|||||||
|
|
||||||
Handle(PrsMgr_Presentation) aPrs = new PrsMgr_Presentation (this, thePrsObj, theMode);
|
Handle(PrsMgr_Presentation) aPrs = new PrsMgr_Presentation (this, thePrsObj, theMode);
|
||||||
aPrs->SetZLayer (thePrsObj->ZLayer());
|
aPrs->SetZLayer (thePrsObj->ZLayer());
|
||||||
aPrs->CStructure()->ViewAffinity = myStructureManager->ObjectAffinity (!theSelObj.IsNull() ? theSelObj : thePrsObj);
|
aPrs->CStructure()->ViewAffinity = !theSelObj.IsNull() ? theSelObj->ViewAffinity() : thePrsObj->ViewAffinity();
|
||||||
thePrsObj->Presentations().Append (aPrs);
|
thePrsObj->Presentations().Append (aPrs);
|
||||||
thePrsObj->Fill (this, aPrs, theMode);
|
thePrsObj->Fill (this, aPrs, theMode);
|
||||||
|
|
||||||
|
@ -626,7 +626,7 @@ void SelectMgr_ViewerSelector::traverseObject (const Handle(SelectMgr_Selectable
|
|||||||
// purpose : Traverses BVH containing all added selectable objects and
|
// purpose : Traverses BVH containing all added selectable objects and
|
||||||
// finds candidates for further search of overlap
|
// finds candidates for further search of overlap
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void SelectMgr_ViewerSelector::TraverseSensitives()
|
void SelectMgr_ViewerSelector::TraverseSensitives (const Standard_Integer theViewId)
|
||||||
{
|
{
|
||||||
SelectMgr_BVHThreadPool::Sentry aSentry (myBVHThreadPool);
|
SelectMgr_BVHThreadPool::Sentry aSentry (myBVHThreadPool);
|
||||||
|
|
||||||
@ -750,14 +750,16 @@ void SelectMgr_ViewerSelector::TraverseSensitives()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Standard_Integer aStartIdx = aBVHTree->BegPrimitive (aNode);
|
const Standard_Integer aStartIdx = aBVHTree->BegPrimitive (aNode);
|
||||||
Standard_Integer anEndIdx = aBVHTree->EndPrimitive (aNode);
|
const Standard_Integer anEndIdx = aBVHTree->EndPrimitive (aNode);
|
||||||
for (Standard_Integer anIdx = aStartIdx; anIdx <= anEndIdx; ++anIdx)
|
for (Standard_Integer anIdx = aStartIdx; anIdx <= anEndIdx; ++anIdx)
|
||||||
{
|
{
|
||||||
const Handle(SelectMgr_SelectableObject)& aSelectableObject =
|
const Handle(SelectMgr_SelectableObject)& aSelObj = mySelectableObjects.GetObjectById (aBVHSubset, anIdx);
|
||||||
mySelectableObjects.GetObjectById (aBVHSubset, anIdx);
|
const Handle(Graphic3d_ViewAffinity)& aViewAffinity = aSelObj->ViewAffinity();
|
||||||
|
if (theViewId == -1 || aViewAffinity->IsVisible (theViewId))
|
||||||
traverseObject (aSelectableObject, aMgr, aCamera, aProjectionMat, aWorldViewMat, aWinSize);
|
{
|
||||||
|
traverseObject (aSelObj, aMgr, aCamera, aProjectionMat, aWorldViewMat, aWinSize);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (aHead < 0)
|
if (aHead < 0)
|
||||||
{
|
{
|
||||||
@ -1175,7 +1177,7 @@ void SelectMgr_ViewerSelector::Pick (const Standard_Integer theXPix,
|
|||||||
mySelectingVolumeMgr.BuildSelectingVolume();
|
mySelectingVolumeMgr.BuildSelectingVolume();
|
||||||
mySelectingVolumeMgr.SetViewClipping (theView->ClipPlanes(), Handle(Graphic3d_SequenceOfHClipPlane)(), NULL);
|
mySelectingVolumeMgr.SetViewClipping (theView->ClipPlanes(), Handle(Graphic3d_SequenceOfHClipPlane)(), NULL);
|
||||||
|
|
||||||
TraverseSensitives();
|
TraverseSensitives (theView->View()->Identification());
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -1204,7 +1206,7 @@ void SelectMgr_ViewerSelector::Pick (const Standard_Integer theXPMin,
|
|||||||
|
|
||||||
mySelectingVolumeMgr.BuildSelectingVolume();
|
mySelectingVolumeMgr.BuildSelectingVolume();
|
||||||
mySelectingVolumeMgr.SetViewClipping (theView->ClipPlanes(), Handle(Graphic3d_SequenceOfHClipPlane)(), NULL);
|
mySelectingVolumeMgr.SetViewClipping (theView->ClipPlanes(), Handle(Graphic3d_SequenceOfHClipPlane)(), NULL);
|
||||||
TraverseSensitives();
|
TraverseSensitives (theView->View()->Identification());
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -1224,7 +1226,7 @@ void SelectMgr_ViewerSelector::Pick (const TColgp_Array1OfPnt2d& thePolyline,
|
|||||||
mySelectingVolumeMgr.BuildSelectingVolume();
|
mySelectingVolumeMgr.BuildSelectingVolume();
|
||||||
mySelectingVolumeMgr.SetViewClipping (theView->ClipPlanes(), Handle(Graphic3d_SequenceOfHClipPlane)(), NULL);
|
mySelectingVolumeMgr.SetViewClipping (theView->ClipPlanes(), Handle(Graphic3d_SequenceOfHClipPlane)(), NULL);
|
||||||
|
|
||||||
TraverseSensitives();
|
TraverseSensitives (theView->View()->Identification());
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -1240,7 +1242,7 @@ void SelectMgr_ViewerSelector::Pick (const gp_Ax1& theAxis,
|
|||||||
mySelectingVolumeMgr.BuildSelectingVolume();
|
mySelectingVolumeMgr.BuildSelectingVolume();
|
||||||
mySelectingVolumeMgr.SetViewClipping (theView->ClipPlanes(), Handle(Graphic3d_SequenceOfHClipPlane)(), NULL);
|
mySelectingVolumeMgr.SetViewClipping (theView->ClipPlanes(), Handle(Graphic3d_SequenceOfHClipPlane)(), NULL);
|
||||||
|
|
||||||
TraverseSensitives();
|
TraverseSensitives (theView->View()->Identification());
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@ -325,7 +325,7 @@ protected:
|
|||||||
|
|
||||||
//! Traverses BVH containing all added selectable objects and
|
//! Traverses BVH containing all added selectable objects and
|
||||||
//! finds candidates for further search of overlap
|
//! finds candidates for further search of overlap
|
||||||
Standard_EXPORT void TraverseSensitives();
|
Standard_EXPORT void TraverseSensitives (const Standard_Integer theViewId = -1);
|
||||||
|
|
||||||
//! Internal function that checks if there is possible overlap between some entity of selectable object theObject and
|
//! Internal function that checks if there is possible overlap between some entity of selectable object theObject and
|
||||||
//! current selecting volume.
|
//! current selecting volume.
|
||||||
|
34
tests/v3d/bugs/bug32978
Normal file
34
tests/v3d/bugs/bug32978
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "0031965: Visualization - AIS_InteractiveContext::HilightWithColor() ignores passed highlight style"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
pload MODELING VISUALIZATION
|
||||||
|
vinit V1/RootView -width 1024 -height 512 -composer 0
|
||||||
|
vbackground GRAY20
|
||||||
|
|
||||||
|
vinit V2/ViewLeft -parent V1/RootView -width 0.5 -height 1.0
|
||||||
|
vbackground GRAY30
|
||||||
|
|
||||||
|
box b 100 200 300
|
||||||
|
vdisplay -dispMode 1 b
|
||||||
|
vaspects b -faceBoundaryDraw 1
|
||||||
|
vfit
|
||||||
|
vviewcube vc
|
||||||
|
|
||||||
|
vinit V2/ViewRight -parent V1/RootView -width 0.5 -height 1.0 -left 0.5
|
||||||
|
vbackground GRAY40
|
||||||
|
psphere s 300
|
||||||
|
vdisplay -dispMode 1 s
|
||||||
|
vaspects s -material SILVER
|
||||||
|
vfit
|
||||||
|
vzbufftrihedron
|
||||||
|
|
||||||
|
vactivate V2/ViewLeft
|
||||||
|
verase s -view
|
||||||
|
vcamera -rotationMode pick
|
||||||
|
vmoveto 100 100
|
||||||
|
if { [string match "*Select3D_SensitiveSphere*" [vstate -entities]] } { puts "Error: sphere should NOT be detected" }
|
||||||
|
|
||||||
|
vseldump $::imagedir/${::casename}_sel.png -type entity
|
||||||
|
vdump $::imagedir/${::casename}_vis.png
|
Loading…
x
Reference in New Issue
Block a user