Commit e8b418ff authored by untereiner's avatar untereiner

Merge cgogn:~cgogn/CGoGN

parents 2a41adea 573ff74e
...@@ -707,7 +707,7 @@ Dart Polyhedron<PFP>::tore_topo(unsigned int m, unsigned int n) ...@@ -707,7 +707,7 @@ Dart Polyhedron<PFP>::tore_topo(unsigned int m, unsigned int n)
Dart d = m_tableVertDarts[i]; Dart d = m_tableVertDarts[i];
Dart e = m_tableVertDarts[(m*n)+i]; Dart e = m_tableVertDarts[(m*n)+i];
e = m_map.phi_1(e); e = m_map.phi_1(e);
m_map.sewFaces(d, e, false); m_map.sewFaces(d, e, true);
} }
// remove the last n vertex darts that are no more necessary (sewed with n first) // remove the last n vertex darts that are no more necessary (sewed with n first)
......
...@@ -236,7 +236,7 @@ void Topo3RenderMapD::updateData(typename PFP::MAP& map, const FunctorSelect& go ...@@ -236,7 +236,7 @@ void Topo3RenderMapD::updateData(typename PFP::MAP& map, const FunctorSelect& go
m_nbRel2++; m_nbRel2++;
} }
e = map.phi3(d); e = map.phi3(d);
if (d < e) if (!map.isBoundaryFace(d) && (d < e))
{ {
*positionF3++ = fv2[d]; *positionF3++ = fv2[d];
*positionF3++ = fv2x[e]; *positionF3++ = fv2x[e];
......
...@@ -158,7 +158,8 @@ void TopoRenderMapD::updateData(typename PFP::MAP& map, const typename PFP::TVEC ...@@ -158,7 +158,8 @@ void TopoRenderMapD::updateData(typename PFP::MAP& map, const typename PFP::TVEC
Dart d = *id; Dart d = *id;
Dart e = map.phi2(d); Dart e = map.phi2(d);
if (e.index > d.index)
if (good(e) && (e.index > d.index))
{ {
*positionF2++ = fv2[d]; *positionF2++ = fv2[d];
*positionF2++ = fv2[e]; *positionF2++ = fv2[e];
......
...@@ -146,6 +146,32 @@ public: ...@@ -146,6 +146,32 @@ public:
FunctorSelect* copy() const { return new SelectorEdgeNoBoundary(m_map);} FunctorSelect* copy() const { return new SelectorEdgeNoBoundary(m_map);}
}; };
template <typename MAP>
class SelectorDartBoundary : public FunctorSelect
{
public:
protected:
MAP& m_map;
public:
SelectorDartBoundary(MAP& m): m_map(m) {}
bool operator()(Dart d) const { return m_map.isBoundaryMarked(d); }
FunctorSelect* copy() const { return new SelectorDartBoundary(m_map);}
};
template <typename MAP>
class SelectorDartNoBoundary : public FunctorSelect
{
public:
protected:
MAP& m_map;
public:
SelectorDartNoBoundary(MAP& m): m_map(m) {}
bool operator()(Dart d) const { return !m_map.isBoundaryMarked(d); }
FunctorSelect* copy() const { return new SelectorDartNoBoundary(m_map);}
};
// //
//class SelectorDartMarked : public FunctorSelect //class SelectorDartMarked : public FunctorSelect
//{ //{
......
Easy application creation:
-------------------------
skeleton_apps.sh:
Usage: skeleton_apps directory [list of additional source names]
This must be done in a CGoGN_Apps directory. It create an empty application
with source, header, ui, CMakeLists.txt, ...
skeleton_test.sh:
Usage: skeleton_apps directory
This must be done in a CGoGN_Apps directory. It create an empty debug application
with only one source (no header, no ui, no Debug/Release)
duplicate_apps.sh:
Usage duplicate_apps src_dir dest_dir
Duplicate an application:
- files that have the name of directory src are changed to dst
- includes are modified to follow these changes
- Classes and vars in .h & .cpp file that have the name (with first
letter in uppercase) are changed with dst name
#!/bin/bash
if test $# -lt 2; then
echo $0 application_directory_source application_directory_destination
exit 2
fi
if test -d $2; then
echo Directory $2 already exist
exit 3
fi
if test ! -d $1; then
echo Directory $1 does not exist
exit 4
fi
echo "copying ..."
cp -r $1 $2
echo "cleanin ..."
cd $2
find . -name "CMakeFiles" -exec rm -rf {} \; 2> /dev/null
find . -name "cmake_install.cmake" -exec rm -f {} \; 2> /dev/null
find . -name "CMakeCache.txt" -exec rm -f {} \; 2> /dev/null
find . -name "Makefile" -exec rm -f {} \; 2> /dev/null
cd bin
rm -rf *
cd ..
app1=`basename $1`
app2=`basename $2`
echo remplace $app1 by $app2 in CMakeLists.txt ...
find . -name "CMakeLists.txt" -exec sed -i s/$app1/$app2/g {} \;
echo "renaming files:"
list_of_files=`find . -name $app1\*`
for f in $list_of_files; do
nf=`echo $f | sed s/$app1/$app2/`
echo " "$f -\> $nf
mv $f $nf
# search into files for inclusion
bf=`basename $f`
bnf=`basename $nf`
list2=`fgrep -wl $bf *`
# if test -n """$list2"""; then
# echo " files to modify (includes)" $list2
for xx in $list2; do
sed -i s/$bf/$bnf/g $xx
done
# fi
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 {} \;
echo finished
This diff is collapsed.
#!/bin/bash
if test $# -lt 1; then
echo $0 application_directory
exit 2
fi
echo "Warning do not forget to check the CGoGN_ROOT_DIR variable (ccmake)"
if test -d $PWD/$1; then
echo Directory $1 already exist
exit 3
fi
apps=$1
mkdir $apps
cd $apps
mkdir bin
mkdir build
echo "cmake_minimum_required(VERSION 2.8)" > CMakeLists.txt
echo project\( $apps \) >> CMakeLists.txt
echo "" >> CMakeLists.txt
echo SET\(CGoGN_ROOT_DIR \$\{CMAKE_SOURCE_DIR\}/../../CGoGN CACHE STRING \"CGoGN root dir\"\) >> CMakeLists.txt
echo "" >> CMakeLists.txt
echo include\(\$\{CGoGN_ROOT_DIR\}/apps_cmake.txt\) >> CMakeLists.txt
echo "" >> CMakeLists.txt
echo SET\(CMAKE_BUILD_TYPE Debug\) >> CMakeLists.txt
echo "" >> CMakeLists.txt
echo link_directories\( \$\{CGoGN_ROOT_DIR\}/lib/Debug/ \$\{CGoGN_ROOT_DIR\}/lib/Release \$\{Boost_LIBRARY_DIRS\}\) >> CMakeLists.txt
echo "" >> CMakeLists.txt
echo include_directories\( >> CMakeLists.txt
echo " " \$\{CGoGN_ROOT_DIR\}/include >> CMakeLists.txt
echo " " \$\{COMMON_INCLUDES\} >> CMakeLists.txt
echo " " \$\{CMAKE_CURRENT_SOURCE_DIR\} >> CMakeLists.txt
echo " " \$\{CMAKE_CURRENT_BINARY_DIR\} >> CMakeLists.txt
echo \) >> CMakeLists.txt
echo "" >> CMakeLists.txt
echo add_executable\( $apps ${apps}.cpp \) >> CMakeLists.txt
echo "" >> CMakeLists.txt
echo target_link_libraries\( $apps \$\{CGoGN_LIBS_D\} \$\{COMMON_LIBS\}\) >> CMakeLists.txt
echo "/*******************************************************************************" > ${apps}.cpp
echo "* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *" >> ${apps}.cpp
echo "* version 0.1 *" >> ${apps}.cpp
echo "* Copyright (C) 2009-2011, IGG Team, LSIIT, University of Strasbourg *" >> ${apps}.cpp
echo "* *" >> ${apps}.cpp
echo "* This library is free software; you can redistribute it and/or modify it *" >> ${apps}.cpp
echo "* under the terms of the GNU Lesser General Public License as published by the *" >> ${apps}.cpp
echo "* Free Software Foundation; either version 2.1 of the License, or (at your *" >> ${apps}.cpp
echo "* option) any later version. *" >> ${apps}.cpp
echo "* *" >> ${apps}.cpp
echo "* This library is distributed in the hope that it will be useful, but WITHOUT *" >> ${apps}.cpp
echo "* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *" >> ${apps}.cpp
echo "* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *" >> ${apps}.cpp
echo "* for more details. *" >> ${apps}.cpp
echo "* *" >> ${apps}.cpp
echo "* You should have received a copy of the GNU Lesser General Public License *" >> ${apps}.cpp
echo "* along with this library; if not, write to the Free Software Foundation, *" >> ${apps}.cpp
echo "* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *" >> ${apps}.cpp
echo "* *" >> ${apps}.cpp
echo "* Web site: http://cgogn.u-strasbg.fr/ *" >> ${apps}.cpp
echo "* Contact information: cgogn@unistra.fr *" >> ${apps}.cpp
echo "* *" >> ${apps}.cpp
echo "*******************************************************************************/" >> ${apps}.cpp
echo "" >> ${apps}.cpp
echo \#include \"Utils/cgognStream.h\" >> ${apps}.cpp
echo "" >> ${apps}.cpp
echo "using namespace CGoGN;" >> ${apps}.cpp
echo "" >> ${apps}.cpp
echo "int main(int argc, char **argv)" >> ${apps}.cpp
echo "{" >> ${apps}.cpp
echo " CGoGNout << \"Hello CGoGN\"<<CGoGNendl;" >> ${apps}.cpp
echo "}" >> ${apps}.cpp
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
* * * *
*******************************************************************************/ *******************************************************************************/
#ifdef WITH_QT
#include <GL/glew.h> #include <GL/glew.h>
#include "Utils/Shaders/shaderSimpleTexture.h" #include "Utils/Shaders/shaderSimpleTexture.h"
...@@ -114,3 +116,6 @@ void ShaderSimpleTexture::restoreUniformsAttribs() ...@@ -114,3 +116,6 @@ void ShaderSimpleTexture::restoreUniformsAttribs()
} // namespace Utils } // namespace Utils
} // namespace CGoGN } // namespace CGoGN
#else
#pragma message(__FILE__ " not compiled because of mising Qt")
#endif
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
* Contact information: cgogn@unistra.fr * * Contact information: cgogn@unistra.fr *
* * * *
*******************************************************************************/ *******************************************************************************/
#ifdef WITH_QT
#include <GL/glew.h> #include <GL/glew.h>
#include "Utils/Shaders/shaderTextureMask.h" #include "Utils/Shaders/shaderTextureMask.h"
...@@ -127,3 +128,7 @@ void ShaderTextureMask::restoreUniformsAttribs() ...@@ -127,3 +128,7 @@ void ShaderTextureMask::restoreUniformsAttribs()
} // namespace Utils } // namespace Utils
} // namespace CGoGN } // namespace CGoGN
#else
#pragma message(__FILE__ " not compiled because of mising Qt")
#endif
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