Gl Graph
Gl Graph Source of glcamera.h
#ifndef GL_CAMERA_H
#define GL_CAMERA_H
#include "glcoordinatesystem.h"
#include "glversion.h"
#include "Mat3f.h"
#include <GL/gl.h>
#include <GL/glext.h>
#include <GL/glx.h>
#include <GL/glxext.h>
#include <GL/glut.h>
#include <string>
#include <iostream>
#include <sstream>
enum CameraView
{
FRONT_VIEW,
UP_VIEW,
DOWN_VIEW,
LEFT_VIEW,
RIGHT_VIEW,
BACK_VIEW,
FREE_VIEW,
};
class GlCamera {
private:
GlCoordinateSystem systemInit;
GlCoordinateSystem systemInitMovement;
GlCoordinateSystem system;
float centerRotationZInit;
float centerRotationZ;
Vec3f scaleInit;
Vec3f scale;
unsigned int height;
unsigned int width;
float halfsizex;
float halfsizey;
Vec3f e1;
Vec3f e2;
Vec3f e3;
bool isKeepProportionXY;
public:
GlCamera();
GlCamera(unsigned int width,unsigned int height);
void setBestView(Vec3f &objectCenterPosistion, float size);
void setBestView(CameraView view,Vec3f &objectCenterPosistion, float size);
void setInitial();
Vec3f getScale();
void setScale(Vec3f s);
void setScale(float s);
void setScale(float sx,float sy,float sz);
void multScale(float s);
void multScale(float sx,float sy,float sz);
void multScale(Vec3f s);
void setKeepProportionXY(bool keepProportionXY);
int getHeight();
int getWidth();
void setHeight(int h);
void setWidth(int w);
void setSize(int h, int w);
void setViewport();
void reset();
GlCoordinateSystem * getSystem();
GlCoordinateSystem * getSystemInitMovement();
GlCoordinateSystem * getSystemInit();
Vec3f getX();
Vec3f getY();
Vec3f getZ();
Vec3f getPosition();
void setPosition(Vec3f &pos);
void startMovement();
void updateMovementTranslation(Vec3f &translation);
void setPosition(Vec3f &pos, Vec3f &translation);
void setTranslation(Vec3f &translation);
void setRotationCenter(float centerRotationZ);
Vec3f getRotationCenter();
void rotate(Mat3f & rotartionMat);
void rotateX(float angle);
void rotateY(float angle);
void rotateZ(float angle);
void setOpenglProjectionMatrixInternal();
void setOpenglPojectionMatrix();
void setOpenglModelViewMatrix();
void pushMatrix();
void popMatrix();
float getXPixelSize();
float getYPixelSize();
float getWorldX(int pixelX);
float getWorldY(int pixelY);
float XPixelToGl(int x);
float YPixelToGl(int y);
float getGlHeight();
float getGlWidth();
friend std::ostream& operator<<(std::ostream& stream, GlCamera &m);
};
#endif