[opengtl-commits] [544] support for rgba colors

[ Thread Index | Date Index | More lists.tuxfamily.org/opengtl-commits Archives ]


Revision: 544
Author:   cyrille
Date:     2008-12-18 22:36:31 +0100 (Thu, 18 Dec 2008)

Log Message:
-----------
support for rgba colors

Modified Paths:
--------------
    trunk/OpenGTL/OpenGTL/GTLCore/Metadata/ParameterEntry.cpp
    trunk/OpenGTL/OpenGTL/GTLCore/Metadata/ParameterEntry.h


Modified: trunk/OpenGTL/OpenGTL/GTLCore/Metadata/ParameterEntry.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/Metadata/ParameterEntry.cpp	2008-12-16 23:11:29 UTC (rev 543)
+++ trunk/OpenGTL/OpenGTL/GTLCore/Metadata/ParameterEntry.cpp	2008-12-18 21:36:31 UTC (rev 544)
@@ -65,6 +65,10 @@
       d->type = TypesManager::getVector( Type::Float, 3 );
       d->widgetType = RgbColorWidget;
       widgetTypeSet = true;
+    } else if( v->text() == "rgba" ) {
+      d->type = TypesManager::getVector( Type::Float, 4 );
+      d->widgetType = RgbaColorWidget;
+      widgetTypeSet = true;
     }
   }
   // DefaultValue
@@ -167,8 +171,15 @@
         d->widgetType = CurveWidget;
         break;
       case Type::VECTOR:
-        d->widgetType = RgbColorWidget;
-        break;
+        if( d->type->vectorSize() == 3 )
+        {
+          d->widgetType = RgbColorWidget;
+          break;
+        } else if( d->type->vectorSize() == 4 )
+        {
+          d->widgetType = RgbaColorWidget;
+          break;
+        }
       default:
         GTL_ABORT("Unsupported datatype");
     }

Modified: trunk/OpenGTL/OpenGTL/GTLCore/Metadata/ParameterEntry.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/Metadata/ParameterEntry.h	2008-12-16 23:11:29 UTC (rev 543)
+++ trunk/OpenGTL/OpenGTL/GTLCore/Metadata/ParameterEntry.h	2008-12-18 21:36:31 UTC (rev 544)
@@ -36,7 +36,7 @@
         virtual ~ParameterEntry();
       public:
         enum WidgetType {
-          IntegerWidget, FloatWidget, CurveWidget, RgbColorWidget
+          IntegerWidget, FloatWidget, CurveWidget, RgbColorWidget, RgbaColorWidget
         };
       public:
         const Value& minimumValue() const;


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/