mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-13 14:27:08 +03:00
0030641: Visualization - possibility to select in predefined ZLayers only - debug messages
This commit is contained in:
@@ -19,6 +19,12 @@
|
|||||||
#include <BVH_BinnedBuilder.hxx>
|
#include <BVH_BinnedBuilder.hxx>
|
||||||
#include <BVH_LinearBuilder.hxx>
|
#include <BVH_LinearBuilder.hxx>
|
||||||
|
|
||||||
|
//#define REPORT_SELECTION_BUILD
|
||||||
|
#ifdef REPORT_SELECTION_BUILD
|
||||||
|
#include <Message_Alerts.hxx>
|
||||||
|
#include <Message_PerfMeter.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
//! Short-cut definition of indexed data map of selectable objects
|
//! Short-cut definition of indexed data map of selectable objects
|
||||||
@@ -46,6 +52,18 @@ namespace
|
|||||||
if (!anObject.IsNull() && myDisabledZLayers.Contains (anObject->ZLayer()))
|
if (!anObject.IsNull() && myDisabledZLayers.Contains (anObject->ZLayer()))
|
||||||
return Select3D_BndBox3d();
|
return Select3D_BndBox3d();
|
||||||
|
|
||||||
|
#ifdef REPORT_SELECTION_BUILD
|
||||||
|
Message_PerfMeter aPerfMeter;
|
||||||
|
if (anObject->ZLayer() == Graphic3d_ZLayerId_Default)
|
||||||
|
{
|
||||||
|
MESSAGE_INFO_OBJECT (anObject, "BVHBuilderAdaptorRegular: default layer", "", &aPerfMeter, NULL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MESSAGE_INFO_OBJECT (anObject, "BVHBuilderAdaptorRegular", anObject->ZLayer(), &aPerfMeter, NULL);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
Bnd_Box aBox;
|
Bnd_Box aBox;
|
||||||
anObject->BoundingBox (aBox);
|
anObject->BoundingBox (aBox);
|
||||||
if (aBox.IsVoid())
|
if (aBox.IsVoid())
|
||||||
@@ -134,6 +152,18 @@ namespace
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef REPORT_SELECTION_BUILD
|
||||||
|
Message_PerfMeter aPerfMeter;
|
||||||
|
if (anObject->ZLayer() == Graphic3d_ZLayerId_Default)
|
||||||
|
{
|
||||||
|
MESSAGE_INFO_OBJECT (anObject, "BVHBuilderAdaptorPersistent: default layer", "", &aPerfMeter, NULL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MESSAGE_INFO_OBJECT (anObject, "BVHBuilderAdaptorPersistent", anObject->ZLayer(), &aPerfMeter, NULL);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
Bnd_Box aBoundingBox;
|
Bnd_Box aBoundingBox;
|
||||||
anObject->BoundingBox (aBoundingBox);
|
anObject->BoundingBox (aBoundingBox);
|
||||||
if (aBoundingBox.IsVoid()
|
if (aBoundingBox.IsVoid()
|
||||||
|
@@ -15,10 +15,12 @@
|
|||||||
// commercial license or contractual agreement.
|
// commercial license or contractual agreement.
|
||||||
|
|
||||||
#include <SelectMgr_ViewerSelector.hxx>
|
#include <SelectMgr_ViewerSelector.hxx>
|
||||||
|
#include <SelectMgr.hxx>
|
||||||
|
|
||||||
#include <BVH_Tree.hxx>
|
#include <BVH_Tree.hxx>
|
||||||
#include <gp_GTrsf.hxx>
|
#include <gp_GTrsf.hxx>
|
||||||
#include <gp_Pnt.hxx>
|
#include <gp_Pnt.hxx>
|
||||||
|
#include <Message_Alerts.hxx>
|
||||||
#include <OSD_Environment.hxx>
|
#include <OSD_Environment.hxx>
|
||||||
#include <Precision.hxx>
|
#include <Precision.hxx>
|
||||||
#include <SelectBasics_EntityOwner.hxx>
|
#include <SelectBasics_EntityOwner.hxx>
|
||||||
@@ -371,6 +373,17 @@ void SelectMgr_ViewerSelector::traverseObject (const Handle(SelectMgr_Selectable
|
|||||||
if (!theObject.IsNull() && myDisabledZLayers.Contains (theObject->ZLayer()))
|
if (!theObject.IsNull() && myDisabledZLayers.Contains (theObject->ZLayer()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#ifdef REPORT_SELECTION_BUILD
|
||||||
|
Message_PerfMeter aPerfMeter;
|
||||||
|
if (theObject->ZLayer() == Graphic3d_ZLayerId_Default)
|
||||||
|
{
|
||||||
|
MESSAGE_INFO_OBJECT (theObject, "traverseObject: default layer", "", &aPerfMeter, NULL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MESSAGE_INFO_OBJECT (theObject, "BVHBuilderAdaptorRegular", theObject->ZLayer(), &aPerfMeter, NULL);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
Handle(SelectMgr_SensitiveEntitySet)& anEntitySet = myMapOfObjectSensitives.ChangeFind (theObject);
|
Handle(SelectMgr_SensitiveEntitySet)& anEntitySet = myMapOfObjectSensitives.ChangeFind (theObject);
|
||||||
if (anEntitySet->Size() == 0)
|
if (anEntitySet->Size() == 0)
|
||||||
{
|
{
|
||||||
@@ -378,7 +391,6 @@ void SelectMgr_ViewerSelector::traverseObject (const Handle(SelectMgr_Selectable
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef REPORT_SELECTION_BUILD
|
#ifdef REPORT_SELECTION_BUILD
|
||||||
Message_PerfMeter aPerfMeter;
|
|
||||||
MESSAGE_INFO_OBJECT (theObject, "traverseObject", "", &aPerfMeter, NULL);
|
MESSAGE_INFO_OBJECT (theObject, "traverseObject", "", &aPerfMeter, NULL);
|
||||||
Handle(Message_Alert) aParentAlert = OCCT_Message_Alert;
|
Handle(Message_Alert) aParentAlert = OCCT_Message_Alert;
|
||||||
#endif
|
#endif
|
||||||
@@ -531,6 +543,10 @@ void SelectMgr_ViewerSelector::TraverseSensitives()
|
|||||||
Message_PerfMeter aPerfMeter;
|
Message_PerfMeter aPerfMeter;
|
||||||
MESSAGE_INFO ("TraverseSensitives", "", &aPerfMeter, NULL);
|
MESSAGE_INFO ("TraverseSensitives", "", &aPerfMeter, NULL);
|
||||||
Handle(Message_Alert) aParentAlert = OCCT_Message_Alert;
|
Handle(Message_Alert) aParentAlert = OCCT_Message_Alert;
|
||||||
|
|
||||||
|
Standard_SStream aStream;
|
||||||
|
Dump (aStream);
|
||||||
|
MESSAGE_INFO_VALUES (aStream, "Parameters", "", &aPerfMeter, aParentAlert);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mystored.Clear();
|
mystored.Clear();
|
||||||
@@ -677,6 +693,11 @@ void SelectMgr_ViewerSelector::TraverseSensitives()
|
|||||||
}
|
}
|
||||||
|
|
||||||
SortResult();
|
SortResult();
|
||||||
|
#ifdef REPORT_SELECTION_BUILD
|
||||||
|
Standard_SStream aStreamDone;
|
||||||
|
Dump (aStreamDone);
|
||||||
|
MESSAGE_INFO_VALUES (aStreamDone, "Parameters", "", &aPerfMeter, aParentAlert);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//==================================================
|
//==================================================
|
||||||
@@ -1073,3 +1094,35 @@ void SelectMgr_ViewerSelector::SetDisabledZLayers (const NCollection_Map<Graphic
|
|||||||
myDisabledZLayers = theLayers;
|
myDisabledZLayers = theLayers;
|
||||||
mySelectableObjects.SetDisabledZLayers (theLayers);
|
mySelectableObjects.SetDisabledZLayers (theLayers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : Dump
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void SelectMgr_ViewerSelector::Dump(Standard_OStream& OS)const
|
||||||
|
{
|
||||||
|
DUMP_VALUES (OS, "SelectMgr_ViewerSelector", 2);
|
||||||
|
|
||||||
|
DUMP_VALUES (OS, "IsPickClosest", IsPickClosest());
|
||||||
|
DUMP_VALUES (OS, "ToUpdateTolerance", myToUpdateTolerance);
|
||||||
|
DUMP_VALUES (OS, "mystored", mystored.Extent());
|
||||||
|
//DUMP_VALUES (OS, "mySelectingVolumeMgr", mySelectingVolumeMgr);
|
||||||
|
|
||||||
|
Standard_Integer aNbOfSelected = 0;
|
||||||
|
for (SelectMgr_SelectableObjectSet::Iterator aSelectableIt (mySelectableObjects); aSelectableIt.More(); aSelectableIt.Next())
|
||||||
|
{
|
||||||
|
aNbOfSelected++;
|
||||||
|
}
|
||||||
|
DUMP_VALUES (OS, "mySelectableObjects", aNbOfSelected);
|
||||||
|
DUMP_VALUES (OS, "myTolerances.Tolerance()", myTolerances.Tolerance());
|
||||||
|
DUMP_VALUES (OS, "myTolerances.CustomTolerance()", myTolerances.CustomTolerance());
|
||||||
|
DUMP_VALUES (OS, "myZLayerOrderMap", myZLayerOrderMap.Size());
|
||||||
|
|
||||||
|
TCollection_AsciiString aDisabledLayers;
|
||||||
|
for (NCollection_Map<Graphic3d_ZLayerId>::Iterator anIterator (myDisabledZLayers); anIterator.More(); anIterator.Next())
|
||||||
|
{
|
||||||
|
aDisabledLayers += anIterator.Value();
|
||||||
|
aDisabledLayers += " ";
|
||||||
|
}
|
||||||
|
DUMP_VALUES (OS, "myDisabledZLayers", aDisabledLayers);
|
||||||
|
}
|
||||||
|
@@ -216,6 +216,9 @@ public:
|
|||||||
//! Sets container of Z layers, that should not be processed by selection
|
//! Sets container of Z layers, that should not be processed by selection
|
||||||
Standard_EXPORT void SetDisabledZLayers (const NCollection_Map<Graphic3d_ZLayerId>& theLayers);
|
Standard_EXPORT void SetDisabledZLayers (const NCollection_Map<Graphic3d_ZLayerId>& theLayers);
|
||||||
|
|
||||||
|
//! Dumps the content of me on the stream <OS>.
|
||||||
|
Standard_EXPORT void Dump (Standard_OStream& OS) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//! Begins an iteration scanning for the owners detected at a position in the view.
|
//! Begins an iteration scanning for the owners detected at a position in the view.
|
||||||
|
Reference in New Issue
Block a user