#ifndef Surface_H #define Surface_H #include #include "glm/glm.hpp" #include "env_map.h" #include "utils.h" #include "Algo/Tiling/Surface/triangular.h" #include "Algo/Render/GL2/mapRender.h" #include "Utils/vbo.h" #include "Utils/Shaders/shaderSimpleColor.h" #include "Algo/Render/GL2/colorPerFaceRender.h" #include "Utils/Shaders/shaderColorPerVertex.h" //particules using namespace CGoGN ; class Simulator; class Surface { public: Surface(Simulator* sim, VEC3 offset) ; VEC3 getPosition(int index); unsigned int nbVertices; unsigned int nbTriangles; std::vector parts_ ; std::vector triangles_; SURFACE surfaceMap; // map CGoGN::Algo::MR::Primal::Adaptive::IHM2 mapOperator; VertexAttribute positionSurface ; //position VertexAttribute indexParticule; // index des particules de chaque sommet FaceAttribute indexTriangle; FaceAttribute faceColor; void initPlane(); //initialisation d'une grille REAL faceMaxdistance(Face face); //calcul du rayon max d'une face bool subdiveMap(); //subdivision de la map void initOperators(SubdivisionType st); // fonction de sélection du type de subdivision pour l'ihm2 void addGeneralCell ( Dart d); bool removeGeneralCell (Dart d); void addGeneralNeighbor ( Dart d); bool removeGeneralNeighbor (Dart d); std::vector< std::vector > belonging_cells; std::vector< std::vector > neighbor_cells; std::vector > general_belonging; std::vector > general_neighbors; double width; Simulator* sim_; unsigned int index_surface; float r; // indice de couleur rouge float g; // indice de couleur vert float b; // indice de couleur bleu float distanceColorationMini; // distance minimale pour commencer a virer rouge float distanceColorationMaxi; // distance a partir de laquelle on est completement rouge // visualisation void initGL(); // initialisation GL void draw(); // redessiner l'objet void changeColor(Triangle *t, float distance); Algo::Render::GL2::MapRender* m_render_map; // render de l'objet Algo::Render::GL2::ColorPerFaceRender * m_render; Utils::VBO* m_positionVBO; //VBO Utils::VBO* m_colorVBO; Utils::ShaderSimpleColor* m_simpleColorShader; // shader Utils::ShaderColorPerVertex * m_shader; }; #endif