| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 | /*=========================================================================  Library:   CTK  Copyright (c) Kitware Inc.   All rights reserved.  Distributed under a BSD License. See LICENSE.txt file.  This software is distributed "AS IS" WITHOUT ANY WARRANTY; without even  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the above copyright notice for more information.=========================================================================*/#ifndef __ctkCoordinatesWidget_h#define __ctkCoordinatesWidget_h// Qt includes#include <QWidget>// CTK includes#include "CTKWidgetsExport.h"class CTK_WIDGETS_EXPORT ctkCoordinatesWidget : public QWidget{  Q_OBJECT   Q_PROPERTY(int Dimension READ dimension WRITE setDimension)  Q_PROPERTY(double minimum READ minimum WRITE setMinimum)  Q_PROPERTY(double maximum READ maximum WRITE setMaximum)  Q_PROPERTY(double singleStep  READ singleStep WRITE setSingleStep STORED false)  Q_PROPERTY(QString coordinates READ coordinatesAsString WRITE setCoordinatesAsString)    public:  explicit ctkCoordinatesWidget(QWidget* parent = 0);  virtual ~ctkCoordinatesWidget();  ///   /// Set/Get the dimension of the point (3D by default)  void setDimension(int dim);  int dimension() const;  ///   /// Set/Get the single step of the QDoubleSpinBoxes   void setSingleStep(double step);  double singleStep() const;  ///   /// Set/Get the minimum value of the QDoubleSpinBoxes   void setMinimum(double minimum);  double minimum() const;  ///   /// Set/Get the maximum value of the QDoubleSpinBoxes   void setMaximum(double minimum);  double maximum() const;  ///   /// Set/Get the coordinates. Use commas between numbers  void setCoordinatesAsString(QString pos);  QString coordinatesAsString()const;  ///   /// Set/Get the coordinates  void setCoordinates(double* pos);  double* coordinates()const;signals:  void valueChanged(double* pos);protected slots:  void coordinateChanged(double);  void coordinatesChanged();protected:  void AddSpinBox();  double  Minimum;  double  Maximum;  double  SingleStep;  int     Dimension;  double* Coordinates;};#endif
 |