From 4bf4215c643280688f98cfbe545daf837d7bda1f Mon Sep 17 00:00:00 2001 From: nds Date: Mon, 12 Dec 2016 13:30:56 +0300 Subject: [PATCH] Cover debug information with _DEBUG definition. --- src/ModelGeomAlgo/ModelGeomAlgo_Point2D.cpp | 3 ++- src/ModelGeomAlgo/ModelGeomAlgo_Point2D.h | 2 ++ src/ModuleBase/ModuleBase_Tools.cpp | 2 ++ src/ModuleBase/ModuleBase_Tools.h | 4 ++-- src/PartSet/PartSet_OverconstraintListener.cpp | 2 ++ src/PartSet/PartSet_OverconstraintListener.h | 2 ++ src/SketchPlugin/SketchPlugin_ConstraintSplit.cpp | 4 ++-- src/SketchPlugin/SketchPlugin_ConstraintSplit.h | 2 ++ src/XGUI/XGUI_Displayer.cpp | 2 ++ src/XGUI/XGUI_Displayer.h | 2 ++ 10 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.cpp b/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.cpp index 0ee9df16e..f9fa6030d 100755 --- a/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.cpp +++ b/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.cpp @@ -175,6 +175,7 @@ namespace ModelGeomAlgo_Point2D { return aValueStr; } +#ifdef _DEBUG std::string getPontAttributesInfo(const std::shared_ptr& theFeature, const std::set >& theAttributesOnly) { @@ -214,5 +215,5 @@ namespace ModelGeomAlgo_Point2D { return anInfo; } - +#endif } // namespace ModelGeomAlgo_Point2D diff --git a/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.h b/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.h index ab445624b..d8fd556c4 100755 --- a/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.h +++ b/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.h @@ -82,6 +82,7 @@ namespace ModelGeomAlgo_Point2D { const std::shared_ptr& thePoint, std::shared_ptr& theProjectedPoint); +#ifdef _DEBUG /// Return feature name, kind and point values united in a string info /// \param theFeature an investigated feature /// \param theAttributesOnly a container of necessary attributes, if empty, all @@ -96,6 +97,7 @@ namespace ModelGeomAlgo_Point2D { MODELGEOMALGO_EXPORT std::string getPointAttributeInfo( const std::shared_ptr& theAttribute); +#endif } #endif diff --git a/src/ModuleBase/ModuleBase_Tools.cpp b/src/ModuleBase/ModuleBase_Tools.cpp index 0114238db..8a671f0bb 100755 --- a/src/ModuleBase/ModuleBase_Tools.cpp +++ b/src/ModuleBase/ModuleBase_Tools.cpp @@ -266,6 +266,7 @@ QAction* createAction(const QIcon& theIcon, const QString& theText, return anAction; } +#ifdef _DEBUG QString objectInfo(const ObjectPtr& theObj, const bool isUseAttributesInfo) { QString aFeatureStr = "feature"; @@ -309,6 +310,7 @@ QString objectInfo(const ObjectPtr& theObj, const bool isUseAttributesInfo) return aFeatureStr; } +#endif typedef QMap ShapeTypes; static ShapeTypes myShapeTypes; diff --git a/src/ModuleBase/ModuleBase_Tools.h b/src/ModuleBase/ModuleBase_Tools.h index fedc9d206..5b4610878 100755 --- a/src/ModuleBase/ModuleBase_Tools.h +++ b/src/ModuleBase/ModuleBase_Tools.h @@ -133,14 +133,14 @@ MODULEBASE_EXPORT QAction* createAction(const QIcon& theIcon, const QString& the const QString& theToolTip = QString(), const QString& theStatusTip = QString()); -//#ifdef _DEBUG +#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); -//#endif +#endif /// Converts string value (name of shape type) to shape enum value /// \param theType - string with shape type name diff --git a/src/PartSet/PartSet_OverconstraintListener.cpp b/src/PartSet/PartSet_OverconstraintListener.cpp index ba05d9bd7..0d8417d63 100755 --- a/src/PartSet/PartSet_OverconstraintListener.cpp +++ b/src/PartSet/PartSet_OverconstraintListener.cpp @@ -170,6 +170,7 @@ XGUI_Workshop* PartSet_OverconstraintListener::workshop() const return aConnector->workshop(); } +#ifdef _DEBUG QString PartSet_OverconstraintListener::getObjectsInfo(const std::set& theObjects) { std::set::const_iterator anIt = theObjects.begin(), @@ -180,3 +181,4 @@ QString PartSet_OverconstraintListener::getObjectsInfo(const std::set return anInfo.join(";\n"); } +#endif diff --git a/src/PartSet/PartSet_OverconstraintListener.h b/src/PartSet/PartSet_OverconstraintListener.h index dd7df2002..1f0e8f01c 100755 --- a/src/PartSet/PartSet_OverconstraintListener.h +++ b/src/PartSet/PartSet_OverconstraintListener.h @@ -69,10 +69,12 @@ private: /// Returns workshop XGUI_Workshop* workshop() const; +#ifdef _DEBUG /// Unite objects in one string information /// \param theObjects a list of objects /// \return a string info static QString getObjectsInfo(const std::set& theObjects); +#endif private: std::set myConflictingObjects; diff --git a/src/SketchPlugin/SketchPlugin_ConstraintSplit.cpp b/src/SketchPlugin/SketchPlugin_ConstraintSplit.cpp index e0b26898b..ccf819ab6 100755 --- a/src/SketchPlugin/SketchPlugin_ConstraintSplit.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintSplit.cpp @@ -1304,7 +1304,7 @@ std::set > SketchPlugin_ConstraintSplit::get return anAttributes; } - +#ifdef _DEBUG std::string SketchPlugin_ConstraintSplit::getFeatureInfo( const std::shared_ptr& theFeature, const bool isUseAttributesInfo) @@ -1365,4 +1365,4 @@ std::string SketchPlugin_ConstraintSplit::getFeatureInfo( } return anInfo; } - +#endif diff --git a/src/SketchPlugin/SketchPlugin_ConstraintSplit.h b/src/SketchPlugin/SketchPlugin_ConstraintSplit.h index b6c13e3e1..bf5fcc2dd 100755 --- a/src/SketchPlugin/SketchPlugin_ConstraintSplit.h +++ b/src/SketchPlugin/SketchPlugin_ConstraintSplit.h @@ -282,11 +282,13 @@ private: std::set > getEdgeAttributes( const std::shared_ptr& theFeature); +#ifdef _DEBUG /// Return feature name, kind, point attribute values united in a string /// \param theFeature an investigated feature /// \return string value std::string getFeatureInfo(const std::shared_ptr& theFeature, const bool isUseAttributesInfo = true); +#endif }; #endif diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index d7f38e04d..a6063a2d3 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -1419,6 +1419,7 @@ void XGUI_Displayer::appendResultObject(ObjectPtr theObject, AISObjectPtr theAIS #endif } +#ifdef _DEBUG std::string XGUI_Displayer::getResult2AISObjectMapInfo() const { QStringList aContent; @@ -1434,6 +1435,7 @@ std::string XGUI_Displayer::getResult2AISObjectMapInfo() const return QString("myResult2AISObjectMap: size = %1\n%2\n").arg(myResult2AISObjectMap.size()). arg(aContent.join("\n")).toStdString().c_str(); } +#endif void XGUI_Displayer::getPresentations(const ObjectPtr& theObject, NCollection_Map& thePresentations) diff --git a/src/XGUI/XGUI_Displayer.h b/src/XGUI/XGUI_Displayer.h index 8ff49c78b..2325de48b 100644 --- a/src/XGUI/XGUI_Displayer.h +++ b/src/XGUI/XGUI_Displayer.h @@ -335,9 +335,11 @@ private: /// \param theAIS AIOS object to display void appendResultObject(ObjectPtr theObject, AISObjectPtr theAIS); +#ifdef _DEBUG /// Returns an information about alredy displayed objects /// \return a string representation std::string getResult2AISObjectMapInfo() const; +#endif /// Returns container of visible presentations for the object. For a feature object, /// the feature results are processed also. The presentations map is not cleared inside. -- 2.39.2