Rev 412 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
/*
* VisObj.h
* GEL
*
* Created by J. Andreas Bærentzen on 20/09/08.
* Copyright 2008 __MyCompanyName__. All rights reserved.
*
*/
#ifndef __MESHEDIT_VISOBJ_H__
#define __MESHEDIT_VISOBJ_H__
#include <string>
#include <GL/glew.h>
#include <HMesh/Manifold.h>
#include <GLGraphics/draw.h>
#include <GLGraphics/GLViewController.h>
#include "harmonics.h"
#include "Renderer.h"
extern int WINX;
extern int WINY;
class VisObj
{
std::string file;
GLGraphics::GLViewController view_ctrl;
bool create_display_list;
HMesh::Manifold mani;
Harmonics* harmonics;
ManifoldRenderer* renderer;
public:
VisObj():
file(""), view_ctrl(WINX,WINY, CGLA::Vec3f(0), 1.0), create_display_list(true), harmonics(0) {}
HMesh::Manifold& mesh() {return mani;}
GLGraphics::GLViewController& view_control() {return view_ctrl;}
bool reload(std::string _file);
void display(const std::string& display_method , bool smooth);
void post_create_display_list()
{
create_display_list = true;
}
void harmonics_analyze_mesh()
{
delete harmonics;
harmonics = new Harmonics(mani);
}
void harmonics_reset_shape()
{
if(harmonics)
harmonics->reset_shape();
}
void harmonics_parse_key(unsigned char key)
{
harmonics->parse_key(key);
}
void harmonics_partial_reconstruct(int eig0, int eig1, float scale)
{
if(harmonics)
harmonics->partial_reconstruct(eig0, eig1, scale);
}
};
#endif