Polyhedron_demo: Fix reload item
This PR actually fixes a general performance issue, due to the use of Boost `flat_map` container. The unique hash map from CGAL has been used instead.
- Remove the std::cerr in the `message()` function of the Mainwindow to avoid having html messages in the console.
- The messages using this function will only be readable in the application's console widget.
Specialization of I/O support for `std::pair<int, int>` was defined
twice.
For the records, the compilation errors were:
```
[ 62%] Building CXX object Plugins/Mesh_3/CMakeFiles/c3t3_io_plugin.dir/C3t3_io_plugin.cpp.o
cd /home/cgal_tester/build/src/cmake/platforms/ArchLinux-CXX14/test/Polyhedron_Demo/Plugins/Mesh_3 && /usr/bin/c++ -DCGAL_EIGEN3_ENABLED -DCGAL_TEST_SUITE -DCGAL_USE_GMP -DCGAL_USE_MPFR -DCGAL_USE_ZLIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_KEYWORDS -DQT_OPENGL_LIB -DQT_SCRIPT_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -DSCENE_IMAGE_GL_BUFFERS_AVAILABLE -DUSE_FORWARD_DECL -Dc3t3_io_plugin_EXPORTS -I/home/cgal_tester/build/src/cmake/platforms/ArchLinux-CXX14/test/Polyhedron_Demo/Plugins/Mesh_3 -I/home/cgal_tester/build/src/cmake/platforms/ArchLinux-CXX14/test/Polyhedron_Demo/./CGAL_demo -I/home/cgal_tester/build/src/cmake/platforms/ArchLinux-CXX14/test/Polyhedron_Demo/../../include -I/home/cgal_tester/build/src/cmake/platforms/ArchLinux-CXX14/test/Polyhedron_Demo/./include -I/home/cgal_tester/build/src/cmake/platforms/ArchLinux-CXX14/test/Polyhedron_Demo/. -I/home/cgal_tester/build/src/cmake/platforms/ArchLinux-CXX14/test/Polyhedron_Demo -I/home/cgal_tester/build/src/cmake/platforms/ArchLinux-CXX14/include -I/mnt/testsuite/include -isystem /usr/include/eigen3 -isystem /usr/include/qt -isystem /usr/include/qt/QtWidgets -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtCore -isystem /usr/lib/qt/mkspecs/linux-g++ -isystem /usr/include/qt/QtScript -isystem /usr/include/qt/QtOpenGL -isystem /usr/include/qt/QtXml -fvisibility=hidden -fPIC -fPIC -o CMakeFiles/c3t3_io_plugin.dir/C3t3_io_plugin.cpp.o -c /home/cgal_tester/build/src/cmake/platforms/ArchLinux-CXX14/test/Polyhedron_Demo/Plugins/Mesh_3/C3t3_io_plugin.cpp
/home/cgal_tester/build/src/cmake/platforms/ArchLinux-CXX14/test/Polyhedron_Demo/Plugins/Mesh_3/C3t3_io_plugin.cpp:299:8: error: redefinition of 'struct CGAL::Get_io_signature<std::pair<int, int> >'
struct Get_io_signature<Fake_patch_id> {
^
In file included from /mnt/testsuite/include/CGAL/Polyhedral_mesh_domain_3.h:61:0,
from /home/cgal_tester/build/src/cmake/platforms/ArchLinux-CXX14/test/Polyhedron_Demo/./C3t3_type.h:24,
from /home/cgal_tester/build/src/cmake/platforms/ArchLinux-CXX14/test/Polyhedron_Demo/./Scene_c3t3_item.h:5,
from /home/cgal_tester/build/src/cmake/platforms/ArchLinux-CXX14/test/Polyhedron_Demo/Plugins/Mesh_3/C3t3_io_plugin.cpp:2:
/mnt/testsuite/include/CGAL/internal/Mesh_3/Handle_IO_for_pair_of_int.h:31:8: error: previous definition of 'struct CGAL::Get_io_signature<std::pair<int, int> >'
struct Get_io_signature<std::pair<int, int> > {
^
/home/cgal_tester/build/src/cmake/platforms/ArchLinux-CXX14/test/Polyhedron_Demo/Plugins/Mesh_3/C3t3_io_plugin.cpp:319:7: error: redefinition of 'class CGAL::Output_rep<std::pair<int, int> >'
class Output_rep<Fake_patch_id> {
^
In file included from /mnt/testsuite/include/CGAL/Polyhedral_mesh_domain_3.h:61:0,
from /home/cgal_tester/build/src/cmake/platforms/ArchLinux-CXX14/test/Polyhedron_Demo/./C3t3_type.h:24,
from /home/cgal_tester/build/src/cmake/platforms/ArchLinux-CXX14/test/Polyhedron_Demo/./Scene_c3t3_item.h:5,
from /home/cgal_tester/build/src/cmake/platforms/ArchLinux-CXX14/test/Polyhedron_Demo/Plugins/Mesh_3/C3t3_io_plugin.cpp:2:
/mnt/testsuite/include/CGAL/internal/Mesh_3/Handle_IO_for_pair_of_int.h:46:7: error: previous definition of 'class CGAL::Output_rep<std::pair<int, int> >'
class Output_rep<std::pair<int, int> > : public IO_rep_is_specialized {
^
/home/cgal_tester/build/src/cmake/platforms/ArchLinux-CXX14/test/Polyhedron_Demo/Plugins/Mesh_3/C3t3_io_plugin.cpp:338:7: error: redefinition of 'class CGAL::Input_rep<std::pair<int, int> >'
class Input_rep<Fake_patch_id> {
^
In file included from /mnt/testsuite/include/CGAL/Polyhedral_mesh_domain_3.h:61:0,
from /home/cgal_tester/build/src/cmake/platforms/ArchLinux-CXX14/test/Polyhedron_Demo/./C3t3_type.h:24,
from /home/cgal_tester/build/src/cmake/platforms/ArchLinux-CXX14/test/Polyhedron_Demo/./Scene_c3t3_item.h:5,
from /home/cgal_tester/build/src/cmake/platforms/ArchLinux-CXX14/test/Polyhedron_Demo/Plugins/Mesh_3/C3t3_io_plugin.cpp:2:
/mnt/testsuite/include/CGAL/internal/Mesh_3/Handle_IO_for_pair_of_int.h:65:7: error: previous definition of 'class CGAL::Input_rep<std::pair<int, int> >'
class Input_rep<std::pair<int, int> > : public IO_rep_is_specialized {
^
Plugins/Mesh_3/CMakeFiles/c3t3_io_plugin.dir/build.make:66: recipe for target 'Plugins/Mesh_3/CMakeFiles/c3t3_io_plugin.dir/C3t3_io_plugin.cpp.o' failed
```
https://cgal.geometryfactory.com/CGAL/testsuite/CGAL-4.9-Ic-97/Polyhedron_Demo/TestReport_lrineau_ArchLinux-CXX14.gz
- By replacing the flat_map by another type of map, the bug that made the calculation of items longer after several reloads is fixed. Why this bug only appeared when reloading an item stays an unsolved mystery.
- I finally found a solution to set manually the frustum ! This version use the same algorithm as did QGLViewer so all of the previous version problems are gone.
- pass the camera in orthographic mode and zoom on screen part to recreate the original image with zoomed parts. If the factor is too high, there will be near plane problems, as the zoom might make the camera go through the item. Plus the separation between the parts is visible. At last, everything that is not centered in the screen will be deformed because of the orthographic projection.
- The translation was done twice : once in the position and once in the frame matrix. The fix computes the position of the plane and the grid centered on O(0,0,0), so only the frame's transformation is kept.