1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0030687: Visualization - remove redundant interfaces SelectBasics_EntityOwner and SelectBasics_SensitiveEntity

SelectBasics_EntityOwner has been merged into SelectMgr_EntityOwner.
Unused property SelectMgr_EntityOwner::ResetLocation() has been removed.
SelectBasics package has been moved from TKService to TKV3d.

SelectBasics_SensitiveEntity has been merged into Select3D_SensitiveEntity.
This commit is contained in:
kgv
2019-05-21 19:42:15 +03:00
parent 547fcc76b2
commit 0ef04197f7
101 changed files with 429 additions and 812 deletions

View File

@@ -19,7 +19,7 @@
#include <Graphic3d_StructureManager.hxx>
#include <Prs3d_Drawer.hxx>
#include <PrsMgr_PresentationManager.hxx>
#include <SelectBasics_EntityOwner.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_SelectableObject.hxx>
#include <Standard_Type.hxx>
#include <StdSelect_Shape.hxx>
@@ -169,16 +169,6 @@ void StdSelect_BRepOwner::SetLocation(const TopLoc_Location& aLoc)
myPrsSh->SetToUpdate();
}
void StdSelect_BRepOwner::ResetLocation()
{
SelectMgr_EntityOwner::ResetLocation();
// we must not nullify the myPrsSh here, because unhilight method
// will be working with wrong entity in this case, the best is to
// set the update flag and then recompute myPrsSh on hilighting
if (!myPrsSh.IsNull())
myPrsSh->SetToUpdate();
}
//=======================================================================
//function : UpdateHighlightTrsf
//purpose :

View File

@@ -111,8 +111,6 @@ public:
Standard_EXPORT virtual void Clear (const Handle(PrsMgr_PresentationManager)& aPM, const Standard_Integer aMode = 0) Standard_OVERRIDE;
Standard_EXPORT virtual void SetLocation (const TopLoc_Location& aLoc) Standard_OVERRIDE;
Standard_EXPORT virtual void ResetLocation() Standard_OVERRIDE;
//! Implements immediate application of location transformation of parent object to dynamic highlight structure
Standard_EXPORT virtual void UpdateHighlightTrsf (const Handle(V3d_Viewer)& theViewer,

View File

@@ -75,7 +75,7 @@ void StdSelect_BRepSelectionTool::PreBuildBVH (const Handle(SelectMgr_Selection)
{
for (NCollection_Vector<Handle(SelectMgr_SensitiveEntity)>::Iterator aSelEntIter (theSelection->Entities()); aSelEntIter.More(); aSelEntIter.Next())
{
const Handle(SelectBasics_SensitiveEntity)& aSensitive = aSelEntIter.Value()->BaseSensitive();
const Handle(Select3D_SensitiveEntity)& aSensitive = aSelEntIter.Value()->BaseSensitive();
if (aSensitive->NbSubElements() >= BVH_PRIMITIVE_LIMIT)
{
aSensitive->BVH();
@@ -190,8 +190,8 @@ void StdSelect_BRepSelectionTool::Load (const Handle(SelectMgr_Selection)& theSe
// loading of selectables...
for (NCollection_Vector<Handle(SelectMgr_SensitiveEntity)>::Iterator aSelEntIter (theSelection->Entities()); aSelEntIter.More(); aSelEntIter.Next())
{
Handle(SelectMgr_EntityOwner) anOwner = Handle(SelectMgr_EntityOwner)::DownCast (aSelEntIter.Value()->BaseSensitive()->OwnerId());
anOwner->Set (theSelectableObj);
const Handle(SelectMgr_EntityOwner)& anOwner = aSelEntIter.Value()->BaseSensitive()->OwnerId();
anOwner->SetSelectable (theSelectableObj);
}
PreBuildBVH (theSelection);

View File

@@ -17,12 +17,11 @@
#ifndef StdSelect_IndexedDataMapOfOwnerPrs_HeaderFile
#define StdSelect_IndexedDataMapOfOwnerPrs_HeaderFile
#include <SelectBasics_EntityOwner.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <StdSelect_Prs.hxx>
#include <TColStd_MapTransientHasher.hxx>
#include <NCollection_IndexedDataMap.hxx>
typedef NCollection_IndexedDataMap<Handle(SelectBasics_EntityOwner),Handle(StdSelect_Prs),TColStd_MapTransientHasher> StdSelect_IndexedDataMapOfOwnerPrs;
typedef NCollection_IndexedDataMap<Handle(SelectMgr_EntityOwner), Handle(StdSelect_Prs), TColStd_MapTransientHasher> StdSelect_IndexedDataMapOfOwnerPrs;
#endif

View File

@@ -16,7 +16,7 @@
#include <StdSelect_ViewerSelector3d.hxx>
#include <StdSelect.hxx>
#include <SelectBasics_SensitiveEntity.hxx>
#include <Select3D_SensitiveEntity.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <gp_Pnt.hxx>
#include <gp_Lin.hxx>
@@ -282,7 +282,7 @@ void StdSelect_ViewerSelector3d::computeSensitivePrs (const Handle(Graphic3d_Str
TColStd_SequenceOfInteger aSeqBnds;
for (NCollection_Vector<Handle(SelectMgr_SensitiveEntity)>::Iterator aSelEntIter (theSel->Entities()); aSelEntIter.More(); aSelEntIter.Next())
{
Handle(Select3D_SensitiveEntity) Ent = Handle(Select3D_SensitiveEntity)::DownCast(aSelEntIter.Value()->BaseSensitive());
const Handle(Select3D_SensitiveEntity)& Ent = aSelEntIter.Value()->BaseSensitive();
const Standard_Boolean hasloc = theLoc.Form() != gp_Identity;
//==============
@@ -759,14 +759,14 @@ namespace
return;
}
const Handle(SelectBasics_SensitiveEntity)& aPickedEntity = myMainSel->PickedEntity (thePicked);
const Handle(Select3D_SensitiveEntity)& aPickedEntity = myMainSel->PickedEntity (thePicked);
Quantity_Color aColor (Quantity_NOC_BLACK);
myMapEntityColors.Find (aPickedEntity, aColor);
myImage->SetPixelColor (theCol, theRow, aColor);
}
protected:
NCollection_DataMap<Handle(SelectBasics_SensitiveEntity), Quantity_Color> myMapEntityColors;
NCollection_DataMap<Handle(Select3D_SensitiveEntity), Quantity_Color> myMapEntityColors;
};
//! Help class for filling pixel with normalized depth of ray.
@@ -969,8 +969,8 @@ namespace
}
Standard_Integer aSelectionMode = -1;
const Handle(SelectMgr_SelectableObject)& aSelectable = myMainSel->Picked (thePicked)->Selectable();
const Handle(SelectBasics_SensitiveEntity)& anEntity = myMainSel->PickedEntity (thePicked);
const Handle(SelectMgr_SelectableObject)& aSelectable = myMainSel->Picked (thePicked)->Selectable();
const Handle(Select3D_SensitiveEntity)& anEntity = myMainSel->PickedEntity (thePicked);
for (SelectMgr_SequenceOfSelection::Iterator aSelIter (aSelectable->Selections()); aSelIter.More(); aSelIter.Next())
{
const Handle(SelectMgr_Selection)& aSelection = aSelIter.Value();