00001 #ifndef IGUANA_GL_BROWSERS_IG_3DVECTOR_BASE_CONTROL_H
00002 # define IGUANA_GL_BROWSERS_IG_3DVECTOR_BASE_CONTROL_H
00003
00004
00005
00006 # include "Iguana/GLBrowsers/interface/Ig3DFieldControl.h"
00007 # include <vector>
00008
00009
00010
00011
00012
00013 class IgQtRangeControlFloat;
00014 class QPixmap;
00015 class IgQtAxisAlignment;
00016
00017
00018
00019
00020
00021 class IGUANA_GL_BROWSERS_API Ig3DVectorBaseControl : public Ig3DFieldControl
00022 {
00023 Q_OBJECT
00024 public:
00025 enum Style {
00026 RotationStyle,
00027 DirectionStyle,
00028 PositionStyle,
00029 PositionWOAStyle,
00030 Vector
00031 };
00032
00033 Ig3DVectorBaseControl (IgControlCategory *pane,
00034 QString label,
00035 Style style,
00036 unsigned int size,
00037 const QString &colSepLabels);
00038
00039
00040
00041
00042
00043 float value (unsigned int index) const;
00044 std::vector<float> values (void) const;
00045
00046 bool isChanged (void) const;
00047 float change (unsigned int index) const;
00048 std::vector<float> changes (void) const;
00049
00050
00051 float minAxisAlign (void) const;
00052 float maxAxisAlign (void) const;
00053 void setMinAxisAlign (float newval);
00054 void setMaxAxisAlign (float newval);
00055
00056
00057 IgQtRangeControlFloat * control (unsigned int index) const;
00058 std::vector<IgQtRangeControlFloat *> controls (void) const;
00059
00060 QString getSettingString (void) const;
00061 void setSettingString (QString &setting);
00062
00063 using IgControlItem::setDirty;
00064 public slots:
00065 virtual void setValues (const std::vector<float> &values);
00066 virtual void setValues (const float* values, unsigned int size);
00067 virtual void setValue (float value, unsigned int index);
00068 virtual void setDirty (bool value);
00069
00070 protected:
00071 virtual void updateValue (void);
00072 virtual void applyValue (void);
00073
00074 private slots:
00075 void alignToAxis (void);
00076 void syncSettings1 (void);
00077 void syncSettings2 (void);
00078
00079 private:
00080 enum Parts {
00081 RotatorButtonPart = 1,
00082 RotatorPart = 2,
00083 ValuePart = 4,
00084 AlignmentPart = 8,
00085 AllParts = (RotatorPart | RotatorButtonPart
00086 | ValuePart | AlignmentPart)
00087 };
00088
00089 void syncSettings (unsigned int start, unsigned int end);
00090 void makeControl (IgControlCategory *pane, QString label,
00091 int parts, int ctlparts,
00092 QPixmap npix, QPixmap ppix);
00093
00094 std::vector<IgQtRangeControlFloat*> m_controls;
00095 IgQtAxisAlignment *m_alignment;
00096 unsigned int m_offset;
00097 };
00098
00099
00100
00101
00102 #endif // IGUANA_GL_BROWSERS_IG_3DVECTOR_BASE_CONTROL_H