| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/drivers/qt/TeQtColorBar.h
Go to the documentation of this file.

    00001 /************************************************************************************
    00002 TerraLib - a library for developing GIS applications.
    00003 Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
    00004
    00005 This code is part of the TerraLib library.
    00006 This library is free software; you can redistribute it and/or
    00007 modify it under the terms of the GNU Lesser General Public
    00008 License as published by the Free Software Foundation; either
    00009 version 2.1 of the License, or (at your option) any later version.
    00010
    00011 You should have received a copy of the GNU Lesser General Public
    00012 License along with this library.
    00013
    00014 The authors reassure the license terms regarding the warranties.
    00015 They specifically disclaim any warranties, including, but not limited to,
    00016 the implied warranties of merchantability and fitness for a particular purpose.
    00017 The library provided hereunder is on an "as is" basis, and the authors have no
    00018 obligation to provide maintenance, support, updates, enhancements, or modifications.
    00019 In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
    00020 indirect, special, incidental, or consequential damages arising out of the use
    00021 of this library and its documentation.
    00022 *************************************************************************************/
    00023
    00024 #ifndef  __TERRALIB_INTERNAL_QTCOLORBAR_H
    00025 #define  __TERRALIB_INTERNAL_QTCOLORBAR_H
    00026
    00027 #include "../../kernel/TeVisual.h"
    00028 #include "../../utils/TeColorUtils.h"
    00029
    00030 #include <qframe.h>
    00031 #include <qpopupmenu.h>
    00032 #include <qcursor.h>
    00033 #include <vector>
    00034 #include <map>
    00035
    00036 #include "../../kernel/TeDefines.h"
    00037
    00038 using namespace std;
    00039
    00040 class Help;
    00041
    00042 //struct ColorBar {
    00043 //         TeColor icor_;
    00044 //         TeColor cor_;
    00045 //         double     distance_;
    00046 //};
    00047
    00048 class TL_DLL TeQtColorBar : public QFrame
    00049 {
    00050            Q_OBJECT
    00051
    00052 public:
    00053
    00054            TeQtColorBar( QWidget* parent, const char* name);
    00055            ~TeQtColorBar() {}
    00056            void       setColorBar(const vector<TeColor>& colorVec);
    00057            void       setColorBar(const vector<ColorBar>& colorBarVec);
    00058            void       setColorBarFromNames(string colors);
    00059            void       drawColorBar();
    00060            void       setVerticalBar(bool b);
    00061            void       setUpDownBar(bool b) {upDown_ = b;}
    00062            void       invertColorBar();
    00063            void       clearColorBar();
    00064            void       setEqualSpace();
    00065            vector<ColorBar>      getInputColorVec() {return inputColorVec_;}
    00066
    00067 public slots:
    00068
    00069            void       addColorSlot();
    00070            void       changeColorSlot();
    00071            void       removeColorSlot();
    00072            void       helpSlot();
    00073
    00074 protected:
    00075
    00076     void   paintEvent(QPaintEvent*);
    00077            void       mousePressEvent(QMouseEvent*);
    00078            void       mouseMoveEvent(QMouseEvent*);
    00079            void       mouseReleaseEvent(QMouseEvent*);
    00080            void       mouseDoubleClickEvent(QMouseEvent*);
    00081            void       leaveEvent(QEvent*);
    00082            void       resizeEvent(QResizeEvent*);
    00083            void       generateColorMap();
    00084            int                   getColorIndiceToChange();
    00085            void       fitMousePosition(QPoint);
    00086            void       changeDistance();
    00087            void       changeBrightness();
    00088            void       changeAllSaturation();
    00089            void       changeSaturation();
    00090            void       changeAllBrightness();
    00091            void       changeHue();
    00092            void       sortByDistance();
    00093            ColorBar* colorEdit_;
    00094 //         vector<TeColor>       getColors(TeColor, TeColor, int);
    00095
    00096            QPopupMenu popupMenu_;
    00097            QPoint     p_;
    00098            QPoint     pa_;
    00099            int                   a_;
    00100            int                   b_;
    00101            int                   ftam_;
    00102            int                   ind_;
    00103            vector<ColorBar> inputColorVec_;
    00104            vector<int> changeVec_;
    00105            map<int, vector<TeColor> > colorMap_;
    00106            bool       vertical_;
    00107            bool       upDown_;
    00108            bool       brightness_;
    00109            bool       change_;
    00110            bool       distance_;
    00111            int                   limit_, inf_, sup_;
    00112            double     totalDistance_;
    00113            Help*      help_;
    00114
    00115 signals:
    00116            void mouseReleaseSignal(QMouseEvent*);
    00117            void mouseMoveSignal(QMouseEvent*);
    00118            void colorChangedSignal();
    00119 };
    00120
    00121 #endif // __TERRALIB_INTERNAL_QTCOLORBAR_H
    00122

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines