ctkCoordinatesWidget.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Library:   CTK
00004  
00005   Copyright (c) 2010  Kitware Inc.
00006 
00007   Licensed under the Apache License, Version 2.0 (the "License");
00008   you may not use this file except in compliance with the License.
00009   You may obtain a copy of the License at
00010 
00011       http://www.commontk.org/LICENSE
00012 
00013   Unless required by applicable law or agreed to in writing, software
00014   distributed under the License is distributed on an "AS IS" BASIS,
00015   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00016   See the License for the specific language governing permissions and
00017   limitations under the License.
00018  
00019 =========================================================================*/
00020 
00021 #ifndef __ctkCoordinatesWidget_h
00022 #define __ctkCoordinatesWidget_h
00023 
00024 // Qt includes
00025 #include <QWidget>
00026 
00027 // CTK includes
00028 #include "CTKWidgetsExport.h"
00029 
00030 class CTK_WIDGETS_EXPORT ctkCoordinatesWidget : public QWidget
00031 {
00032   Q_OBJECT 
00033   Q_PROPERTY(int Dimension READ dimension WRITE setDimension)
00034   Q_PROPERTY(double minimum READ minimum WRITE setMinimum)
00035   Q_PROPERTY(double maximum READ maximum WRITE setMaximum)
00036   Q_PROPERTY(double singleStep  READ singleStep WRITE setSingleStep STORED false)
00037   Q_PROPERTY(QString coordinates READ coordinatesAsString WRITE setCoordinatesAsString)
00038 
00039     
00040 public:
00041   explicit ctkCoordinatesWidget(QWidget* parent = 0);
00042   virtual ~ctkCoordinatesWidget();
00043 
00046   void setDimension(int dim);
00047   int dimension() const;
00048 
00051   void setSingleStep(double step);
00052   double singleStep() const;
00053 
00056   void setMinimum(double minimum);
00057   double minimum() const;
00058 
00061   void setMaximum(double minimum);
00062   double maximum() const;
00063 
00066   void setCoordinatesAsString(QString pos);
00067   QString coordinatesAsString()const;
00068 
00071   void setCoordinates(double* pos);
00072   double* coordinates()const;
00073 
00074 signals:
00075   void valueChanged(double* pos);
00076 
00077 protected slots:
00078   void coordinateChanged(double);
00079   void coordinatesChanged();
00080 
00081 protected:
00082   void AddSpinBox();
00083 
00084   double  Minimum;
00085   double  Maximum;
00086   double  SingleStep;
00087   int     Dimension;
00088   double* Coordinates;
00089 };
00090 
00091 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines