// // File: texture_image.h // // (C) 2000-2006 Helmut Cantzler // // Licensed under the terms of the Lesser General Public License. // #ifndef _TEXTURE_IMAGE_H #define _TEXTURE_IMAGE_H #include #include #include #include "glmesh.h" #include "mesh.h" class Gan_Matrix33; typedef struct { int x, y; } Point; class TextureImage : public QWidget { Q_OBJECT public: TextureImage(QWidget *parent); const unsigned int* getHomoPoints(void); const char* getFileName(void) const; int width(void) const { return img.width(); } int height(void) const { return img.height(); } public slots: void loadImage(void); void clearSelection(void); protected: void mousePressEvent (QMouseEvent *e); void paintEvent(QPaintEvent *e); private: void drawPoint(Point p, unsigned int color); QString fn, fn_short; QImage img, img_org; QPixmap pix; int homo_nr; Point homo_points[4]; }; class TextureImageWindow : public QMainWindow { Q_OBJECT public: TextureImageWindow(QWidget *parent, GLMesh *glmesh, Mesh *mesh); private slots: void clearSelection(void); int texture_mapping(void); private: void calc_projection(float *v, Gan_Matrix33 *h, float *x, float *y); QWidget *parent; GLMesh *glmesh; Mesh *mesh; TextureImage *img; QAction *textureDisplay; }; #endif