changeset 738:8e31b174ab26

removing using namespace
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 22 May 2019 08:54:38 +0200
parents 4d69256d2a46
children be9c1530d40a
files Framework/Scene2DViewport/CreateAngleMeasureTracker.cpp Framework/Scene2DViewport/CreateLineMeasureTracker.cpp Framework/Scene2DViewport/MeasureTools.cpp Framework/Scene2DViewport/MeasureTrackers.cpp Framework/Scene2DViewport/OneGesturePointerTracker.cpp Framework/Scene2DViewport/ViewportController.cpp Framework/StoneException.h Framework/Toolbox/DicomStructureSet.cpp
diffstat 8 files changed, 34 insertions(+), 48 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/Scene2DViewport/CreateAngleMeasureTracker.cpp	Wed May 22 08:43:41 2019 +0200
+++ b/Framework/Scene2DViewport/CreateAngleMeasureTracker.cpp	Wed May 22 08:54:38 2019 +0200
@@ -21,8 +21,6 @@
 #include "CreateAngleMeasureTracker.h"
 #include <Core/OrthancException.h>
 
-using namespace Orthanc;
-
 namespace OrthancStone
 {
   CreateAngleMeasureTracker::CreateAngleMeasureTracker(
@@ -49,7 +47,7 @@
 
     if (!alive_)
     {
-      throw OrthancException(ErrorCode_InternalError,
+      throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError,
         "Internal error: wrong state in CreateAngleMeasureTracker::"
         "PointerMove: active_ == false");
     }
@@ -66,7 +64,7 @@
       GetCommand()->SetSide2End(scenePos);
       break;
     default:
-      throw OrthancException(ErrorCode_InternalError,
+      throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError,
         "Wrong state in CreateAngleMeasureTracker::"
         "PointerMove: state_ invalid");
     }
@@ -88,12 +86,12 @@
       state_ = CreatingSide2;
       break;
     case CreatingSide2:
-      throw OrthancException(ErrorCode_InternalError,
+      throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError,
         "Wrong state in CreateAngleMeasureTracker::"
         "PointerUp: state_ == CreatingSide2 ; this should not happen");
       break;
     default:
-      throw OrthancException(ErrorCode_InternalError,
+      throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError,
         "Wrong state in CreateAngleMeasureTracker::"
         "PointerMove: state_ invalid");
     }
@@ -104,7 +102,7 @@
     switch (state_)
     {
     case CreatingSide1:
-      throw OrthancException(ErrorCode_InternalError,
+      throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError,
         "Wrong state in CreateAngleMeasureTracker::"
         "PointerDown: state_ == CreatingSide1 ; this should not happen");
       break;
@@ -113,7 +111,7 @@
       alive_ = false;
       break;
     default:
-      throw OrthancException(ErrorCode_InternalError,
+      throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError,
         "Wrong state in CreateAngleMeasureTracker::"
         "PointerMove: state_ invalid");
     }
--- a/Framework/Scene2DViewport/CreateLineMeasureTracker.cpp	Wed May 22 08:43:41 2019 +0200
+++ b/Framework/Scene2DViewport/CreateLineMeasureTracker.cpp	Wed May 22 08:54:38 2019 +0200
@@ -21,8 +21,6 @@
 #include "CreateLineMeasureTracker.h"
 #include <Core/OrthancException.h>
 
-using namespace Orthanc;
-
 namespace OrthancStone
 {
   CreateLineMeasureTracker::CreateLineMeasureTracker(
@@ -49,7 +47,7 @@
     
     if (!alive_)
     {
-      throw OrthancException(ErrorCode_InternalError,
+      throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError,
         "Internal error: wrong state in CreateLineMeasureTracker::"
         "PointerMove: active_ == false");
     }
--- a/Framework/Scene2DViewport/MeasureTools.cpp	Wed May 22 08:43:41 2019 +0200
+++ b/Framework/Scene2DViewport/MeasureTools.cpp	Wed May 22 08:54:38 2019 +0200
@@ -26,8 +26,6 @@
 
 #include <boost/math/constants/constants.hpp>
 
-using namespace Orthanc;
-
 namespace OrthancStone
 {
 
@@ -58,7 +56,7 @@
   {
     ViewportControllerPtr controller = controllerW_.lock();
     if (!controller)
-      throw OrthancException(ErrorCode_InternalError, 
+      throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, 
         "Using dead ViewportController object!");
     return controller;
   }
--- a/Framework/Scene2DViewport/MeasureTrackers.cpp	Wed May 22 08:43:41 2019 +0200
+++ b/Framework/Scene2DViewport/MeasureTrackers.cpp	Wed May 22 08:54:38 2019 +0200
@@ -21,8 +21,6 @@
 #include "MeasureTrackers.h"
 #include <Core/OrthancException.h>
 
-using namespace Orthanc;
-
 namespace OrthancStone
 {
 
--- a/Framework/Scene2DViewport/OneGesturePointerTracker.cpp	Wed May 22 08:43:41 2019 +0200
+++ b/Framework/Scene2DViewport/OneGesturePointerTracker.cpp	Wed May 22 08:54:38 2019 +0200
@@ -25,8 +25,6 @@
 
 #include "../StoneException.h"
 
-using namespace Orthanc;
-
 namespace OrthancStone
 {
   OneGesturePointerTracker::OneGesturePointerTracker(
--- a/Framework/Scene2DViewport/ViewportController.cpp	Wed May 22 08:43:41 2019 +0200
+++ b/Framework/Scene2DViewport/ViewportController.cpp	Wed May 22 08:54:38 2019 +0200
@@ -25,8 +25,6 @@
 
 #include <boost/make_shared.hpp>
 
-using namespace Orthanc;
-
 namespace OrthancStone
 {
   ViewportController::ViewportController(MessageBroker& broker)
--- a/Framework/StoneException.h	Wed May 22 08:43:41 2019 +0200
+++ b/Framework/StoneException.h	Wed May 22 08:54:38 2019 +0200
@@ -120,6 +120,6 @@
       std::stringstream sst; \
       sst << "Assertion failed. Condition = \"" #cond "\" Message = \"" << streamChainMessage << "\""; \
       std::string sstr = sst.str(); \
-      throw OrthancException(ErrorCode_InternalError,sstr.c_str()); \
+      throw ::Orthanc::OrthancException(::Orthanc::ErrorCode_InternalError,sstr.c_str()); \
     } else (void)0
 
--- a/Framework/Toolbox/DicomStructureSet.cpp	Wed May 22 08:43:41 2019 +0200
+++ b/Framework/Toolbox/DicomStructureSet.cpp	Wed May 22 08:54:38 2019 +0200
@@ -367,9 +367,7 @@
 
   DicomStructureSet::DicomStructureSet(const OrthancPlugins::FullOrthancDataset& tags)
   {
-    using namespace OrthancPlugins;
-
-    DicomDatasetReader reader(tags);
+    OrthancPlugins::DicomDatasetReader reader(tags);
     
     size_t count, tmp;
     if (!tags.GetSequenceSize(count, DICOM_TAG_RT_ROI_OBSERVATIONS_SEQUENCE) ||
@@ -385,18 +383,18 @@
     for (size_t i = 0; i < count; i++)
     {
       structures_[i].interpretation_ = reader.GetStringValue
-        (DicomPath(DICOM_TAG_RT_ROI_OBSERVATIONS_SEQUENCE, i,
-                   DICOM_TAG_RT_ROI_INTERPRETED_TYPE),
+        (OrthancPlugins::DicomPath(DICOM_TAG_RT_ROI_OBSERVATIONS_SEQUENCE, i,
+                                   DICOM_TAG_RT_ROI_INTERPRETED_TYPE),
          "No interpretation");
 
       structures_[i].name_ = reader.GetStringValue
-        (DicomPath(DICOM_TAG_STRUCTURE_SET_ROI_SEQUENCE, i,
-                   DICOM_TAG_ROI_NAME),
+        (OrthancPlugins::DicomPath(DICOM_TAG_STRUCTURE_SET_ROI_SEQUENCE, i,
+                                   DICOM_TAG_ROI_NAME),
          "No interpretation");
 
       Vector color;
-      if (ParseVector(color, tags, DicomPath(DICOM_TAG_ROI_CONTOUR_SEQUENCE, i,
-                                             DICOM_TAG_ROI_DISPLAY_COLOR)) &&
+      if (ParseVector(color, tags, OrthancPlugins::DicomPath(DICOM_TAG_ROI_CONTOUR_SEQUENCE, i,
+                                                             DICOM_TAG_ROI_DISPLAY_COLOR)) &&
           color.size() == 3)
       {
         structures_[i].red_ = ConvertColor(color[0]);
@@ -411,8 +409,8 @@
       }
 
       size_t countSlices;
-      if (!tags.GetSequenceSize(countSlices, DicomPath(DICOM_TAG_ROI_CONTOUR_SEQUENCE, i,
-                                                       DICOM_TAG_CONTOUR_SEQUENCE)))
+      if (!tags.GetSequenceSize(countSlices, OrthancPlugins::DicomPath(DICOM_TAG_ROI_CONTOUR_SEQUENCE, i,
+                                                                       DICOM_TAG_CONTOUR_SEQUENCE)))
       {
         countSlices = 0;
       }
@@ -429,9 +427,9 @@
         unsigned int countPoints;
 
         if (!reader.GetUnsignedIntegerValue
-            (countPoints, DicomPath(DICOM_TAG_ROI_CONTOUR_SEQUENCE, i,
-                                    DICOM_TAG_CONTOUR_SEQUENCE, j,
-                                    DICOM_TAG_NUMBER_OF_CONTOUR_POINTS)))
+            (countPoints, OrthancPlugins::DicomPath(DICOM_TAG_ROI_CONTOUR_SEQUENCE, i,
+                                                    DICOM_TAG_CONTOUR_SEQUENCE, j,
+                                                    DICOM_TAG_NUMBER_OF_CONTOUR_POINTS)))
         {
           throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat);
         }
@@ -439,9 +437,9 @@
         //LOG(INFO) << "Parsing slice containing " << countPoints << " vertices";
 
         std::string type = reader.GetMandatoryStringValue
-          (DicomPath(DICOM_TAG_ROI_CONTOUR_SEQUENCE, i,
-                     DICOM_TAG_CONTOUR_SEQUENCE, j,
-                     DICOM_TAG_CONTOUR_GEOMETRIC_TYPE));
+          (OrthancPlugins::DicomPath(DICOM_TAG_ROI_CONTOUR_SEQUENCE, i,
+                                     DICOM_TAG_CONTOUR_SEQUENCE, j,
+                                     DICOM_TAG_CONTOUR_GEOMETRIC_TYPE));
         if (type != "CLOSED_PLANAR")
         {
           LOG(WARNING) << "Ignoring contour with geometry type: " << type;
@@ -449,24 +447,24 @@
         }
 
         size_t size;
-        if (!tags.GetSequenceSize(size, DicomPath(DICOM_TAG_ROI_CONTOUR_SEQUENCE, i,
-                                                  DICOM_TAG_CONTOUR_SEQUENCE, j,
-                                                  DICOM_TAG_CONTOUR_IMAGE_SEQUENCE)) ||
+        if (!tags.GetSequenceSize(size, OrthancPlugins::DicomPath(DICOM_TAG_ROI_CONTOUR_SEQUENCE, i,
+                                                                  DICOM_TAG_CONTOUR_SEQUENCE, j,
+                                                                  DICOM_TAG_CONTOUR_IMAGE_SEQUENCE)) ||
             size != 1)
         {
           throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented);          
         }
 
         std::string sopInstanceUid = reader.GetMandatoryStringValue
-          (DicomPath(DICOM_TAG_ROI_CONTOUR_SEQUENCE, i,
-                     DICOM_TAG_CONTOUR_SEQUENCE, j,
-                     DICOM_TAG_CONTOUR_IMAGE_SEQUENCE, 0,
-                     DICOM_TAG_REFERENCED_SOP_INSTANCE_UID));
+          (OrthancPlugins::DicomPath(DICOM_TAG_ROI_CONTOUR_SEQUENCE, i,
+                                     DICOM_TAG_CONTOUR_SEQUENCE, j,
+                                     DICOM_TAG_CONTOUR_IMAGE_SEQUENCE, 0,
+                                     DICOM_TAG_REFERENCED_SOP_INSTANCE_UID));
         
         std::string slicesData = reader.GetMandatoryStringValue
-          (DicomPath(DICOM_TAG_ROI_CONTOUR_SEQUENCE, i,
-                     DICOM_TAG_CONTOUR_SEQUENCE, j,
-                     DICOM_TAG_CONTOUR_DATA));
+          (OrthancPlugins::DicomPath(DICOM_TAG_ROI_CONTOUR_SEQUENCE, i,
+                                     DICOM_TAG_CONTOUR_SEQUENCE, j,
+                                     DICOM_TAG_CONTOUR_DATA));
 
         Vector points;
         if (!LinearAlgebra::ParseVector(points, slicesData) ||