1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
#ifndef ALIGNSET_H
#define ALIGNSET_H
#include <QString>
#include <QImage>
#include <QGLFramebufferObject>
// local headers
#include "common/meshmodel.h"
// VCG headers
#include <vcg/math/shot.h>
//#include "fbo.h"
#include "pointCorrespondence.h"
class QGLFramebufferObject;
class AlignSet {
//typedef vcg::Camera<float> Camera;
//typedef vcg::Shot<float> Shot;
//typedef vcg::Box3<float> Box;
public:
int wt,ht;
CMeshO* mesh;
QImage* image;
double imageRatio;
vcg::Shot<float> shot;
vcg::Box3<float> box;
QList<PointCorrespondence*> *correspList; //List that includes corresponces involving the model
double error; //alignment error in px
GLuint vbo, nbo, cbo, ibo; // vertex buffer object (vertices, normals, colors indices)
GLint programs[6];
enum RenderingMode {COMBINE=0, NORMALMAP=1, COLOR=2, SPECULAR=3, SILHOUETTE=4, SPECAMB = 5};
RenderingMode mode;
unsigned char *target, *render; //buffers for rendered images
AlignSet();
~AlignSet();
void initializeGL();
int width() { return wt; }
int height() { return ht; }
void resize(int max_side); // resize the fbo and the images so that the longest side is max_side
double focal();
bool setFocal(double f); //return false if unchanged
void setPixelSizeMm(double ccdWidth);
void renderScene(vcg::Shot<float> &shot, int component);
void readRender(int component);
void drawMeshPoints();
void drawImagePoints();
void undistortImage();
void resetAlign();
private:
GLuint createShaderFromFiles(QString basename); // converted into shader/basename.vert .frag
GLuint createShaders(const char *vert, const char *frag);
};
#endif
|