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
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
CGoGN
CGoGN
Commits
1ff6b8b3
Commit
1ff6b8b3
authored
Dec 07, 2012
by
untereiner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Regular Refinement ok - lerp filters
parent
88a0b0c1
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
459 additions
and
44 deletions
+459
-44
Apps/Examples/viewer.h
Apps/Examples/viewer.h
+1
-0
include/Algo/Geometry/convexity.h
include/Algo/Geometry/convexity.h
+51
-0
include/Algo/Geometry/convexity.hpp
include/Algo/Geometry/convexity.hpp
+57
-0
include/Algo/Modelisation/polyhedron.h
include/Algo/Modelisation/polyhedron.h
+14
-0
include/Algo/Modelisation/polyhedron.hpp
include/Algo/Modelisation/polyhedron.hpp
+56
-0
include/Algo/Multiresolution/Map2MR/Filters/lerp.h
include/Algo/Multiresolution/Map2MR/Filters/lerp.h
+185
-17
include/Algo/Multiresolution/Map3MR/Filters/lerp.h
include/Algo/Multiresolution/Map3MR/Filters/lerp.h
+70
-8
include/Algo/Multiresolution/Map3MR/map3MR_PrimalRegular.hpp
include/Algo/Multiresolution/Map3MR/map3MR_PrimalRegular.hpp
+25
-19
No files found.
Apps/Examples/viewer.h
View file @
1ff6b8b3
...
...
@@ -52,6 +52,7 @@
#include "Algo/Geometry/boundingbox.h"
#include "Algo/Geometry/normal.h"
#include "Algo/Geometry/convexity.h"
using
namespace
CGoGN
;
...
...
include/Algo/Geometry/convexity.h
0 → 100644
View file @
1ff6b8b3
/*******************************************************************************
* 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 *
* *
*******************************************************************************/
#ifndef __ALGO_GEOMETRY_CONVEXITY_H__
#define __ALGO_GEOMETRY_CONVEXITY_H__
namespace
CGoGN
{
namespace
Algo
{
namespace
Geometry
{
/**
* Test if an edge bounded by 2 faces is convex or concave
*/
template
<
typename
PFP
>
bool
isEdgeConvexe
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
)
;
}
// namespace Geometry
}
// namespace Algo
}
// namespace CGoGN
#include "Algo/Geometry/convexity.hpp"
#endif
include/Algo/Geometry/convexity.hpp
0 → 100644
View file @
1ff6b8b3
/*******************************************************************************
* 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 "Geometry/basic.h"
#include "Algo/Geometry/normal.h"
#include <limits>
namespace
CGoGN
{
namespace
Algo
{
namespace
Geometry
{
template
<
typename
PFP
>
bool
isEdgeConvexe
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
)
{
typedef
typename
PFP
::
VEC3
VEC3
;
const
VEC3
n
=
faceNormal
<
PFP
>
(
map
,
d
,
position
);
const
VEC3
e
=
Algo
::
Geometry
::
vectorOutOfDart
<
PFP
>
(
map
,
map
.
phi1
(
map
.
phi2
(
d
)),
position
)
;
if
((
e
*
n
)
>
0
)
return
false
;
else
return
true
;
}
}
// namespace Geometry
}
// namespace Algo
}
// namespace CGoGN
include/Algo/Modelisation/polyhedron.h
View file @
1ff6b8b3
...
...
@@ -125,6 +125,20 @@ Dart createQuadrangularPyramid(typename PFP::MAP& map, bool withBoundary = true)
template
<
typename
PFP
>
Dart
createOctahedron
(
typename
PFP
::
MAP
&
map
,
bool
withBoundary
=
true
);
//TODO optimize
template
<
typename
PFP
>
bool
isPyra
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
unsigned
int
thread
=
0
);
//TODO optimize
template
<
typename
PFP
>
bool
isPrism
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
unsigned
int
thread
=
0
);
/**
...
...
include/Algo/Modelisation/polyhedron.hpp
View file @
1ff6b8b3
...
...
@@ -201,6 +201,62 @@ Dart createOctahedron(typename PFP::MAP& map, bool withBoundary)
template
<
typename
PFP
>
bool
isPyra
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
unsigned
int
thread
)
{
unsigned
int
nbFacesT
=
0
;
unsigned
int
nbFacesQ
=
0
;
//Test the number of faces end its valency
Traversor3WF
<
typename
PFP
::
MAP
>
travWF
(
map
,
d
,
false
,
thread
);
for
(
Dart
dit
=
travWF
.
begin
()
;
dit
!=
travWF
.
end
();
dit
=
travWF
.
next
())
{
//increase the number of faces
if
(
map
.
faceDegree
(
dit
)
==
3
)
nbFacesT
++
;
else
if
(
map
.
faceDegree
(
dit
)
==
4
)
nbFacesQ
++
;
else
return
false
;
}
if
((
nbFacesT
!=
4
)
||
(
nbFacesQ
!=
1
))
//too much faces
return
false
;
return
true
;
}
template
<
typename
PFP
>
bool
isPrism
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
unsigned
int
thread
)
{
unsigned
int
nbFacesT
=
0
;
unsigned
int
nbFacesQ
=
0
;
//Test the number of faces end its valency
Traversor3WF
<
typename
PFP
::
MAP
>
travWF
(
map
,
d
,
false
,
thread
);
for
(
Dart
dit
=
travWF
.
begin
()
;
dit
!=
travWF
.
end
();
dit
=
travWF
.
next
())
{
//increase the number of faces
if
(
map
.
faceDegree
(
dit
)
==
3
)
nbFacesT
++
;
else
if
(
map
.
faceDegree
(
dit
)
==
4
)
nbFacesQ
++
;
else
return
false
;
}
if
((
nbFacesT
!=
2
)
||
(
nbFacesQ
!=
3
))
//too much faces
return
false
;
return
true
;
}
template
<
typename
PFP
>
void
explodPolyhedron
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
)
{
...
...
include/Algo/Multiresolution/Map2MR/Filters/lerp.h
View file @
1ff6b8b3
...
...
@@ -46,64 +46,232 @@ namespace Filters
/*********************************************************************************
* SYNTHESIS FILTERS
*********************************************************************************/
// Quad refinement
template
<
typename
PFP
>
class
Lerp
Edge
SynthesisFilter
:
public
Filter
class
Lerp
QuadOdd
SynthesisFilter
:
public
Filter
{
protected:
typename
PFP
::
MAP
&
m_map
;
VertexAttribute
<
typename
PFP
::
VEC3
>&
m_position
;
public:
Lerp
Edge
SynthesisFilter
(
typename
PFP
::
MAP
&
m
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
p
)
:
m_map
(
m
),
m_position
(
p
)
Lerp
QuadOdd
SynthesisFilter
(
typename
PFP
::
MAP
&
m
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
p
)
:
m_map
(
m
),
m_position
(
p
)
{}
void
operator
()
()
{
Traversor
E
<
typename
PFP
::
MAP
>
trav
(
m_map
)
;
for
(
Dart
d
=
trav
.
begin
();
d
!=
trav
.
end
();
d
=
trav
.
next
())
Traversor
F
<
typename
PFP
::
MAP
>
travF
(
m_map
)
;
for
(
Dart
d
=
trav
F
.
begin
();
d
!=
travF
.
end
();
d
=
travF
.
next
())
{
typename
PFP
::
VEC3
p
=
(
m_position
[
d
]
+
m_position
[
m_map
.
phi1
(
d
)])
*
typename
PFP
::
REAL
(
0.5
);
typename
PFP
::
VEC3
vf
(
0.0
);
typename
PFP
::
VEC3
ef
(
0.0
);
unsigned
int
count
=
0
;
Traversor2FE
<
typename
PFP
::
MAP
>
travFE
(
m_map
,
d
);
for
(
Dart
dit
=
travFE
.
begin
();
dit
!=
travFE
.
end
();
dit
=
travFE
.
next
())
{
vf
+=
m_position
[
dit
];
m_map
.
incCurrentLevel
();
ef
+=
m_position
[
m_map
.
phi1
(
dit
)];
m_map
.
decCurrentLevel
();
++
count
;
}
ef
/=
count
;
ef
*=
2.0
;
vf
/=
count
;
m_map
.
incCurrentLevel
()
;
Dart
midF
=
m_map
.
phi1
(
m_map
.
phi1
(
d
));
m_position
[
midF
]
+=
vf
+
ef
;
m_map
.
decCurrentLevel
()
;
}
Dart
midV
=
m_map
.
phi1
(
d
)
;
m_position
[
midV
]
=
p
;
TraversorE
<
typename
PFP
::
MAP
>
travE
(
m_map
)
;
for
(
Dart
d
=
travE
.
begin
();
d
!=
travE
.
end
();
d
=
travE
.
next
())
{
typename
PFP
::
VEC3
ve
=
(
m_position
[
d
]
+
m_position
[
m_map
.
phi1
(
d
)])
*
typename
PFP
::
REAL
(
0.5
);
m_map
.
incCurrentLevel
()
;
Dart
midV
=
m_map
.
phi1
(
d
)
;
m_position
[
midV
]
+=
ve
;
m_map
.
decCurrentLevel
()
;
}
}
}
;
};
// Tri/quad refinement
template
<
typename
PFP
>
class
Lerp
Face
SynthesisFilter
:
public
Filter
class
Lerp
TriQuadOdd
SynthesisFilter
:
public
Filter
{
protected:
typename
PFP
::
MAP
&
m_map
;
VertexAttribute
<
typename
PFP
::
VEC3
>&
m_position
;
public:
Lerp
Face
SynthesisFilter
(
typename
PFP
::
MAP
&
m
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
p
)
:
m_map
(
m
),
m_position
(
p
)
Lerp
TriQuadOdd
SynthesisFilter
(
typename
PFP
::
MAP
&
m
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
p
)
:
m_map
(
m
),
m_position
(
p
)
{}
void
operator
()
()
{
TraversorF
<
typename
PFP
::
MAP
>
trav
(
m_map
)
;
for
(
Dart
d
=
trav
.
begin
();
d
!=
trav
.
end
();
d
=
trav
.
next
())
TraversorF
<
typename
PFP
::
MAP
>
trav
F
(
m_map
)
;
for
(
Dart
d
=
trav
F
.
begin
();
d
!=
travF
.
end
();
d
=
travF
.
next
())
{
typename
PFP
::
VEC3
p
=
Algo
::
Geometry
::
faceCentroid
<
PFP
>
(
m_map
,
d
,
m_position
);
m_map
.
incCurrentLevel
()
;
if
(
m_map
.
faceDegree
(
d
)
!=
3
)
{
typename
PFP
::
VEC3
vf
(
0.0
);
typename
PFP
::
VEC3
ef
(
0.0
);
unsigned
int
count
=
0
;
Traversor2FE
<
typename
PFP
::
MAP
>
travFE
(
m_map
,
d
);
for
(
Dart
dit
=
travFE
.
begin
();
dit
!=
travFE
.
end
();
dit
=
travFE
.
next
())
{
vf
+=
m_position
[
dit
];
m_map
.
incCurrentLevel
();
ef
+=
m_position
[
m_map
.
phi1
(
dit
)];
m_map
.
decCurrentLevel
();
++
count
;
}
ef
/=
count
;
ef
*=
2.0
;
vf
/=
count
;
m_map
.
incCurrentLevel
()
;
Dart
midF
=
m_map
.
phi1
(
m_map
.
phi1
(
d
));
m_position
[
midF
]
=
p
;
m_position
[
midF
]
+=
vf
+
ef
;
m_map
.
decCurrentLevel
()
;
}
}
TraversorE
<
typename
PFP
::
MAP
>
travE
(
m_map
)
;
for
(
Dart
d
=
travE
.
begin
();
d
!=
travE
.
end
();
d
=
travE
.
next
())
{
typename
PFP
::
VEC3
ve
=
(
m_position
[
d
]
+
m_position
[
m_map
.
phi1
(
d
)])
*
typename
PFP
::
REAL
(
0.5
);
m_map
.
incCurrentLevel
()
;
Dart
midV
=
m_map
.
phi1
(
d
)
;
m_position
[
midV
]
+=
ve
;
m_map
.
decCurrentLevel
()
;
}
}
};
/*********************************************************************************
* ANALYSIS FILTERS
*********************************************************************************/
// Quad refinement
template
<
typename
PFP
>
class
LerpQuadOddAnalysisFilter
:
public
Filter
{
protected:
typename
PFP
::
MAP
&
m_map
;
VertexAttribute
<
typename
PFP
::
VEC3
>&
m_position
;
public:
LerpQuadOddAnalysisFilter
(
typename
PFP
::
MAP
&
m
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
p
)
:
m_map
(
m
),
m_position
(
p
)
{}
void
operator
()
()
{
TraversorE
<
typename
PFP
::
MAP
>
travE
(
m_map
)
;
for
(
Dart
d
=
travE
.
begin
();
d
!=
travE
.
end
();
d
=
travE
.
next
())
{
typename
PFP
::
VEC3
ve
=
(
m_position
[
d
]
+
m_position
[
m_map
.
phi1
(
d
)])
*
typename
PFP
::
REAL
(
0.5
);
m_map
.
incCurrentLevel
()
;
Dart
midV
=
m_map
.
phi1
(
d
)
;
m_position
[
midV
]
-=
ve
;
m_map
.
decCurrentLevel
()
;
}
TraversorF
<
typename
PFP
::
MAP
>
travF
(
m_map
)
;
for
(
Dart
d
=
travF
.
begin
();
d
!=
travF
.
end
();
d
=
travF
.
next
())
{
typename
PFP
::
VEC3
vf
(
0.0
);
typename
PFP
::
VEC3
ef
(
0.0
);
unsigned
int
count
=
0
;
Traversor2FE
<
typename
PFP
::
MAP
>
travFE
(
m_map
,
d
);
for
(
Dart
dit
=
travFE
.
begin
();
dit
!=
travFE
.
end
();
dit
=
travFE
.
next
())
{
vf
+=
m_position
[
dit
];
m_map
.
incCurrentLevel
();
ef
+=
m_position
[
m_map
.
phi1
(
dit
)];
m_map
.
decCurrentLevel
();
++
count
;
}
ef
/=
count
;
ef
*=
2.0
;
vf
/=
count
;
m_map
.
incCurrentLevel
()
;
Dart
midF
=
m_map
.
phi1
(
m_map
.
phi1
(
d
));
m_position
[
midF
]
-=
vf
+
ef
;
m_map
.
decCurrentLevel
()
;
}
}
}
;
};
// Tri/quad refinement
template
<
typename
PFP
>
class
LerpTriQuadOddAnalysisFilter
:
public
Filter
{
protected:
typename
PFP
::
MAP
&
m_map
;
VertexAttribute
<
typename
PFP
::
VEC3
>&
m_position
;
public:
LerpTriQuadOddAnalysisFilter
(
typename
PFP
::
MAP
&
m
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
p
)
:
m_map
(
m
),
m_position
(
p
)
{}
void
operator
()
()
{
TraversorE
<
typename
PFP
::
MAP
>
travE
(
m_map
)
;
for
(
Dart
d
=
travE
.
begin
();
d
!=
travE
.
end
();
d
=
travE
.
next
())
{
typename
PFP
::
VEC3
ve
=
(
m_position
[
d
]
+
m_position
[
m_map
.
phi1
(
d
)])
*
typename
PFP
::
REAL
(
0.5
);
m_map
.
incCurrentLevel
()
;
Dart
midV
=
m_map
.
phi1
(
d
)
;
m_position
[
midV
]
-=
ve
;
m_map
.
decCurrentLevel
()
;
}
TraversorF
<
typename
PFP
::
MAP
>
travF
(
m_map
)
;
for
(
Dart
d
=
travF
.
begin
();
d
!=
travF
.
end
();
d
=
travF
.
next
())
{
if
(
m_map
.
faceDegree
(
d
)
!=
3
)
{
typename
PFP
::
VEC3
vf
(
0.0
);
typename
PFP
::
VEC3
ef
(
0.0
);
unsigned
int
count
=
0
;
Traversor2FE
<
typename
PFP
::
MAP
>
travFE
(
m_map
,
d
);
for
(
Dart
dit
=
travFE
.
begin
();
dit
!=
travFE
.
end
();
dit
=
travFE
.
next
())
{
vf
+=
m_position
[
dit
];
m_map
.
incCurrentLevel
();
ef
+=
m_position
[
m_map
.
phi1
(
dit
)];
m_map
.
decCurrentLevel
();
++
count
;
}
ef
/=
count
;
ef
*=
2.0
;
vf
/=
count
;
m_map
.
incCurrentLevel
()
;
Dart
midF
=
m_map
.
phi1
(
m_map
.
phi1
(
d
));
m_position
[
midF
]
-=
vf
+
ef
;
m_map
.
decCurrentLevel
()
;
}
}
}
};
}
// namespace Filters
...
...
include/Algo/Multiresolution/Map3MR/Filters/lerp.h
View file @
1ff6b8b3
...
...
@@ -28,6 +28,7 @@
#include <cmath>
#include "Algo/Geometry/centroid.h"
#include "Algo/Modelisation/tetrahedralization.h"
#include "Algo/Modelisation/polyhedron.h"
#include "Algo/Multiresolution/filter.h"
namespace
CGoGN
...
...
@@ -51,6 +52,69 @@ namespace Filters
/* Linear Interpolation
*********************************************************************************/
template
<
typename
PFP
>
class
LerpOddSynthesisFilter
:
public
Filter
{
protected:
typename
PFP
::
MAP
&
m_map
;
VertexAttribute
<
typename
PFP
::
VEC3
>&
m_position
;
public:
LerpOddSynthesisFilter
(
typename
PFP
::
MAP
&
m
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
p
)
:
m_map
(
m
),
m_position
(
p
)
{}
void
operator
()
()
{
TraversorE
<
typename
PFP
::
MAP
>
trav
(
m_map
)
;
for
(
Dart
d
=
trav
.
begin
();
d
!=
trav
.
end
();
d
=
trav
.
next
())
{
typename
PFP
::
VEC3
p
=
(
m_position
[
d
]
+
m_position
[
m_map
.
phi2
(
d
)])
*
typename
PFP
::
REAL
(
0.5
);
m_map
.
incCurrentLevel
()
;
Dart
midV
=
m_map
.
phi2
(
d
)
;
m_position
[
midV
]
+=
p
;
m_map
.
decCurrentLevel
()
;
}
TraversorF
<
typename
PFP
::
MAP
>
trav
(
m_map
)
;
for
(
Dart
d
=
trav
.
begin
();
d
!=
trav
.
end
();
d
=
trav
.
next
())
{
typename
PFP
::
VEC3
p
=
Algo
::
Geometry
::
faceCentroid
<
PFP
>
(
m_map
,
d
,
m_position
);
m_map
.
incCurrentLevel
()
;
Dart
midF
=
m_map
.
phi2
(
m_map
.
phi1
(
d
));
m_position
[
midF
]
+=
p
;
m_map
.
decCurrentLevel
()
;
}
TraversorW
<
typename
PFP
::
MAP
>
trav
(
m_map
)
;
for
(
Dart
d
=
trav
.
begin
();
d
!=
trav
.
end
();
d
=
trav
.
next
())
{
if
(
!
Algo
::
Modelisation
::
Tetrahedralization
::
isTetrahedron
<
PFP
>
(
m_map
,
d
)
&&
!
Algo
::
Modelisation
::
isPrism
<
PFP
>
(
m_map
,
d
)
&&
!
Algo
::
Modelisation
::
isPyra
<
PFP
>
(
m_map
,
d
))
{
typename
PFP
::
VEC3
p
=
Algo
::
Geometry
::
volumeCentroid
<
PFP
>
(
m_map
,
d
,
m_position
);
m_map
.
incCurrentLevel
()
;
Dart
midV
=
m_map
.
phi_1
(
m_map
.
phi2
(
m_map
.
phi1
(
d
)));
m_position
[
midV
]
+=
p
;
m_map
.
decCurrentLevel
()
;
}
}
}
};
template
<
typename
PFP
>
class
LerpEdgeSynthesisFilter
:
public
Filter
{
...
...
@@ -156,20 +220,17 @@ public:
TraversorW
<
typename
PFP
::
MAP
>
trav
(
m_map
)
;
for
(
Dart
d
=
trav
.
begin
();
d
!=
trav
.
end
();
d
=
trav
.
next
())
{
typename
PFP
::
VEC3
p
=
Algo
::
Geometry
::
volumeCentroid
<
PFP
>
(
m_map
,
d
,
m_position
);
if
(
!
Algo
::
Modelisation
::
Tetrahedralization
::
isTetrahedron
<
PFP
>
(
m_map
,
d
)
&&
!
Algo
::
Modelisation
::
isPrism
<
PFP
>
(
m_map
,
d
)
&&
!
Algo
::
Modelisation
::
isPyra
<
PFP
>
(
m_map
,
d
))
{
typename
PFP
::
VEC3
p
=
Algo
::
Geometry
::
volumeCentroid
<
PFP
>
(
m_map
,
d
,
m_position
);
m_map
.
incCurrentLevel
()
;
m_map
.
incCurrentLevel
()
;
if
(
!
Algo
::
Modelisation
::
Tetrahedralization
::
isTetrahedron
<
PFP
>
(
m_map
,
d
))
// && is not a pyramide && is not a prisme
{
Dart
midV
=
m_map
.
phi_1
(
m_map
.
phi2
(
m_map
.
phi1
(
d
)));
m_position
[
midV
]
=
p
;
std
::
cout
<<
"midV = "
<<
midV
<<
std
::
endl
;
m_map
.
decCurrentLevel
()
;
}
m_map
.
decCurrentLevel
()
;
}
}
}
;
...
...
@@ -203,6 +264,7 @@ public:
}
}
;
}
// namespace Filters
}
// namespace Primal
...
...
include/Algo/Multiresolution/Map3MR/map3MR_PrimalRegular.hpp
View file @
1ff6b8b3
...
...
@@ -543,15 +543,11 @@ void Map3MR<PFP>::addNewLevel()
if
(
fdeg
==
4
)
{
std
::
cout
<<
"== 4"
<<
std
::
endl
;
if
(
m_map
.
PFP
::
MAP
::
ParentMap
::
vertexDegree
(
ditWV
)
==
3
)
{
isocta
=
false
;
ispyra
=
true
;
std
::
cout
<<
"pyra"
<<
std
::
endl
;
Dart
it
=
ditWV
;
if
((
m_map
.
faceDegree
(
it
)
==
3
)
&&
(
m_map
.
faceDegree
(
m_map
.
phi2
(
it
)))
==
3
)
{
...
...
@@ -572,8 +568,6 @@ void Map3MR<PFP>::addNewLevel()
{
isocta
=
true
;
std
::
cout
<<
"octa"
<<
std
::
endl
;
Dart
old
=
m_map
.
phi2
(
m_map
.
phi1
(
ditWV
));
Dart
dd
=
m_map
.
phi1
(
old
)
;
m_map
.
splitFace
(
old
,
dd
)
;
...
...
@@ -599,8 +593,6 @@ void Map3MR<PFP>::addNewLevel()
}
else
if
(
fdeg
==
5
)
{
std
::
cout
<<
"== 5"
<<
std
::
endl
;
isprism
=
true
;
Dart
it
=
ditWV
;
...
...
@@ -620,7 +612,6 @@ void Map3MR<PFP>::addNewLevel()
}
if
(
fdeg
==
6
)
{
std
::
cout
<<
"== 6"
<<
std
::
endl
;
ishex
=
true
;
Dart
dd
=
m_map
.
phi2
(
m_map
.
phi1
(
ditWV
));;
...
...
@@ -630,7 +621,6 @@ void Map3MR<PFP>::addNewLevel()
Dart
ne
=
m_map
.
phi2
(
m_map
.
phi_1
(
dd
))
;
m_map
.
cutEdge
(
ne
)
;
// cut the new edge to insert the central vertex
centralDart
=
m_map
.
phi1
(
ne
);
//m_map.template setOrbitEmbedding<VERTEX>(centralDart, m_map.template getEmbedding<VERTEX>(centralDart));
dd
=
m_map
.
phi1
(
m_map
.
phi1
(
next
))
;
while
(
dd
!=
ne
)
// turn around the face and insert new edges
...
...
@@ -687,21 +677,17 @@ void Map3MR<PFP>::addNewLevel()
Dart
tmp
=
m_map
.
phi_1
(
m_map
.
phi2
(
m_map
.
phi_1
(
m_map
.
phi2
(
m_map
.
phi_1
(
f3
)))));
//future voisin par phi2
swapEdges
(
f3
,
tmp
);