From 56c06e01c22c9f2a4237c57c78bccabb073fbe72 Mon Sep 17 00:00:00 2001 From: Martin Heistermann Date: Mon, 30 Mar 2020 10:29:35 +0200 Subject: [PATCH] Fix ODR violations by using VSI namespace. There is some copied code here (and other files in that folder) that causes ODR violations: OpenFlipper/publicWidgets/objectSelectionWidget/SelectionObjectMarker.cc Plugin-VSI/types/objectId/SelectionObjectMarker.cc --- types/objectId/SelectionObjectMarker.cc | 7 +++++-- types/objectId/SelectionObjectMarker.hh | 3 +++ types/objectId/TreeModel.cc | 4 ++++ types/objectId/TreeModel.hh | 4 ++++ types/objectId/objectIdWidget.hh | 3 ++- types/objectId/objectPickDialog.hh | 3 ++- 6 files changed, 20 insertions(+), 4 deletions(-) diff --git a/types/objectId/SelectionObjectMarker.cc b/types/objectId/SelectionObjectMarker.cc index b0c31d6..b0bac43 100644 --- a/types/objectId/SelectionObjectMarker.cc +++ b/types/objectId/SelectionObjectMarker.cc @@ -43,11 +43,13 @@ #include #include "SelectionObjectMarker.hh" + +namespace VSI { //****************************************************************************** -const ACG::Vec4f disabled_color (0.4f,0.4f,0.4f,1.0f); -const ACG::Vec4f selected_color (0.0f,1.0f,0.0f,0.5f); +static const ACG::Vec4f disabled_color (0.4f,0.4f,0.4f,1.0f); +static const ACG::Vec4f selected_color (0.0f,1.0f,0.0f,0.5f); //****************************************************************************** @@ -87,3 +89,4 @@ bool SelectionObjectMarker::blendForStencilRefNumber(GLuint _reference, GLenum & return false; } +} // namespace VSI diff --git a/types/objectId/SelectionObjectMarker.hh b/types/objectId/SelectionObjectMarker.hh index b0ec940..ea76406 100644 --- a/types/objectId/SelectionObjectMarker.hh +++ b/types/objectId/SelectionObjectMarker.hh @@ -48,6 +48,7 @@ #include #include +namespace VSI { /** Object marker to visualize objectPickDialog selection */ class SelectionObjectMarker : public ViewObjectMarker @@ -59,4 +60,6 @@ class SelectionObjectMarker : public ViewObjectMarker bool blendForStencilRefNumber (GLuint _reference, GLenum &_src, GLenum &_dst, ACG::Vec4f &_color); }; +} // namespce VSI + #endif diff --git a/types/objectId/TreeModel.cc b/types/objectId/TreeModel.cc index 869bb97..2d46246 100644 --- a/types/objectId/TreeModel.cc +++ b/types/objectId/TreeModel.cc @@ -51,6 +51,7 @@ #include +namespace VSI { //****************************************************************************** @@ -594,3 +595,6 @@ bool TreeModel::setData(const QModelIndex &_index, const QVariant &_value, int / bool TreeModel::isRoot(TreeItem * _item) { return ( _item == rootItem_ ); } + + +} // namespace VSI diff --git a/types/objectId/TreeModel.hh b/types/objectId/TreeModel.hh index b531c76..31de56a 100644 --- a/types/objectId/TreeModel.hh +++ b/types/objectId/TreeModel.hh @@ -50,6 +50,8 @@ #include "TreeItem.hh" +namespace VSI { + class TreeModel : public QAbstractItemModel { Q_OBJECT @@ -169,5 +171,7 @@ private: }; +} // namespace VSI + #endif diff --git a/types/objectId/objectIdWidget.hh b/types/objectId/objectIdWidget.hh index 69927c9..0b6024a 100644 --- a/types/objectId/objectIdWidget.hh +++ b/types/objectId/objectIdWidget.hh @@ -50,11 +50,12 @@ //== FORWARDDECLARATIONS ====================================================== class QComboBox; class QPushButton; -class TreeModel; //== NAMESPACES =============================================================== namespace VSI { +class TreeModel; + //== CLASS DEFINITION ========================================================= /** Widget to configure object id inputs diff --git a/types/objectId/objectPickDialog.hh b/types/objectId/objectPickDialog.hh index 8cba264..6410a6e 100644 --- a/types/objectId/objectPickDialog.hh +++ b/types/objectId/objectPickDialog.hh @@ -55,13 +55,14 @@ class QPushButton; class QTreeView; class QMouseEvent; -class TreeModel; class SimpleViewer; //== NAMESPACES =============================================================== namespace VSI { +class TreeModel; + //== CLASS DEFINITION ========================================================= /** Widget to pick a object -- GitLab