Commit 89d6b223 authored by Sylvain Thery's avatar Sylvain Thery

compil visual 2013

parent 1e795b2d
...@@ -58,7 +58,7 @@ int main() ...@@ -58,7 +58,7 @@ int main()
ch.start(); ch.start();
// add position attribute on vertices and get handler on it // add position attribute on vertices and get handler on it
VertexAttribute<VEC3, MAP> position = myMap.addAttribute<VEC3, VERTEX, MAP>("position"); VertexAttribute<VEC3, MAP> position = myMap.addAttribute<VEC3, VERTEX, MAP>("position");
constexpr int nb = 100; const int nb = 100;
Algo::Volume::Tilings::Cubic::Grid<PFP> cubic(myMap, nb, nb, nb); Algo::Volume::Tilings::Cubic::Grid<PFP> cubic(myMap, nb, nb, nb);
cubic.embedIntoGrid(position, 10.0f, 10.0f, 10.0f); cubic.embedIntoGrid(position, 10.0f, 10.0f, 10.0f);
std::cout<< "construct grid in " << ch.elapsed()<< " ms"<< std::endl; std::cout<< "construct grid in " << ch.elapsed()<< " ms"<< std::endl;
......
...@@ -53,7 +53,7 @@ int main() ...@@ -53,7 +53,7 @@ int main()
// add position attribute on vertices and get handler on it // add position attribute on vertices and get handler on it
VertexAttribute<VEC3, MAP> position = myMap.addAttribute<VEC3, VERTEX, MAP>("position"); VertexAttribute<VEC3, MAP> position = myMap.addAttribute<VEC3, VERTEX, MAP>("position");
constexpr int nb = 2; const int nb = 2;
Algo::Volume::Tilings::Cubic::Grid<PFP> cubic(myMap, nb, nb, nb); Algo::Volume::Tilings::Cubic::Grid<PFP> cubic(myMap, nb, nb, nb);
cubic.embedIntoGrid(position, 10.0f, 10.0f, 10.0f); cubic.embedIntoGrid(position, 10.0f, 10.0f, 10.0f);
......
...@@ -54,7 +54,7 @@ int main() ...@@ -54,7 +54,7 @@ int main()
// add position attribute on vertices and get handler on it // add position attribute on vertices and get handler on it
VertexAttribute<VEC3, MAP> position = myMap.addAttribute<VEC3, VERTEX, MAP>("position"); VertexAttribute<VEC3, MAP> position = myMap.addAttribute<VEC3, VERTEX, MAP>("position");
constexpr int nb = 2; const int nb = 2;
Algo::Volume::Tilings::Cubic::Grid<PFP> cubic(myMap, nb, nb, nb); Algo::Volume::Tilings::Cubic::Grid<PFP> cubic(myMap, nb, nb, nb);
cubic.embedIntoGrid(position, 10.0f, 10.0f, 10.0f); cubic.embedIntoGrid(position, 10.0f, 10.0f, 10.0f);
......
...@@ -69,9 +69,9 @@ Approximator<PFP,T,ORBIT>::~Approximator() ...@@ -69,9 +69,9 @@ Approximator<PFP,T,ORBIT>::~Approximator()
// std::cout << "Approximator<PFP,T,ORBIT>::~Approximator()" << std::endl ; // std::cout << "Approximator<PFP,T,ORBIT>::~Approximator()" << std::endl ;
for (unsigned int i = 0 ; i < m_attrV.size() ; ++i) for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
{ {
this->m_map.template removeAttribute(m_approx[i]) ; this->m_map.removeAttribute(m_approx[i]) ;
if(m_predictor) if(m_predictor)
this->m_map.template removeAttribute(m_detail[i]) ; this->m_map.removeAttribute(m_detail[i]) ;
} }
} }
......
...@@ -288,7 +288,7 @@ public: ...@@ -288,7 +288,7 @@ public:
*/ */
void overwrite(unsigned int src_b, unsigned int src_id, unsigned int dst_b, unsigned int dst_id) void overwrite(unsigned int src_b, unsigned int src_id, unsigned int dst_b, unsigned int dst_id)
{ {
bool b = m_tableData[src_b][src_id/32] & (1 << (src_id%32)); bool b = (m_tableData[src_b][src_id/32] & (1 << (src_id%32))) != 0;
unsigned int mask = 1 << (dst_id%32); unsigned int mask = 1 << (dst_id%32);
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
* Contact information: cgogn@unistra.fr * * Contact information: cgogn@unistra.fr *
* * * *
*******************************************************************************/ *******************************************************************************/
#include <algorithm>
namespace CGoGN namespace CGoGN
{ {
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
* * * *
*******************************************************************************/ *******************************************************************************/
#include <cmath>
namespace CGoGN { namespace CGoGN {
namespace Utils { namespace Utils {
...@@ -139,7 +141,11 @@ template <typename REAL> ...@@ -139,7 +141,11 @@ template <typename REAL>
bool bool
Quadric<REAL>::optimize(VEC4& v) const Quadric<REAL>::optimize(VEC4& v) const
{ {
if (std::isnan(A(0,0))) #ifdef WIN32
if (A(0, 0) != A(0, 0))
#else
if (std::isnan(A(0, 0)))
#endif
return false ; return false ;
MATRIX44 A2(A) ; MATRIX44 A2(A) ;
...@@ -286,7 +292,11 @@ template <typename REAL, unsigned int N> ...@@ -286,7 +292,11 @@ template <typename REAL, unsigned int N>
bool bool
QuadricNd<REAL,N>::optimize(VECN& v) const QuadricNd<REAL,N>::optimize(VECN& v) const
{ {
if (std::isnan(A(0,0))) #ifdef WIN32
if (A(0, 0) != A(0, 0))
#else
if (std::isnan(A(0, 0)))
#endif
return false ; return false ;
Geom::Matrix<N,N,double> Ainv ; Geom::Matrix<N,N,double> Ainv ;
......
...@@ -28,10 +28,12 @@ ...@@ -28,10 +28,12 @@
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <vector> #include <vector>
#include <algorithm>
#include "Utils/cgognStream.h" #include "Utils/cgognStream.h"
#include "glm/gtx/inverse_transpose.hpp" #include "glm/gtx/inverse_transpose.hpp"
namespace CGoGN namespace CGoGN
{ {
......
...@@ -840,14 +840,14 @@ float FrameManipulator::scaleFromMouse(int dx, int dy) ...@@ -840,14 +840,14 @@ float FrameManipulator::scaleFromMouse(int dx, int dy)
if (abs(dx) > abs(dy)) if (abs(dx) > abs(dy))
{ {
if (dx>0) if (dx>0)
return 1.01; return 1.01f;
return 0.99; return 0.99f;
} }
else else
{ {
if (dy>0) if (dy>0)
return 1.01; return 1.01f;
return 0.99; return 0.99f;
} }
} }
......
...@@ -262,7 +262,7 @@ Pickable* Pickable::pick(const std::vector<Pickable*>& picks,const Geom::Vec3f& ...@@ -262,7 +262,7 @@ Pickable* Pickable::pick(const std::vector<Pickable*>& picks,const Geom::Vec3f&
glm::vec4 IWglm = tr*ii; glm::vec4 IWglm = tr*ii;
Geom::Vec3f IW(IWglm[0]/IWglm[3],IWglm[1]/IWglm[3],IWglm[2]/IWglm[3]); Geom::Vec3f IW(IWglm[0]/IWglm[3],IWglm[1]/IWglm[3],IWglm[2]/IWglm[3]);
IW -= P; IW -= P;
float dist = IW.norm(); float dist = float(IW.norm());
if (dist < mdist) if (dist < mdist)
{ {
res = *it; res = *it;
......
...@@ -27,6 +27,9 @@ ...@@ -27,6 +27,9 @@
#include "Utils/svg.h" #include "Utils/svg.h"
#include "Utils/gzstream.h" #include "Utils/gzstream.h"
#include <algorithm>
namespace CGoGN namespace CGoGN
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment