Commit ba254fb4 authored by Sylvain Thery's avatar Sylvain Thery

Merge branch 'develop' into 'develop'

Develop

See merge request !47
parents a82493fa 0390e0f1
......@@ -2,26 +2,6 @@ cmake_minimum_required(VERSION 2.8)
project(benches)
#SET(CMAKE_BUILD_TYPE Release)
#SET(CMAKE_BUILD_TYPE Debug)
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOTOPOWARNING")
# define includes path
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CGoGN_ROOT_DIR}/include
${CGoGN_EXT_INCLUDES}
)
# define libs path
#IF(WIN32)
# link_directories( ${CGoGN_ROOT_DIR}/lib/$(ConfigurationName) ${Boost_LIBRARY_DIRS} )
#ELSE(WIN32)
# link_directories( ${CGoGN_ROOT_DIR}/lib/Release )
#ENDIF(WIN32)
add_executable(bench_trav bench_trav.cpp )
target_link_libraries( bench_trav ${CGoGN_LIBS} ${CGoGN_EXT_LIBS} )
......
IF (ONELIB)
IF (CGoGN_ONELIB)
SET(CGoGN_LIBS cgogn)
ELSE (ONELIB)
SET(CGoGN_LIBS algo topology container utils)
ENDIF (ONELIB)
ELSE ()
SET(CGoGN_LIBS algo) # topology container utils include by dependencies
ENDIF ()
IF (WIN32)
link_directories( ${CGoGN_ROOT_DIR}/lib/${ConfigurationName} ${Boost_LIBRARY_DIRS})
SET(EXECUTABLE_OUTPUT_PATH ${CGoGN_ROOT_DIR}/bin/) # Release/Debug added automatically by visual
link_directories( ${CGoGN_ROOT_DIR}/windows_dependencies/lib/)
IF((CGoGN_WITH_QTCREATOR))
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})
SET(EXECUTABLE_OUTPUT_PATH ${CGoGN_ROOT_DIR}/bin/) # Release/Debug added automatically by visual
ENDIF()
ELSE()
link_directories( ${CGoGN_ROOT_DIR}/lib/${CMAKE_BUILD_TYPE} )
SET(EXECUTABLE_OUTPUT_PATH ${CGoGN_ROOT_DIR}/bin/${CMAKE_BUILD_TYPE} )
ENDIF()
include_directories(
${CGoGN_ROOT_DIR}/include
${CGoGN_EXT_INCLUDES})
#include_directories(
# ${CGoGN_ROOT_DIR}/include
# ${CGoGN_EXT_INCLUDES})
IF (COMPILE_SANDBOX)
IF (CGoGN_COMPILE_SANDBOX)
add_subdirectory(SandBox)
ENDIF()
IF (COMPILE_EXAMPLES AND WITH_QT)
add_subdirectory(Examples)
IF (CGoGN_COMPILE_EXAMPLES AND CGoGN_WITH_QT)
add_subdirectory(Examples)
ENDIF()
IF (COMPILE_TUTOS)
IF (CGoGN_COMPILE_TUTOS)
add_subdirectory(Tuto)
ENDIF()
IF (COMPILE_BENCHES)
IF (CGoGN_COMPILE_BENCHES)
add_subdirectory(Benches)
ENDIF()
IF (COMPILE_TESTS)
IF (CGoGN_COMPILE_TESTS)
add_subdirectory(Tests)
ENDIF()
#IF (WITH_QT)
# add_subdirectory(Tuto)
# add_subdirectory(Examples)
# IF (NOT DONOT_COMPILE_SANDBOX)
# add_subdirectory(SandBox)
# ENDIF (NOT DONOT_COMPILE_SANDBOX)
#ENDIF (WITH_QT)
#add_subdirectory(Tests)
#add_subdirectory(Benches)
#add_subdirectory(Tuto/Traversals)
#add_subdirectory(Tuto/Attributes)
#add_subdirectory(Tuto/Markers)
#add_subdirectory(Tuto/Boundary)
#add_subdirectory(Tuto/Modelling)
......@@ -2,20 +2,10 @@ cmake_minimum_required(VERSION 2.8)
project(examples)
#SET(CMAKE_BUILD_TYPE Release)
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOTOPOWARNING")
# define includes path
include_directories(${CMAKE_CURRENT_BINARY_DIR})
# define libs path
#IF(WIN32)
# link_directories( ${CGoGN_ROOT_DIR}/lib/$(ConfigurationName) ${Boost_LIBRARY_DIRS} )
#ELSE(WIN32)
# link_directories( ${CGoGN_ROOT_DIR}/lib/Release )
#ENDIF(WIN32)
#define exec to compile
......
......@@ -692,7 +692,7 @@ Clipping::Clipping():
m_timer(NULL),
m_lastAnimatedClippingPreset(NULL)
{
m_coeffTopoExplod = Geom::Vec3f(0.9,0.9,0.9);
m_coeffTopoExplod = Geom::Vec3f(0.9f,0.9f,0.9f);
}
void Clipping::initGUI()
......@@ -856,10 +856,10 @@ void Clipping::cb_initGL()
// setup clipping shapes
m_planeDrawable = new Utils::Grid;
m_planeDrawable->setColor(Geom::Vec4f(1.0, 0.0, 0.0, 1.0));
m_planeDrawable->setColor(Geom::Vec4f(1.0f, 0.0f, 0.0f, 1.0f));
m_planeDrawable->updatePrecisionDrawing(5);
m_sphereDrawable = new Utils::IcoSphere;
m_sphereDrawable->setColor(Geom::Vec4f(0.0, 0.4, 1.0, 1.0));
m_sphereDrawable->setColor(Geom::Vec4f(0.0f, 0.4f, 1.0f, 1.0f));
m_sphereDrawable->updatePrecisionDrawing(1);
// setup clipping picking frame
......
......@@ -542,7 +542,7 @@ void Viewer::importMesh(std::string& filename)
else
{
std::vector<std::string> attrNames ;
if(!Algo::Surface::Import::importMesh<PFP>(myMap, filename.c_str(), attrNames))
if(!Algo::Surface::Import::importMesh<PFP>(myMap, filename, attrNames))
{
CGoGNerr << "could not import " << filename << CGoGNendl ;
return;
......
......@@ -29,12 +29,8 @@
#include "Algo/Modelisation/polyhedron.h"
#include "Algo/Import/import.h"
#include "Algo/Geometry/volume.h"
#include "Algo/Modelisation/tetrahedralization.h"
#include "Algo/Geometry/area.h"
#include "Utils/chrono.h"
#include "Algo/Export/exportVol.h"
MAP myMap;
......@@ -181,7 +177,7 @@ void MyQT::cb_Open()
// maxV=v;
if(myMap.isVolumeIncidentToBoundary(d))
color[d] = VEC3(1,0.41,0.706);
color[d] = VEC3(1.0f,0.41f,0.706f);
}
// for (unsigned int i = color.begin(); i != color.end(); color.next(i))
// {
......@@ -275,6 +271,14 @@ void MyQT::cb_redraw()
m_frame->draw();
m_PlanePick->draw();
}
m_nbFrames++;
if (m_nbFrames >=40)
{
std::cout << 40000.0/m_frame_ch.elapsed()<< " fps"<<std::endl;
m_nbFrames = 0;
m_frame_ch.start();
}
}
......@@ -385,23 +389,6 @@ int main(int argc, char **argv)
std::string filename(argv[1]);
size_t pos = filename.rfind("."); // position of "." in filename
std::string extension = filename.substr(pos);
/*
if(extension == std::string(".off"))
{
if(!Algo::Volume::Import::importMeshToExtrude<PFP>(myMap, filename, attrNames))
{
std::cerr << "could not import " << filename << std::endl ;
return 1;
}
else
{
position = myMap.getAttribute<VEC3, VERTEX>(attrNames[0]) ;
myMap.closeMap();
}
}
else
{
*/
if(extension == std::string(".mapbin"))
{
......@@ -421,36 +408,20 @@ int main(int argc, char **argv)
color = myMap.addAttribute<VEC3, VOLUME, MAP>("colorVol");
TraversorCell<MAP, VOLUME> tra(myMap);
float maxV = 0.0f;
for (Dart d = tra.begin(); d != tra.end(); d = tra.next())
{
// float v = Algo::Geometry::tetrahedronVolume<PFP>(myMap, d, position);
color[d] = PFP::VEC3(1.0,0,0);
// if (v>maxV)
// maxV=v;
if(myMap.isVolumeIncidentToBoundary(d))
color[d] = PFP::VEC3(1,0.41,0.706);
//else
// color[d] = PFP::VEC3(1.0,0,0);
/*
float v = Algo::Geometry::tetrahedronVolume<PFP>(myMap, d, position);
float v = Algo::Geometry::convexPolyhedronVolume<PFP>(myMap, d, position);
color[d] = VEC3(v,0,0);
if (v>maxV)
maxV=v;
// if(myMap.isVolumeIncidentToBoundary(d))
// color[d] = VEC3(0,0,0);
// else
color[d] = VEC3(v,0,0);
}
for (unsigned int i = color.begin(); i != color.end(); color.next(i))
{
color[i][0] /= maxV;
color[i][2] = 1.0f - color[i][0];
*/
}
}
......@@ -458,7 +429,7 @@ int main(int argc, char **argv)
{
position = myMap.addAttribute<VEC3, VERTEX, MAP>("position");
int nb = 32;
int nb = 16;
Algo::Volume::Tilings::Cubic::Grid<PFP> cubic(myMap, nb, nb, nb);
cubic.embedIntoGrid(position, 1.0f, 1.0f, 1.0f);
......@@ -472,9 +443,6 @@ int main(int argc, char **argv)
TraversorW<MAP> tra(myMap);
for (Dart d = tra.begin(); d != tra.end(); d = tra.next())
color[d] = position[d] + VEC3(0.5,0.5,0.5);
// Algo::Volume::Export::exportMSH<PFP>(myMap,position,"/tmp/test2.msh");
// Algo::Volume::Export::exportNAS<PFP>(myMap,position,"/tmp/test1.nas");
// Algo::Volume::Export::exportVTU<PFP>(myMap,position,"/tmp/test3.vtu");
}
myMap.check();
......@@ -513,37 +481,30 @@ int main(int argc, char **argv)
sqt.show();
dock.slider_explode->setValue(80);