1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- /*=========================================================================
- Library: CTK
-
- Copyright (c) 2010 Kitware Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
- http://www.commontk.org/LICENSE
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- =========================================================================*/
- #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
|