diff Framework/Scene2D/ColorSceneLayer.h @ 804:61ba4b504e9a

PolylineSceneLayer now has one color per chain
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 28 May 2019 15:58:21 +0200
parents f0008c55e5f7
children 2d8ab34c8c91
line wrap: on
line diff
--- a/Framework/Scene2D/ColorSceneLayer.h	Tue May 28 14:18:46 2019 +0200
+++ b/Framework/Scene2D/ColorSceneLayer.h	Tue May 28 15:58:21 2019 +0200
@@ -22,18 +22,17 @@
 #pragma once
 
 #include "ISceneLayer.h"
-#include <Core/Enumerations.h>
+#include "Color.h"
 
-#include <stdint.h>
+#include <Core/Enumerations.h>  // For ORTHANC_OVERRIDE
 
 namespace OrthancStone
 {
+  // TODO - Is this needed?
   class ColorSceneLayer : public ISceneLayer
   {
   private:
-    uint8_t  red_;
-    uint8_t  green_;
-    uint8_t  blue_;
+    Color    color_;
     uint64_t revision_;
 
   protected:
@@ -45,9 +44,6 @@
 
   public:
     ColorSceneLayer() :
-      red_(255),
-      green_(255),
-      blue_(255),
       revision_(0)
     {
     }
@@ -61,40 +57,19 @@
                   uint8_t green,
                   uint8_t blue)
     {
-      red_ = red;
-      green_ = green;
-      blue_ = blue;
+      color_ = Color(red, green, blue);
       BumpRevision();
     }
 
-    uint8_t GetRed() const
+    void SetColor(const Color& color)
     {
-      return red_;
-    }
-
-    uint8_t GetGreen() const
-    {
-      return green_;
+      color_ = color;
+      BumpRevision();
     }
 
-    uint8_t GetBlue() const
-    {
-      return blue_;
-    }
-
-    float GetRedAsFloat() const
+    const Color& GetColor() const
     {
-      return static_cast<float>(red_) / 255.0f;
-    }
-
-    float GetGreenAsFloat() const
-    {
-      return static_cast<float>(green_) / 255.0f;
-    }
-
-    float GetBlueAsFloat() const
-    {
-      return static_cast<float>(blue_) / 255.0f;
+      return color_;
     }
   };
 }