From: nds Date: Mon, 12 Dec 2016 10:14:30 +0000 (+0300) Subject: Remove selection debug information as this information is available through VInspecto... X-Git-Tag: before_porting_8.2.0~30 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8ed331d9f0dc910fdcdfebd6d6e0ac108a79496c;p=modules%2Fshaper.git Remove selection debug information as this information is available through VInspector using. --- diff --git a/src/ModuleBase/ModuleBase_FilterValidated.cpp b/src/ModuleBase/ModuleBase_FilterValidated.cpp index 21fe81e3a..2a9debb0b 100644 --- a/src/ModuleBase/ModuleBase_FilterValidated.cpp +++ b/src/ModuleBase/ModuleBase_FilterValidated.cpp @@ -29,8 +29,6 @@ Standard_Boolean ModuleBase_FilterValidated:: ModuleBase_IViewer* aViewer = myWorkshop->viewer(); Handle(AIS_InteractiveContext) aContext = aViewer->AISContext(); - ModuleBase_Tools::selectionInfo(aContext, "ModuleBase_FilterValidated::IsOk"); - ModuleBase_IPropertyPanel* aPanel = anOperation->propertyPanel(); ModuleBase_ModelWidget* aCurrentWidget = aPanel->preselectionWidget(); if (!aCurrentWidget) diff --git a/src/ModuleBase/ModuleBase_Tools.cpp b/src/ModuleBase/ModuleBase_Tools.cpp index 41b19a1f4..0114238db 100755 --- a/src/ModuleBase/ModuleBase_Tools.cpp +++ b/src/ModuleBase/ModuleBase_Tools.cpp @@ -73,23 +73,6 @@ const double DEFAULT_DEVIATION_COEFFICIENT = 1.e-4; //#define DEBUG_ACTIVATE_WINDOW //#define DEBUG_SET_FOCUS -//#define DEBUG_SELECTION_INFO - -#ifdef DEBUG_SELECTION_INFO -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#endif #ifdef WIN32 # define FSEP "\\" @@ -327,196 +310,6 @@ QString objectInfo(const ObjectPtr& theObj, const bool isUseAttributesInfo) return aFeatureStr; } -#ifdef DEBUG_SELECTION_INFO -QString getShapeTypeInfo(const int theType) -{ - QString anInfo = "Undefined"; - switch(theType) { - case TopAbs_COMPOUND: anInfo = "compound"; break; - case TopAbs_COMPSOLID: anInfo = "compsolid"; break; - case TopAbs_SOLID: anInfo = "solid"; break; - case TopAbs_SHELL: anInfo = "shell"; break; - case TopAbs_FACE: anInfo = "face"; break; - case TopAbs_WIRE: anInfo = "wire"; break; - case TopAbs_EDGE: anInfo = "edge"; break; - case TopAbs_VERTEX: anInfo = "vertex"; break; - case TopAbs_SHAPE: anInfo = "shape"; break; - case ModuleBase_ResultPrs::Sel_Result: - anInfo = "result_shape"; break; - default: break; - } - return anInfo; -} - -QString getModeInfo(const int theMode) -{ - QString anInfo = "Undefined"; - switch(theMode) { - case 0: anInfo = "SHAPE(0)"; break; - case 1: anInfo = "VERTEX(1)"; break; - case 2: anInfo = "EDGE(2)"; break; - case 3: anInfo = "WIRE(3)"; break; - case 4: anInfo = "FACE(4)"; break; - case 5: anInfo = "SHELL(5)"; break; - case 6: anInfo = "SOLID(6)"; break; - case 7: anInfo = "COMPSOLID(7)"; break; - case 8: anInfo = "COMPOUND(8)"; break; - case 100: anInfo = "Sel_Mode_First(100)"; break; //SketcherPrs_Tools - case 101: anInfo = "Sel_Constraint(101)"; break; - case 102: anInfo = "Sel_Dimension_All(102)"; break; - case 103: anInfo = "Sel_Dimension_Line(103)"; break; - case 104: anInfo = "Sel_Dimension_Text(104)"; break; - default: break; - } - return anInfo; -} - -QString displayedInteractiveObjects(Handle(AIS_InteractiveContext)& theContext, - const bool theShapeInfoOnly = true) -{ - if (theContext.IsNull()) - return ""; - AIS_ListOfInteractive aListOfIO; - theContext->DisplayedObjects(aListOfIO, false); - QStringList anObjects; - AIS_ListIteratorOfListOfInteractive aIt; - for (aIt.Initialize(aListOfIO); aIt.More(); aIt.Next()) { - Handle(AIS_InteractiveObject) anAISIO = aIt.Value(); - Handle(AIS_Shape) aShapePrs = Handle(AIS_Shape)::DownCast(anAISIO); - if (theShapeInfoOnly && aShapePrs.IsNull()) - continue; - - QString anInfo = "IO"; - std::ostringstream aPtrStr; - aPtrStr << "[" << anAISIO.Access() << "]"; - anInfo += aPtrStr.str().c_str(); - - if (!aShapePrs.IsNull()) { - const TopoDS_Shape& aShape = aShapePrs->Shape(); - if (aShape.IsNull()) { - //Events_Error::throwException("An empty AIS presentation"); - } - else - anInfo += QString(", shape type: %1").arg(getShapeTypeInfo(aShape.ShapeType())); - } - TColStd_ListOfInteger aTColModes; - theContext->ActivatedModes(anAISIO, aTColModes); - TColStd_ListIteratorOfListOfInteger itr( aTColModes ); - QIntList aModesActivatedForIO; - bool isDeactivated = false; - QStringList aModes; - for (; itr.More(); itr.Next() ) { - Standard_Integer aMode = itr.Value(); - aModes.append(getModeInfo(aMode)); - //int aShapeMode = (aMode > 8)? aMode : AIS_Shape::SelectionType(aMode); - } - if (aModes.size() > 0) - anInfo += QString(", activated modes: %1").arg(aModes.join(", ")); - - anObjects += anInfo; - } - QString aValue = QString("displayedIO[%1]").arg(anObjects.size()); - if (anObjects.size() > 0) - aValue += QString(":\n %1").arg(anObjects.join("\n ")); - return aValue; -} - -QString activeOwners(Handle(AIS_InteractiveContext)& theContext, const bool theShapeInfoOnly = true) -{ - if (theContext.IsNull()) - return ""; - Handle(AIS_LocalContext) aLContext = theContext->LocalContext(); - TCollection_AsciiString aSelectionName = aLContext->SelectionName(); - aLContext->UnhilightPicked(Standard_False); - - NCollection_List anActiveOwners; - aLContext->MainSelector()->ActiveOwners(anActiveOwners); - NCollection_List::Iterator anOwnersIt (anActiveOwners); - Handle(SelectMgr_EntityOwner) anOwner; - QStringList anObjects; - for (; anOwnersIt.More(); anOwnersIt.Next()) { - anOwner = Handle(SelectMgr_EntityOwner)::DownCast (anOwnersIt.Value()); - Handle(StdSelect_BRepOwner) BROwnr = Handle(StdSelect_BRepOwner)::DownCast(anOwner); - if (theShapeInfoOnly && BROwnr.IsNull()) - continue; - - QString anInfo = "Owner"; - std::ostringstream aPtrStr; - aPtrStr << "[" << anOwner.Access() << "]"; - anInfo += aPtrStr.str().c_str(); - - Handle(AIS_InteractiveObject) aAISObj = - Handle(AIS_InteractiveObject)::DownCast(anOwner->Selectable()); - if (!aAISObj.IsNull()) { - std::ostringstream aPtrStr; - aPtrStr << "[" << aAISObj.Access() << "]"; - anInfo += QString(", selectable(IO): %1").arg(aPtrStr.str().c_str()); - } - - if (!BROwnr.IsNull() && BROwnr->HasShape()) { - const TopoDS_Shape& aShape = BROwnr->Shape(); - if (aShape.IsNull()) { - //Events_Error::throwException("An empty AIS presentation"); - } - else - anInfo += QString(", shape type: %1").arg(getShapeTypeInfo(aShape.ShapeType())); - } - anObjects += anInfo; - } - QString aValue = QString("activeOwners[%1]").arg(anObjects.size()); - if (anObjects.size() > 0) - aValue += QString(":\n %1").arg(anObjects.join("\n ")); - return aValue; -} - -QString selectedOwners(Handle(AIS_InteractiveContext)& theContext, - const bool theShapeInfoOnly = true) -{ - QStringList anObjects; - if (theContext.IsNull()) - return ""; - - QList aSelectedIds; // Remember of selected address in order to avoid duplicates - for (theContext->InitSelected(); theContext->MoreSelected(); theContext->NextSelected()) { - Handle(SelectMgr_EntityOwner) anOwner = theContext->SelectedOwner(); - Handle(StdSelect_BRepOwner) BROwnr = Handle(StdSelect_BRepOwner)::DownCast(anOwner); - if (theShapeInfoOnly && BROwnr.IsNull()) - continue; - - if (aSelectedIds.contains((long)anOwner.Access())) - continue; - aSelectedIds.append((long)anOwner.Access()); - - QString anInfo = "Owner"; - std::ostringstream aPtrStr; - aPtrStr << "[" << anOwner.Access() << "]"; - anInfo += aPtrStr.str().c_str(); - - if (!BROwnr.IsNull() && BROwnr->HasShape()) { - const TopoDS_Shape& aShape = BROwnr->Shape(); - anInfo += QString(", shape type = %1").arg(getShapeTypeInfo(aShape.ShapeType())); - } - anObjects += anInfo; - } - QString aValue = QString("selectedOwners[%1]").arg(anObjects.size()); - if (anObjects.size() > 0) - aValue += QString(":\n %1").arg(anObjects.join("\n ")); - return aValue; -} -#endif - -void selectionInfo(Handle(AIS_InteractiveContext)& theContext, const std::string& thePrefix) -{ -#ifdef DEBUG_SELECTION_INFO - QString aValue = QString("\n\n\nDEBUG_SELECTION_INFO for '%1'\n%2\n%3\n%4") - .arg(thePrefix.c_str()) - .arg(displayedInteractiveObjects(theContext)) - .arg(activeOwners(theContext)) - .arg(selectedOwners(theContext)); - qDebug(aValue.toStdString().c_str()); -#endif -} - typedef QMap ShapeTypes; static ShapeTypes myShapeTypes; diff --git a/src/ModuleBase/ModuleBase_Tools.h b/src/ModuleBase/ModuleBase_Tools.h index ab5b63073..fedc9d206 100755 --- a/src/ModuleBase/ModuleBase_Tools.h +++ b/src/ModuleBase/ModuleBase_Tools.h @@ -133,18 +133,14 @@ MODULEBASE_EXPORT QAction* createAction(const QIcon& theIcon, const QString& the const QString& theToolTip = QString(), const QString& theStatusTip = QString()); +//#ifdef _DEBUG /// Converts the object to the feature or a result and generate information string /// \param theObj an object /// \param isUseAttributesInfo a flag whether the attribute values information is used /// \return a string MODULEBASE_EXPORT QString objectInfo(const ObjectPtr& theObj, const bool isUseAttributesInfo = false); - -/// Converts the AIS context information in a string information. -/// \param theContext a viewer context -/// \param thePrefix additional information where the method is called -MODULEBASE_EXPORT void selectionInfo(Handle_AIS_InteractiveContext& theContext, - const std::string& thePrefix); +//#endif /// Converts string value (name of shape type) to shape enum value /// \param theType - string with shape type name diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index 15d4e4b78..d7f38e04d 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -288,7 +288,6 @@ bool XGUI_Displayer::erase(ObjectPtr theObject, const bool theUpdateViewer) #ifdef VINSPECTOR if (myContextCallBack) myContextCallBack->Remove(anAIS); #endif - ModuleBase_Tools::selectionInfo(aContext, "XGUI_Displayer::erase -- Remove"); aErased = true; } } @@ -379,7 +378,6 @@ bool XGUI_Displayer::redisplay(ObjectPtr theObject, bool theUpdateViewer) #ifdef VINSPECTOR if (myContextCallBack) myContextCallBack->Redisplay(aAISIO); #endif - ModuleBase_Tools::selectionInfo(aContext, "XGUI_Displayer::redisplay -- Redisplay"); if (aNeedToRestoreSelection) myWorkshop->module()->restoreSelection(); @@ -428,8 +426,6 @@ void XGUI_Displayer::deactivate(ObjectPtr theObject, const bool theUpdateViewer) #ifdef VINSPECTOR if (myContextCallBack) myContextCallBack->ClearOutdatedSelection(anAIS); #endif - ModuleBase_Tools::selectionInfo(aContext, - "XGUI_Displayer::deactivate -- ClearOutdatedSelection"); if (theUpdateViewer) updateViewer(); } @@ -707,8 +703,6 @@ void XGUI_Displayer::setSelected(const QList& theValue } } } - ModuleBase_Tools::selectionInfo(aContext, - "XGUI_Displayer::setSelected -- AddOrRemoveSelected/UnhilightCurrents(no local context)"); if (theUpdateViewer) updateViewer(); } @@ -746,7 +740,6 @@ bool XGUI_Displayer::eraseAll(const bool theUpdateViewer) if (theUpdateViewer) updateViewer(); } - ModuleBase_Tools::selectionInfo(aContext, "XGUI_Displayer::eraseAll -- Remove"); myResult2AISObjectMap.clear(); #ifdef DEBUG_DISPLAY qDebug("eraseAll"); @@ -767,7 +760,6 @@ void deactivateObject(Handle(AIS_InteractiveContext) theContext, #ifdef VINSPECTOR if (theCallBack) theCallBack->Deactivate(theObject); #endif - ModuleBase_Tools::selectionInfo(theContext, "XGUI_Displayer::deactivateObject -- Deactivate"); //if (theClear) { //theObject->ClearSelected(); // theContext->LocalContext()->ClearOutdatedSelection(theObject, true); @@ -1023,7 +1015,6 @@ void XGUI_Displayer::activateAIS(const Handle(AIS_InteractiveObject)& theIO, "edge-selection-sensitivity", 2); aContext->SetSelectionSensitivity(theIO, theMode, aPrecision); } - ModuleBase_Tools::selectionInfo(aContext, "XGUI_Displayer::activateAIS -- Activate"); #ifdef DEBUG_ACTIVATE_AIS ObjectPtr anObject = getObject(theIO); @@ -1053,7 +1044,6 @@ void XGUI_Displayer::deactivateAIS(const Handle(AIS_InteractiveObject)& theIO, if (myContextCallBack) myContextCallBack->Deactivate(theIO, theMode); #endif } - ModuleBase_Tools::selectionInfo(aContext, "XGUI_Displayer::deactivateAIS -- Deactivate"); #ifdef DEBUG_DEACTIVATE_AIS ObjectPtr anObject = getObject(theIO); @@ -1135,7 +1125,6 @@ bool XGUI_Displayer::eraseAIS(AISObjectPtr theAIS, const bool theUpdateViewer) #ifdef VINSPECTOR if (myContextCallBack) myContextCallBack->Remove(anAISIO); #endif - ModuleBase_Tools::selectionInfo(aContext, "XGUI_Displayer::eraseAIS -- Remove"); aErased = true; } } @@ -1341,8 +1330,6 @@ bool XGUI_Displayer::activate(const Handle(AIS_InteractiveObject)& theIO, #ifdef VINSPECTOR if (myContextCallBack) myContextCallBack->ClearOutdatedSelection(theIO); #endif - ModuleBase_Tools::selectionInfo(aContext, - "XGUI_Displayer::activate -- ClearSelected/ClearOutdatedSelection"); // For performance issues //if (theUpdateViewer) // updateViewer(); diff --git a/src/XGUI/XGUI_SelectionMgr.cpp b/src/XGUI/XGUI_SelectionMgr.cpp index 894198d3d..d126f49ce 100755 --- a/src/XGUI/XGUI_SelectionMgr.cpp +++ b/src/XGUI/XGUI_SelectionMgr.cpp @@ -73,8 +73,6 @@ void XGUI_SelectionMgr::setSelectedOwners(const SelectMgr_IndexedMapOfOwner& the #endif } } - ModuleBase_Tools::selectionInfo(aContext, - "XGUI_SelectionMgr::setSelectedOwners -- AddOrRemoveSelected"); } //**************************************************************