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 
00034 class CTK_WIDGETS_EXPORT ctkCoordinatesWidget : public QWidget
00035 {
00036   Q_OBJECT 
00037   Q_PROPERTY(int Dimension READ dimension WRITE setDimension)
00038   Q_PROPERTY(double minimum READ minimum WRITE setMinimum)
00039   Q_PROPERTY(double maximum READ maximum WRITE setMaximum)
00040   Q_PROPERTY(double singleStep  READ singleStep WRITE setSingleStep STORED false)
00041   Q_PROPERTY(QString coordinates READ coordinatesAsString WRITE setCoordinatesAsString)
00042     
00043 public:
00044   explicit ctkCoordinatesWidget(QWidget* parent = 0);
00045   virtual ~ctkCoordinatesWidget();
00046 
00049   void setDimension(int dim);
00050   int dimension() const;
00051 
00054   void setSingleStep(double step);
00055   double singleStep() const;
00056 
00059   void setMinimum(double minimum);
00060   double minimum() const;
00061 
00064   void setMaximum(double minimum);
00065   double maximum() const;
00066 
00069   void setCoordinatesAsString(QString pos);
00070   QString coordinatesAsString()const;
00071 
00074   void setCoordinates(double* pos);
00075   double* coordinates()const;
00076 
00077 signals:
00080   void valueChanged(double* pos);
00081 
00082 protected slots:
00083   void coordinateChanged(double);
00084   void coordinatesChanged();
00085 
00086 protected:
00087   void addSpinBox();
00088 
00089   double  Minimum;
00090   double  Maximum;
00091   double  SingleStep;
00092   int     Dimension;
00093   double* Coordinates;
00094 };
00095 
00096 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated on 21 May 2010 for CTK by  doxygen 1.6.1