Commit 26eef763 authored by untereiner's avatar untereiner

Merge cgogn:~thery/CGoGN

Conflicts:
	include/Algo/Render/GL2/topoRender.hpp
parents 39cfb89e f94a83e2
......@@ -14,7 +14,7 @@ SET ( BUILD_SHARED_LIBS OFF CACHE BOOL "if used all library are build as shared
SET ( WITH_ASSIMP ON CACHE BOOL "build CGoGN with Assimp ")
SET ( WITH_ZINRI ON CACHE BOOL "build CGoGN with Zinri lib ")
SET ( WITH_QT ON CACHE BOOL "build CGoGN with Qt lib ")
#SET ( WITH_NUMERICAL OFF CACHE BOOL "build CGoGN with Numerical libs support ")
SET ( WITH_NUMERICAL ON CACHE BOOL "build CGoGN with Numerical libs support ")
IF(WIN32)
set(CMAKE_PREFIX_PATH ${CGoGN_ROOT_DIR}/windows_dependencies CACHE STRING "path to dependencies")
......@@ -59,12 +59,14 @@ IF (WITH_ASSIMP)
add_definitions(-DWITH_ASSIMP)
SET (CGoGN_EXT_INCLUDES ${CGoGN_EXT_INCLUDES} ${CGoGN_ROOT_DIR}/ThirdParty/Assimp/include)
SET (CGoGN_EXT_LIBS ${CGoGN_EXT_LIBS} assimp)
INSTALL (DIRECTORY ThirdParty/Assimp/include DESTINATION .)
ENDIF (WITH_ASSIMP)
IF (WITH_ZINRI)
add_definitions(-DWITH_ZINRI)
SET (CGoGN_EXT_INCLUDES ${CGoGN_EXT_INCLUDES} ${CGoGN_ROOT_DIR}/ThirdParty/Zinri)
SET (CGoGN_EXT_LIBS ${CGoGN_EXT_LIBS} Zinri)
INSTALL (DIRECTORY ThirdParty/Zinri/ DESTINATION include FILES_MATCHING PATTERN "*.h")
ENDIF (WITH_ZINRI)
IF (WITH_QT)
......@@ -83,6 +85,12 @@ ENDIF (WITH_QT)
# SET (CGoGN_NUMERICAL_LIBS f2c blas numerical lapack)
#ENDIF (WITH_NUMERICAL)
IF (WITH_NUMERICAL)
INSTALL(FILES ThirdParty/Numerical/UFconfig/UFconfig.h DESTINATION include )
INSTALL(DIRECTORY ThirdParty/Numerical/ DESTINATION include FILES_MATCHING PATTERN "*.h")
INSTALL(DIRECTORY ThirdParty/Numerical/ DESTINATION include FILES_MATCHING PATTERN "*.hpp")
ENDIF (WITH_NUMERICAL)
# qq definition specifiques pour mac
IF(APPLE)
# attention a changer pour chercher la bonne version automatiquement
......@@ -105,3 +113,8 @@ ELSE(WIN32)
add_subdirectory(${CGoGN_ROOT_DIR}/Apps Apps)
ENDIF(WIN32)
INSTALL (DIRECTORY ${CGoGN_ROOT_DIR}/include ${CGoGN_ROOT_DIR}/lib ${CGoGN_ROOT_DIR}/bin DESTINATION .)
INSTALL (DIRECTORY ThirdParty/glm/glm DESTINATION include)
INSTALL (DIRECTORY cmake_modules DESTINATION .)
INSTALL (FILES apps_cmake.txt DESTINATION .)
......@@ -93,9 +93,6 @@ void Topo3Render::updateDataMap3(typename PFP::MAP& mapx, const typename PFP::TV
{
if (good(d))
{
m_attIndex[d] = posDBI;
posDBI+=2;
CellMarkerStore markVert(map, VERTEX); //marker for vertices
VEC3 center(0, 0, 0);
unsigned int nbv = 0;
......@@ -196,6 +193,9 @@ void Topo3Render::updateDataMap3(typename PFP::MAP& mapx, const typename PFP::TV
VEC3 P = vecPos[i]*ke + vecPos[i+1]*oke;
VEC3 Q = vecPos[i+1]*ke + vecPos[i]*oke;
m_attIndex[d] = posDBI;
posDBI+=2;
*positionDartBuf++ = P;
*positionDartBuf++ = Q;
*colorDartBuf++ = VEC3(1.,1.,1.0);
......@@ -311,7 +311,7 @@ void Topo3Render::setDartsIdColor(typename PFP::MAP& map, const FunctorSelect& g
else
{
CGoGNerr << "Error buffer too small for color picking (change the good parameter ?)" << CGoGNendl;
d = map.end();
break;
}
}
}
......@@ -364,9 +364,6 @@ void Topo3Render::updateDataGMap3(typename PFP::MAP& mapx, const typename PFP::T
{
if (good(d))
{
m_attIndex[d] = posDBI;
posDBI+=2;
CellMarkerStore markVert(map, VERTEX); //marker for vertices
VEC3 center(0, 0, 0);
unsigned int nbv = 0;
......@@ -477,6 +474,10 @@ void Topo3Render::updateDataGMap3(typename PFP::MAP& mapx, const typename PFP::T
*colorDartBuf++ = VEC3(1.,1.,1.);
*colorDartBuf++ = VEC3(1.,1.,1.);
m_attIndex[d] = posDBI;
posDBI+=2;
fv1[d] = P*0.9f + PP*0.1f;
fv2x[d] = P*0.52f + PP*0.48f;
fv2[d] = P*0.48f + PP*0.52f;
......@@ -484,6 +485,10 @@ void Topo3Render::updateDataGMap3(typename PFP::MAP& mapx, const typename PFP::T
fv1[dx] = Q*0.9f + QQ*0.1f;
fv2[dx] = Q*0.52f + QQ*0.48f;
fv2x[dx] = Q*0.48f + QQ*0.52f;
m_attIndex[dx] = posDBI;
posDBI+=2;
d = map.phi1(d);
}
......
......@@ -75,10 +75,7 @@ void TopoRender::updateDataMap(typename PFP::MAP& mapx, const typename PFP::TVEC
for(Dart d = map.begin(); d!= map.end(); map.next(d))
{
if (good(d))
{
vecDarts.push_back(d);
m_attIndex[d] = (vecDarts.size()-1)*2;
}
}
m_nbDarts = vecDarts.size();
......@@ -102,6 +99,8 @@ void TopoRender::updateDataMap(typename PFP::MAP& mapx, const typename PFP::TVEC
std::vector<VEC3> vecPos;
vecPos.reserve(16);
unsigned int indexDC=0;
DartMarker mf(map);
for(std::vector<Dart>::iterator id = vecDarts.begin(); id!= vecDarts.end(); id++)
{
......@@ -137,11 +136,12 @@ void TopoRender::updateDataMap(typename PFP::MAP& mapx, const typename PFP::TVEC
VEC3 P = vecPos[i]*ke + vecPos[i+1]*k;
VEC3 Q = vecPos[i+1]*ke + vecPos[i]*k;
m_attIndex[d] = indexDC;
indexDC+=2;
*positionDartBuf++ = P;
*colorDartBuf++ = VEC3(1.,0.,0.);
*positionDartBuf++ = Q;
*colorDartBuf++ = VEC3(1.,1.,1.);
*colorDartBuf++ = VEC3(1.,1.,1.);
VEC3 f = P*0.5f + Q*0.5f;
fv2[d] = f;
f = P*0.1f + Q*0.9f;
......@@ -220,10 +220,7 @@ void TopoRender::updateDataGMap(typename PFP::MAP& mapx, const typename PFP::TVE
for(Dart d = map.begin(); d!= map.end(); map.next(d))
{
if (good(d))
{
vecDarts.push_back(d);
m_attIndex[d] = (vecDarts.size()-1)*2;
}
}
m_nbDarts = vecDarts.size();
......@@ -248,6 +245,8 @@ void TopoRender::updateDataGMap(typename PFP::MAP& mapx, const typename PFP::TVE
std::vector<VEC3> vecPos;
vecPos.reserve(16);
unsigned int indexDC=0;
DartMarker mf(map);
for(std::vector<Dart>::iterator id = vecDarts.begin(); id!= vecDarts.end(); id++)
{
......@@ -285,6 +284,8 @@ void TopoRender::updateDataGMap(typename PFP::MAP& mapx, const typename PFP::TVE
VEC3 PP = REAL(0.52)*P + REAL(0.48)*Q;
VEC3 QQ = REAL(0.52)*Q + REAL(0.48)*P;
m_attIndex[d] = indexDC;
indexDC+=2;
*positionDartBuf++ = P;
*colorDartBuf++ = VEC3(1.,1.,1.);
*positionDartBuf++ = PP;
......@@ -304,6 +305,9 @@ void TopoRender::updateDataGMap(typename PFP::MAP& mapx, const typename PFP::TVE
fv2[dd] = f;
f = Q*0.9f + QQ*0.1f;
fv1[dd] = f;
m_attIndex[dd] = indexDC;
indexDC+=2;
d = map.phi1(d);
}
......@@ -379,13 +383,12 @@ void TopoRender::setDartsIdColor(typename PFP::MAP& map, const FunctorSelect& go
*local++ = r;
*local++ = g;
*local++ = b;
nb++;
}
else
{
CGoGNerr << "Error buffer too small for color picking (change the good parameter ?)" << CGoGNendl;
d = map.end();
break;
}
}
}
......
......@@ -32,6 +32,32 @@ cd ..
app1=`basename $1`
app2=`basename $2`
app1_maj=`echo $app1 | awk '
BEGIN { upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
lower = "abcdefghijklmnopqrstuvwxyz"
}
{
FIRSTCHAR = substr($1, 1, 1)
if (CHAR = index(lower, FIRSTCHAR))
$1 = substr(upper, CHAR, 1) substr($1, 2)
print $0
}' `
app2_maj=`echo $app2 | awk '
BEGIN { upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
lower = "abcdefghijklmnopqrstuvwxyz"
}
{
FIRSTCHAR = substr($1, 1, 1)
if (CHAR = index(lower, FIRSTCHAR))
$1 = substr(upper, CHAR, 1) substr($1, 2)
print $0
}' `
echo remplace $app1 by $app2 in CMakeLists.txt ...
find . -name "CMakeLists.txt" -exec sed -i s/$app1/$app2/g {} \;
......@@ -55,9 +81,9 @@ for f in $list_of_files; do
done
echo Modify contents ...
find . -name "*.cpp" -o -name "*.hpp" -o -name "*.h" -exec sed -i s/${app1^}/${app2^}/g {} \;
find . -name "*.cpp" -exec sed -i s/${app1^}/${app2^}/g {} \;
find . -name "*.h" -exec sed -i s/${app1^}/${app2^}/g {} \;
find . -name "*.cpp" -o -name "*.hpp" -o -name "*.h" -exec sed -i s/${app1_maj}/${app2_maj}/g {} \;
find . -name "*.cpp" -exec sed -i s/${app1_maj}/${app2_maj}/g {} \;
find . -name "*.h" -exec sed -i s/${app1_maj}/${app2_maj}/g {} \;
echo finished
......
......@@ -14,6 +14,20 @@ echo "Warning do not forget to check the CGoGN_ROOT_DIR variable (ccmake)"
apps=$1
#create a string with first letter capitalize (${apps^} does not work on osX !
apps_maj=`echo $1 | awk '
BEGIN { upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
lower = "abcdefghijklmnopqrstuvwxyz"
}
{
FIRSTCHAR = substr($1, 1, 1)
if (CHAR = index(lower, FIRSTCHAR))
$1 = substr(upper, CHAR, 1) substr($1, 2)
print $0
}' `
mkdir $apps
cd $apps
......@@ -128,14 +142,14 @@ echo \#include \"Utils/Qt/qtui.h\" >> ${apps}.h
echo "" >> ${apps}.h
echo "using namespace CGoGN;" >> ${apps}.h
echo "" >> ${apps}.h
echo "class ${apps^}: public Utils::QT::SimpleQT" >> ${apps}.h
echo "class $apps_maj: public Utils::QT::SimpleQT" >> ${apps}.h
echo "{" >> ${apps}.h
echo " Q_OBJECT" >> ${apps}.h
echo "public:" >> ${apps}.h
echo "" >> ${apps}.h
echo " ${apps^}() {}" >> ${apps}.h
echo " $apps_maj() {}" >> ${apps}.h
echo "" >> ${apps}.h
echo " ~${apps^}() {}" >> ${apps}.h
echo " ~$apps_maj() {}" >> ${apps}.h
echo "" >> ${apps}.h
echo " void cb_redraw();" >> ${apps}.h
echo "" >> ${apps}.h
......@@ -188,10 +202,10 @@ echo "**************************************************************************
echo "" >> ${apps}.cpp
echo \#include \"${apps}.h\" >> ${apps}.cpp
echo "" >> ${apps}.cpp
echo "void ${apps^}::cb_initGL()" >> ${apps}.cpp
echo "void $apps_maj::cb_initGL()" >> ${apps}.cpp
echo "{}" >> ${apps}.cpp
echo "" >> ${apps}.cpp
echo "void ${apps^}::cb_redraw()" >> ${apps}.cpp
echo "void $apps_maj::cb_redraw()" >> ${apps}.cpp
echo "{}" >> ${apps}.cpp
echo "" >> ${apps}.cpp
......@@ -199,8 +213,8 @@ echo "int main(int argc, char **argv)" >> ${apps}.cpp
echo "{" >> ${apps}.cpp
echo "" >> ${apps}.cpp
echo " QApplication app(argc, argv);" >> ${apps}.cpp
echo " ${apps^} sqt;" >> ${apps}.cpp
echo " "sqt.setWindowTitle\(\"${apps^}\"\)\; >> ${apps}.cpp
echo " $apps_maj sqt;" >> ${apps}.cpp
echo " "sqt.setWindowTitle\(\"$apps_maj\"\)\; >> ${apps}.cpp
echo "" >> ${apps}.cpp
echo " Utils::QT::uiDockInterface dock;" >> ${apps}.cpp
echo " sqt.setDock(&dock);" >> ${apps}.cpp
......
......@@ -83,10 +83,10 @@ Dart EmbeddedGMap3::cutEdge(Dart d)
do
{
unsigned int vEmb = getEmbedding(VOLUME, f) ;
setDartEmbedding(FACE, beta0(f), vEmb);
setDartEmbedding(FACE, phi1(f), vEmb);
setDartEmbedding(FACE, phi2(f), vEmb);
setDartEmbedding(FACE, beta1(phi2(f)), vEmb);
setDartEmbedding(VOLUME, beta0(f), vEmb);
setDartEmbedding(VOLUME, phi1(f), vEmb);
setDartEmbedding(VOLUME, phi2(f), vEmb);
setDartEmbedding(VOLUME, beta1(phi2(f)), vEmb);
f = alpha2(f);
} while(f != d);
}
......
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