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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
KennethVanhoey
CGoGN
Commits
a14c6c9e
Commit
a14c6c9e
authored
Oct 05, 2012
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of cgogn:~untereiner/CGoGN
parents
1a767014
e73d3657
Changes
24
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
2276 additions
and
71 deletions
+2276
-71
include/Algo/Decimation/edgeSelector.h
include/Algo/Decimation/edgeSelector.h
+7
-7
include/Algo/Decimation/edgeSelector.hpp
include/Algo/Decimation/edgeSelector.hpp
+4
-6
include/Algo/Decimation/selector.h
include/Algo/Decimation/selector.h
+1
-1
include/Algo/Multiresolution/Map2MR/Filters/lerp.h
include/Algo/Multiresolution/Map2MR/Filters/lerp.h
+127
-0
include/Algo/Multiresolution/Map2MR/Filters/loop.h
include/Algo/Multiresolution/Map2MR/Filters/loop.h
+263
-0
include/Algo/Multiresolution/Map2MR/Masks/catmullClark.h
include/Algo/Multiresolution/Map2MR/Masks/catmullClark.h
+189
-0
include/Algo/Multiresolution/Map2MR/Masks/lerp.h
include/Algo/Multiresolution/Map2MR/Masks/lerp.h
+141
-0
include/Algo/Multiresolution/Map2MR/Masks/loop.h
include/Algo/Multiresolution/Map2MR/Masks/loop.h
+133
-0
include/Algo/Multiresolution/Map2MR/map2MR_PM.h
include/Algo/Multiresolution/Map2MR/map2MR_PM.h
+1
-1
include/Algo/Multiresolution/Map2MR/map2MR_PM.hpp
include/Algo/Multiresolution/Map2MR/map2MR_PM.hpp
+39
-39
include/Algo/Multiresolution/Map2MR/map2MR_PrimalAdapt.h
include/Algo/Multiresolution/Map2MR/map2MR_PrimalAdapt.h
+1
-1
include/Algo/Multiresolution/Map2MR/map2MR_PrimalAdapt.hpp
include/Algo/Multiresolution/Map2MR/map2MR_PrimalAdapt.hpp
+0
-0
include/Algo/Multiresolution/Map2MR/map2MR_PrimalRegular.h
include/Algo/Multiresolution/Map2MR/map2MR_PrimalRegular.h
+6
-6
include/Algo/Multiresolution/Map2MR/map2MR_PrimalRegular.hpp
include/Algo/Multiresolution/Map2MR/map2MR_PrimalRegular.hpp
+0
-0
include/Algo/Multiresolution/Map3MR/Filters/bertram.h
include/Algo/Multiresolution/Map3MR/Filters/bertram.h
+402
-0
include/Algo/Multiresolution/Map3MR/Filters/lerp.h
include/Algo/Multiresolution/Map3MR/Filters/lerp.h
+154
-0
include/Algo/Multiresolution/Map3MR/Filters/loop.h
include/Algo/Multiresolution/Map3MR/Filters/loop.h
+441
-0
include/Algo/Multiresolution/Map3MR/Masks/mcCrackenJoy.h
include/Algo/Multiresolution/Map3MR/Masks/mcCrackenJoy.h
+349
-0
include/Algo/Multiresolution/Map3MR/map3MR_PrimalAdapt.h
include/Algo/Multiresolution/Map3MR/map3MR_PrimalAdapt.h
+1
-1
include/Algo/Multiresolution/Map3MR/map3MR_PrimalAdapt.hpp
include/Algo/Multiresolution/Map3MR/map3MR_PrimalAdapt.hpp
+0
-0
include/Algo/Multiresolution/Map3MR/map3MR_PrimalRegular.h
include/Algo/Multiresolution/Map3MR/map3MR_PrimalRegular.h
+2
-2
include/Algo/Multiresolution/Map3MR/map3MR_PrimalRegular.hpp
include/Algo/Multiresolution/Map3MR/map3MR_PrimalRegular.hpp
+0
-0
include/Topology/generic/genericmap.hpp
include/Topology/generic/genericmap.hpp
+13
-5
src/Topology/map/map2.cpp
src/Topology/map/map2.cpp
+2
-2
No files found.
include/Algo/Decimation/edgeSelector.h
View file @
a14c6c9e
...
...
@@ -66,7 +66,7 @@ public:
{}
void
updateAfterCollapse
(
Dart
d2
,
Dart
dd2
)
;
bool
nextEdgeWithoutUpdates
(
Dart
&
d
)
{
}
void
updateWithoutCollapse
(
)
{
}
}
;
template
<
typename
PFP
>
...
...
@@ -97,7 +97,7 @@ public:
{}
void
updateAfterCollapse
(
Dart
d2
,
Dart
dd2
)
;
bool
nextEdgeWithoutUpdates
(
Dart
&
d
)
{
}
void
updateWithoutCollapse
(
)
{
}
}
;
template
<
typename
PFP
>
...
...
@@ -142,7 +142,7 @@ public:
void
updateBeforeCollapse
(
Dart
d
)
;
void
updateAfterCollapse
(
Dart
d2
,
Dart
dd2
)
;
bool
nextEdgeWithoutUpdates
(
Dart
&
d
)
{
}
void
updateWithoutCollapse
(
)
{
}
}
;
template
<
typename
PFP
>
...
...
@@ -194,7 +194,7 @@ public:
void
updateBeforeCollapse
(
Dart
d
)
;
void
updateAfterCollapse
(
Dart
d2
,
Dart
dd2
)
;
bool
nextEdgeWithoutUpdates
(
Dart
&
d
);
void
updateWithoutCollapse
(
);
}
;
template
<
typename
PFP
>
...
...
@@ -246,7 +246,7 @@ public:
void
updateBeforeCollapse
(
Dart
d
)
;
void
updateAfterCollapse
(
Dart
d2
,
Dart
dd2
)
;
bool
nextEdgeWithoutUpdates
(
Dart
&
d
)
{
}
void
updateWithoutCollapse
(
)
{
}
}
;
template
<
typename
PFP
>
...
...
@@ -344,7 +344,7 @@ public:
void
updateBeforeCollapse
(
Dart
d
)
;
void
updateAfterCollapse
(
Dart
d2
,
Dart
dd2
)
;
bool
nextEdgeWithoutUpdates
(
Dart
&
d
)
{
}
void
updateWithoutCollapse
(
)
{
}
}
;
template
<
typename
PFP
>
...
...
@@ -392,7 +392,7 @@ public:
void
updateBeforeCollapse
(
Dart
d
)
;
void
updateAfterCollapse
(
Dart
d2
,
Dart
dd2
)
;
bool
nextEdgeWithoutUpdates
(
Dart
&
d
)
{
}
void
updateWithoutCollapse
(
)
{
}
}
;
/*****************************************************************************************************************
...
...
include/Algo/Decimation/edgeSelector.hpp
View file @
a14c6c9e
...
...
@@ -480,19 +480,17 @@ void EdgeSelector_QEM<PFP>::computeEdgeInfo(Dart d, EdgeInfo& einfo)
}
template <typename PFP>
bool
EdgeSelector_QEM
<
PFP
>::
nextEdgeWithoutUpdates
(
Dart
&
d
)
void EdgeSelector_QEM<PFP>::updateWithoutCollapse(
)
{
if
(
cur
==
edges
.
end
()
||
edges
.
empty
())
return
false
;
EdgeInfo& einfo = edgeInfo[(*cur).second] ;
einfo.valid = false ;
edges.erase(einfo.it) ;
//edges.erase(cur) ;
cur = edges.begin();
d
=
(
*
cur
).
second
;
return
true
;
}
/************************************************************************************
* QUADRIC ERROR METRIC (Memoryless version) *
************************************************************************************/
...
...
include/Algo/Decimation/selector.h
View file @
a14c6c9e
...
...
@@ -79,7 +79,7 @@ public:
virtual
void
updateBeforeCollapse
(
Dart
d
)
=
0
;
virtual
void
updateAfterCollapse
(
Dart
d2
,
Dart
dd2
)
=
0
;
virtual
bool
nextEdgeWithoutUpdates
(
Dart
&
d
)
=
0
;
virtual
void
updateWithoutCollapse
(
)
=
0
;
}
;
}
// namespace Decimation
...
...
include/Algo/Multiresolution/Map2MR/Filters/lerp.h
0 → 100644
View file @
a14c6c9e
/*******************************************************************************
* 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 __MR_LERP_FILTER__
#define __MR_LERP_FILTER__
#include <cmath>
#include "Algo/Multiresolution/filter.h"
namespace
CGoGN
{
namespace
Algo
{
namespace
MR
{
namespace
Primal
{
namespace
Filters
{
/*********************************************************************************
* ANALYSIS FILTERS
*********************************************************************************/
/*********************************************************************************
* SYNTHESIS FILTERS
*********************************************************************************/
template
<
typename
PFP
>
class
LerpEdgeSynthesisFilter
:
public
Filter
{
protected:
typename
PFP
::
MAP
&
m_map
;
VertexAttribute
<
typename
PFP
::
VEC3
>&
m_position
;
public:
LerpEdgeSynthesisFilter
(
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
.
phi1
(
d
)])
*
typename
PFP
::
REAL
(
0.5
);
m_map
.
incCurrentLevel
()
;
Dart
midV
=
m_map
.
phi1
(
d
)
;
m_position
[
midV
]
=
p
;
m_map
.
decCurrentLevel
()
;
}
}
}
;
template
<
typename
PFP
>
class
LerpFaceSynthesisFilter
:
public
Filter
{
protected:
typename
PFP
::
MAP
&
m_map
;
VertexAttribute
<
typename
PFP
::
VEC3
>&
m_position
;
public:
LerpFaceSynthesisFilter
(
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
())
{
typename
PFP
::
VEC3
p
=
Algo
::
Geometry
::
faceCentroid
<
PFP
>
(
m_map
,
d
,
m_position
);
m_map
.
incCurrentLevel
()
;
if
(
m_map
.
faceDegree
(
d
)
!=
3
)
{
Dart
midF
=
m_map
.
phi1
(
m_map
.
phi1
(
d
));
m_position
[
midF
]
=
p
;
}
m_map
.
decCurrentLevel
()
;
}
}
}
;
}
// namespace Filters
}
// namespace Primal
}
// namespace MR
}
// namespace Algo
}
// namespace CGoGN
#endif
include/Algo/Multiresolution/
map2MR/filters_Primal
.h
→
include/Algo/Multiresolution/
Map2MR/Filters/loop
.h
View file @
a14c6c9e
...
...
@@ -22,11 +22,11 @@
* *
*******************************************************************************/
#ifndef __MR_
FILTERS_PRIMAL
__
#define __MR_
FILTERS_PRIMAL
__
#ifndef __MR_
LOOP_FILTER
__
#define __MR_
LOOP_FILTER
__
#include <cmath>
//#include "Algo/Decimation/decimation
.h"
#include "Algo/Multiresolution/filter
.h"
namespace
CGoGN
{
...
...
@@ -37,13 +37,12 @@ namespace Algo
namespace
MR
{
class
Filter
namespace
Primal
{
namespace
Filters
{
public:
Filter
()
{}
virtual
~
Filter
()
{}
virtual
void
operator
()
()
=
0
;
}
;
/*********************************************************************************
* LOOP BASIC FUNCTIONS
...
...
@@ -250,403 +249,9 @@ public:
}
}
;
/*********************************************************************************
* SYNTHESIS FILTERS
*********************************************************************************/
/* Linear Interpolation
*********************************************************************************/
template
<
typename
PFP
>
class
LerpEdgeSynthesisFilter
:
public
Filter
{
protected:
typename
PFP
::
MAP
&
m_map
;
VertexAttribute
<
typename
PFP
::
VEC3
>&
m_position
;
public:
LerpEdgeSynthesisFilter
(
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
.
phi1
(
d
)])
*
typename
PFP
::
REAL
(
0.5
);
m_map
.
incCurrentLevel
()
;
Dart
midV
=
m_map
.
phi1
(
d
)
;
m_position
[
midV
]
=
p
;
m_map
.
decCurrentLevel
()
;
}
}
}
;
template
<
typename
PFP
>
class
LerpFaceSynthesisFilter
:
public
Filter
{
protected:
typename
PFP
::
MAP
&
m_map
;
VertexAttribute
<
typename
PFP
::
VEC3
>&
m_position
;
public:
LerpFaceSynthesisFilter
(
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
())
{
typename
PFP
::
VEC3
p
=
Algo
::
Geometry
::
faceCentroid
<
PFP
>
(
m_map
,
d
,
m_position
);
m_map
.
incCurrentLevel
()
;
if
(
m_map
.
faceDegree
(
d
)
!=
3
)
{
Dart
midF
=
m_map
.
phi1
(
m_map
.
phi1
(
d
));
m_position
[
midF
]
=
p
;
}
m_map
.
decCurrentLevel
()
;
}
}
}
;
/* SQRT(3)
*********************************************************************************/
template
<
typename
PFP
>
class
Sqrt3OddSynthesisFilter
:
public
Filter
{
protected:
typename
PFP
::
MAP
&
m_map
;
VertexAttribute
<
typename
PFP
::
VEC3
>&
m_position
;
public:
Sqrt3OddSynthesisFilter
(
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
())
{
typename
PFP
::
VEC3
p
(
0.0
);
p
+=
m_position
[
d
];
p
+=
m_position
[
m_map
.
phi1
(
d
)];
p
+=
m_position
[
m_map
.
phi_1
(
d
)];
p
/=
3.0
;
m_map
.
incCurrentLevel
()
;
Dart
midF
=
m_map
.
phi1
(
d
);
m_position
[
midF
]
=
p
;
m_map
.
decCurrentLevel
()
;
}
}
};
/*********************************************************************************
* SUBDIVISION FUNCTORS
*********************************************************************************/
template
<
typename
PFP
>
class
PipoVertexVertexFunctor
:
public
FunctorType
{
protected:
typename
PFP
::
MAP
&
m_map
;
VertexAttribute
<
typename
PFP
::
VEC3
>&
m_position
;
public:
PipoVertexVertexFunctor
(
typename
PFP
::
MAP
&
m
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
p
)
:
m_map
(
m
),
m_position
(
p
)
{}
bool
operator
()
(
Dart
d
)
{
m_map
.
decCurrentLevel
()
;
typename
PFP
::
VEC3
p
=
m_position
[
d
]
;
m_map
.
incCurrentLevel
()
;
m_position
[
d
]
=
p
;
return
false
;
}
}
;
template
<
typename
PFP
>
class
PipoEdgeVertexFunctor
:
public
FunctorType
{
protected:
typename
PFP
::
MAP
&
m_map
;
VertexAttribute
<
typename
PFP
::
VEC3
>&
m_position
;
public:
PipoEdgeVertexFunctor
(
typename
PFP
::
MAP
&
m
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
p
)
:
m_map
(
m
),
m_position
(
p
)
{}
bool
operator
()
(
Dart
d
)
{
Dart
d1
=
m_map
.
phi2
(
d
)
;
m_map
.
decCurrentLevel
()
;
Dart
d2
=
m_map
.
phi2
(
d1
)
;
typename
PFP
::
VEC3
p
=
(
m_position
[
d1
]
+
m_position
[
d2
])
/
2.0
;
m_map
.
incCurrentLevel
()
;
m_position
[
d
]
=
p
;
return
false
;
}
}
;
template
<
typename
PFP
>
class
PipoFaceVertexFunctor
:
public
FunctorType
{
protected:
typename
PFP
::
MAP
&
m_map
;
VertexAttribute
<
typename
PFP
::
VEC3
>&
m_position
;
public:
PipoFaceVertexFunctor
(
typename
PFP
::
MAP
&
m
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
p
)
:
m_map
(
m
),
m_position
(
p
)
{}
bool
operator
()
(
Dart
d
)
{
Dart
df
=
m_map
.
phi1
(
m_map
.
phi1
(
d
))
;
m_map
.
decCurrentLevel
()
;
typename
PFP
::
VEC3
p
(
0
)
;
unsigned
int
degree
=
0
;
Traversor2FV
<
typename
PFP
::
MAP
>
trav
(
m_map
,
df
)
;
for
(
Dart
it
=
trav
.
begin
();
it
!=
trav
.
end
();
it
=
trav
.
next
())
{
++
degree
;
p
+=
m_position
[
it
]
;
}
p
/=
degree
;
m_map
.
incCurrentLevel
()
;
m_position
[
d
]
=
p
;
return
false
;
}
}
;
template
<
typename
PFP
>
class
LoopVertexVertexFunctor
:
public
FunctorType
{
protected:
typename
PFP
::
MAP
&
m_map
;
VertexAttribute
<
typename
PFP
::
VEC3
>&
m_position
;
public:
LoopVertexVertexFunctor
(
typename
PFP
::
MAP
&
m
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
p
)
:
m_map
(
m
),
m_position
(
p
)
{}
bool
operator
()
(
Dart
d
)
{
m_map
.
decCurrentLevel
()
;
typename
PFP
::
VEC3
np
(
0
)
;
unsigned
int
degree
=
0
;
Traversor2VVaE
<
typename
PFP
::
MAP
>
trav
(
m_map
,
d
)
;
for
(
Dart
it
=
trav
.
begin
();
it
!=
trav
.
end
();
it
=
trav
.
next
())
{
++
degree
;
np
+=
m_position
[
it
]
;
}
float
tmp
=
3.0
+
2.0
*
cos
(
2.0
*
M_PI
/
degree
)
;
float
beta
=
(
5.0
/
8.0
)
-
(
tmp
*
tmp
/
64.0
)
;
np
*=
beta
/
degree
;
typename
PFP
::
VEC3
vp
=
m_position
[
d
]
;
vp
*=
1.0
-
beta
;
m_map
.
incCurrentLevel
()
;
m_position
[
d
]
=
np
+
vp
;
return
false
;
}
}
;
template
<
typename
PFP
>
class
LoopEdgeVertexFunctor
:
public
FunctorType
{
protected:
typename
PFP
::
MAP
&
m_map
;
VertexAttribute
<
typename
PFP
::
VEC3
>&
m_position
;
public:
LoopEdgeVertexFunctor
(
typename
PFP
::
MAP
&
m
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
p
)
:
m_map
(
m
),
m_position
(
p
)
{}
bool
operator
()
(
Dart
d
)
{
Dart
d1
=
m_map
.
phi2
(
d
)
;
m_map
.
decCurrentLevel
()
;
Dart
d2
=
m_map
.
phi2
(
d1
)
;
Dart
d3
=
m_map
.
phi_1
(
d1
)
;
Dart
d4
=
m_map
.
phi_1
(
d2
)
;
typename
PFP
::
VEC3
p1
=
m_position
[
d1
]
;
typename
PFP
::
VEC3
p2
=
m_position
[
d2
]
;
typename
PFP
::
VEC3
p3
=
m_position
[
d3
]
;
typename
PFP
::
VEC3
p4
=
m_position
[
d4
]
;
p1
*=
3.0
/
8.0
;
p2
*=
3.0
/
8.0
;
p3
*=
1.0
/
8.0
;
p4
*=
1.0
/
8.0
;
m_map
.
incCurrentLevel
()
;
m_position
[
d
]
=
p1
+
p2
+
p3
+
p4
;
return
false
;
}
}
;
template
<
typename
PFP
>
class
CCVertexVertexFunctor
:
public
FunctorType
{
protected:
typename
PFP
::
MAP
&
m_map
;
VertexAttribute
<
typename
PFP
::
VEC3
>&
m_position
;
public:
CCVertexVertexFunctor
(
typename
PFP
::
MAP
&
m
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
p
)
:
m_map
(
m
),
m_position
(
p
)
{}
bool
operator
()
(
Dart
d
)
{
m_map
.
decCurrentLevel
()
;
typename
PFP
::
VEC3
np1
(
0
)
;
typename
PFP
::
VEC3
np2
(
0
)
;
unsigned
int
degree1
=
0
;
unsigned
int
degree2
=
0
;
Dart
it
=
d
;
do
{
++
degree1
;
Dart
dd
=
m_map
.
phi1
(
it
)
;
np1
+=
m_position
[
dd
]
;
Dart
end
=
m_map
.
phi_1
(
it
)
;
dd
=
m_map
.
phi1
(
dd
)
;
do
{
++
degree2
;
np2
+=
m_position
[
dd
]
;
dd
=
m_map
.
phi1
(
dd
)
;
}
while
(
dd
!=
end
)
;
it
=
m_map
.
alpha1
(
it
)
;
}
while
(
it
!=
d
)
;
float
beta
=
3.0
/
(
2.0
*
degree1
)
;
float
gamma
=
1.0
/
(
4.0
*
degree2
)
;
np1
*=
beta
/
degree1
;
np2
*=
gamma
/
degree2
;
typename
PFP
::
VEC3
vp
=
m_position
[
d
]
;
vp
*=
1.0
-
beta
-
gamma
;
m_map
.
incCurrentLevel
()
;
m_position
[
d
]
=
np1
+
np2
+
vp
;
return
false
;
}
}
;
template
<
typename
PFP
>
class
CCEdgeVertexFunctor
:
public
FunctorType
{
protected:
typename
PFP
::
MAP
&
m_map
;
VertexAttribute
<
typename
PFP
::
VEC3
>&
m_position
;
public:
CCEdgeVertexFunctor
(
typename
PFP
::
MAP
&
m
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
p
)
:
m_map
(
m
),
m_position
(
p
)
{}
bool
operator
()
(
Dart
d
)
{
Dart
d1
=
m_map
.
phi2
(
d
)
;
m_map
.
decCurrentLevel
()
;
Dart
d2
=
m_map
.
phi2
(
d1
)
;
Dart
d3
=
m_map
.
phi_1
(
d1
)
;
Dart
d4
=
m_map
.
phi_1
(
d2
)
;
Dart
d5
=
m_map
.
phi1
(
m_map
.
phi1
(
d1
))
;
Dart
d6
=
m_map
.
phi1
(
m_map
.
phi1
(
d2
))
;
typename
PFP
::
VEC3
p1
=
m_position
[
d1
]
;
typename
PFP
::
VEC3
p2
=
m_position
[
d2
]
;
typename
PFP
::
VEC3
p3
=
m_position
[
d3
]
;
typename
PFP
::
VEC3
p4
=
m_position
[
d4
]
;
typename
PFP
::
VEC3
p5
=
m_position
[
d5
]
;
typename
PFP
::
VEC3
p6
=
m_position
[
d6
]
;
p1
*=
3.0
/
8.0
;
p2
*=
3.0
/
8.0
;
p3
*=
1.0
/
16.0
;
p4
*=
1.0
/
16.0
;
p5
*=
1.0
/
16.0
;
p6
*=
1.0
/
16.0
;