Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CGoGN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
David Cazier
CGoGN
Commits
6018ea78
Commit
6018ea78
authored
May 29, 2015
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more test of compil.
parent
1666a619
Changes
48
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
48 changed files
with
860 additions
and
20587 deletions
+860
-20587
Apps/Tests/Algo/CMakeLists.txt
Apps/Tests/Algo/CMakeLists.txt
+3
-3
Apps/Tests/Algo/Export/CMakeLists.txt
Apps/Tests/Algo/Export/CMakeLists.txt
+14
-0
Apps/Tests/Algo/Export/algo_export.cpp
Apps/Tests/Algo/Export/algo_export.cpp
+16
-0
Apps/Tests/Algo/Export/export.cpp
Apps/Tests/Algo/Export/export.cpp
+38
-160
Apps/Tests/Algo/Export/exportPov.cpp
Apps/Tests/Algo/Export/exportPov.cpp
+30
-267
Apps/Tests/Algo/Export/exportVTU.cpp
Apps/Tests/Algo/Export/exportVTU.cpp
+18
-279
Apps/Tests/Algo/Export/exportVol.cpp
Apps/Tests/Algo/Export/exportVol.cpp
+11
-132
Apps/Tests/Algo/Import/AHEMImporter.cpp
Apps/Tests/Algo/Import/AHEMImporter.cpp
+16
-118
Apps/Tests/Algo/Import/AHEMImporterDefAttr.cpp
Apps/Tests/Algo/Import/AHEMImporterDefAttr.cpp
+10
-68
Apps/Tests/Algo/Import/CMakeLists.txt
Apps/Tests/Algo/Import/CMakeLists.txt
+17
-0
Apps/Tests/Algo/Import/algo_import.cpp
Apps/Tests/Algo/Import/algo_import.cpp
+21
-0
Apps/Tests/Algo/Import/import.cpp
Apps/Tests/Algo/Import/import.cpp
+45
-112
Apps/Tests/Algo/Import/import2tables.cpp
Apps/Tests/Algo/Import/import2tables.cpp
+0
-245
Apps/Tests/Algo/Import/importFileTypes.cpp
Apps/Tests/Algo/Import/importFileTypes.cpp
+2
-0
Apps/Tests/Algo/Import/importMRDAT.cpp
Apps/Tests/Algo/Import/importMRDAT.cpp
+20
-212
Apps/Tests/Algo/Import/importObjTex.cpp
Apps/Tests/Algo/Import/importObjTex.cpp
+17
-404
Apps/Tests/Algo/Import/importPlyData.cpp
Apps/Tests/Algo/Import/importPlyData.cpp
+0
-144
Apps/Tests/Algo/Import/importSvg.cpp
Apps/Tests/Algo/Import/importSvg.cpp
+82
-82
Apps/Tests/Algo/Import/import_utils.cpp
Apps/Tests/Algo/Import/import_utils.cpp
+0
-59
Apps/Tests/Algo/Import/ply.cpp
Apps/Tests/Algo/Import/ply.cpp
+0
-257
Apps/Tests/Algo/MC/CMakeLists.txt
Apps/Tests/Algo/MC/CMakeLists.txt
+15
-0
Apps/Tests/Algo/MC/algo_mc.cpp
Apps/Tests/Algo/MC/algo_mc.cpp
+17
-0
Apps/Tests/Algo/MC/buffer.cpp
Apps/Tests/Algo/MC/buffer.cpp
+0
-273
Apps/Tests/Algo/MC/bufferGen.cpp
Apps/Tests/Algo/MC/bufferGen.cpp
+0
-295
Apps/Tests/Algo/MC/image.cpp
Apps/Tests/Algo/MC/image.cpp
+15
-381
Apps/Tests/Algo/MC/marchingcube.cpp
Apps/Tests/Algo/MC/marchingcube.cpp
+32
-268
Apps/Tests/Algo/MC/marchingcubeGen.cpp
Apps/Tests/Algo/MC/marchingcubeGen.cpp
+45
-249
Apps/Tests/Algo/MC/tables.cpp
Apps/Tests/Algo/MC/tables.cpp
+0
-111
Apps/Tests/Algo/MC/type.cpp
Apps/Tests/Algo/MC/type.cpp
+0
-34
Apps/Tests/Algo/MC/windowing.cpp
Apps/Tests/Algo/MC/windowing.cpp
+69
-326
Apps/Tests/Algo/Modelisation/extrusion.cpp
Apps/Tests/Algo/Modelisation/extrusion.cpp
+10
-13
Apps/Tests/Algo/Modelisation/planeCutting.cpp
Apps/Tests/Algo/Modelisation/planeCutting.cpp
+16
-19
CGoGN/include/Algo/Export/exportPov.h
CGoGN/include/Algo/Export/exportPov.h
+7
-7
CGoGN/include/Algo/Export/exportVTU.h
CGoGN/include/Algo/Export/exportVTU.h
+14
-14
CGoGN/include/Algo/Export/exportVTU.hpp
CGoGN/include/Algo/Export/exportVTU.hpp
+46
-45
CGoGN/include/Algo/Import/AHEMImporter.hpp
CGoGN/include/Algo/Import/AHEMImporter.hpp
+6
-4
CGoGN/include/Algo/Import/AHEMImporterDefAttr.hpp
CGoGN/include/Algo/Import/AHEMImporterDefAttr.hpp
+7
-7
CGoGN/include/Algo/Import/import2tablesSurface.hpp
CGoGN/include/Algo/Import/import2tablesSurface.hpp
+6
-6
CGoGN/include/Algo/Import/importObjTex.h
CGoGN/include/Algo/Import/importObjTex.h
+5
-4
CGoGN/include/Algo/Import/importObjTex.hpp
CGoGN/include/Algo/Import/importObjTex.hpp
+23
-22
CGoGN/include/Algo/MC/image.h
CGoGN/include/Algo/MC/image.h
+8
-6
CGoGN/include/Algo/MC/image.hpp
CGoGN/include/Algo/MC/image.hpp
+15
-8
CGoGN/include/Algo/MC/marchingcube.h
CGoGN/include/Algo/MC/marchingcube.h
+4
-3
CGoGN/include/Algo/MC/marchingcube.hpp
CGoGN/include/Algo/MC/marchingcube.hpp
+53
-51
CGoGN/include/Algo/MC/marchingcubeGen.h
CGoGN/include/Algo/MC/marchingcubeGen.h
+18
-17
CGoGN/include/Algo/MC/marchingcubeGen.hpp
CGoGN/include/Algo/MC/marchingcubeGen.hpp
+68
-68
CGoGN/include/Algo/MC/windowing.h
CGoGN/include/Algo/MC/windowing.h
+1
-41
ThirdParty/PythonQt/generated_cpp_54/com_trolltech_qt_gui/com_trolltech_qt_gui4.cpp
...ted_cpp_54/com_trolltech_qt_gui/com_trolltech_qt_gui4.cpp
+0
-15773
No files found.
Apps/Tests/Algo/CMakeLists.txt
View file @
6018ea78
...
...
@@ -4,14 +4,14 @@ project(testing_algo)
#add_subdirectory(BooleanOperator)
add_subdirectory
(
Decimation
)
#
add_subdirectory(Export)
add_subdirectory
(
Export
)
add_subdirectory
(
Filtering
)
add_subdirectory
(
Geometry
)
#add_subdirectory(Histogram)
#add_subdirectory(ImplicitHierarchicalMesh)
#
add_subdirectory(Import)
add_subdirectory
(
Import
)
#add_subdirectory(LinearSolving)
#
add_subdirectory(MC)
add_subdirectory
(
MC
)
add_subdirectory
(
Modelisation
)
#add_subdirectory(MovingObjects)
#add_subdirectory(Multiresolution)
...
...
Apps/Tests/Algo/Export/CMakeLists.txt
0 → 100644
View file @
6018ea78
cmake_minimum_required
(
VERSION 2.6
)
project
(
testing_algo_export
)
add_executable
(
test_algo_export
algo_export.cpp
export.cpp
exportPov.cpp
exportVTU.cpp
exportVol.cpp
)
target_link_libraries
(
test_algo_export
${
CGoGN_LIBS
}
${
CGoGN_EXT_LIBS
}
)
\ No newline at end of file
Apps/Tests/Algo/Export/algo_export.cpp
0 → 100644
View file @
6018ea78
#include <iostream>
extern
int
test_export
();
extern
int
test_exportPov
();
extern
int
test_exportVTU
();
extern
int
test_exportVol
();
int
main
()
{
test_export
();
test_exportPov
();
test_exportVTU
();
test_exportVol
();
return
0
;
}
Apps/Tests/Algo/Export/export.cpp
View file @
6018ea78
/*******************************************************************************
* 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 "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap2.h"
#include "Topology/map/embeddedMap3.h"
#include "Topology/gmap/embeddedGMap2.h"
#ifndef __EXPORT_H__
#define __EXPORT_H__
#include "Topology/generic/attributeHandler.h"
#include "Algo/Import/importFileTypes.h"
#include "Algo/Export/export.h"
using
namespace
CGoGN
;
#include <stdint.h>
namespace
CGoGN
struct
PFP1
:
public
PFP_STANDARD
{
typedef
EmbeddedMap2
MAP
;
};
namespace
Algo
{
template
bool
Algo
::
Surface
::
Export
::
exportPLY
<
PFP1
>(
PFP1
::
MAP
&
map
,
const
VertexAttribute
<
PFP1
::
VEC3
,
PFP1
::
MAP
>&
position
,
const
char
*
filename
,
const
bool
binary
);
template
bool
Algo
::
Surface
::
Export
::
exportPLYnew
<
PFP1
>(
PFP1
::
MAP
&
map
,
const
std
::
vector
<
VertexAttribute
<
PFP1
::
VEC3
,
PFP1
::
MAP
>*
>&
attributeHandlers
,
const
char
*
filename
,
const
bool
binary
);
template
bool
Algo
::
Surface
::
Export
::
exportOFF
<
PFP1
>(
PFP1
::
MAP
&
map
,
const
VertexAttribute
<
PFP1
::
VEC3
,
PFP1
::
MAP
>&
position
,
const
char
*
filename
);
template
bool
Algo
::
Surface
::
Export
::
exportOBJ
<
PFP1
>(
PFP1
::
MAP
&
map
,
const
VertexAttribute
<
PFP1
::
VEC3
,
PFP1
::
MAP
>&
position
,
const
char
*
filename
);
template
bool
Algo
::
Surface
::
Export
::
exportTrian
<
PFP1
>(
PFP1
::
MAP
&
map
,
const
VertexAttribute
<
PFP1
::
VEC3
,
PFP1
::
MAP
>&
position
,
char
*
filename
);
template
bool
Algo
::
Surface
::
Export
::
exportChoupi
<
PFP1
>(
PFP1
::
MAP
&
map
,
const
VertexAttribute
<
PFP1
::
VEC3
,
PFP1
::
MAP
>&
position
,
const
char
*
filename
);
namespace
Surface
{
namespace
Export
struct
PFP2
:
public
PFP_DOUBLE
{
typedef
EmbeddedMap2
MAP
;
};
/**
* export the map into a PLY file
* @param the_map map to be exported
* @param position the position container
* @param filename filename of ply file
* @param binary write in binary mode
* @return true
*/
template
<
typename
PFP
>
bool
exportPLY
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
,
const
char
*
filename
,
const
bool
binary
)
;
/**
* export the map into a PLY file
* @param the_map map to be exported
* @param vertexAttrNames the vertex attribute names
* @param filename filename of ply file
* @param binary write in binary mode
* @return true
*/
template
<
typename
PFP
>
bool
exportPLYnew
(
typename
PFP
::
MAP
&
map
,
const
std
::
vector
<
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>*
>&
attributeHandlers
,
const
char
*
filename
,
const
bool
binary
)
;
/**
* export the map into a OFF file
* @param the_map map to be exported
* @param filename filename of off file
* @return true
*/
template
<
typename
PFP
>
bool
exportOFF
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
,
const
char
*
filename
)
;
/**
* export the map into a OBJ file
* @param the_map map to be exported
* @param filename filename of obj file
* @return true
*/
template
<
typename
PFP
>
bool
exportOBJ
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
,
const
char
*
filename
)
;
/**
* export the map into a Trian file
* @param the_map map to be exported
* @param filename filename of trian file
* @return true
*/
template
<
typename
PFP
>
bool
exportTrian
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
,
char
*
filename
)
;
template
bool
Algo
::
Surface
::
Export
::
exportPLY
<
PFP2
>(
PFP2
::
MAP
&
map
,
const
VertexAttribute
<
PFP2
::
VEC3
,
PFP2
::
MAP
>&
position
,
const
char
*
filename
,
const
bool
binary
);
template
bool
Algo
::
Surface
::
Export
::
exportPLYnew
<
PFP2
>(
PFP2
::
MAP
&
map
,
const
std
::
vector
<
VertexAttribute
<
PFP2
::
VEC3
,
PFP2
::
MAP
>*
>&
attributeHandlers
,
const
char
*
filename
,
const
bool
binary
);
template
bool
Algo
::
Surface
::
Export
::
exportOFF
<
PFP2
>(
PFP2
::
MAP
&
map
,
const
VertexAttribute
<
PFP2
::
VEC3
,
PFP2
::
MAP
>&
position
,
const
char
*
filename
);
template
bool
Algo
::
Surface
::
Export
::
exportOBJ
<
PFP2
>(
PFP2
::
MAP
&
map
,
const
VertexAttribute
<
PFP2
::
VEC3
,
PFP2
::
MAP
>&
position
,
const
char
*
filename
);
template
bool
Algo
::
Surface
::
Export
::
exportTrian
<
PFP2
>(
PFP2
::
MAP
&
map
,
const
VertexAttribute
<
PFP2
::
VEC3
,
PFP2
::
MAP
>&
position
,
char
*
filename
);
template
bool
Algo
::
Surface
::
Export
::
exportChoupi
<
PFP2
>(
PFP2
::
MAP
&
map
,
const
VertexAttribute
<
PFP2
::
VEC3
,
PFP2
::
MAP
>&
position
,
const
char
*
filename
);
/**
* export the map into a PLYPTMgeneric file (K. Vanhoey generic format).
*
* exports position + any attribute named : "frame_T" (frame tangent : VEC3), "frame_B" (frame binormal : VEC3), "frame_N" (frame normal : VEC3),
* "colorPTM_a<i> : VEC3" (coefficient number i of the 3 polynomials - one per channel - ; the max i depends on the degree of the PTM polynomial),
* "errL2 : REAL" (L2 fitting error), "errLmax : REAL" (maximal fitting error), "stdDev : REAL" (standard deviation of the L2 fitting errors).
*
* @param map map to be exported
* @param filename filename of ply file
* @param position the position container
* @return true
*/
//template <typename PFP>
//bool exportPlySLFgeneric(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>& position, const char* filename) ;
/**
* export the map into a PLYPTMgeneric file (K. Vanhoey generic format).
*
* exports position + any attribute named : "frame_T" (frame tangent : VEC3), "frame_B" (frame binormal : VEC3), "frame_N" (frame normal : VEC3),
* "colorPTM_a<i> : VEC3" (coefficient number i of the 3 polynomials - one per channel - ; the max i depends on the degree of the PTM polynomial),
* "errL2 : REAL" (L2 fitting error), "errLmax : REAL" (maximal fitting error), "stdDev : REAL" (standard deviation of the L2 fitting errors).
*
* @param map map to be exported
* @param filename filename of ply file
* @param position the position container
* @return true
*/
//template <typename PFP>
//bool exportPlySLFgenericBin(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>& position, const char* filename) ;
/**
* export the map into a PLYSLF file (K. Vanhoey generic format).
*
* exports position + any attribute named : "frame_T" (frame tangent : VEC3), "frame_B" (frame binormal : VEC3), "frame_N" (frame normal : VEC3),
* "SLF_<i> : VEC3" (coefficient number i of the 3 - one per channel - ; the max i is nbCoefs),
*
* @param map map to be exported
* @param filename filename of ply file
* @param position the position container
* @param nbCoefs the number of coefficients of the representation
* @return true
*/
/*template <typename PFP>
bool exportPlyPTMgeneric(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>& position, const char* filename) ;
*/
/**
* export the map into a PLYPTMgeneric file (K. Vanhoey generic format)
* @param map map to be exported
* @param filename filename of ply file
* @param position the position container
* @param the local frame (3xVEC3 : tangent, bitangent, normal)
* @param colorPTM the 6 coefficients (x3 channels) of the PTM functions
* @return true
*/
/*
template <typename PFP>
bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const VertexAttribute<typename PFP::VEC3>& position, const VertexAttribute<typename PFP::VEC3> frame[3], const VertexAttribute<typename PFP::VEC3> colorPTM[6]) ;
*/
/**
* export meshes used at the workbench
* export just a list of vertices and edges connectivity
* @param map
* @param position
* @return
*/
template
<
typename
PFP
>
bool
exportChoupi
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
,
const
char
*
filename
)
;
}
// namespace Export
}
// namespace Surface
struct
PFP3
:
public
PFP_DOUBLE
{
typedef
EmbeddedGMap2
MAP
;
};
}
// namespace Algo
template
bool
Algo
::
Surface
::
Export
::
exportPLY
<
PFP3
>(
PFP3
::
MAP
&
map
,
const
VertexAttribute
<
PFP3
::
VEC3
,
PFP3
::
MAP
>&
position
,
const
char
*
filename
,
const
bool
binary
);
template
bool
Algo
::
Surface
::
Export
::
exportPLYnew
<
PFP3
>(
PFP3
::
MAP
&
map
,
const
std
::
vector
<
VertexAttribute
<
PFP3
::
VEC3
,
PFP3
::
MAP
>*
>&
attributeHandlers
,
const
char
*
filename
,
const
bool
binary
);
template
bool
Algo
::
Surface
::
Export
::
exportOFF
<
PFP3
>(
PFP3
::
MAP
&
map
,
const
VertexAttribute
<
PFP3
::
VEC3
,
PFP3
::
MAP
>&
position
,
const
char
*
filename
);
template
bool
Algo
::
Surface
::
Export
::
exportOBJ
<
PFP3
>(
PFP3
::
MAP
&
map
,
const
VertexAttribute
<
PFP3
::
VEC3
,
PFP3
::
MAP
>&
position
,
const
char
*
filename
);
template
bool
Algo
::
Surface
::
Export
::
exportTrian
<
PFP3
>(
PFP3
::
MAP
&
map
,
const
VertexAttribute
<
PFP3
::
VEC3
,
PFP3
::
MAP
>&
position
,
char
*
filename
);
template
bool
Algo
::
Surface
::
Export
::
exportChoupi
<
PFP3
>(
PFP3
::
MAP
&
map
,
const
VertexAttribute
<
PFP3
::
VEC3
,
PFP3
::
MAP
>&
position
,
const
char
*
filename
);
}
// namespace CGoGN
#include "Algo/Export/export.hpp"
int
test_export
()
{
#endif
return
0
;
}
\ No newline at end of file
Apps/Tests/Algo/Export/exportPov.cpp
View file @
6018ea78
#ifndef EXPORT_POV_H
#define EXPORT_POV_H
#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap2.h"
#include "Topology/map/embeddedMap3.h"
#include "Topology/gmap/embeddedGMap2.h"
#include "Topology/generic/attributeHandler.h"
#include "Utils/cgognStream.h"
#include "Algo/Geometry/normal.h"
namespace
CGoGN
{
namespace
Algo
{
#include "Algo/Export/exportPov.h"
namespace
Surface
{
using
namespace
CGoGN
;
namespace
ExportPov
struct
PFP1
:
public
PFP_STANDARD
{
typedef
EmbeddedMap2
MAP
;
};
template
<
typename
PFP
>
void
exportTriangleWire
(
std
::
ofstream
&
out
,
typename
PFP
::
VEC3
&
p1
,
typename
PFP
::
VEC3
&
p2
,
typename
PFP
::
VEC3
&
p3
,
float
width
)
{
out
<<
"cylinder { <"
<<
p1
[
0
]
<<
","
<<
p1
[
1
]
<<
","
<<
p1
[
2
]
<<
">, <"
<<
p2
[
0
]
<<
","
<<
p2
[
1
]
<<
","
<<
p2
[
2
]
<<
">, "
<<
width
<<
"}"
<<
std
::
endl
;
out
<<
"cylinder { <"
<<
p1
[
0
]
<<
","
<<
p1
[
1
]
<<
","
<<
p1
[
2
]
<<
">, <"
<<
p3
[
0
]
<<
","
<<
p3
[
1
]
<<
","
<<
p3
[
2
]
<<
">, "
<<
width
<<
"}"
<<
std
::
endl
;
out
<<
"cylinder { <"
<<
p3
[
0
]
<<
","
<<
p3
[
1
]
<<
","
<<
p3
[
2
]
<<
">, <"
<<
p2
[
0
]
<<
","
<<
p2
[
1
]
<<
","
<<
p2
[
2
]
<<
">, "
<<
width
<<
"}"
<<
std
::
endl
;
}
template
void
Algo
::
Surface
::
ExportPov
::
exportTriangleWire
<
PFP1
>(
std
::
ofstream
&
out
,
PFP1
::
VEC3
&
p1
,
PFP1
::
VEC3
&
p2
,
PFP1
::
VEC3
&
p3
,
float
width
);
template
void
Algo
::
Surface
::
ExportPov
::
exportTrianglePlain
<
PFP1
>(
std
::
ofstream
&
out
,
PFP1
::
VEC3
&
p1
,
PFP1
::
VEC3
&
p2
,
PFP1
::
VEC3
&
p3
);
template
void
Algo
::
Surface
::
ExportPov
::
exportMeshPlain
<
PFP1
>(
std
::
ofstream
&
out
,
PFP1
::
MAP
&
map
,
VertexAttribute
<
PFP1
::
VEC3
,
PFP1
::
MAP
>&
position
,
const
std
::
string
&
meshName
);
template
void
Algo
::
Surface
::
ExportPov
::
exportMeshWire
<
PFP1
>(
std
::
ofstream
&
out
,
PFP1
::
MAP
&
map
,
VertexAttribute
<
PFP1
::
VEC3
,
PFP1
::
MAP
>&
position
,
const
std
::
string
&
meshName
);
template
bool
Algo
::
Surface
::
ExportPov
::
exportScenePov
<
PFP1
>(
PFP1
::
MAP
&
map
,
VertexAttribute
<
PFP1
::
VEC3
,
PFP1
::
MAP
>&
position
,
const
std
::
string
&
filename
,
PFP1
::
VEC3
cameraPos
,
PFP1
::
VEC3
cameraLook
,
PFP1
::
VEC3
translate
,
float
angle_X
,
float
angle_Y
,
float
angle_Z
);
template
<
typename
PFP
>
void
exportTrianglePlain
(
std
::
ofstream
&
out
,
typename
PFP
::
VEC3
&
p1
,
typename
PFP
::
VEC3
&
p2
,
typename
PFP
::
VEC3
&
p3
)
{
out
<<
"triangle {"
<<
std
::
endl
;
out
<<
"<"
<<
p1
[
0
]
<<
","
<<
p1
[
2
]
<<
","
<<
p1
[
1
]
<<
">,"
<<
std
::
endl
;
out
<<
"<"
<<
p2
[
0
]
<<
","
<<
p2
[
2
]
<<
","
<<
p2
[
1
]
<<
">, "
<<
std
::
endl
;
out
<<
"<"
<<
p3
[
0
]
<<
","
<<
p3
[
2
]
<<
","
<<
p3
[
1
]
<<
"> "
<<
std
::
endl
;
out
<<
"}"
<<
std
::
endl
;
}
template
<
typename
PFP
>
void
exportMeshPlain
(
std
::
ofstream
&
out
,
typename
PFP
::
MAP
&
map
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
const
std
::
string
&
meshName
)
struct
PFP2
:
public
PFP_DOUBLE
{
out
<<
"#declare "
<<
meshName
<<
"= union {"
<<
std
::
endl
;
TraversorF
<
typename
PFP
::
MAP
>
travF
(
map
);
typedef
EmbeddedMap2
MAP
;
};
for
(
Dart
d
=
travF
.
begin
()
;
d
!=
travF
.
end
()
;
d
=
travF
.
next
())
{
unsigned
int
nb
=
map
.
faceDegree
(
d
);
template
void
Algo
::
Surface
::
ExportPov
::
exportTriangleWire
<
PFP2
>(
std
::
ofstream
&
out
,
PFP2
::
VEC3
&
p1
,
PFP2
::
VEC3
&
p2
,
PFP2
::
VEC3
&
p3
,
float
width
);
template
void
Algo
::
Surface
::
ExportPov
::
exportTrianglePlain
<
PFP2
>(
std
::
ofstream
&
out
,
PFP2
::
VEC3
&
p1
,
PFP2
::
VEC3
&
p2
,
PFP2
::
VEC3
&
p3
);
template
void
Algo
::
Surface
::
ExportPov
::
exportMeshPlain
<
PFP2
>(
std
::
ofstream
&
out
,
PFP2
::
MAP
&
map
,
VertexAttribute
<
PFP2
::
VEC3
,
PFP2
::
MAP
>&
position
,
const
std
::
string
&
meshName
);
template
void
Algo
::
Surface
::
ExportPov
::
exportMeshWire
<
PFP2
>(
std
::
ofstream
&
out
,
PFP2
::
MAP
&
map
,
VertexAttribute
<
PFP2
::
VEC3
,
PFP2
::
MAP
>&
position
,
const
std
::
string
&
meshName
);
template
bool
Algo
::
Surface
::
ExportPov
::
exportScenePov
<
PFP2
>(
PFP2
::
MAP
&
map
,
VertexAttribute
<
PFP2
::
VEC3
,
PFP2
::
MAP
>&
position
,
const
std
::
string
&
filename
,
PFP2
::
VEC3
cameraPos
,
PFP2
::
VEC3
cameraLook
,
PFP2
::
VEC3
translate
,
float
angle_X
,
float
angle_Y
,
float
angle_Z
);
if
(
nb
==
3
)
exportTrianglePlain
<
PFP
>
(
out
,
position
[
d
],
position
[
map
.
phi1
(
d
)],
position
[
map
.
phi1
(
map
.
phi1
(
d
))]);
else
{
out
<<
"polygon{ "
<<
nb
+
1
<<
std
::
endl
;
Dart
dd
=
d
;
do
{
out
<<
"<"
<<
position
[
dd
][
0
]
<<
","
<<
position
[
dd
][
2
]
<<
","
<<
position
[
dd
][
1
]
<<
">,"
<<
std
::
endl
;
dd
=
map
.
phi1
(
dd
);
}
while
(
dd
!=
d
);
out
<<
"<"
<<
position
[
d
][
0
]
<<
","
<<
position
[
d
][
2
]
<<
","
<<
position
[
d
][
1
]
<<
">"
<<
std
::
endl
;
out
<<
"}"
<<
std
::
endl
;
}
}
out
<<
"}"
<<
std
::
endl
;
}
template
<
typename
PFP
>
void
export3MeshPlainSmooth
(
std
::
ofstream
&
out
,
typename
PFP
::
MAP
&
map
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
const
std
::
string
&
meshName
)
struct
PFP3
:
public
PFP_DOUBLE
{
typedef
typename
PFP
::
VEC3
VEC3
;
out
<<
"#declare "
<<
meshName
<<
"= mesh2 {"
<<
std
::
endl
;
unsigned
int
nbDarts
=
map
.
getNbDarts
()
;
//vector containing the degree of faces
std
::
vector
<
unsigned
int
>
facesSize
;
//vector containing the list of index of vertices
std
::
vector
<
std
::
vector
<
unsigned
int
>
>
facesIdx
;
facesSize
.
reserve
(
nbDarts
/
3
)
;
facesIdx
.
reserve
(
nbDarts
/
3
)
;
//map : attribute place / index in declaration (for vertices and normals)
std
::
map
<
unsigned
int
,
unsigned
int
>
vIndex
;
//index : start from 0 and increase (used to ignore the gaps potentially present in the container)
unsigned
int
vCpt
=
0
;
typedef
EmbeddedMap3
MAP
;
};
//remember the attribute lines
std
::
vector
<
unsigned
int
>
vertices
;
template
void
Algo
::
Surface
::
ExportPov
::
export3MeshPlainSmooth
<
PFP3
>(
std
::
ofstream
&
out
,
PFP3
::
MAP
&
map
,
VertexAttribute
<
PFP3
::
VEC3
,
PFP3
::
MAP
>&
position
,
const
std
::
string
&
meshName
);
template
bool
Algo
::
Surface
::
ExportPov
::
exportScenePovSmooth
<
PFP3
>(
PFP3
::
MAP
&
map
,
VertexAttribute
<
PFP3
::
VEC3
,
PFP3
::
MAP
>&
position
,
const
std
::
string
&
filename
,
PFP3
::
VEC3
cameraPos
,
PFP3
::
VEC3
cameraLook
,
PFP3
::
VEC3
translate
,
float
angle_X
,
float
angle_Y
,
float
angle_Z
)
;
std
::
vector
<
VEC3
>
normals
;
vertices
.
reserve
(
nbDarts
/
6
)
;
normals
.
reserve
(
nbDarts
/
6
)
;
CellMarker
<
VERTEX
>
markV
(
map
)
;
DartMarker
markF
(
map
)
;
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
{
if
(
!
markF
.
isMarked
(
d
)
&&
map
.
phi3
(
d
)
==
d
)
{
markF
.
markOrbit
<
FACE
>
(
d
)
;
std
::
vector
<
unsigned
int
>
fidx
;
fidx
.
reserve
(
4
)
;
Dart
dd
=
d
;
do
{
unsigned
int
vNum
=
map
.
getEmbedding
<
VERTEX
>
(
dd
)
;
if
(
!
markV
.
isMarked
(
dd
))
{
markV
.
mark
(
dd
)
;
VEC3
norm
=
Geometry
::
vertexBorderNormal
<
PFP
>
(
map
,
dd
,
position
);
vIndex
[
vNum
]
=
vCpt
++
;
vertices
.
push_back
(
vNum
)
;
normals
.
push_back
(
norm
)
;
}
fidx
.
push_back
(
vIndex
[
vNum
])
;
dd
=
map
.
phi1
(
dd
)
;
}
while
(
dd
!=
d
)
;
facesSize
.
push_back
(
map
.
faceDegree
(
d
))
;
facesIdx
.
push_back
(
fidx
)
;
}
}
//export all vertices
out
<<
"vertex_vectors {"
<<
std
::
endl
;
out
<<
vertices
.
size
()
<<
","
<<
std
::
endl
;
for
(
unsigned
int
i
=
0
;
i
<
vertices
.
size
();
++
i
)
{
const
VEC3
&
v
=
position
[
vertices
[
i
]]
;
out
<<
"<"
<<
v
[
0
]
<<
", "
<<
v
[
1
]
<<
", "
<<
v
[
2
]
<<
">"
<<
std
::
endl
;
}
out
<<
"}"
<<
std
::
endl
;
//export all normals
out
<<
"normal_vectors {"
<<
std
::
endl
;
out
<<
normals
.
size
()
<<
","
<<
std
::
endl
;
for
(
unsigned
int
i
=
0
;
i
<
normals
.
size
();
++
i
)
{
const
VEC3
&
v
=
normals
[
i
];
out
<<
"<"
<<
v
[
0
]
<<
", "
<<
v
[
1
]
<<
", "
<<
v
[
2
]
<<
">"
<<
std
::
endl
;
}
out
<<
"}"
<<
std
::
endl
;
//export all faces
out
<<
"face_indices {"
<<
std
::
endl
;
out
<<
facesSize
.
size
()
<<
","
<<
std
::
endl
;
for
(
unsigned
int
i
=
0
;
i
<
facesSize
.
size
();
++
i
)
{
out
<<
"<"
<<
facesIdx
[
i
][
0
];
for
(
unsigned
int
j
=
1
;
j
<
facesIdx
[
i
].
size
();
++
j
)
out
<<
", "
<<
facesIdx
[
i
][
j
]
;
out
<<
">"
<<
std
::
endl
;
}
out
<<
"}"
<<
std
::
endl
;
out
<<
"}"
<<
std
::
endl
;
}
template
<
typename
PFP
>
void
exportMeshWire
(
std
::
ofstream
&
out
,
typename
PFP
::
MAP
&
map
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
const
std
::
string
&
meshName
)
int
test_exportPov
()
{
out
<<
"#declare "
<<
meshName
<<
"= union {"
<<
std
::
endl
;
TraversorE
<
typename
PFP
::
MAP
>
travE
(
map
);
for
(
Dart
d
=
travE
.
begin
()
;
d
!=
travE
.
end
()
;
d
=
travE
.
next
())
{
Dart
dd
=
map
.
phi2
(
d
);
out
<<
"cylinder{ "
<<
std
::
endl
;
out
<<
"<"
<<
position
[
d
][
0
]
<<
","
<<
position
[
d
][
1
]
<<
","
<<
position
[
d
][
2
]
<<
">,"
<<
std
::
endl
;
out
<<
"<"
<<
position
[
dd
][
0
]
<<
","
<<
position
[
dd
][
1
]
<<
","
<<
position
[
dd
][
2
]
<<
">,"
<<
0.5
<<
std
::
endl
;
out
<<
"}"
<<
std
::
endl
;
}
out
<<
"}"
<<
std
::
endl
;
}
template
<
typename
PFP
>
bool
exportScenePov
(
typename
PFP
::
MAP
&
map
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
const
std
::
string
&
filename
,
typename
PFP
::
VEC3
cameraPos
,
typename
PFP
::
VEC3
cameraLook
,
typename
PFP
::
VEC3
translate
,
float
angle_X
,
float
angle_Y
,
float
angle_Z
)
{
std
::
ofstream
out
(
filename
.
c_str
(),
std
::
ios
::
out
);
if
(
!
out
.
good
())
{
CGoGNerr
<<
"(export) Unable to open file "
<<
filename
<<
CGoGNendl
;
return
false
;
}
float
angleX
=
angle_X
;
float
angleY
=
angle_Y
;
float
angleZ
=
angle_Z
;
//define the camera position
out
<<
"camera { location <"
<<
cameraPos
[
0
]
<<
","
<<
cameraPos
[
1
]
<<
","
<<
cameraPos
[
2
]
<<
"> look_at <"
<<
cameraLook
[
0
]
<<
","
<<
cameraLook
[
1
]
<<
","
<<
cameraLook
[
2
]
<<
">}"
<<
std
::
endl
;
//set a "infinite" plane
// out << "plane { y, -1 pigment { color rgb 1 } }" << std::endl;
//set a sky sphere
out
<<
"sphere { <0, 0, 0>, 5000"
;
out
<<
"texture{ pigment { color rgb <1, 1, 1>} finish { ambient 1 diffuse 0 } } }"
<<
std
::
endl
;
//put some lights
out
<<
"light_source { <"
<<
cameraPos
[
0
]
<<
","
<<
cameraPos
[
1
]
<<
","
<<
cameraPos
[
2
]
<<
"> color rgb 0.45}"
<<
std
::
endl
;
// out << "light_source { <-120, -300, -10> color rgb 0.25 }"<< std::endl;
//set a high quality rendering
out
<<
"global_settings {"
<<
std
::
endl
;
out
<<
"radiosity {"
<<
std
::
endl
;
out
<<
"pretrace_start 0.08 pretrace_end 0.04"
<<
std
::
endl
;
out
<<
"count 100 nearest_count 10 error_bound 0.15 recursion_limit 1 low_error_factor 0.2 gray_threshold 0.0 minimum_reuse 0.015 brightness 1 adc_bailout 0.01/2 normal off media off}"
<<
std
::
endl
;
out
<<
"max_trace_level 255}"
<<
std
::
endl
;
exportMeshPlain
<
PFP
>
(
out
,
map
,
position
,
"myMesh"
);
out
<<
"object {myMesh"
<<
std
::
endl
;
out
<<
"translate <"
<<
translate
[
0
]
<<
","
<<
translate
[
1
]
<<
","
<<
translate
[
2
]
<<
">"
<<
std
::
endl
;
out
<<
"rotate <"
<<
angleX
<<
","
<<
angleY
<<
","
<<
angleZ
<<
"> "
<<
std
::
endl
;
out
<<
"texture{ pigment{ color rgb<1.0,1.0,1>} finish { ambient rgb 0.05 brilliance 0.5 } } }"
<<
std
::
endl
;
out
.
close
();
return
true
;
}
template
<
typename
PFP
>
bool
exportScenePovSmooth
(
typename
PFP
::
MAP
&
map
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
const
std
::
string
&
filename
,
typename
PFP
::
VEC3
cameraPos
,
typename
PFP
::
VEC3
cameraLook
,
typename
PFP
::
VEC3
translate
,
float
angle_X
,
float
angle_Y
,
float
angle_Z
)
{
std
::
ofstream
out
(
filename
.
c_str
(),
std
::
ios
::
out
);
if
(
!
out
.
good
())
{
CGoGNerr
<<
"(export) Unable to open file "
<<
filename
<<
CGoGNendl
;
return
false
;
}
float
angleX
=
angle_X
;
float
angleY
=
angle_Y
;
float
angleZ
=
angle_Z
;
//define the camera position
out
<<
"camera { location <"
<<
cameraPos
[
0
]
<<
","
<<
cameraPos
[
1
]
<<
","
<<
cameraPos
[
2
]
<<
"> look_at <"
<<
cameraLook
[
0
]
<<
","
<<
cameraLook
[
1
]
<<
","
<<
cameraLook
[
2
]
<<
">}"
<<
std
::
endl
;
//set a "infinite" plane
// out << "plane { y, -1 pigment { color rgb 1 } }" << std::endl;
//set a sky sphere
out
<<
"sphere { <0, 0, 0>, 5000"
;
out
<<
"texture{ pigment { color rgb <1, 1, 1>} finish { ambient 1 diffuse 0 } } }"
<<
std
::
endl
;
//put some lights
out
<<
"light_source { <"
<<
cameraPos
[
0
]
<<
","
<<
cameraPos
[
1
]
<<
","
<<
cameraPos
[
2
]
<<
"> color rgb 0.45}"
<<
std
::
endl
;
//set a high quality rendering
out
<<
"global_settings {"
<<
std
::
endl
;
// out << "radiosity {" << std::endl;
// out << "pretrace_start 0.08 pretrace_end 0.04" << std::endl;
// out << "count 300 nearest_count 10 error_bound 0.15 recursion_limit 1 low_error_factor 0.2 gray_threshold 0.0 minimum_reuse 0.015 brightness 1 adc_bailout 0.01/2 normal off media off}" << std::endl;
out
<<
"max_trace_level 60}"
<<
std
::
endl
;
export3MeshPlainSmooth
<
PFP
>
(
out
,
map
,
position
,
"myMesh"
);
out
<<
"object {myMesh"
<<
std
::
endl
;
out
<<
"translate <"
<<
translate
[
0
]
<<
","
<<
translate
[
1
]
<<
","
<<
translate
[