Commit df0b20a2 authored by Sylvain Thery's avatar Sylvain Thery

Merge branch 'develop' into 'master'

Develop



See merge request !78
parents 8e42adeb 4a11dd11
......@@ -2,4 +2,5 @@
CMakeLists.txt.user
bin/
ThirdParty/bin/
SCHNApps/bin
\ No newline at end of file
SCHNApps/bin/
windows_dependencies/
......@@ -14,7 +14,7 @@ IF (WIN32)
link_directories( ${CGoGN_ROOT_DIR}/bin/${CMAKE_BUILD_TYPE})
SET(EXECUTABLE_OUTPUT_PATH ${CGoGN_ROOT_DIR}/bin/${CMAKE_BUILD_TYPE}) # Release/Debug added automatically by visual
ELSE()
link_directories( ${CGoGN_ROOT_DIR}/bin/${ConfigurationName})
link_directories( ${CGoGN_ROOT_DIR}/bin/$(ConfigurationName))
SET(EXECUTABLE_OUTPUT_PATH ${CGoGN_ROOT_DIR}/bin/) # Release/Debug added automatically by visual
ENDIF()
ELSE()
......
......@@ -92,21 +92,20 @@ void Viewer::cb_initGL()
m_positionVBO = new Utils::VBO() ;
m_normalVBO = new Utils::VBO() ;
m_phongShader = new Utils::ShaderPhong(true,false,false) ;
m_phongShader = new Utils::ShaderPhong(true,false) ;
m_phongShader->setAttributePosition(m_positionVBO) ;
m_phongShader->setAttributeNormal(m_normalVBO) ;
m_phongShader->setAmbiant(colClear) ;
m_phongShader->setDiffuse(colDif) ;
m_phongShader->setSpecular(colSpec) ;
m_phongShader->setShininess(shininess) ;
m_phongShader->setBackColor(Geom::Vec4f(0,0,0.2,0)) ;
m_phongShader->setBackColor(Geom::Vec4f(0.9f, 0.0f, 0.0f, 0.0f));
m_flatShader = new Utils::ShaderSimpleFlat(true,false) ;
m_flatShader = new Utils::ShaderSimpleFlat() ;
m_flatShader->setAttributePosition(m_positionVBO) ;
m_flatShader->setAmbiant(colClear) ;
m_flatShader->setDiffuse(colDif) ;
m_flatShader->setBackColor(Geom::Vec4f(0,0,0.2,0)) ;
m_flatShader->setBackColor(Geom::Vec4f(0.9f, 0.0f, 0.0f, 0.0f));
m_vectorShader = new Utils::ShaderVectorPerVertex() ;
m_vectorShader->setAttributePosition(m_positionVBO) ;
......@@ -182,7 +181,7 @@ void Viewer::cb_redraw()
}
m_nbFrames++;
if (m_nbFrames >=100)
if (m_nbFrames >=500)
{
std::cout << 100000.0/m_frame_ch.elapsed()<< " fps"<<std::endl;
m_nbFrames = 0;
......@@ -214,6 +213,34 @@ void Viewer::cb_keyPress(int keycode)
{
switch(keycode)
{
case 'd':
{
m_phongShader->setDoubleSided(true);
m_flatShader->setDoubleSided(true);
updateGL();
}
break;
case 'D':
{
m_phongShader->setDoubleSided(false);
m_flatShader->setDoubleSided(false);
updateGL();
}
break;
case 'q':
{
Utils::Chrono ch;
ch.start();
for (int i = 0; i < 1000; ++i)
{
m_render->draw(m_flatShader, Algo::Render::GL2::TRIANGLES);
glFlush();
}
std::cout << "speed render " << 1000.0*1000.0/ch.elapsed() << " fps " << std::endl;
}
case 'n':
m_flatShader->setNoClippingPlane();
m_phongShader->setNoClippingPlane();
......
......@@ -43,6 +43,7 @@
#include "Utils/Shaders/shaderPhong.h"
#include "Utils/Shaders/shaderSimpleFlat.h"
//#include "Utils/Shaders/shaderFlat.h"
#include "Utils/Shaders/shaderSimpleColor.h"
#include "Utils/Shaders/shaderVectorPerVertex.h"
#include "Utils/pointSprite.h"
......
......@@ -135,7 +135,7 @@ void MyQT::squareTiling(int code)
{
std::cout << "square grid helicoid tiling" << std::endl;
Algo::Surface::Tilings::Square::Grid<PFP> g(myMap,20,20,true);
g.embedIntoHelicoid(position, 0.2, 0.3, 0.8, 2.0);
g.embedIntoHelicoid(position, 0.2f, 0.3f, 0.8f, 2.0f);
// Geom::Matrix44f trf;
// trf.identity();
......
......@@ -31,7 +31,7 @@ void MyQT::cb_initGL()
{
position = myMap.addAttribute<PFP::VEC3, VERTEX, MAP>("position");
Algo::Surface::Tilings::Square::Cylinder<PFP> c(myMap,50,50);
c.embedIntoCylinder(position,0.5,0.7,1.0);
c.embedIntoCylinder(position,0.5f,0.7f,1.0f);
Geom::BoundingBox<PFP::VEC3> bb = Algo::Geometry::computeBoundingBox<PFP>(myMap, position);
float lWidthObj = std::max<PFP::REAL>(std::max<PFP::REAL>(bb.size(0), bb.size(1)), bb.size(2));
Geom::Vec3f lPosObj = (bb.min() + bb.max()) / PFP::REAL(2);
......
cmake_minimum_required(VERSION 2.6)
project(testing_algo_booleanOperator)
add_executable( test_algo_booleanOperator
algo_booleanOperator.cpp
mergeVertices.cpp
)
target_link_libraries( test_algo_booleanOperator
${CGoGN_LIBS} ${CGoGN_EXT_LIBS})
#include <iostream>
extern int test_mergeVertices();
int main()
{
test_mergeVertices();
return 0;
}
#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap2.h"
#include "Topology/gmap/embeddedGMap2.h"
#include "Algo/BooleanOperator/mergeVertices.h"
using namespace CGoGN;
struct PFP1 : public PFP_STANDARD
{
typedef EmbeddedMap2 MAP;
};
template bool Algo::Surface::BooleanOperator::isBetween<PFP1>(PFP1::MAP& map, const VertexAttribute<PFP1::VEC3, PFP1::MAP>& positions, Dart d, Dart e, Dart f);
template void Algo::Surface::BooleanOperator::mergeVertex<PFP1>(PFP1::MAP& map, VertexAttribute<PFP1::VEC3, PFP1::MAP>& positions, Dart d, Dart e, int precision);
template void Algo::Surface::BooleanOperator::mergeVertices<PFP1>(PFP1::MAP& map, VertexAttribute<PFP1::VEC3, PFP1::MAP>& positions, int precision);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
struct PFP2 : public PFP_DOUBLE
{
typedef EmbeddedMap2 MAP;
};
template bool Algo::Surface::BooleanOperator::isBetween<PFP2>(PFP2::MAP& map, const VertexAttribute<PFP2::VEC3, PFP2::MAP>& positions, Dart d, Dart e, Dart f);
template void Algo::Surface::BooleanOperator::mergeVertex<PFP2>(PFP2::MAP& map, VertexAttribute<PFP2::VEC3, PFP2::MAP>& positions, Dart d, Dart e, int precision);
template void Algo::Surface::BooleanOperator::mergeVertices<PFP2>(PFP2::MAP& map, VertexAttribute<PFP2::VEC3, PFP2::MAP>& positions, int precision);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//struct PFP3 : public PFP_STANDARD
//{
// typedef EmbeddedGMap2 MAP;
//};
//template bool Algo::Surface::BooleanOperator::isBetween<PFP3>(PFP3::MAP& map, const VertexAttribute<PFP3::VEC3, PFP3::MAP>& positions, Dart d, Dart e, Dart f);
//template void Algo::Surface::BooleanOperator::mergeVertex<PFP3>(PFP3::MAP& map, VertexAttribute<PFP3::VEC3, PFP3::MAP>& positions, Dart d, Dart e, int precision);
//template void Algo::Surface::BooleanOperator::mergeVertices<PFP3>(PFP3::MAP& map, VertexAttribute<PFP3::VEC3, PFP3::MAP>& positions, int precision);
// TODO add removeEdgeFromVertex & insertEdgeInVertex in GMap2
int test_mergeVertices()
{
return 0;
}
cmake_minimum_required(VERSION 2.6)
project(testing_algo)
add_subdirectory(BooleanOperator)
add_subdirectory(Decimation)
add_subdirectory(Export)
add_subdirectory(Filtering)
add_subdirectory(Geometry)
add_subdirectory(Histogram)
#add_subdirectory(ImplicitHierarchicalMesh)
add_subdirectory(Import)
add_subdirectory(LinearSolving)
add_subdirectory(MC)
add_subdirectory(Modelisation)
add_subdirectory(MovingObjects)
#add_subdirectory(Multiresolution)
add_subdirectory(ProgressiveMesh)
add_subdirectory(Remeshing)
add_subdirectory(Render)
add_subdirectory(Selection)
add_subdirectory(Simulation)
add_subdirectory(Tiling)
add_subdirectory(Topo)
cmake_minimum_required(VERSION 2.6)
project(testing_algo_decimation)
add_executable( test_algo_decimation
algo_decimation.cpp
colorPerVertexApproximator.cpp
decimation.cpp
edgeSelector.cpp
geometryApproximator.cpp
geometryPredictor.cpp
halfEdgeSelector.cpp
predictor.cpp
)
target_link_libraries( test_algo_decimation
${CGoGN_LIBS} ${CGoGN_EXT_LIBS})
#include <iostream>
extern int test_geometryApproximator();
extern int test_colorPerVertexApproximator();
extern int test_predictor();
extern int test_geometryPredictor();
extern int test_edgeSelector();
extern int test_halfEdgeSelector();
extern int test_decimation();
int main()
{
test_geometryApproximator();
test_colorPerVertexApproximator();
test_predictor();
test_geometryPredictor();
test_edgeSelector();
test_halfEdgeSelector();
test_decimation();
return 0;
}
#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap2.h"
#include "Topology/gmap/embeddedGMap2.h"
#include "Algo/Decimation/colorPerVertexApproximator.h"
using namespace CGoGN;
struct PFP1 : public PFP_STANDARD
{
typedef EmbeddedMap2 MAP;
};
struct PFP2 : public PFP_DOUBLE
{
typedef EmbeddedMap2 MAP;
};
struct PFP3 : public PFP_DOUBLE
{
typedef EmbeddedGMap2 MAP;
};
template class Algo::Surface::Decimation::Approximator_ColorNaive<PFP1>;
int test_colorPerVertexApproximator()
{
return 0;
}
#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap2.h"
#include "Topology/gmap/embeddedGMap2.h"
#include "Algo/Decimation/decimation.h"
using namespace CGoGN;
struct PFP1 : public PFP_STANDARD
{
typedef EmbeddedMap2 MAP;
};
struct PFP2 : public PFP_DOUBLE
{
typedef EmbeddedMap2 MAP;
};
struct PFP3 : public PFP_DOUBLE
{
typedef EmbeddedGMap2 MAP;
};
template int Algo::Surface::Decimation::decimate<PFP1, Geom::Vec3f>(
PFP1::MAP& map,
SelectorType s,
ApproximatorType a,
std::vector<VertexAttribute<Geom::Vec3f, PFP1::MAP> >& attribs,
unsigned int nbWantedVertices,
EdgeAttribute<PFP1::REAL, PFP1::MAP>* edgeErrors,
void(*callback_wrapper)(void*, const void*) ,
void* callback_object
);
template int Algo::Surface::Decimation::decimate<PFP1>(
PFP1::MAP& map,
Selector<PFP1>* s,
std::vector<ApproximatorGen<PFP1>*>& a,
unsigned int nbWantedVertices,
bool recomputePriorityList,
EdgeAttribute<PFP1::REAL, PFP1::MAP>* edgeErrors,
void(*callback_wrapper)(void*, const void*),
void* callback_object
);
template int Algo::Surface::Decimation::decimate<PFP2, Geom::Vec3d>(
PFP2::MAP& map,
SelectorType s,
ApproximatorType a,
std::vector<VertexAttribute<Geom::Vec3d, PFP2::MAP> >& attribs,
unsigned int nbWantedVertices,
EdgeAttribute<PFP2::REAL, PFP2::MAP>* edgeErrors,
void(*callback_wrapper)(void*, const void*),
void* callback_object
);
//
//
//template int Algo::Surface::Decimation::decimate<PFP2>(
// PFP2::MAP& map,
// Selector<PFP2>* s,
// std::vector<ApproximatorGen<PFP2>*>& a,
// unsigned int nbWantedVertices,
// bool recomputePriorityList,
// EdgeAttribute<PFP2::REAL, PFP2::MAP>* edgeErrors,
// void(*callback_wrapper)(void*, const void*),
// void* callback_object
// );
int test_decimation()
{
return 0;
}
\ No newline at end of file
#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap2.h"
#include "Topology/gmap/embeddedGMap2.h"
#include "Algo/Decimation/edgeSelector.h"
using namespace CGoGN;
struct PFP1 : public PFP_STANDARD
{
typedef EmbeddedMap2 MAP;
};
struct PFP2 : public PFP_DOUBLE
{
typedef EmbeddedMap2 MAP;
};
struct PFP3 : public PFP_DOUBLE
{
typedef EmbeddedGMap2 MAP;
};
template class Algo::Surface::Decimation::EdgeSelector_MapOrder<PFP1>;
template class Algo::Surface::Decimation::EdgeSelector_Random<PFP1>;
template class Algo::Surface::Decimation::EdgeSelector_Length<PFP1>;
template class Algo::Surface::Decimation::EdgeSelector_QEM<PFP1>;
template class Algo::Surface::Decimation::EdgeSelector_QEMml<PFP1>;
template class Algo::Surface::Decimation::EdgeSelector_NormalArea<PFP1>;
template class Algo::Surface::Decimation::EdgeSelector_Curvature<PFP1>;
template class Algo::Surface::Decimation::EdgeSelector_CurvatureTensor<PFP1>;
template class Algo::Surface::Decimation::EdgeSelector_MinDetail<PFP1>;
template class Algo::Surface::Decimation::EdgeSelector_ColorNaive<PFP1>;
template class Algo::Surface::Decimation::EdgeSelector_GeomColOptGradient<PFP1>;
template class Algo::Surface::Decimation::EdgeSelector_QEMextColor<PFP1>;
int test_edgeSelector()
{
return 0;
}
#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap2.h"
#include "Topology/gmap/embeddedGMap2.h"
#include "Algo/Decimation/geometryApproximator.h"
using namespace CGoGN;
struct PFP1 : public PFP_STANDARD
{
typedef EmbeddedMap2 MAP;
};
struct PFP2 : public PFP_DOUBLE
{
typedef EmbeddedMap2 MAP;
};
struct PFP3 : public PFP_DOUBLE
{
typedef EmbeddedGMap2 MAP;
};
template class Algo::Surface::Decimation::Approximator_QEM<PFP1>;
template class Algo::Surface::Decimation::Approximator_QEMhalfEdge<PFP1>;
template class Algo::Surface::Decimation::Approximator_InterpolateAlongEdge<PFP1,float>;
template class Algo::Surface::Decimation::Approximator_HalfCollapse<PFP1,float>;
template class Algo::Surface::Decimation::Approximator_CornerCutting<PFP1>;
template class Algo::Surface::Decimation::Approximator_NormalArea<PFP1>;
int test_geometryApproximator()
{
return 0;
}
#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap2.h"
#include "Topology/gmap/embeddedGMap2.h"
#include "Algo/Decimation/geometryPredictor.h"
using namespace CGoGN;
struct PFP1 : public PFP_STANDARD
{
typedef EmbeddedMap2 MAP;
};
struct PFP2 : public PFP_DOUBLE
{
typedef EmbeddedMap2 MAP;
};
struct PFP3 : public PFP_DOUBLE
{
typedef EmbeddedGMap2 MAP;
};
template class Algo::Surface::Decimation::Predictor_HalfCollapse<PFP1>;
template class Algo::Surface::Decimation::Predictor_TangentPredict1<PFP1>;
template class Algo::Surface::Decimation::Predictor_TangentPredict2<PFP1>;
template class Algo::Surface::Decimation::Predictor_HalfCollapse<PFP2>;
template class Algo::Surface::Decimation::Predictor_TangentPredict1<PFP2>;
template class Algo::Surface::Decimation::Predictor_TangentPredict2<PFP2>;
template class Algo::Surface::Decimation::Predictor_HalfCollapse<PFP3>;
template class Algo::Surface::Decimation::Predictor_TangentPredict1<PFP3>;
template class Algo::Surface::Decimation::Predictor_TangentPredict2<PFP3>;
int test_geometryPredictor()
{