Commit c926209f authored by Sylvain Thery's avatar Sylvain Thery

corrrection tuto compilation

parent fc493e8f
cmake_minimum_required(VERSION 2.8)
project(Tuto_Traversals)
SET (CMAKE_BUILD_TYPE Debug)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOTOPOWARNING")
project(Tuto_Attributes)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_executable( simple_attribs simple_attribs.cpp)
target_link_libraries( simple_attribs ${CGoGN_LIBS} ${CGoGN_EXT_LIBS} )
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 ${CGoGN_ROOT_DIR}/lib/Debug)
ENDIF(WIN32)
add_executable( multi_attribs multi_attribs.cpp)
target_link_libraries( multi_attribs ${CGoGN_LIBS} ${CGoGN_EXT_LIBS} )
#define exec to compile
IF(WITH_QT)
add_executable( simple_attribs simple_attribs.cpp)
target_link_libraries( simple_attribs ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
QT4_WRAP_UI(vbo_attribs_ui vbo_attribs.ui)
QT4_WRAP_CPP(vbo_attribs_moc vbo_attribs.h)
add_executable( vbo_attribs vbo_attribs.cpp ${vbo_attribs_ui} ${vbo_attribs_moc})
target_link_libraries( vbo_attribs ${CGoGN_LIBS} ${CGoGN_EXT_LIBS} )
add_executable( multi_attribs multi_attribs.cpp)
target_link_libraries( multi_attribs ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
ENDIF()
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#include "vbo_attribs.h"
#include "Algo/Geometry/boundingbox.h"
using namespace CGoGN ;
int main(int argc, char **argv)
{
// // interface
QApplication app(argc, argv);
MyQT sqt;
// copy output tout Qt console of application (shift enter)
CGoGNout.toConsole(&sqt);
// example code itself
sqt.createMap();
// set help message in menu
sqt.setHelpMsg("Tuto 2: \nCreate and use multiple attributes\nrender with multiple shaders");
// final show for redraw
sqt.show();
// and wait for the end
return app.exec();
}
void MyQT::createMap()
{
// creation of 2 new faces: 1 triangle and 1 square, sew and embed (see tuto1 for details)
Dart d1 = myMap.newFace(3);
Dart d2 = myMap.newFace(4);
myMap.sewFaces(d1, d2);
VertexAttribute<VEC3, MAP> position = myMap.addAttribute<PFP::VEC3, VERTEX, MAP>("position");
position[d1] = PFP::VEC3(0, 0, 0);
position[PHI1(d1)] = PFP::VEC3(2, 0, 0);
position[PHI_1(d1)] = PFP::VEC3(1, 2, 0);
position[PHI<11>(d2)] = PFP::VEC3(0, -2, 0);
position[PHI_1(d2)] = PFP::VEC3(2, -2, 0);
// create another attribute on vertices (for faces drawing)
VertexAttribute<VEC3, MAP> colorF = myMap.addAttribute<PFP::VEC3, VERTEX, MAP>("colorF");
colorF[d1] = Geom::Vec3f(1.0f,0.0f,0.0f);
colorF[PHI1(d1)] = Geom::Vec3f(0.0f,1.0f,0.0f);
colorF[PHI_1(d1)] = Geom::Vec3f(0.0f,0.0f,1.0f);
colorF[PHI<11>(d2)] = Geom::Vec3f(1.0f,0.0f,1.0f);
colorF[PHI_1(d2)] = Geom::Vec3f(0.0f,1.0f,1.0f);
// create another attribute on vertices (for edges drawing)
VertexAttribute<VEC3, MAP> colorE = myMap.addAttribute<PFP::VEC3, VERTEX, MAP>("colorE");
colorE[d1] = Geom::Vec3f(0.0f,0.5f,0.5f);
colorE[PHI1(d1)] = Geom::Vec3f(0.5f,0.0f,0.5f);
colorE[PHI_1(d1)] = Geom::Vec3f(0.5f,0.5f,0.0f);
colorE[PHI<11>(d2)] = Geom::Vec3f(0.0f,0.5f,0.0f);
colorE[PHI_1(d2)] = Geom::Vec3f(0.5f,0.0f,0.0f);
// example of attribute on face
// here for example we store the number of edges of faces at construction
FaceAttribute<int, MAP> side = myMap.addAttribute<int, FACE, MAP>("nb_sides");
side[d1] = 3;
side[d2] = 4;
// bounding box of scene
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);
// send BB info to interface for centering on GL screen
setParamObject(lWidthObj, lPosObj.data());
// first show for be sure that GL context is binded
show();
// update of position VBO (context GL necessary)
m_positionVBO->updateData(position);
// m_colorVBO1->updateData(colorF);
m_colorVBO2->updateData(colorE);
m_colorVBO1->updateData_withLambdaConversion<PFP::VEC3,Geom::Vec3f,3>(colorF, [](const PFP::VEC3& x)
{
return Geom::Vec3f(float(1.0-x[0]),float(1.0-x[1]),float(1.0-x[2]));
});
// m_colorVBO2->updateData_withLambdaConversion<PFP::VEC3,Geom::Vec3f,3>(colorE, [](const PFP::VEC3& x)
// {
// return Geom::Vec3f(float(1.0-x[0]),float(1.0-x[1]),float(1.0-x[2]));
// });
// construct rendering primities
m_render->initPrimitives<PFP>(myMap, Algo::Render::GL2::TRIANGLES);
m_render->initPrimitives<PFP>(myMap, Algo::Render::GL2::LINES);
m_render->initPrimitives<PFP>(myMap, Algo::Render::GL2::POINTS);
}
// initialization GL callback
void MyQT::cb_initGL()
{
// choose to use GL version 2
Utils::GLSLShader::setCurrentOGLVersion(2);
// create the render
m_render = new Algo::Render::GL2::MapRender();
// create VBO for position
m_positionVBO = new Utils::VBO();
// and color
m_colorVBO1 = new Utils::VBO();
m_colorVBO2 = new Utils::VBO();
// using simple shader with color
m_shader = new Utils::ShaderSimpleColor();
m_shader->setAttributePosition(m_positionVBO);
m_shader->setColor(Geom::Vec4f(0.0f, 1.0f, 0.0f, 0.0f));
// each shader must be registred to allow Qt interface to update matrices uniforms
registerShader(m_shader);
m_shader2 = new Utils::ShaderColorPerVertex();
m_shader2->setAttributePosition(m_positionVBO);
// m_shader2->setAttributeColor(m_colorVBO1);
// each shader must be registred to allow Qt interface to update matrices uniforms
registerShader(m_shader2);
}
// redraw GL callback (clear and swap already done)
void MyQT::cb_redraw()
{
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glEnable(GL_CULL_FACE);
// draw yellow points
glLineWidth(2.0f);
m_shader2->setAttributeColor(m_colorVBO1);
m_render->draw(m_shader2, Algo::Render::GL2::LINES);
// draw white points
glPointSize(7.0f);
m_shader->setColor(Geom::Vec4f(1.,1.,1.,0.));
m_render->draw(m_shader, Algo::Render::GL2::POINTS);
// use offset for nice drawing
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(1.0f, 1.0f);
// draw faces with pervertex color rendering
m_shader2->setAttributeColor(m_colorVBO2);
m_render->draw(m_shader2, Algo::Render::GL2::TRIANGLES);
glDisable(GL_POLYGON_OFFSET_FILL);
}
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#ifndef _VBO_ATTTRIBS_
#define _VBO_ATTTRIBS_
#include "Utils/Qt/qtSimple.h"
#include "Utils/cgognStream.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap2.h"
#include "Algo/Render/GL2/mapRender.h"
#include "Utils/Shaders/shaderSimpleColor.h"
#include "Utils/Shaders/shaderColorPerVertex.h"
#include "Utils/vbo.h"
using namespace CGoGN ;
/**
* Struct that contains some informations about the types of the manipulated objects
* Mainly here to be used by the algorithms that are parameterized by it
*/
struct PFP: public PFP_DOUBLE
{
typedef EmbeddedMap2 MAP;
};
typedef PFP::MAP MAP ;
typedef PFP::VEC3 VEC3 ;
class MyQT: public Utils::QT::SimpleQT
{
Q_OBJECT
public:
MyQT(): m_render(NULL), m_positionVBO(NULL), m_shader(NULL) {}
void cb_redraw();
void cb_initGL();
protected:
// declaration of the map
MAP myMap;
// render
Algo::Render::GL2::MapRender* m_render;
// VBO
Utils::VBO* m_positionVBO; // position 3D
Utils::VBO* m_colorVBO1; // color per vertex for face drawing
Utils::VBO* m_colorVBO2; // color per vertex for edge drawing
//shaders
Utils::ShaderSimpleColor* m_shader;
Utils::ShaderColorPerVertex* m_shader2;
// just for more compact writing
inline Dart PHI1(Dart d) {return myMap.phi1(d);}
inline Dart PHI_1(Dart d) {return myMap.phi_1(d);}
inline Dart PHI2(Dart d) {return myMap.phi2(d);}
template<int X>
Dart PHI(Dart d) {return myMap.phi<X>(d);}
public:
// example of simple map creation
void createMap();
};
#endif
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DockWidget</class>
<widget class="QDockWidget" name="DockWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>122</width>
<height>335</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="floating">
<bool>false</bool>
</property>
<property name="features">
<set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable</set>
</property>
<property name="allowedAreas">
<set>Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set>
</property>
<property name="windowTitle">
<string>Control</string>
</property>
<widget class="QWidget" name="dockWidgetContents">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>122</width>
<height>0</height>
</size>
</property>
<widget class="QWidget" name="verticalLayoutWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>122</width>
<height>311</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="sizeConstraint">
<enum>QLayout::SetMaximumSize</enum>
</property>
<item>
<widget class="QCheckBox" name="checkLines">
<property name="text">
<string>Edges drawing</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="color_button">
<property name="text">
<string>Color</string>
</property>
</widget>
</item>
<item>
<widget class="QDial" name="dial_line_width">
<property name="cursor">
<cursorShape>ClosedHandCursor</cursorShape>
</property>
<property name="maximum">
<number>10</number>
</property>
<property name="pageStep">
<number>2</number>
</property>
<property name="sliderPosition">
<number>4</number>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="horizontalSlider">
<property name="maximum">
<number>10</number>
</property>
<property name="pageStep">
<number>2</number>
</property>
<property name="value">
<number>4</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="lineWidth">
<number>3</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Nb darts :</string>
</property>
</widget>
</item>
<item>
<widget class="QLCDNumber" name="number_of_darts">
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="lineWidth">
<number>2</number>
</property>
<property name="numDigits">
<number>6</number>
</property>
<property name="segmentStyle">
<enum>QLCDNumber::Flat</enum>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</widget>
<resources/>
<connections>
<connection>
<sender>dial_line_width</sender>
<signal>valueChanged(int)</signal>
<receiver>horizontalSlider</receiver>
<slot>setValue(int)</slot>
<hints>
<hint type="sourcelabel">
<x>60</x>
<y>134</y>
</hint>
<hint type="destinationlabel">
<x>60</x>
<y>200</y>
</hint>
</hints>
</connection>
<connection>
<sender>horizontalSlider</sender>
<signal>valueChanged(int)</signal>
<receiver>dial_line_width</receiver>
<slot>setValue(int)</slot>
<hints>
<hint type="sourcelabel">
<x>60</x>
<y>200</y>
</hint>
<hint type="destinationlabel">
<x>60</x>
<y>134</y>
</hint>
</hints>
</connection>
</connections>
</ui>
cmake_minimum_required(VERSION 2.8)
project(Tuto_Traversals)
project(Tuto_Boundaries)
SET (CMAKE_BUILD_TYPE Debug)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOTOPOWARNING")
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 ${CGoGN_ROOT_DIR}/lib/Debug)
ENDIF(WIN32)
#define exec to compile
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_executable( boundaries boundaries.cpp)
target_link_libraries( boundaries ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
target_link_libraries( boundaries ${CGoGN_LIBS} ${CGoGN_EXT_LIBS} )
......@@ -20,6 +20,11 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
# link_directories(${CGoGN_ROOT_DIR}/lib/Release ${CGoGN_ROOT_DIR}/lib/Debug)
#ENDIF(WIN32)
add_subdirectory(Boundary)
add_subdirectory(Modelling)
add_subdirectory(Markers)
add_subdirectory(Traversals)
add_subdirectory(Attributes)
#define exec to compile
IF (WITH_QT)
......
cmake_minimum_required(VERSION 2.8)
project(Tuto_Traversals)
project(Tuto_Markers)
SET (CMAKE_BUILD_TYPE Debug)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOTOPOWARNING")
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 ${CGoGN_ROOT_DIR}/lib/Debug)
ENDIF(WIN32)
#define exec to compile
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_executable( dartmarkers dartmarkers.cpp)
target_link_libraries( dartmarkers ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
target_link_libraries( dartmarkers ${CGoGN_LIBS} ${CGoGN_EXT_LIBS} )
add_executable( cellmarkers cellmarkers.cpp)
target_link_libraries( cellmarkers ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
target_link_libraries( cellmarkers ${CGoGN_LIBS} ${CGoGN_EXT_LIBS} )
cmake_minimum_required(VERSION 2.8)
project(Tuto_Traversals)
project(Tuto_Modelling)
SET (CMAKE_BUILD_TYPE Debug)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOTOPOWARNING")
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 ${CGoGN_ROOT_DIR}/lib/Debug)
ENDIF(WIN32)
#define exec to compile
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_executable( basics basics.cpp)
target_link_libraries( basics ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
target_link_libraries( basics ${CGoGN_LIBS} ${CGoGN_EXT_LIBS} )
QT4_WRAP_UI( tuto_oper2_ui tuto_oper2.ui )
QT4_WRAP_CPP(tuto_oper2_moc tuto_oper2.h)
add_executable( tuto_oper2 tuto_oper2.cpp ${tuto_oper2_ui} ${tuto_oper2_moc})
target_link_libraries( tuto_oper2
${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
${CGoGN_LIBS} ${CGoGN_EXT_LIBS} )
QT4_WRAP_UI( tuto_oper3_ui tuto_oper3.ui )
QT4_WRAP_CPP(tuto_oper3_moc tuto_oper3.h)
add_executable( tuto_oper3 tuto_oper3.cpp ${tuto_oper3_ui} ${tuto_oper3_moc})
target_link_libraries( tuto_oper3
${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
${CGoGN_LIBS} ${CGoGN_EXT_LIBS} )
......@@ -2,56 +2,24 @@ cmake_minimum_required(VERSION 2.8)
project(Tuto_Traversals)
SET (CMAKE_BUILD_TYPE Debug)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOTOPOWARNING")
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 ${CGoGN_ROOT_DIR}/lib/Debug)
ENDIF(WIN32)
#define exec to compile
#QT4_WRAP_CPP(tuto1_moc tuto1.h)
#add_executable( tuto1 tuto1.cpp ${tuto1_moc})
#target_link_libraries( tuto1
# ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
#QT4_WRAP_UI( tuto2_ui tuto2.ui )
#QT4_WRAP_CPP(tuto2_moc tuto2.h)
#add_executable( tuto2 tuto2.cpp tuto2.h ${tuto2_ui} ${tuto2_moc})
#target_link_libraries( tuto2
# ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_executable( traverse_cells traverse_cells.cpp)
target_link_libraries( traverse_cells ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
target_link_libraries( traverse_cells ${CGoGN_LIBS} ${CGoGN_EXT_LIBS} )
add_executable( traverse_neighbours traverse_neighbours.cpp)
target_link_libraries( traverse_neighbours ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
target_link_libraries( traverse_neighbours ${CGoGN_LIBS} ${CGoGN_EXT_LIBS} )
add_executable( traverse_attributes traverse_attributes.cpp)
target_link_libraries( traverse_attributes ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
target_link_libraries( traverse_attributes ${CGoGN_LIBS} ${CGoGN_EXT_LIBS} )
QT4_WRAP_UI( show_traversors_ui2 show_traversors2.ui )
QT4_WRAP_CPP(show_traversors_moc2 show_traversors2.h)
add_executable( show_traversors2 show_traversors2.cpp ${show_traversors_ui2} ${show_traversors_moc2})
target_link_libraries( show_traversors2 ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
target_link_libraries( show_traversors2 ${CGoGN_LIBS} ${CGoGN_EXT_LIBS} )
QT4_WRAP_UI( show_traversors_ui3 show_traversors3.ui )
QT4_WRAP_CPP(show_traversors_moc3 show_traversors3.h)
add_executable( show_traversors3 show_traversors3.cpp ${show_traversors_ui3} ${show_traversors_moc3})
target_link_libraries( show_traversors3 ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
target_link_libraries( show_traversors3 ${CGoGN_LIBS} ${CGoGN_EXT_LIBS} )
......@@ -147,6 +147,9 @@ public:
void updateData(const AttributeMultiVectorGen* attrib);
// template <typename T_IN, typename T_OUT, unsigned int VS, typename CONVFUNC>
// void updateData_withLambdaConversion(const AttributeHandlerGen& attribHG, CONVFUNC conv);
/**
* set the converter that convert buffer to float *
*/
......@@ -168,8 +171,62 @@ public:
void copyData(void *ptr) const;
void allocate(unsigned int nbElts);
template <typename T_IN, typename T_OUT, unsigned int VS, typename CONVFUNC>
void updateData_withLambdaConversion(const AttributeHandlerGen& attribHG, CONVFUNC conv)
{
const AttributeMultiVectorGen* attrib = attribHG.getDataVectorGen();
m_name = attrib->getName();
m_typeName = attrib->getTypeName();
m_data_size = VS;
// alloue la memoire pour le buffer et initialise le conv
T_OUT* typedBuffer = new T_OUT[_BLOCKSIZE_];