| 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/TeQtGLWidget.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_QTGLBOX_H
    00025 #define  __TERRALIB_INTERNAL_QTGLBOX_H
    00026
    00027 #include <qgl.h>
    00028 #include <qpixmap.h>
    00029 #include "../../kernel/TeDataTypes.h"
    00030 #include <vector>
    00031
    00032 #include "../../kernel/TeDefines.h"
    00033
    00034 using namespace std;
    00035
    00036 class TeTheme;
    00037 class TeDatabase;
    00038 class TeQtGrid;
    00039
    00040 class TL_DLL TeQtGLWidget : public QGLWidget
    00041 {
    00042     Q_OBJECT
    00043
    00044 public:
    00045
    00046     TeQtGLWidget( QWidget* parent, const char* name, TeQtGrid* grid, string xField, string yField, string zField, QPaintDevice* xy, QPaintDevice* xz, QPaintDevice* yz, int selectedObjects = TeAll, string func = "NONE");
    00047     ~TeQtGLWidget();
    00048            void drawAxis(bool b) {drawAxis_ = b; updateGL();}
    00049
    00050     GLfloat xRot_, yRot_, zRot_;
    00051            GLfloat xTranslation_, yTranslation_, zTranslation_;
    00052            GLfloat viewAngle_;
    00053            GLfloat xOff_, yOff_, zOff_;
    00054            GLfloat xSize_, ySize_, zSize_;
    00055            string xField_, yField_, zField_;
    00056            bool frontLighting_;
    00057            bool addSelection_;
    00058            TeTheme* theme_;
    00059            TeDatabase* db_;
    00060
    00061 public slots:
    00062
    00063            // the values of degrees, offset, size, translation and angle are between 0 - 99.
    00064            // therefore it shoud be conveted to adequate value
    00065
    00066     void   setXRotation( int degrees );
    00067     void   setYRotation( int degrees );
    00068     void   setZRotation( int degrees );
    00069
    00070     void   setXOffset( int offset );
    00071     void   setYOffset( int offset );
    00072     void   setZOffset( int offset );
    00073
    00074     void   setXSize( int size );
    00075     void   setYSize( int size );
    00076     void   setZSize( int size );
    00077
    00078     void   xOffsetReleased();
    00079     void   yOffsetReleased();
    00080     void   zOffsetReleased();
    00081
    00082     void   xSizeReleased();
    00083     void   ySizeReleased();
    00084     void   zSizeReleased();
    00085
    00086     void   setViewAngle( int angle );
    00087
    00088     void   setLightingMode( int m );
    00089
    00090            void       paint2D();
    00091            void       paint3D();
    00092            void       getCubeCoordinate(double& x1, double& y1, double& z1, double& x2, double& y2, double& z2);
    00093            void       drawSelecteds();
    00094            void       changeFunction(string function);
    00095            void       changeInputObjects(int v);
    00096            void       changeQuality(int v);
    00097            void       updateSelection();
    00098            void       deleteGLObject();
    00099            void       initGLObject();
    00100
    00101 protected:
    00102
    00103     void   initializeGL();
    00104     void   paintGL();
    00105     void   resizeGL( int w, int h );
    00106            void       mousePressEvent(QMouseEvent*);
    00107            void       mouseMoveEvent(QMouseEvent*);
    00108            void       mouseReleaseEvent(QMouseEvent*);
    00109            void       keyPressEvent(QKeyEvent*);
    00110            void       keyReleaseEvent(QKeyEvent*);
    00111            void       draw2DPixmaps();
    00112     void   makeObject();
    00113            void       getValues();
    00114            void       selectFromHexaedro();
    00115
    00116 signals:
    00117            void setXOffsetSignal(int);
    00118            void setYOffsetSignal(int);
    00119            void setZOffsetSignal(int);
    00120            void setXSizeSignal(int);
    00121            void setYSizeSignal(int);
    00122            void setZSizeSignal(int);
    00123            void setXRotationSignal(int);
    00124            void setYRotationSignal(int);
    00125            void setZRotationSignal(int);
    00126            void setZoomSignal(int);
    00127
    00128
    00129 private:
    00130
    00131            int selIni_;
    00132            int quality_;
    00133            GLuint cone_;
    00134            vector<GLuint> ballVec_;
    00135            vector<string> idVec_;
    00136            map<string, GLuint> ballMap_;
    00137            GLfloat scale_;
    00138            GLfloat min_, max_;
    00139            QPoint mousePosition_;
    00140            vector<double> xVec_, yVec_, zVec_;
    00141            bool drawAxis_;
    00142            bool drawSelecteds_;
    00143            QPaintDevice *xyDevice_, *zxDevice_, *yzDevice_;
    00144            QPixmap xyPixmap_, zxPixmap_, yzPixmap_;
    00145            QColor defaultColor_;
    00146            QColor pointingColor_;
    00147            string function_;
    00148            int selectedObjects_;
    00149            TeQtGrid* grid_;
    00150            int        keyPress_;
    00151 };
    00152
    00153
    00154 #endif // __TERRALIB_INTERNAL_QTGLBOX_H

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines