Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
David Cazier
CGoGN
Commits
21f73349
Commit
21f73349
authored
Jul 12, 2011
by
Pierre Kraemer
Browse files
corrections average + delete averagePositions
parent
73576e31
Changes
4
Hide whitespace changes
Inline
Side-by-side
include/Algo/Filtering/average.h
View file @
21f73349
...
...
@@ -33,26 +33,28 @@ namespace Algo
namespace
Filtering
{
enum
neighborhood
{
INSIDE
=
1
,
BORDER
=
2
};
enum
neighborhood
{
INSIDE
=
1
,
BORDER
=
2
};
template
<
typename
PFP
,
typename
T
>
void
filterAverageAttribute_OneRing
(
typename
PFP
::
MAP
&
map
,
const
typename
AttributeHandler
<
T
>&
attIn
,
typename
AttributeHandler
<
T
>&
attOut
,
neighborhood
neigh
,
const
FunctorSelect
&
select
=
SelectorTrue
())
void
filterAverageAttribute_OneRing
(
typename
PFP
::
MAP
&
map
,
const
AttributeHandler
<
T
>&
attIn
,
AttributeHandler
<
T
>&
attOut
,
neighborhood
neigh
,
const
FunctorSelect
&
select
=
SelectorTrue
())
{
typedef
typename
PFP
::
VEC3
VEC3
;
FunctorAverage
<
typename
PFP
::
VEC3
>
fa
(
attIn
)
;
FunctorAverage
<
VEC3
>
fa
(
attIn
)
;
Algo
::
Selection
::
Collector_OneRing
<
PFP
>
col
(
map
)
;
CellMarker
markV
(
map
,
VERTEX
);
CellMarker
markV
(
map
,
VERTEX
)
;
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
{
if
(
select
(
d
)
&&
!
markV
.
isMarked
(
d
))
{
markV
.
mark
(
d
);
markV
.
mark
(
d
)
;
if
(
neigh
&
INSIDE
)
col
.
collectAll
(
d
)
;
...
...
@@ -60,8 +62,10 @@ void filterAverageAttribute_OneRing(typename PFP::MAP& map,
col
.
collectBorder
(
d
)
;
fa
.
reset
()
;
if
(
neigh
&
INSIDE
){
switch
(
attIn
.
getOrbit
())
{
if
(
neigh
&
INSIDE
)
{
switch
(
attIn
.
getOrbit
())
{
case
VERTEX
:
col
.
applyOnInsideVertices
(
fa
)
;
break
;
...
...
@@ -80,25 +84,26 @@ void filterAverageAttribute_OneRing(typename PFP::MAP& map,
}
template
<
typename
PFP
,
typename
T
>
void
filterAverageEdgesAttribute_WithinSphere
(
typename
PFP
::
MAP
&
map
,
const
typename
AttributeHandler
<
T
>&
attIn
,
typename
AttributeHandler
<
T
>&
attOut
,
neighborhood
neigh
,
typename
PFP
::
TVEC3
&
position
,
typename
PFP
::
REAL
radius
,
const
FunctorSelect
&
select
=
SelectorTrue
())
void
filterAverageEdgesAttribute_WithinSphere
(
typename
PFP
::
MAP
&
map
,
const
AttributeHandler
<
T
>&
attIn
,
AttributeHandler
<
T
>&
attOut
,
neighborhood
neigh
,
typename
PFP
::
TVEC3
&
position
,
typename
PFP
::
REAL
radius
,
const
FunctorSelect
&
select
=
SelectorTrue
())
{
typedef
typename
PFP
::
VEC3
VEC3
;
FunctorAverage
<
typename
PFP
::
VEC3
>
fa
(
attIn
)
;
FunctorAverage
<
VEC3
>
fa
(
attIn
)
;
Algo
::
Selection
::
Collector_WithinSphere
<
PFP
>
col
(
map
,
position
,
radius
)
;
CellMarker
markV
(
map
,
VERTEX
);
CellMarker
markV
(
map
,
VERTEX
)
;
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
{
if
(
select
(
d
)
&&
!
markV
.
isMarked
(
d
))
{
markV
.
mark
(
d
);
markV
.
mark
(
d
)
;
if
(
neigh
&
INSIDE
)
col
.
collectAll
(
d
)
;
...
...
@@ -114,25 +119,26 @@ void filterAverageEdgesAttribute_WithinSphere(typename PFP::MAP& map,
}
template
<
typename
PFP
,
typename
T
>
void
filterAverageFacesAttribute_WithinSphere
(
typename
PFP
::
MAP
&
map
,
const
typename
AttributeHandler
<
T
>&
attIn
,
typename
AttributeHandler
<
T
>&
attOut
,
neighborhood
neigh
,
typename
PFP
::
TVEC3
&
position
,
typename
PFP
::
REAL
radius
,
const
FunctorSelect
&
select
=
SelectorTrue
())
void
filterAverageFacesAttribute_WithinSphere
(
typename
PFP
::
MAP
&
map
,
const
AttributeHandler
<
T
>&
attIn
,
AttributeHandler
<
T
>&
attOut
,
neighborhood
neigh
,
typename
PFP
::
TVEC3
&
position
,
typename
PFP
::
REAL
radius
,
const
FunctorSelect
&
select
=
SelectorTrue
())
{
typedef
typename
PFP
::
VEC3
VEC3
;
FunctorAverage
<
typename
PFP
::
VEC3
>
fa
(
attIn
)
;
FunctorAverage
<
VEC3
>
fa
(
attIn
)
;
Algo
::
Selection
::
Collector_WithinSphere
<
PFP
>
col
(
map
,
position
,
radius
)
;
CellMarker
markV
(
map
,
VERTEX
);
CellMarker
markV
(
map
,
VERTEX
)
;
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
{
if
(
select
(
d
)
&&
!
markV
.
isMarked
(
d
))
{
markV
.
mark
(
d
);
markV
.
mark
(
d
)
;
if
(
neigh
&
INSIDE
)
col
.
collectAll
(
d
)
;
...
...
@@ -148,26 +154,27 @@ void filterAverageFacesAttribute_WithinSphere(typename PFP::MAP& map,
}
template
<
typename
PFP
,
typename
T
>
void
filterAverageVertexAttribute_WithinSphere
(
typename
PFP
::
MAP
&
map
,
const
typename
AttributeHandler
<
T
>&
attIn
,
typename
AttributeHandler
<
T
>&
attOut
,
neighborhood
neigh
,
typename
PFP
::
TVEC3
&
position
,
typename
PFP
::
REAL
radius
,
const
FunctorSelect
&
select
=
SelectorTrue
())
void
filterAverageVertexAttribute_WithinSphere
(
typename
PFP
::
MAP
&
map
,
const
AttributeHandler
<
T
>&
attIn
,
AttributeHandler
<
T
>&
attOut
,
neighborhood
neigh
,
typename
PFP
::
TVEC3
&
position
,
typename
PFP
::
REAL
radius
,
const
FunctorSelect
&
select
=
SelectorTrue
())
{
typedef
typename
PFP
::
VEC3
VEC3
;
FunctorAverage
<
typename
PFP
::
VEC3
>
faInside
(
attIn
)
;
FunctorAverage
<
VEC3
>
faInside
(
attIn
)
;
FunctorAverageOnSphereBorder
<
PFP
,
typename
PFP
::
VEC3
>
faBorder
(
map
,
attIn
,
position
)
;
Algo
::
Selection
::
Collector_WithinSphere
<
PFP
>
col
(
map
,
position
,
radius
)
;
CellMarker
markV
(
map
,
VERTEX
);
CellMarker
markV
(
map
,
VERTEX
)
;
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
{
if
(
select
(
d
)
&&
!
markV
.
isMarked
(
d
))
{
markV
.
mark
(
d
);
markV
.
mark
(
d
)
;
if
(
neigh
&
INSIDE
)
col
.
collectAll
(
d
)
;
...
...
include/Algo/Filtering/average_positions.h
deleted
100644 → 0
View file @
73576e31
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2011, 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.u-strasbg.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#include
"Algo/Filtering/functors.h"
#include
"Algo/Selection/collector.h"
namespace
CGoGN
{
namespace
Algo
{
namespace
Filtering
{
template
<
typename
PFP
>
void
filterAveragePositions
(
typename
PFP
::
MAP
&
map
,
const
typename
PFP
::
TVEC3
&
position
,
typename
PFP
::
TVEC3
&
position2
,
const
FunctorSelect
&
select
=
SelectorTrue
())
{
typedef
typename
PFP
::
VEC3
VEC3
;
FunctorAverage
<
typename
PFP
::
VEC3
>
fa
(
position
)
;
Algo
::
Selection
::
Collector_OneRing
<
PFP
>
c
(
map
)
;
CellMarker
markV
(
map
,
VERTEX
);
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
{
if
(
select
(
d
)
&&
!
markV
.
isMarked
(
d
))
{
markV
.
mark
(
d
);
c
.
collectBorder
(
d
)
;
fa
.
reset
()
;
c
.
applyOnBorder
(
fa
)
;
position2
[
d
]
=
fa
.
getAverage
()
;
}
}
}
}
// namespace Filtering
}
// namespace Algo
}
// namespace CGoGN
include/Algo/Filtering/functors.h
View file @
21f73349
...
...
@@ -26,7 +26,7 @@
#define __FILTERING_FUNCTORS_H__
#include
"Topology/generic/functor.h"
#include
"
Utils
/intersection.h"
#include
"
Algo/Geometry
/intersection.h"
namespace
CGoGN
{
...
...
@@ -38,7 +38,7 @@ namespace Filtering
{
template
<
typename
T
>
class
FunctorAverage
:
public
FunctorType
class
FunctorAverage
:
public
virtual
FunctorType
{
protected:
const
AttributeHandler
<
T
>&
attr
;
...
...
include/Topology/generic/functor.h
View file @
21f73349
...
...
@@ -45,7 +45,7 @@ public:
// Base Class for Functors that need access to the map
/********************************************************/
template
<
typename
MAP
>
class
FunctorMap
:
public
virtual
FunctorType
class
FunctorMap
:
public
virtual
FunctorType
{
protected:
MAP
&
m_map
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment