Commit 1d00bf8f authored by Pierre Kraemer's avatar Pierre Kraemer

Merge branch 'develop' of icube-forge.unistra.fr:cgogn/cgogn into develop

parents 76a2aeaa 2b08f627
...@@ -55,7 +55,7 @@ void testVAbyNames(MAP& map, const std::string& name) ...@@ -55,7 +55,7 @@ void testVAbyNames(MAP& map, const std::string& name)
if (testPos.isValid()) if (testPos.isValid())
std::cout << "Attribute "<< name <<" valid"<< std::endl; std::cout << "Attribute "<< name <<" valid"<< std::endl;
else else
std::cout << "Attribute "<< name <<"invalid"<< std::endl; std::cout << "Attribute "<< name <<" invalid"<< std::endl;
} }
/** /**
...@@ -240,6 +240,7 @@ int main() ...@@ -240,6 +240,7 @@ int main()
computeNewPositions(myMap,positionAtt); computeNewPositions(myMap,positionAtt);
dumpAttribute(positionAtt); dumpAttribute(positionAtt);
//check if there is a Vertex Attribute of VEC3 named position => yes //check if there is a Vertex Attribute of VEC3 named position => yes
testVAbyNames(myMap,"position"); testVAbyNames(myMap,"position");
...@@ -247,7 +248,29 @@ int main() ...@@ -247,7 +248,29 @@ int main()
myMap.removeAttribute(positionAtt); myMap.removeAttribute(positionAtt);
//check if there is a Vertex Attribute of VEC3 named position => no //check if there is a Vertex Attribute of VEC3 named position => no
std::cout << "after removing position"<< std::endl;
testVAbyNames(myMap,"position"); testVAbyNames(myMap,"position");
// its also possible to add an attribute only with name of type in a string (if type has been registred)
if (myMap.addAttribute<VERTEX>("double", "pipo_double"))
{
VertexAttribute<double, MAP> position_double = myMap.getAttribute<double, VERTEX, MAP>("pipo_double");
position_double[v] = 3.1415926;
}
if (!myMap.addAttribute<VERTEX>("double", "pipo_double"))
{
std::cout << "problem"<< std::endl;
}
if (!myMap.addAttribute<VERTEX>("triple", "pipo_triple"))
{
std::cout << "problem"<< std::endl;
}
return 0; return 0;
} }
...@@ -6,7 +6,9 @@ project(Tutos) ...@@ -6,7 +6,9 @@ project(Tutos)
#SET (CMAKE_BUILD_TYPE Debug) #SET (CMAKE_BUILD_TYPE Debug)
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOTOPOWARNING") #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOTOPOWARNING")
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wno-overloaded-virtual")
endif()
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
# ${CGoGN_ROOT_DIR}/include # ${CGoGN_ROOT_DIR}/include
......
...@@ -84,6 +84,7 @@ ENDIF (WITH_GLEWMX) ...@@ -84,6 +84,7 @@ ENDIF (WITH_GLEWMX)
add_definitions(-DSHADERPATH="${CGoGN_ROOT_DIR}/lib/Shaders/") add_definitions(-DSHADERPATH="${CGoGN_ROOT_DIR}/lib/Shaders/")
add_definitions(-DGLM_FORCE_RADIANS)
# define includes of external libs # define includes of external libs
SET (CGoGN_EXT_INCLUDES SET (CGoGN_EXT_INCLUDES
...@@ -115,7 +116,7 @@ IF(WIN32) ...@@ -115,7 +116,7 @@ IF(WIN32)
ELSE(WIN32) ELSE(WIN32)
find_package(SuiteSparse REQUIRED) find_package(SuiteSparse REQUIRED)
SET (CGoGN_EXT_INCLUDES ${CGoGN_EXT_INCLUDES} ${SUITESPARSE_INCLUDE_DIRS}) SET (CGoGN_EXT_INCLUDES ${CGoGN_EXT_INCLUDES} ${SUITESPARSE_INCLUDE_DIRS})
SET (CGoGN_EXT_LIBS ${CGoGN_EXT_LIBS} ${SUITESPARSE_LIBRARIES}) SET (CGoGN_EXT_LIBS ${CGoGN_EXT_LIBS} ${SUITESPARSE_LIBRARIES} pthread)
ENDIF(WIN32) ENDIF(WIN32)
...@@ -150,7 +151,6 @@ IF (WITH_GLEWMX) ...@@ -150,7 +151,6 @@ IF (WITH_GLEWMX)
ADD_DEFINITIONS(-DGLEW_MX) ADD_DEFINITIONS(-DGLEW_MX)
ENDIF (WITH_GLEWMX) ENDIF (WITH_GLEWMX)
# qq definition specifiques pour mac # qq definition specifiques pour mac
#IF(APPLE) #IF(APPLE)
# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMAC_OSX") # SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMAC_OSX")
...@@ -174,7 +174,9 @@ ELSE() ...@@ -174,7 +174,9 @@ ELSE()
endif() endif()
ENDIF() ENDIF()
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wno-overloaded-virtual")
endif()
IF(WIN32) IF(WIN32)
......
...@@ -39,6 +39,7 @@ SET( QT_USE_QTSVG TRUE ) ...@@ -39,6 +39,7 @@ SET( QT_USE_QTSVG TRUE )
INCLUDE(${QT_USE_FILE}) INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(${QT_DEFINITIONS})
add_definitions(-DGLM_FORCE_RADIANS)
#MESSAGE HERE FOR MORE EASY READING (MESSAGE AT THE END) #MESSAGE HERE FOR MORE EASY READING (MESSAGE AT THE END)
MESSAGE("Build type = " ${CMAKE_BUILD_TYPE} " (for change -DCMAKE_BUILD_TYPE=Release|Debug)" ) MESSAGE("Build type = " ${CMAKE_BUILD_TYPE} " (for change -DCMAKE_BUILD_TYPE=Release|Debug)" )
...@@ -96,13 +97,18 @@ SET (EXT_LIBS ...@@ -96,13 +97,18 @@ SET (EXT_LIBS
# qq definition specifiques pour mac # qq definition specifiques pour mac
IF(APPLE) #IF(APPLE)
# attention a changer pour chercher la bonne version automatiquement # attention a changer pour chercher la bonne version automatiquement
SET(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.6.sdk" CACHE STRING "developer SDK") # SET(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.6.sdk" CACHE STRING "developer SDK")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined -Wl,dynamic_lookup") # SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined -Wl,dynamic_lookup")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMAC_OSX") # SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMAC_OSX")
SET(CMAKE_OSX_ARCHITECTURES x86_64) # SET(CMAKE_OSX_ARCHITECTURES x86_64)
ENDIF(APPLE) #ENDIF(APPLE)
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wno-overloaded-virtual")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined -Wl,dynamic_lookup")
endif()
if(CMAKE_COMPILER_IS_GNUCXX) if(CMAKE_COMPILER_IS_GNUCXX)
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
...@@ -150,6 +156,7 @@ SET(SCHNApps_QOBJECT_FILES ...@@ -150,6 +156,7 @@ SET(SCHNApps_QOBJECT_FILES
${SCHNApps_ROOT_DIR}/include/controlDock_pluginTab.h ${SCHNApps_ROOT_DIR}/include/controlDock_pluginTab.h
${SCHNApps_ROOT_DIR}/include/controlDock_mapTab.h ${SCHNApps_ROOT_DIR}/include/controlDock_mapTab.h
${SCHNApps_ROOT_DIR}/include/colorComboBox.h ${SCHNApps_ROOT_DIR}/include/colorComboBox.h
${SCHNApps_ROOT_DIR}/include/dialogList.h
) )
...@@ -187,6 +194,7 @@ ADD_EXECUTABLE( SCHNApps ...@@ -187,6 +194,7 @@ ADD_EXECUTABLE( SCHNApps
TARGET_LINK_LIBRARIES( SCHNApps TARGET_LINK_LIBRARIES( SCHNApps
${CGoGN_LIBS} ${CGoGN_LIBS}
${EXT_LIBS} ${EXT_LIBS}
pthread
) )
......
...@@ -3,10 +3,13 @@ QT4_WRAP_UI( PLUGIN_UIC_FILES ${PLUGIN_UI_FILES} ) ...@@ -3,10 +3,13 @@ QT4_WRAP_UI( PLUGIN_UIC_FILES ${PLUGIN_UI_FILES} )
QT4_WRAP_CPP( PLUGIN_MOC_FILES ${PLUGIN_QOBJECT_FILES} ) QT4_WRAP_CPP( PLUGIN_MOC_FILES ${PLUGIN_QOBJECT_FILES} )
IF(APPLE) #IF(APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -L/usr/local/lib") # SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -L/usr/local/lib")
ENDIF(APPLE) #ENDIF(APPLE)
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
endif()
ADD_LIBRARY( ${PLUGIN_NAME} SHARED ADD_LIBRARY( ${PLUGIN_NAME} SHARED
${PLUGIN_FILES} ${PLUGIN_FILES}
...@@ -17,6 +20,7 @@ ADD_LIBRARY( ${PLUGIN_NAME} SHARED ...@@ -17,6 +20,7 @@ ADD_LIBRARY( ${PLUGIN_NAME} SHARED
TARGET_LINK_LIBRARIES( ${PLUGIN_NAME} TARGET_LINK_LIBRARIES( ${PLUGIN_NAME}
${CGoGN_LIBS} ${CGoGN_LIBS}
${EXT_LIBS} ${EXT_LIBS}
pthread
) )
ADD_DEPENDENCIES( ${PLUGIN_NAME} SCHNApps ) ADD_DEPENDENCIES( ${PLUGIN_NAME} SCHNApps )
......
...@@ -38,6 +38,8 @@ private slots: ...@@ -38,6 +38,8 @@ private slots:
void computeNormalFromDialog(); void computeNormalFromDialog();
void computeCurvatureFromDialog(); void computeCurvatureFromDialog();
void appsFinished();
public slots: public slots:
void computeNormal(const QString& mapName, void computeNormal(const QString& mapName,
const QString& positionAttributeName = "position", const QString& positionAttributeName = "position",
......
...@@ -37,6 +37,9 @@ bool Surface_DifferentialProperties_Plugin::enable() ...@@ -37,6 +37,9 @@ bool Surface_DifferentialProperties_Plugin::enable()
connect(m_schnapps, SIGNAL(mapAdded(MapHandlerGen*)), this, SLOT(mapAdded(MapHandlerGen*))); connect(m_schnapps, SIGNAL(mapAdded(MapHandlerGen*)), this, SLOT(mapAdded(MapHandlerGen*)));
connect(m_schnapps, SIGNAL(mapRemoved(MapHandlerGen*)), this, SLOT(mapRemoved(MapHandlerGen*))); connect(m_schnapps, SIGNAL(mapRemoved(MapHandlerGen*)), this, SLOT(mapRemoved(MapHandlerGen*)));
connect(m_schnapps, SIGNAL(appsFinished()), this, SLOT(appsFinished()));
foreach(MapHandlerGen* map, m_schnapps->getMapSet().values()) foreach(MapHandlerGen* map, m_schnapps->getMapSet().values())
mapAdded(map); mapAdded(map);
...@@ -56,6 +59,8 @@ void Surface_DifferentialProperties_Plugin::disable() ...@@ -56,6 +59,8 @@ void Surface_DifferentialProperties_Plugin::disable()
disconnect(m_schnapps, SIGNAL(mapAdded(MapHandlerGen*)), this, SLOT(mapAdded(MapHandlerGen*))); disconnect(m_schnapps, SIGNAL(mapAdded(MapHandlerGen*)), this, SLOT(mapAdded(MapHandlerGen*)));
disconnect(m_schnapps, SIGNAL(mapRemoved(MapHandlerGen*)), this, SLOT(mapRemoved(MapHandlerGen*))); disconnect(m_schnapps, SIGNAL(mapRemoved(MapHandlerGen*)), this, SLOT(mapRemoved(MapHandlerGen*)));
disconnect(m_schnapps, SIGNAL(appsFinished()), this, SLOT(appsFinished()));
} }
void Surface_DifferentialProperties_Plugin::mapAdded(MapHandlerGen *map) void Surface_DifferentialProperties_Plugin::mapAdded(MapHandlerGen *map)
...@@ -213,6 +218,7 @@ void Surface_DifferentialProperties_Plugin::computeNormal( ...@@ -213,6 +218,7 @@ void Surface_DifferentialProperties_Plugin::computeNormal(
mh->notifyAttributeModification(normal); mh->notifyAttributeModification(normal);
} }
void Surface_DifferentialProperties_Plugin::computeCurvature( void Surface_DifferentialProperties_Plugin::computeCurvature(
const QString& mapName, const QString& mapName,
const QString& positionAttributeName, const QString& positionAttributeName,
...@@ -303,6 +309,13 @@ void Surface_DifferentialProperties_Plugin::computeCurvature( ...@@ -303,6 +309,13 @@ void Surface_DifferentialProperties_Plugin::computeCurvature(
} }
} }
void Surface_DifferentialProperties_Plugin::appsFinished()
{
m_computeNormalDialog->close();
m_computeCurvatureDialog->close();
}
Q_EXPORT_PLUGIN2(Surface_DifferentialProperties_Plugin, Surface_DifferentialProperties_Plugin) Q_EXPORT_PLUGIN2(Surface_DifferentialProperties_Plugin, Surface_DifferentialProperties_Plugin)
} // namespace SCHNApps } // namespace SCHNApps
......
...@@ -67,6 +67,8 @@ public: ...@@ -67,6 +67,8 @@ public:
~Surface_Render_Plugin() ~Surface_Render_Plugin()
{} {}
private: private:
virtual bool enable(); virtual bool enable();
virtual void disable(); virtual void disable();
...@@ -95,6 +97,8 @@ private slots: ...@@ -95,6 +97,8 @@ private slots:
void vboAdded(Utils::VBO* vbo); void vboAdded(Utils::VBO* vbo);
void vboRemoved(Utils::VBO* vbo); void vboRemoved(Utils::VBO* vbo);
void appsFinished();
public slots: public slots:
// slots for Python calls // slots for Python calls
......
...@@ -41,6 +41,7 @@ bool Surface_Render_Plugin::enable() ...@@ -41,6 +41,7 @@ bool Surface_Render_Plugin::enable()
connect(m_schnapps, SIGNAL(selectedMapChanged(MapHandlerGen*, MapHandlerGen*)), this, SLOT(selectedMapChanged(MapHandlerGen*, MapHandlerGen*))); connect(m_schnapps, SIGNAL(selectedMapChanged(MapHandlerGen*, MapHandlerGen*)), this, SLOT(selectedMapChanged(MapHandlerGen*, MapHandlerGen*)));
connect(m_schnapps, SIGNAL(mapAdded(MapHandlerGen*)), this, SLOT(mapAdded(MapHandlerGen*))); connect(m_schnapps, SIGNAL(mapAdded(MapHandlerGen*)), this, SLOT(mapAdded(MapHandlerGen*)));
connect(m_schnapps, SIGNAL(mapRemoved(MapHandlerGen*)), this, SLOT(mapRemoved(MapHandlerGen*))); connect(m_schnapps, SIGNAL(mapRemoved(MapHandlerGen*)), this, SLOT(mapRemoved(MapHandlerGen*)));
connect(m_schnapps, SIGNAL(appsFinished()), this, SLOT(appsFinished()));
foreach(MapHandlerGen* map, m_schnapps->getMapSet().values()) foreach(MapHandlerGen* map, m_schnapps->getMapSet().values())
mapAdded(map); mapAdded(map);
...@@ -61,6 +62,7 @@ void Surface_Render_Plugin::disable() ...@@ -61,6 +62,7 @@ void Surface_Render_Plugin::disable()
disconnect(m_schnapps, SIGNAL(selectedMapChanged(MapHandlerGen*, MapHandlerGen*)), this, SLOT(selectedMapChanged(MapHandlerGen*, MapHandlerGen*))); disconnect(m_schnapps, SIGNAL(selectedMapChanged(MapHandlerGen*, MapHandlerGen*)), this, SLOT(selectedMapChanged(MapHandlerGen*, MapHandlerGen*)));
disconnect(m_schnapps, SIGNAL(mapAdded(MapHandlerGen*)), this, SLOT(mapAdded(MapHandlerGen*))); disconnect(m_schnapps, SIGNAL(mapAdded(MapHandlerGen*)), this, SLOT(mapAdded(MapHandlerGen*)));
disconnect(m_schnapps, SIGNAL(mapRemoved(MapHandlerGen*)), this, SLOT(mapRemoved(MapHandlerGen*))); disconnect(m_schnapps, SIGNAL(mapRemoved(MapHandlerGen*)), this, SLOT(mapRemoved(MapHandlerGen*)));
disconnect(m_schnapps, SIGNAL(appsFinished()), this, SLOT(appsFinished()));
foreach(MapHandlerGen* map, m_schnapps->getMapSet().values()) foreach(MapHandlerGen* map, m_schnapps->getMapSet().values())
mapRemoved(map); mapRemoved(map);
...@@ -397,6 +399,12 @@ void Surface_Render_Plugin::changeVertexColor(const QString& view, const QString ...@@ -397,6 +399,12 @@ void Surface_Render_Plugin::changeVertexColor(const QString& view, const QString
} }
void Surface_Render_Plugin::appsFinished()
{
m_dockTab->m_colorDial->close();
}
Q_EXPORT_PLUGIN2(Surface_Render_Plugin, Surface_Render_Plugin) Q_EXPORT_PLUGIN2(Surface_Render_Plugin, Surface_Render_Plugin)
} // namespace SCHNApps } // namespace SCHNApps
......
...@@ -29,6 +29,7 @@ public: ...@@ -29,6 +29,7 @@ public:
private slots: private slots:
void openSubdivisionDialog(); void openSubdivisionDialog();
void subdivideFromDialog(); void subdivideFromDialog();
void appsFinished();
public slots: public slots:
void loopSubdivision( void loopSubdivision(
......
...@@ -125,6 +125,12 @@ void Surface_Subdivision_Plugin::trianguleFaces( ...@@ -125,6 +125,12 @@ void Surface_Subdivision_Plugin::trianguleFaces(
view->updateGL(); view->updateGL();
} }
void Surface_Subdivision_Plugin::appsFinished()
{
m_subdivisionDialog->close();
}
Q_EXPORT_PLUGIN2(Surface_Subdivision_Plugin, Surface_Subdivision_Plugin) Q_EXPORT_PLUGIN2(Surface_Subdivision_Plugin, Surface_Subdivision_Plugin)
} // namespace SCHNApps } // namespace SCHNApps
......
...@@ -26,6 +26,12 @@ public: ...@@ -26,6 +26,12 @@ public:
~Camera(); ~Camera();
const QString& getName() const { return m_name; } const QString& getName() const { return m_name; }
void updateParams();
void drawBBCam();
bool m_drawBB;
public slots: public slots:
QString getName() { return m_name; } QString getName() { return m_name; }
SCHNApps* getSCHNApps() const { return m_schnapps; } SCHNApps* getSCHNApps() const { return m_schnapps; }
...@@ -40,24 +46,34 @@ public slots: ...@@ -40,24 +46,34 @@ public slots:
const QList<View*>& getLinkedViews() const { return l_views; } const QList<View*>& getLinkedViews() const { return l_views; }
bool isLinkedToView(View* view) const { return l_views.contains(view); } bool isLinkedToView(View* view) const { return l_views.contains(view); }
bool isLinkedToMap(MapHandlerGen* mhg) const;
private: private:
void linkView(View* view); void linkView(View* view);
void unlinkView(View* view); void unlinkView(View* view);
private slots: private slots:
void frameModified(); void frameModified();
void mapAdded(MapHandlerGen* mhg);
void mapRemoved(MapHandlerGen* mhg);
void BBModified();
public slots: public slots:
void setProjectionType(int t); void setProjectionType(int t);
void setDraw(bool b); void setDraw(bool b);
void setDrawPath(bool b); void setDrawPath(bool b);
signals: signals:
void projectionTypeChanged(int); void projectionTypeChanged(int);
void drawChanged(bool); void drawChanged(bool);
void drawPathChanged(bool); void drawPathChanged(bool);
protected: protected:
qglviewer::Vec m_bbMin;
qglviewer::Vec m_bbMax;
QString m_name; QString m_name;
SCHNApps* m_schnapps; SCHNApps* m_schnapps;
......
...@@ -28,22 +28,25 @@ private slots: ...@@ -28,22 +28,25 @@ private slots:
void cameraProjectionChanged(QAbstractButton* b); void cameraProjectionChanged(QAbstractButton* b);
void cameraDrawClicked(bool b); void cameraDrawClicked(bool b);
void cameraDrawPathClicked(bool b); void cameraDrawPathClicked(bool b);
void cameraSelectionChanged();
// slots called from SCHNApps signals // slots called from SCHNApps signals
void cameraAdded(Camera* c); void cameraAdded(Camera* c);
void cameraRemoved(Camera* c); void cameraRemoved(Camera* c);
void selectedViewChanged(View* prev, View* cur); // void selectedViewChanged(View* prev, View* cur);