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
a0a2dc32
Commit
a0a2dc32
authored
Jan 27, 2015
by
Lionel Untereiner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
old fashioned IHM3 are back
parent
652fa86d
Changes
24
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
429 additions
and
227 deletions
+429
-227
Apps/Examples/viewer.cpp
Apps/Examples/viewer.cpp
+6
-3
Apps/Tuto/Modelling/tuto_oper2.cpp
Apps/Tuto/Modelling/tuto_oper2.cpp
+1
-1
Apps/Tuto/Modelling/tuto_oper3.cpp
Apps/Tuto/Modelling/tuto_oper3.cpp
+1
-1
CMakeLists.txt
CMakeLists.txt
+1
-1
ThirdParty/build/.gitignore
ThirdParty/build/.gitignore
+0
-2
ThirdParty/buildDebug/.gitignore
ThirdParty/buildDebug/.gitignore
+0
-2
apps_cmake.txt
apps_cmake.txt
+1
-0
build/.gitignore
build/.gitignore
+0
-2
buildDebug/.gitignore
buildDebug/.gitignore
+0
-2
include/Algo/Export/exportVol.h
include/Algo/Export/exportVol.h
+3
-0
include/Algo/Export/exportVol.hpp
include/Algo/Export/exportVol.hpp
+75
-0
include/Algo/ImplicitHierarchicalMesh/ihm3.h
include/Algo/ImplicitHierarchicalMesh/ihm3.h
+9
-9
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
+7
-6
include/Algo/ImplicitHierarchicalMesh/subdivision3.h
include/Algo/ImplicitHierarchicalMesh/subdivision3.h
+15
-15
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
+61
-60
include/Algo/Import/import.hpp
include/Algo/Import/import.hpp
+13
-0
include/Algo/Import/import2tables.h
include/Algo/Import/import2tables.h
+4
-0
include/Algo/Import/import2tablesSurface.hpp
include/Algo/Import/import2tablesSurface.hpp
+86
-0
include/Algo/Multiresolution/IHM3/ihm3_PrimalAdapt.hpp
include/Algo/Multiresolution/IHM3/ihm3_PrimalAdapt.hpp
+113
-114
include/Topology/generic/traversor/traversor2_closed.h
include/Topology/generic/traversor/traversor2_closed.h
+2
-2
include/Topology/map/map2.h
include/Topology/map/map2.h
+6
-0
include/Topology/map/map2.hpp
include/Topology/map/map2.hpp
+18
-0
include/Topology/map/map3.hpp
include/Topology/map/map3.hpp
+1
-1
src/Algo/ImplicitHierarchicalMesh/ihm3.cpp
src/Algo/ImplicitHierarchicalMesh/ihm3.cpp
+6
-6
No files found.
Apps/Examples/viewer.cpp
View file @
a0a2dc32
...
...
@@ -31,7 +31,7 @@ Viewer::Viewer() :
m_drawFaces
(
true
),
m_drawNormals
(
false
),
m_drawTopo
(
false
),
m_drawBoundaryTopo
(
tru
e
),
m_drawBoundaryTopo
(
fals
e
),
m_render
(
NULL
),
m_phongShader
(
NULL
),
m_flatShader
(
NULL
),
...
...
@@ -87,7 +87,7 @@ void Viewer::cb_initGL()
m_render
=
new
Algo
::
Render
::
GL2
::
MapRender
()
;
m_topoRender
=
new
Algo
::
Render
::
GL2
::
TopoRender
()
;
m_topoRender
->
setInitialDartsColor
(
0.25
f
,
0.25
f
,
0.25
f
)
;
m_topoRender
->
setInitialDartsColor
(
1.0
f
,
1.00
f
,
1.00
f
)
;
m_positionVBO
=
new
Utils
::
VBO
()
;
m_normalVBO
=
new
Utils
::
VBO
()
;
...
...
@@ -552,11 +552,14 @@ void Viewer::importMesh(std::string& filename)
// myMap.enableQuickTraversal<VERTEX>() ;
std
::
cout
<<
"The mesh is "
<<
(
myMap
.
isOpen
()
?
"open"
:
"closed"
)
<<
std
::
endl
;
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
Algo
::
Render
::
GL2
::
POINTS
)
;
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
Algo
::
Render
::
GL2
::
LINES
)
;
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
Algo
::
Render
::
GL2
::
TRIANGLES
)
;
m_topoRender
->
updateData
<
PFP
>
(
myMap
,
position
,
0.85
f
,
0.85
f
,
m_drawBoundaryTopo
)
;
m_topoRender
->
updateData
<
PFP
>
(
myMap
,
position
,
0.85
f
,
0.85
f
,
m_drawBoundaryTopo
,
true
)
;
bb
=
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
myMap
,
position
)
;
normalBaseSize
=
bb
.
diagSize
()
/
100.0
f
;
...
...
Apps/Tuto/Modelling/tuto_oper2.cpp
View file @
a0a2dc32
...
...
@@ -248,7 +248,7 @@ void MyQT::cb_redraw()
if
(
!
m_selecteds
.
empty
())
{
for
(
std
::
vector
<
Dart
>::
iterator
it
=
m_selecteds
.
begin
()
;
it
!=
m_selecteds
.
end
()
;
++
it
)
m_render_topo
->
overdrawDart
(
*
it
,
11
,
0.0
f
,
0.0
f
,
1.0
f
);
m_render_topo
->
overdrawDart
(
myMap
,
*
it
,
11
,
0.0
f
,
0.0
f
,
1.0
f
);
}
m_render_topo
->
overdrawDart
(
myMap
,
m_selected2
,
11
,
0.0
f
,
1.0
f
,
0.0
f
);
...
...
Apps/Tuto/Modelling/tuto_oper3.cpp
View file @
a0a2dc32
...
...
@@ -852,7 +852,7 @@ void MyQT::importMesh(std::string& filename)
std
::
cerr
<<
"could not import "
<<
filename
<<
std
::
endl
;
return
;
}
else
else
position
=
myMap
.
getAttribute
<
VEC3
,
VERTEX
,
MAP
>
(
attrNames
[
0
])
;
m_selected
=
NIL
;
...
...
CMakeLists.txt
View file @
a0a2dc32
...
...
@@ -125,7 +125,7 @@ SET (CGoGN_EXT_INCLUDES
# define libs for external libs
SET
(
CGoGN_EXT_LIBS
nl
nl
${
OPENGL_LIBRARY
}
${
GLEW_LIBRARIES
}
${
ZLIB_LIBRARIES
}
...
...
ThirdParty/build/.gitignore
deleted
100644 → 0
View file @
652fa86d
# all build directory ignored !
*
ThirdParty/buildDebug/.gitignore
deleted
100644 → 0
View file @
652fa86d
# all build directory ignored !
*
apps_cmake.txt
View file @
a0a2dc32
...
...
@@ -69,6 +69,7 @@ SET (COMMON_LIBS
${LIBXML2_LIBRARIES}
${Boost_SYSTEM_LIBRARY}
${Boost_REGEX_LIBRARY}
tinyxml2
)
IF(WIN32)
...
...
build/.gitignore
deleted
100644 → 0
View file @
652fa86d
#ignore all build directory
*
buildDebug/.gitignore
deleted
100644 → 0
View file @
652fa86d
#ignore all build directory
*
include/Algo/Export/exportVol.h
View file @
a0a2dc32
...
...
@@ -125,6 +125,9 @@ template <typename PFP>
bool
exportTetmesh
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
,
const
char
*
filename
);
template
<
typename
PFP
>
bool
exportBoundaryOFF
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
,
const
char
*
filename
);
}
// namespace Export
}
// namespace Volume
...
...
include/Algo/Export/exportVol.hpp
View file @
a0a2dc32
...
...
@@ -853,6 +853,81 @@ bool exportMesh(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3
}
}
template
<
typename
PFP
>
bool
exportBoundaryOFF
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
,
const
char
*
filename
)
{
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
VEC3
VEC3
;
std
::
ofstream
out
(
filename
,
std
::
ios
::
out
)
;
if
(
!
out
.
good
())
{
CGoGNerr
<<
"Unable to open file "
<<
CGoGNendl
;
return
false
;
}
unsigned
int
nbDarts
=
map
.
getNbDarts
()
;
std
::
vector
<
unsigned
int
>
facesSize
;
std
::
vector
<
std
::
vector
<
unsigned
int
>
>
facesIdx
;
facesSize
.
reserve
(
nbDarts
/
3
)
;
facesIdx
.
reserve
(
nbDarts
/
3
)
;
std
::
map
<
unsigned
int
,
unsigned
int
>
vIndex
;
unsigned
int
vCpt
=
0
;
std
::
vector
<
unsigned
int
>
vertices
;
vertices
.
reserve
(
nbDarts
/
6
)
;
CellMarker
<
typename
PFP
::
MAP
,
VERTEX
>
markV
(
map
)
;
TraversorF
<
MAP
>
t
(
map
)
;
for
(
Dart
d
=
t
.
begin
();
d
!=
t
.
end
();
d
=
t
.
next
())
{
if
(
map
.
isBoundaryFace
(
d
))
{
Dart
db
=
d
;
if
(
!
map
.
template
isBoundaryMarked
<
3
>(
db
))
db
=
map
.
phi3
(
db
);
std
::
vector
<
unsigned
int
>
fidx
;
fidx
.
reserve
(
8
)
;
unsigned
int
degree
=
0
;
Traversor2FV
<
typename
PFP
::
MAP
>
tfv
(
map
,
db
)
;
for
(
Dart
it
=
tfv
.
begin
();
it
!=
tfv
.
end
();
it
=
tfv
.
next
())
{
++
degree
;
unsigned
int
vNum
=
map
.
template
getEmbedding
<
VERTEX
>(
it
)
;
if
(
!
markV
.
isMarked
(
it
))
{
markV
.
mark
(
it
)
;
vIndex
[
vNum
]
=
vCpt
++
;
vertices
.
push_back
(
vNum
)
;
}
fidx
.
push_back
(
vIndex
[
vNum
])
;
}
facesSize
.
push_back
(
degree
)
;
facesIdx
.
push_back
(
fidx
)
;
}
}
out
<<
"OFF"
<<
std
::
endl
;
out
<<
vertices
.
size
()
<<
" "
<<
facesSize
.
size
()
<<
" "
<<
0
<<
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
;
}
for
(
unsigned
int
i
=
0
;
i
<
facesSize
.
size
();
++
i
)
{
out
<<
facesSize
[
i
]
;
for
(
unsigned
int
j
=
0
;
j
<
facesIdx
[
i
].
size
();
++
j
)
out
<<
" "
<<
facesIdx
[
i
][
j
]
;
out
<<
std
::
endl
;
}
out
.
close
()
;
return
true
;
}
}
// namespace Export
}
// namespace Volume
...
...
include/Algo/ImplicitHierarchicalMesh/ihm3.h
xx
→
include/Algo/ImplicitHierarchicalMesh/ihm3.h
View file @
a0a2dc32
...
...
@@ -57,9 +57,9 @@ public:
unsigned
int
m_edgeIdCount
;
unsigned
int
m_faceIdCount
;
DartAttribute
<
unsigned
int
,
ImplicitHierarchical
Map3
>
m_dartLevel
;
DartAttribute
<
unsigned
int
,
ImplicitHierarchical
Map3
>
m_edgeId
;
DartAttribute
<
unsigned
int
,
ImplicitHierarchical
Map3
>
m_faceId
;
DartAttribute
<
unsigned
int
,
Embedded
Map3
>
m_dartLevel
;
DartAttribute
<
unsigned
int
,
Embedded
Map3
>
m_edgeId
;
DartAttribute
<
unsigned
int
,
Embedded
Map3
>
m_faceId
;
AttributeMultiVector
<
unsigned
int
>*
m_nextLevelCell
[
NB_ORBITS
]
;
...
...
@@ -100,15 +100,15 @@ public:
/*!
*
*/
template
<
typename
T
,
unsigned
int
ORBIT
>
AttributeHandler_IHM
<
T
,
ORBIT
>
addAttribute
(
const
std
::
string
&
nameAttr
)
;
//
template <typename T, unsigned int ORBIT>
//
AttributeHandler_IHM<T, ORBIT> addAttribute(const std::string& nameAttr) ;
//!
/*!
*
*/
template
<
typename
T
,
unsigned
int
ORBIT
>
AttributeHandler_IHM
<
T
,
ORBIT
>
getAttribute
(
const
std
::
string
&
nameAttr
)
;
//
template <typename T, unsigned int ORBIT>
//
AttributeHandler_IHM<T, ORBIT> getAttribute(const std::string& nameAttr) ;
//@}
/*! @name Basic Topological Operators
...
...
@@ -419,8 +419,8 @@ public:
void
foreach_dart_of_cc
(
Dart
d
,
FUNC
&
f
)
const
;
//@}
template
<
unsigned
int
ORBIT
>
unsigned
int
getEmbedding
(
Cell
<
ORBIT
>
c
)
const
;
//
template <unsigned int ORBIT>
//
unsigned int getEmbedding(Cell<ORBIT> c) const;
}
;
template
<
typename
T
,
unsigned
int
ORBIT
>
...
...
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
xx
→
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
View file @
a0a2dc32
...
...
@@ -37,7 +37,7 @@ namespace IHM
/***************************************************
* ATTRIBUTES MANAGEMENT *
***************************************************/
/*
template <typename T, unsigned int ORBIT>
AttributeHandler_IHM<T, ORBIT> ImplicitHierarchicalMap3::addAttribute(const std::string& nameAttr)
{
...
...
@@ -65,13 +65,13 @@ AttributeHandler_IHM<T, ORBIT> ImplicitHierarchicalMap3::getAttribute(const std:
AttributeHandler<T, ORBIT, ImplicitHierarchicalMap3> h = Map3::getAttribute<T, ORBIT, ImplicitHierarchicalMap3>(nameAttr) ;
return AttributeHandler_IHM<T, ORBIT>(this, h.getDataVector()) ;
}
*/
inline
void
ImplicitHierarchicalMap3
::
update_topo_shortcuts
()
{
// Map3::update_topo_shortcuts();
m_dartLevel = Map3::getAttribute<unsigned int, DART, ImplicitHierarchical
Map3>("dartLevel") ;
m_faceId = Map3::getAttribute<unsigned int, DART, ImplicitHierarchical
Map3>("faceId") ;
m_edgeId = Map3::getAttribute<unsigned int, DART, ImplicitHierarchical
Map3>("edgeId") ;
m_dartLevel
=
Map3
::
getAttribute
<
unsigned
int
,
DART
,
Embedded
Map3
>
(
"dartLevel"
)
;
m_faceId
=
Map3
::
getAttribute
<
unsigned
int
,
DART
,
Embedded
Map3
>
(
"faceId"
)
;
m_edgeId
=
Map3
::
getAttribute
<
unsigned
int
,
DART
,
Embedded
Map3
>
(
"edgeId"
)
;
//AttributeContainer& cont = m_attribs[DART] ;
//m_nextLevelCell = cont.getDataVector<unsigned int>(cont.getAttributeIndex("nextLevelCell")) ;
...
...
@@ -638,6 +638,7 @@ inline unsigned int ImplicitHierarchicalMap3::edgeLevel(Dart d)
return
r
;
}
/*
template <unsigned int ORBIT>
inline unsigned int ImplicitHierarchicalMap3::getEmbedding(Cell<ORBIT> c) const
{
...
...
@@ -655,7 +656,7 @@ inline unsigned int ImplicitHierarchicalMap3::getEmbedding(Cell<ORBIT> c) const
}
return index;
}
}
*/
inline
bool
ImplicitHierarchicalMap3
::
isWellEmbedded
()
{
...
...
include/Algo/ImplicitHierarchicalMesh/subdivision3.h
xx
→
include/Algo/ImplicitHierarchicalMesh/subdivision3.h
View file @
a0a2dc32
...
...
@@ -48,7 +48,7 @@ enum SubdivideType
template
<
typename
PFP
>
void
newLevelHexa
(
typename
PFP
::
MAP
&
map
,
AttributeHandler
<
typename
PFP
::
VEC3
,
VERTEX
>&
position
);
void
newLevelHexa
(
typename
PFP
::
MAP
&
map
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
);
/***********************************************************************************
...
...
@@ -56,13 +56,13 @@ void newLevelHexa(typename PFP::MAP& map, AttributeHandler<typename PFP::VEC3, V
***********************************************************************************/
template
<
typename
PFP
>
void
subdivideEdge
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
AttributeHandler
<
typename
PFP
::
VEC3
,
VERTEX
>&
position
)
;
void
subdivideEdge
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
)
;
template
<
typename
PFP
>
void
subdivideFace
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
AttributeHandler
<
typename
PFP
::
VEC3
,
VERTEX
>&
position
,
SubdivideType
sType
=
S_TRI
);
void
subdivideFace
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
,
SubdivideType
sType
=
S_TRI
);
template
<
typename
PFP
>
Dart
subdivideVolumeClassic
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
AttributeHandler
<
typename
PFP
::
VEC3
,
VERTEX
>&
position
);
Dart
subdivideVolumeClassic
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
);
...
...
@@ -72,13 +72,13 @@ Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, AttributeHandler<typ
template
<
typename
PFP
>
void
subdivideEdgeWrong
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
AttributeHandler
<
typename
PFP
::
VEC3
,
VERTEX
>&
position
)
;
void
subdivideEdgeWrong
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
)
;
template
<
typename
PFP
>
void
subdivideFaceWrong
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
AttributeHandler
<
typename
PFP
::
VEC3
,
VERTEX
>&
position
,
SubdivideType
sType
=
S_TRI
);
void
subdivideFaceWrong
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
,
SubdivideType
sType
=
S_TRI
);
template
<
typename
PFP
>
Dart
subdivideVolumeClassicWrong
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
AttributeHandler
<
typename
PFP
::
VEC3
,
VERTEX
>&
position
);
Dart
subdivideVolumeClassicWrong
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
);
...
...
@@ -89,23 +89,23 @@ Dart subdivideVolumeClassicWrong(typename PFP::MAP& map, Dart d, AttributeHandle
template
<
typename
PFP
>
Dart
subdivideVolume
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
AttributeHandler
<
typename
PFP
::
VEC3
,
VERTEX
>&
position
);
Dart
subdivideVolume
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
);
template
<
typename
PFP
>
Dart
subdivideVolumeGen
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
AttributeHandler
<
typename
PFP
::
VEC3
,
VERTEX
>&
position
);
Dart
subdivideVolumeGen
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
);
template
<
typename
PFP
>
Dart
subdivideVolumeClassic2
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
AttributeHandler
<
typename
PFP
::
VEC3
,
VERTEX
>&
position
);
Dart
subdivideVolumeClassic2
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
);
template
<
typename
PFP
>
void
subdivideLoop
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
AttributeHandler
<
typename
PFP
::
VEC3
,
VERTEX
>&
position
);
void
subdivideLoop
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
);
/***********************************************************************************
...
...
@@ -113,13 +113,13 @@ void subdivideLoop(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP
***********************************************************************************/
template
<
typename
PFP
>
void
coarsenEdge
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
AttributeHandler
<
typename
PFP
::
VEC3
,
VERTEX
>&
position
);
void
coarsenEdge
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
);
template
<
typename
PFP
>
void
coarsenFace
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
AttributeHandler
<
typename
PFP
::
VEC3
,
VERTEX
>&
position
,
SubdivideType
sType
=
S_TRI
);
void
coarsenFace
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
,
SubdivideType
sType
=
S_TRI
);
template
<
typename
PFP
>
void
coarsenVolume
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
AttributeHandler
<
typename
PFP
::
VEC3
,
VERTEX
>&
position
);
void
coarsenVolume
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
);
/***********************************************************************************
* Raffinement
...
...
@@ -128,7 +128,7 @@ void coarsenVolume(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP
* Un brin de la face oppose aux faces a spliter
*/
template
<
typename
PFP
>
void
splitVolume
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
AttributeHandler
<
typename
PFP
::
VEC3
,
VERTEX
>&
position
);
void
splitVolume
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
);
...
...
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
xx
→
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
View file @
a0a2dc32
This diff is collapsed.
Click to expand it.
include/Algo/Import/import.hpp
View file @
a0a2dc32
...
...
@@ -182,6 +182,19 @@ bool importVoxellisation(typename PFP::MAP& map, Algo::Surface::Modelisation::Vo
return
importMesh
<
PFP
>
(
map
,
mts
);
}
template
<
typename
PFP2
,
typename
PFP3
>
bool
import3DMap
(
typename
PFP2
::
MAP
&
map2
,
typename
PFP3
::
MAP
&
map3
,
std
::
vector
<
std
::
string
>&
attrNames
,
bool
mergeCloseVertices
)
{
MeshTablesSurface
<
PFP2
>
mts
(
map2
);
if
(
!
mts
.
template
import3DMap
<
PFP3
>(
map3
,
attrNames
))
return
false
;
if
(
mergeCloseVertices
)
mts
.
mergeCloseVertices
();
return
importMesh
<
PFP2
>
(
map2
,
mts
);
}
template
<
typename
PFP
>
bool
importMeshSAsV
(
typename
PFP
::
MAP
&
map
,
MeshTablesSurface
<
PFP
>&
mts
)
...
...
include/Algo/Import/import2tables.h
View file @
a0a2dc32
...
...
@@ -133,6 +133,10 @@ public:
bool
importPlySLFgenericBin
(
const
std
::
string
&
filename
,
std
::
vector
<
std
::
string
>&
attrNames
);
template
<
typename
PFP3
>
bool
import3DMap
(
typename
PFP3
::
MAP
&
map
,
std
::
vector
<
std
::
string
>&
attrNames
);
MeshTablesSurface
(
MAP
&
map
)
:
m_map
(
map
)
{
}
...
...
include/Algo/Import/import2tablesSurface.hpp
View file @
a0a2dc32
...
...
@@ -381,6 +381,92 @@ bool MeshTablesSurface<PFP>::importVoxellisation(Algo::Surface::Modelisation::Vo
return true;
}
template <typename PFP>
template <typename PFP3>
bool MeshTablesSurface<PFP>::import3DMap(typename PFP3::MAP& map, std::vector<std::string>& attrNames)
{
VertexAttribute<VEC3, MAP> positions = m_map.template getAttribute<VEC3, VERTEX, MAP>("position") ;
VertexAttribute<VEC3, typename PFP3::MAP> position_from = map.template getAttribute<VEC3, VERTEX, typename PFP3::MAP>("position") ;
if (!positions.isValid())
positions = m_map.template addAttribute<VEC3, VERTEX, MAP>("position") ;
attrNames.push_back(positions.name()) ;
AttributeContainer& container = m_map.template getAttributeContainer<VERTEX>() ;
// lecture des nombres de sommets / faces du bord
m_nbVertices = 0;
foreach_cell<VERTEX>(map, [&] (Vertex v)
{
if(map.isBoundaryVertex(v.dart))
++m_nbVertices;
}, FORCE_DART_MARKING);
std::cout << "nbVertices = " << m_nbVertices << std::endl;
m_nbFaces = 0;
foreach_cell<FACE>(map, [&] (Face f)
{
if(map.isBoundaryFace(f.dart))
++m_nbFaces;
}, FORCE_DART_MARKING);
std::cout << "m_nbFaces = " << m_nbFaces << std::endl;
// std::vector<unsigned int> verticesID;
// verticesID.reserve(m_nbVertices);
// //parcours des sommets de la 3-carte
// foreach_cell<VERTEX>(map, [&] (Vertex v)
// {
// //si c'est un sommet du bord
// if(map.isBoundaryVertex(v.dart))
// {
// // insert une nouvelle ligne dans le container
// unsigned int id = container.insertLine();
// // copie de la position
// positions[id] = position_from[id];
// // push_back
// verticesID.push_back(id);
// }
// }, FORCE_DART_MARKING);
// //parcours des faces de la 3-carte
// // normalement nbVertices*8 devrait suffire largement
// m_nbEdges.reserve(m_nbFaces);
// m_emb.reserve(m_nbVertices*8);
// foreach_cell<FACE>(map, [&] (Face f)
// {
// if(map.isBoundaryFace(f.dart))
// {
// Dart d = f.dart;
// if(!map.template isBoundaryMarked<3>(d))
// d = map.phi3(d);
// Dart dit = d;
// do
// {
// unsigned int index ; // index of embedding
// index = map.getEmbedding(Vertex(d));
// m_emb.push_back(verticesID[index]) ;
// dit = map.phi1(dit);
// }while(dit != d);
// }
// }, FORCE_DART_MARKING);
return true;
}
template<typename PFP>
bool MeshTablesSurface<PFP>::importMeshBin(const std::string& filename, std::vector<std::string>& attrNames)
{
...
...
include/Algo/Multiresolution/IHM3/ihm3_PrimalAdapt.hpp
View file @
a0a2dc32
...
...
@@ -97,7 +97,7 @@ unsigned int IHM3<PFP>::faceLevel(Dart d)
unsigned
int
l
=
edgeLevel
(
it
)
;
// is the minimum of the levels
fLevel
=
l
<
fLevel
?
l
:
fLevel
;
// of its edges
}
while
(
it
!=
d
)
;
/*
unsigned
int
cur
=
m_map
.
getCurrentLevel
()
;
m_map
.
setCurrentLevel
(
fLevel
)
;
...
...
@@ -117,7 +117,7 @@ unsigned int IHM3<PFP>::faceLevel(Dart d)
}
m_map
.
setCurrentLevel
(
cur
)
;
*/
return
fLevel
;
}
...
...
@@ -129,21 +129,20 @@ unsigned int IHM3<PFP>::volumeLevel(Dart d)
if
(
m_map
.
getCurrentLevel
()
==
0
)
return
0
;
Dart
oldest
=
d
;
unsigned
int
vLevel
=
std
::
numeric_limits
<
unsigned
int
>::
max
();
//hook sioux
// Dart oldest = d ;
// unsigned int vLevel = std::numeric_limits<unsigned int>::max(); //hook sioux
// //First : the level of a volume is the minimum of the levels of its faces
// Traversor3WF<typename PFP::MAP> travF(m_map, d);
// for (Dart dit = travF.begin(); dit != travF.end(); dit = travF.next())
// {
// // in a first time, the level of a face
// //the level of the volume is the minimum of the
// //levels of its faces
// unsigned int fLevel = faceLevel(dit);
// vLevel = fLevel < vLevel ? fLevel : vLevel ;
// }
//First : the level of a volume is the minimum of the levels of its faces
Traversor3WF
<
typename
PFP
::
MAP
>
travF
(
m_map
,
d
);
for
(
Dart
dit
=
travF
.
begin
();
dit
!=
travF
.
end
();
dit
=
travF
.
next
())
{
// in a first time, the level of a face
//the level of the volume is the minimum of the
//levels of its faces
unsigned
int
fLevel
=
faceLevel
(
dit
);
vLevel
=
fLevel
<
vLevel
?
fLevel
:
vLevel
;
}
/*
//First : the level of a volume is the
//minimum of the levels of its faces
...
...
@@ -237,7 +236,7 @@ unsigned int IHM3<PFP>::volumeLevel(Dart d)
e
=
m_map
.
phi1
(
e
)
;
}
while
(
e
!=
visitedFaces
[
i
])
;
}
*/
//Second : the case of all faces regularly subdivided but not the volume itself
...
...
@@ -601,8 +600,8 @@ unsigned int IHM3<PFP>::subdivideFace(Dart d, bool triQuad)
e
=
m_map
.
phi1
(
e
)
;
m_map
.
splitFace
(
dd
,
e
)
;
// insert a new edge
//
unsigned int id = m_map.getNewEdgeId() ;
unsigned
int
id
=
m_map
.
triRefinementEdgeId
(
m_map
.
phi_1
(
dd
));
unsigned
int
id
=
m_map
.
getNewEdgeId
()
;
//
unsigned int id = m_map.triRefinementEdgeId(m_map.phi_1(dd));
m_map
.
setEdgeId
(
m_map
.
phi_1
(
dd
),
id
)
;
// set the edge id of the inserted edge to the next available id
unsigned
int
idface
=
m_map
.
getFaceId
(
old
);
...
...
@@ -614,8 +613,8 @@ unsigned int IHM3<PFP>::subdivideFace(Dart d, bool triQuad)
(
*
vertexVertexFunctor
)(
e
)
;
e
=
m_map
.
phi1
(
dd
);
m_map
.
splitFace
(
dd
,
e
)
;
//
id = m_map.getNewEdgeId() ;
id
=
m_map
.
triRefinementEdgeId
(
m_map
.
phi_1
(
dd
));
id
=
m_map
.
getNewEdgeId
()
;
//
id = m_map.triRefinementEdgeId(m_map.phi_1(dd));
m_map
.
setEdgeId
(
m_map
.
phi_1
(
dd
),
id
)
;
m_map
.
setFaceId
(
dd
,
idface
,
FACE
)
;
...
...
@@ -626,8 +625,8 @@ unsigned int IHM3<PFP>::subdivideFace(Dart d, bool triQuad)
(
*
vertexVertexFunctor
)(
e
)
;
e
=
m_map
.
phi1
(
dd
);
m_map
.
splitFace
(
dd
,
e
)
;
//
id = m_map.getNewEdgeId() ;
id
=
m_map
.
triRefinementEdgeId
(
m_map
.
phi_1
(
dd
));
id
=
m_map
.
getNewEdgeId
()
;
//
id = m_map.triRefinementEdgeId(m_map.phi_1(dd));
m_map
.
setEdgeId
(
m_map
.
phi_1
(
dd
),
id
)
;
m_map
.
setFaceId
(
dd
,
idface
,
FACE
)
;
...
...
@@ -644,11 +643,11 @@ unsigned int IHM3<PFP>::subdivideFace(Dart d, bool triQuad)
Dart
ne2
=
m_map
.
phi2
(
ne
);
m_map
.
cutEdge
(
ne
)
;
//
unsigned int id = m_map.getNewEdgeId() ;
unsigned
int
id
=
m_map
.
getQuadRefinementEdgeId
(
m_map
.
phi2
(
ne
));
unsigned
int
id
=
m_map
.
getNewEdgeId
()
;
//
unsigned int id = m_map.getQuadRefinementEdgeId(m_map.phi2(ne));
m_map
.
setEdgeId
(
ne
,
id
)
;
//
id = m_map.getNewEdgeId() ;
id
=
m_map
.
getQuadRefinementEdgeId
(
m_map
.
phi2
(
ne2
));
id
=
m_map
.
getNewEdgeId
()
;
//
id = m_map.getQuadRefinementEdgeId(m_map.phi2(ne2));
m_map
.
setEdgeId
(
ne2
,
id
)
;
dd
=
m_map
.
phi1
(
next
)
;
...
...
@@ -658,8 +657,8 @@ unsigned int IHM3<PFP>::subdivideFace(Dart d, bool triQuad)
{
m_map
.
splitFace
(
m_map
.
phi1
(
ne
),
dd
)
;
Dart
nne
=
m_map
.
phi2
(
m_map
.
phi_1
(
dd
))
;
//
id = m_map.getNewEdgeId() ;
id
=
m_map
.
getQuadRefinementEdgeId
(
m_map
.
phi2
(
nne
));
id
=
m_map
.
getNewEdgeId
()
;
//
id = m_map.getQuadRefinementEdgeId(m_map.phi2(nne));
m_map
.
setEdgeId
(
nne
,
id
)
;
dd
=
m_map
.
phi1
(
dd
)
;
(
*
vertexVertexFunctor
)(
dd
)
;
...
...
@@ -747,17 +746,20 @@ Dart IHM3<PFP>::subdivideVolume(Dart d, bool triQuad, bool OneLevelDifference)
unsigned
int
cur
=
m_map
.
getCurrentLevel
();