From 5c96d99dfc1f0e930714881495a86acd15267bdd Mon Sep 17 00:00:00 2001 From: thery Date: Thu, 28 Jul 2011 06:57:34 +0200 Subject: [PATCH] MAJ compilation sous windows --- Apps/Tuto/tp_master.cpp | 6 +++--- Apps/Tuto/tuto5.cpp | 10 +++++----- README_VISUAL.TXT | 21 +++++++++++++------- build/CMakeLists.txt | 6 +++--- include/Algo/Import/import2tablesSurface.hpp | 2 +- include/Algo/Modelisation/subdivision.hpp | 3 +++ include/Utils/frameManipulator.h | 3 +-- src/Utils/frameManipulator.cpp | 10 +++++----- src/Utils/pickables.cpp | 7 ++++--- 9 files changed, 39 insertions(+), 29 deletions(-) diff --git a/Apps/Tuto/tp_master.cpp b/Apps/Tuto/tp_master.cpp index 4829dcec8..6361650a1 100644 --- a/Apps/Tuto/tp_master.cpp +++ b/Apps/Tuto/tp_master.cpp @@ -334,13 +334,13 @@ void MyQT::cb_initGL() m_shader = new Utils::ShaderPhong(); m_shader->setAttributePosition(m_positionVBO); m_shader->setAttributeNormal(m_normalVBO); - m_shader->setDiffuse(Geom::Vec4f(0.,0.6,0.,0.)); - m_shader->setSpecular(Geom::Vec4f(0.,0.0,0.,0.)); // no specular + m_shader->setDiffuse(Geom::Vec4f(0.0f,0.6f,0.0f,0.0f)); + m_shader->setSpecular(Geom::Vec4f(0.0f,0.0f,0.0f,0.0f)); // no specular // using simple shader with color m_shader2 = new Utils::ShaderSimpleColor(); m_shader2->setAttributePosition(m_positionVBO); - m_shader2->setColor(Geom::Vec4f(0.,0.1,0.,0.)); + m_shader2->setColor(Geom::Vec4f(0.0f,0.1f,0.0f,0.0f)); registerShader(m_shader); registerShader(m_shader2); } diff --git a/Apps/Tuto/tuto5.cpp b/Apps/Tuto/tuto5.cpp index c760c1fae..9bd5f44c2 100644 --- a/Apps/Tuto/tuto5.cpp +++ b/Apps/Tuto/tuto5.cpp @@ -160,7 +160,7 @@ void MyQT::cb_initGL() m_sprite = new Utils::PointSprite(); m_sprite->setAttributePosition(m_positionVBO); - m_strings = new Utils::Strings3D(true, Geom::Vec3f(0.1,0.,0.3)); + m_strings = new Utils::Strings3D(true, Geom::Vec3f(0.1f,0.0f,0.3f)); storeVerticesInfo(); m_strings->sendToVBO(); @@ -192,7 +192,7 @@ void MyQT::cb_initGL() m_render->initPrimitives(myMap, allDarts, Algo::Render::GL2::LINES); m_render->initPrimitives(myMap, allDarts, Algo::Render::GL2::POINTS); - m_render_topo->updateData(myMap, allDarts, position, 0.9, 0.9, 0.9); + m_render_topo->updateData(myMap, allDarts, position, 0.9f, 0.9f, 0.9f); // timer example for animation @@ -284,7 +284,7 @@ int main(int argc, char **argv) { position = myMap.addAttribute(VERTEX, "position"); - CGoGNout << 5.34 << " toto "<< Geom::Vec3f(2.5, 2.2, 4.3) << CGoGNendl; + CGoGNout << 5.34 << " toto "<< Geom::Vec3f(2.5f, 2.2f, 4.3f) << CGoGNendl; CGoGNout << 3 << " tutu "<< 4 <::importASSIMP(const std::string& filename, std::vect template bool MeshTablesSurface::mergeCloseVertices() { - const unsigned int NBV=64; // seems to be good + const int NBV=64; // seems to be good const int NEIGH[27]={ -NBV*NBV - NBV - 1, -NBV*NBV - NBV, -NBV*NBV - NBV + 1, diff --git a/include/Algo/Modelisation/subdivision.hpp b/include/Algo/Modelisation/subdivision.hpp index ded537ada..63fee21f8 100644 --- a/include/Algo/Modelisation/subdivision.hpp +++ b/include/Algo/Modelisation/subdivision.hpp @@ -25,6 +25,9 @@ #include "Algo/Geometry/centroid.h" #include "Topology/generic/autoAttributeHandler.h" +#define _USE_MATH_DEFINES +#include + namespace CGoGN { diff --git a/include/Utils/frameManipulator.h b/include/Utils/frameManipulator.h index d01aa3da6..55d32999b 100644 --- a/include/Utils/frameManipulator.h +++ b/include/Utils/frameManipulator.h @@ -51,8 +51,7 @@ protected: */ static const unsigned int nb_segments = 64; - static const float ring_half_width = 0.08f; - + static const float ring_half_width; /** * locking table diff --git a/src/Utils/frameManipulator.cpp b/src/Utils/frameManipulator.cpp index 9510ce59f..5dc1f0d6e 100644 --- a/src/Utils/frameManipulator.cpp +++ b/src/Utils/frameManipulator.cpp @@ -28,17 +28,17 @@ #include "Geometry/intersection.h" #include -//#include -//#include "glm/gtc/type_precision.hpp" -//#include "glm/gtc/type_ptr.hpp" -//#include +#define _USE_MATH_DEFINES +#include + namespace CGoGN { namespace Utils { +const float FrameManipulator::ring_half_width = 0.08f; FrameManipulator::FrameManipulator(): m_highlighted(NONE), @@ -900,7 +900,7 @@ void FrameManipulator::rotateInScreen(int dx, int dy) Geom::Vec3f axisRotation(P[0]-m_trans[0], P[1]-m_trans[1], P[2]-m_trans[2]); axisRotation.normalize(); - glm::mat4 tr = glm::rotate(glm::mat4(1.0f),float(sqrt(dx*dx+dy*dy))/2.0f,glm::vec3(axisRotation[0],axisRotation[1],axisRotation[2])); + glm::mat4 tr = glm::rotate(glm::mat4(1.0f),sqrt(float(dx*dx+dy*dy))/2.0f,glm::vec3(axisRotation[0],axisRotation[1],axisRotation[2])); m_rotations = tr*m_rotations; } diff --git a/src/Utils/pickables.cpp b/src/Utils/pickables.cpp index 2ba82fc33..618ca68de 100644 --- a/src/Utils/pickables.cpp +++ b/src/Utils/pickables.cpp @@ -26,8 +26,9 @@ #include "glm/gtc/matrix_transform.hpp" #include "Geometry/distances.h" #include "Geometry/intersection.h" -#include #include +#define _USE_MATH_DEFINES +#include namespace CGoGN { @@ -915,7 +916,7 @@ void IcoSphere::changeTopo(unsigned int sub) { if (sub<2) sub=2; - int subd = int(log(sub/2)/log(2.0))-1; + int subd = int(log(0.5*sub)/log(2.0))-1; if (subd<0) subd=0; @@ -929,7 +930,7 @@ void IcoSphere::changeTopoSubdivision(unsigned int sub) m_sub = sub; - unsigned int subEdge = powf(2.0f,4.0f-sub); + unsigned int subEdge = (unsigned int)(powf(2.0f,4.0f-sub)); std::vector points; points.reserve(10000); -- GitLab