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
50a9f367
Commit
50a9f367
authored
Apr 12, 2012
by
untereiner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
starting working on MR Progressive Meshes
parent
00a75e94
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
620 additions
and
52 deletions
+620
-52
include/Algo/Import/import2tablesSurface.hpp
include/Algo/Import/import2tablesSurface.hpp
+1
-2
include/Algo/Import/importMesh.hpp
include/Algo/Import/importMesh.hpp
+2
-2
include/Topology/generic/traversor3.h
include/Topology/generic/traversor3.h
+3
-3
include/Topology/map/map2MR/map2MR_PM.h
include/Topology/map/map2MR/map2MR_PM.h
+79
-0
include/Topology/map/map3MR/schemes_Primal.h
include/Topology/map/map3MR/schemes_Primal.h
+407
-45
src/Topology/map/map2MR/map2MR_PM.cpp
src/Topology/map/map2MR/map2MR_PM.cpp
+128
-0
No files found.
include/Algo/Import/import2tablesSurface.hpp
View file @
50a9f367
...
@@ -120,7 +120,6 @@ bool MeshTablesSurface<PFP>::importMesh(const std::string& filename, std::vector
...
@@ -120,7 +120,6 @@ bool MeshTablesSurface<PFP>::importMesh(const std::string& filename, std::vector
CGoGNout << "TYPE: PLYSLFgenericBin" << CGoGNendl;
CGoGNout << "TYPE: PLYSLFgenericBin" << CGoGNendl;
return importPlySLFgenericBin(filename, attrNames);
return importPlySLFgenericBin(filename, attrNames);
break;
break;
case ImportSurfacique::OBJ:
case ImportSurfacique::OBJ:
CGoGNout << "TYPE: OBJ" << CGoGNendl;
CGoGNout << "TYPE: OBJ" << CGoGNendl;
return importObj(filename, attrNames);
return importObj(filename, attrNames);
...
@@ -591,7 +590,7 @@ bool MeshTablesSurface<PFP>::importPly(const std::string& filename, std::vector<
...
@@ -591,7 +590,7 @@ bool MeshTablesSurface<PFP>::importPly(const std::string& filename, std::vector<
CGoGNerr << "Unable to open file " << filename << CGoGNendl;
CGoGNerr << "Unable to open file " << filename << CGoGNendl;
return false;
return false;
}
}
AttributeHandler<typename PFP::VEC3> colors = m_map.template getAttribute<typename PFP::VEC3>(VERTEX, "color") ;
AttributeHandler<typename PFP::VEC3> colors = m_map.template getAttribute<typename PFP::VEC3>(VERTEX, "color") ;
if (pid.hasColors())
if (pid.hasColors())
{
{
...
...
include/Algo/Import/importMesh.hpp
View file @
50a9f367
...
@@ -268,8 +268,8 @@ bool importMeshV(typename PFP::MAP& map, const std::string& filename, std::vecto
...
@@ -268,8 +268,8 @@ bool importMeshV(typename PFP::MAP& map, const std::string& filename, std::vecto
if
((
filename
.
rfind
(
".tet"
)
!=
std
::
string
::
npos
)
||
(
filename
.
rfind
(
".TET"
)
!=
std
::
string
::
npos
))
if
((
filename
.
rfind
(
".tet"
)
!=
std
::
string
::
npos
)
||
(
filename
.
rfind
(
".TET"
)
!=
std
::
string
::
npos
))
kind
=
ImportVolumique
::
TET
;
kind
=
ImportVolumique
::
TET
;
if
((
filename
.
rfind
(
".
ele"
)
!=
std
::
string
::
npos
)
||
(
filename
.
rfind
(
".ELE
"
)
!=
std
::
string
::
npos
))
if
((
filename
.
rfind
(
".
off"
)
!=
std
::
string
::
npos
)
||
(
filename
.
rfind
(
".OFF
"
)
!=
std
::
string
::
npos
))
kind
=
ImportVolumique
::
ELE
;
kind
=
ImportVolumique
::
OFF
;
if
((
filename
.
rfind
(
".ts"
)
!=
std
::
string
::
npos
)
||
(
filename
.
rfind
(
".TS"
)
!=
std
::
string
::
npos
))
if
((
filename
.
rfind
(
".ts"
)
!=
std
::
string
::
npos
)
||
(
filename
.
rfind
(
".TS"
)
!=
std
::
string
::
npos
))
kind
=
ImportVolumique
::
TS
;
kind
=
ImportVolumique
::
TS
;
...
...
include/Topology/generic/traversor3.h
View file @
50a9f367
...
@@ -323,7 +323,7 @@ public:
...
@@ -323,7 +323,7 @@ public:
/**
/**
* Traverse volumes adjacent to a volume
e
by a vertex
* Traverse volumes adjacent to a volume by a vertex
*/
*/
template
<
typename
MAP
>
template
<
typename
MAP
>
class
Traversor3WWaV
:
public
Traversor3XXaY
<
MAP
>
class
Traversor3WWaV
:
public
Traversor3XXaY
<
MAP
>
...
@@ -333,7 +333,7 @@ public:
...
@@ -333,7 +333,7 @@ public:
};
};
/**
/**
* Traverse volumes adjacent to a volume
e
by an edge
* Traverse volumes adjacent to a volume by an edge
*/
*/
template
<
typename
MAP
>
template
<
typename
MAP
>
class
Traversor3WWaE
:
public
Traversor3XXaY
<
MAP
>
class
Traversor3WWaE
:
public
Traversor3XXaY
<
MAP
>
...
@@ -343,7 +343,7 @@ public:
...
@@ -343,7 +343,7 @@ public:
};
};
/**
/**
* Traverse volumes adjacent to a volume
e
by a face
* Traverse volumes adjacent to a volume by a face
*/
*/
template
<
typename
MAP
>
template
<
typename
MAP
>
class
Traversor3WWaF
:
public
Traversor3XXaY
<
MAP
>
class
Traversor3WWaF
:
public
Traversor3XXaY
<
MAP
>
...
...
include/Topology/map/map2MR/map2MR_PM.h
0 → 100644
View file @
50a9f367
/*******************************************************************************
* 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 __MAP2MR_PM__
#define __MAP2MR_PM__
#include "Topology/map/embeddedMap2.h"
#include "Topology/generic/traversorCell.h"
#include "Topology/generic/traversor2.h"
#include "Topology/map/map2MR/filters_Primal.h"
#include "Algo/Modelisation/subdivision.h"
namespace
CGoGN
{
class
SelectorCollapsingEdges
:
public
FunctorSelect
{
protected:
const
DartMarker
&
m_dm
;
public:
SelectorCollapsingEdges
(
const
DartMarker
&
dm
)
:
m_dm
(
dm
)
{}
bool
operator
()(
Dart
d
)
const
{
return
m_dm
.
isMarked
(
d
);
}
FunctorSelect
*
copy
()
const
{
return
new
SelectorCollapsingEdges
(
m_dm
);}
};
class
Map2MR_PM
:
public
EmbeddedMap2
{
protected:
bool
shareVertexEmbeddings
;
std
::
vector
<
Multiresolution
::
MRFilter
*>
synthesisFilters
;
std
::
vector
<
Multiresolution
::
MRFilter
*>
analysisFilters
;
DartMarkerStore
*
selectedEdges
;
public:
Map2MR_PM
()
;
virtual
std
::
string
mapTypeName
()
const
{
return
"Map2MR_PM"
;
}
void
addNewLevel
(
bool
embedNewVertices
=
true
)
;
void
addSynthesisFilter
(
Multiresolution
::
MRFilter
*
f
)
{
synthesisFilters
.
push_back
(
f
)
;
}
void
addAnalysisFilter
(
Multiresolution
::
MRFilter
*
f
)
{
analysisFilters
.
push_back
(
f
)
;
}
void
clearSynthesisFilters
()
{
synthesisFilters
.
clear
()
;
}
void
clearAnalysisFilters
()
{
analysisFilters
.
clear
()
;
}
void
analysis
()
;
void
synthesis
()
;
}
;
}
;
}
// namespace CGoGN
#endif
include/Topology/map/map3MR/schemes_Primal.h
View file @
50a9f367
...
@@ -609,137 +609,499 @@ public:
...
@@ -609,137 +609,499 @@ public:
}
}
};
};
/*
BSXW02 on Boundary Vertices and on Insides Vertices
/*
Lerp on Boundary Vertices and on Insides Vertices and BSXW02 Averaging
*********************************************************************************/
*********************************************************************************/
template
<
typename
PFP
>
template
<
typename
PFP
>
class
BSXW02
Vertex
Subdivision
:
public
MRScheme
class
BSXW02
Averaging
Subdivision
:
public
MRScheme
{
{
protected:
protected:
typename
PFP
::
MAP
&
m_map
;
typename
PFP
::
MAP
&
m_map
;
typename
PFP
::
TVEC3
&
m_position
;
typename
PFP
::
TVEC3
&
m_position
;
public:
public:
BSXW02
Vertex
Subdivision
(
typename
PFP
::
MAP
&
m
,
typename
PFP
::
TVEC3
&
p
)
:
m_map
(
m
),
m_position
(
p
)
BSXW02
Averaging
Subdivision
(
typename
PFP
::
MAP
&
m
,
typename
PFP
::
TVEC3
&
p
)
:
m_map
(
m
),
m_position
(
p
)
{}
{}
void
operator
()
()
void
operator
()
()
{
{
TraversorW
<
typename
PFP
::
MAP
>
trav
(
m_map
)
;
m_map
.
incCurrentLevel
()
;
for
(
Dart
d
=
trav
.
begin
();
d
!=
trav
.
end
();
d
=
trav
.
next
())
TraversorV
<
typename
PFP
::
MAP
>
trav
(
m_map
)
;
for
(
Dart
ditE
=
trav
.
begin
();
ditE
!=
trav
.
end
();
ditE
=
trav
.
next
())
{
{
//cell points : these points are the average of the
if
(
m_map
.
isBoundaryVertex
(
ditE
))
//vertices of the lattice that bound the cell
{
typename
PFP
::
VEC3
p
=
Algo
::
Geometry
::
volumeCentroid
<
PFP
>
(
m_map
,
d
,
m_position
);
Dart
db
=
m_map
.
findBoundaryFaceOfVertex
(
ditE
);
m_map
.
incCurrentLevel
()
;
typename
PFP
::
VEC3
P
(
0
);
unsigned
int
count
=
0
;
Traversor2VF
<
typename
PFP
::
MAP
>
travVF
(
m_map
,
db
);
for
(
Dart
ditVF
=
travVF
.
begin
();
ditVF
!=
travVF
.
end
();
ditVF
=
travVF
.
next
())
{
P
+=
Algo
::
Geometry
::
faceCentroid
<
PFP
>
(
m_map
,
ditVF
,
m_position
);
++
count
;
}
if
(
!
m_map
.
isTetrahedron
(
d
))
P
/=
count
;
m_position
[
db
]
=
P
;
}
else
if
(
m_map
.
isBoundaryEdge
(
ditE
))
{
{
Dart
midV
=
m_map
.
phi_1
(
m_map
.
phi2
(
m_map
.
phi1
(
d
)));
Dart
db
=
m_map
.
findBoundaryEdgeOfVertex
(
ditE
);
m_position
[
midV
]
=
p
;
typename
PFP
::
VEC3
P
(
0
);
unsigned
int
count
=
0
;
Traversor2VF
<
typename
PFP
::
MAP
>
travVF
(
m_map
,
db
);
for
(
Dart
ditVF
=
travVF
.
begin
();
ditVF
!=
travVF
.
end
();
ditVF
=
travVF
.
next
())
{
P
+=
Algo
::
Geometry
::
faceCentroid
<
PFP
>
(
m_map
,
ditVF
,
m_position
);
++
count
;
}
P
/=
count
;
m_position
[
db
]
=
P
;
}
}
else
{
typename
PFP
::
VEC3
P
(
0
);
unsigned
int
count
=
0
;
Traversor3VW
<
typename
PFP
::
MAP
>
travVF
(
m_map
,
ditE
);
for
(
Dart
ditVF
=
travVF
.
begin
();
ditVF
!=
travVF
.
end
();
ditVF
=
travVF
.
next
())
{
P
+=
Algo
::
Geometry
::
volumeCentroid
<
PFP
>
(
m_map
,
ditVF
,
m_position
);
++
count
;
}
m_map
.
decCurrentLevel
()
;
P
/=
count
;
m_position
[
ditE
]
=
P
;
}
}
}
m_map
.
decCurrentLevel
()
;
}
}
};
};
template
<
typename
PFP
>
template
<
typename
PFP
>
class
BSXW02EdgeSubdivision
:
public
MRScheme
class
BSXW02Edge
Averaging
Subdivision
:
public
MRScheme
{
{
protected:
protected:
typename
PFP
::
MAP
&
m_map
;
typename
PFP
::
MAP
&
m_map
;
typename
PFP
::
TVEC3
&
m_position
;
typename
PFP
::
TVEC3
&
m_position
;
public:
public:
BSXW02EdgeSubdivision
(
typename
PFP
::
MAP
&
m
,
typename
PFP
::
TVEC3
&
p
)
:
m_map
(
m
),
m_position
(
p
)
BSXW02Edge
Averaging
Subdivision
(
typename
PFP
::
MAP
&
m
,
typename
PFP
::
TVEC3
&
p
)
:
m_map
(
m
),
m_position
(
p
)
{}
{}
void
operator
()
()
void
operator
()
()
{
{
Traversor
W
<
typename
PFP
::
MAP
>
trav
(
m_map
)
;
Traversor
E
<
typename
PFP
::
MAP
>
trav
(
m_map
)
;
for
(
Dart
d
=
trav
.
begin
();
d
!=
trav
.
end
();
d
=
trav
.
next
())
for
(
Dart
d
itE
=
trav
.
begin
();
ditE
!=
trav
.
end
();
ditE
=
trav
.
next
())
{
{
//cell points : these points are the average of the
if
(
m_map
.
isBoundaryEdge
(
ditE
))
//vertices of the lattice that bound the cell
{
typename
PFP
::
VEC3
p
=
Algo
::
Geometry
::
volumeCentroid
<
PFP
>
(
m_map
,
d
,
m_position
);
Dart
db
=
m_map
.
findBoundaryFaceOfEdge
(
ditE
);
m_map
.
incCurrentLevel
()
;
m_map
.
incCurrentLevel
()
;
if
(
!
m_map
.
isTetrahedron
(
d
))
db
=
m_map
.
phi1
(
db
);
typename
PFP
::
VEC3
P
(
0
);
unsigned
int
count
=
0
;
Traversor2VF
<
typename
PFP
::
MAP
>
travVF
(
m_map
,
db
);
for
(
Dart
ditVF
=
travVF
.
begin
();
ditVF
!=
travVF
.
end
();
ditVF
=
travVF
.
next
())
{
P
+=
Algo
::
Geometry
::
faceCentroid
<
PFP
>
(
m_map
,
ditVF
,
m_position
);
++
count
;
}
P
/=
count
;
m_position
[
db
]
=
P
;
m_map
.
decCurrentLevel
()
;
}
}
}
};
template
<
typename
PFP
>
class
BSXW02FaceAveragingSubdivision
:
public
MRScheme
{
protected:
typename
PFP
::
MAP
&
m_map
;
typename
PFP
::
TVEC3
&
m_position
;
public:
BSXW02FaceAveragingSubdivision
(
typename
PFP
::
MAP
&
m
,
typename
PFP
::
TVEC3
&
p
)
:
m_map
(
m
),
m_position
(
p
)
{}
void
operator
()
()
{
TraversorF
<
typename
PFP
::
MAP
>
trav
(
m_map
)
;
for
(
Dart
ditE
=
trav
.
begin
();
ditE
!=
trav
.
end
();
ditE
=
trav
.
next
())
{
if
(
m_map
.
isBoundaryFace
(
ditE
))
{
{
Dart
midV
=
m_map
.
phi_1
(
m_map
.
phi2
(
m_map
.
phi1
(
d
)));
Dart
db
=
m_map
.
phi3
(
ditE
);
m_position
[
midV
]
=
p
;
m_map
.
incCurrentLevel
()
;
if
(
m_map
.
faceDegree
(
db
)
!=
3
)
{
db
=
m_map
.
phi2
(
m_map
.
phi1
(
db
));
typename
PFP
::
VEC3
P
(
0
);
unsigned
int
count
=
0
;
Traversor2VF
<
typename
PFP
::
MAP
>
travVF
(
m_map
,
db
);
for
(
Dart
ditVF
=
travVF
.
begin
();
ditVF
!=
travVF
.
end
();
ditVF
=
travVF
.
next
())
{
P
+=
Algo
::
Geometry
::
faceCentroid
<
PFP
>
(
m_map
,
ditVF
,
m_position
);
++
count
;
}
P
/=
count
;
m_position
[
db
]
=
P
;
}
m_map
.
decCurrentLevel
()
;
}
}
}
}
};
template
<
typename
PFP
>
class
BSXW02VolumeAveragingSubdivision
:
public
MRScheme
{
protected:
typename
PFP
::
MAP
&
m_map
;
typename
PFP
::
TVEC3
&
m_position
;
public:
BSXW02VolumeAveragingSubdivision
(
typename
PFP
::
MAP
&
m
,
typename
PFP
::
TVEC3
&
p
)
:
m_map
(
m
),
m_position
(
p
)
{}
void
operator
()
()
{
TraversorW
<
typename
PFP
::
MAP
>
trav
(
m_map
)
;
for
(
Dart
ditE
=
trav
.
begin
();
ditE
!=
trav
.
end
();
ditE
=
trav
.
next
())
{
m_map
.
incCurrentLevel
()
;
if
(
!
m_map
.
isTetrahedron
(
ditE
))
{
Dart
midV
=
m_map
.
phi_1
(
m_map
.
phi2
(
m_map
.
phi1
(
ditE
)));
typename
PFP
::
VEC3
P
(
0
);
unsigned
int
count
=
0
;
Traversor3VW
<
typename
PFP
::
MAP
>
travVF
(
m_map
,
midV
);
for
(
Dart
ditVF
=
travVF
.
begin
();
ditVF
!=
travVF
.
end
();
ditVF
=
travVF
.
next
())
{
P
+=
Algo
::
Geometry
::
volumeCentroid
<
PFP
>
(
m_map
,
ditVF
,
m_position
);
++
count
;
}
P
/=
count
;
m_position
[
midV
]
=
P
;
}
m_map
.
decCurrentLevel
()
;
m_map
.
decCurrentLevel
()
;
}
}
}
}
};
};
/* DHL93 on Boundary Vertices and MCQ04 on Insides Vertices
*********************************************************************************/
template
<
typename
PFP
>
template
<
typename
PFP
>
class
BSXW02FaceSubdivision
:
public
MRScheme
class
MCQ04VertexSubdivision
:
public
MRScheme
{
{
protected:
protected:
typename
PFP
::
MAP
&
m_map
;
typename
PFP
::
MAP
&
m_map
;
typename
PFP
::
TVEC3
&
m_position
;
typename
PFP
::
TVEC3
&
m_position
;
public:
public:
BSXW02Face
Subdivision
(
typename
PFP
::
MAP
&
m
,
typename
PFP
::
TVEC3
&
p
)
:
m_map
(
m
),
m_position
(
p
)
MCQ04Vertex
Subdivision
(
typename
PFP
::
MAP
&
m
,
typename
PFP
::
TVEC3
&
p
)
:
m_map
(
m
),
m_position
(
p
)
{}
{}
void
operator
()
()
void
operator
()
()
{
{
Traversor
W
<
typename
PFP
::
MAP
>
trav
(
m_map
)
;
Traversor
V
<
typename
PFP
::
MAP
>
trav
(
m_map
)
;
for
(
Dart
d
=
trav
.
begin
();
d
!=
trav
.
end
();
d
=
trav
.
next
())
for
(
Dart
d
=
trav
.
begin
();
d
!=
trav
.
end
();
d
=
trav
.
next
())
{
{
//cell points : these points are the average of the
typename
PFP
::
VEC3
p
=
m_position
[
d
];
//vertices of the lattice that bound the cell
typename
PFP
::
VEC3
p
=
Algo
::
Geometry
::
volumeCentroid
<
PFP
>
(
m_map
,
d
,
m_position
);
m_map
.
incCurrentLevel
()
;
m_map
.
incCurrentLevel
()
;
m_position
[
d
]
=
p
;
m_map
.
decCurrentLevel
()
;
}
}
}
;
if
(
!
m_map
.
isTetrahedron
(
d
))
template
<
typename
PFP
>
class
MCQ04EdgeSubdivision
:
public
MRScheme
{
protected:
typename
PFP
::
MAP
&
m_map
;
typename
PFP
::
TVEC3
&
m_position
;
public:
MCQ04EdgeSubdivision
(
typename
PFP
::
MAP
&
m
,
typename
PFP
::
TVEC3
&
p
)
:
m_map
(
m
),
m_position
(
p
)
{}
void
operator
()
()
{
typename
PFP
::
REAL
omega
=
1.0
/
16.0
;
TraversorE
<
typename
PFP
::
MAP
>
trav
(
m_map
)
;
for
(
Dart
ditE
=
trav
.
begin
();
ditE
!=
trav
.
end
();
ditE
=
trav
.
next
())
{
if
(
m_map
.
isBoundaryEdge
(
ditE
))
{
{
Dart
midV
=
m_map
.
phi_1
(
m_map
.
phi2
(
m_map
.
phi1
(
d
)));
Dart
db
=
m_map
.
findBoundaryFaceOfEdge
(
ditE
);
typename
PFP
::
VEC3
p
=
(
m_position
[
db
]
+
m_position
[
m_map
.
phi2
(
db
)])
*
typename
PFP
::
REAL
(
0.5
);
m_map
.
incCurrentLevel
()
;
Dart
midV
=
m_map
.
phi2
(
db
)
;
m_position
[
midV
]
=
p
;
m_position
[
midV
]
=
p
;
m_map
.
decCurrentLevel
()
;
}
}
else
{
typename
PFP
::
VEC3
P
=
(
m_position
[
ditE
]
+
m_position
[
m_map
.
phi2
(
ditE
)]
)
*
typename
PFP
::
REAL
(
0.5
);
m_map
.
decCurrentLevel
()
;
typename
PFP
::
VEC3
Q
(
0
);
typename
PFP
::
VEC3
R
(
0
);
unsigned
int
count
=
0
;
Dart
dit
=
ditE
;
do
{
Dart
d_1
=
m_map
.
phi_1
(
dit
);
Dart
d11
=
m_map
.
phi1
(
m_map
.
phi1
(
dit
));
Q
+=
m_position
[
d_1
];
Q
+=
m_position
[
d11
];
++
count
;
Dart
dr1
=
m_map
.
phi1
(
m_map
.
phi1
(
m_map
.
alpha2
(
d_1
)));
R
+=
m_position
[
dr1
];
Dart
dr2
=
m_map
.
phi1
(
m_map
.
phi1
(
m_map
.
alpha2
(
m_map
.
phi1
(
dit
))));
R
+=
m_position
[
dr2
];
dit
=
m_map
.
alpha2
(
dit
);
}
while
(
dit
!=
ditE
);
Q
*=
(
omega
/
count
);
R
*=
(
omega
/
count
);
m_map
.
incCurrentLevel
()
;
Dart
midV
=
m_map
.
phi2
(
ditE
);
m_position
[
midV
]
=
P
+
Q
-
R
;
m_map
.
decCurrentLevel
()
;
}
}
}
}
}
};
};
template
<
typename
PFP
>
template
<
typename
PFP
>
class
BSXW02Volum
eSubdivision
:
public
MRScheme
class
MCQ04Fac
eSubdivision
:
public
MRScheme
{
{
protected:
protected:
typename
PFP
::
MAP
&
m_map
;
typename
PFP
::
MAP
&
m_map
;
typename
PFP
::
TVEC3
&
m_position
;
typename
PFP
::
TVEC3
&
m_position
;
public:
public:
BSXW02Volum
eSubdivision
(
typename
PFP
::
MAP
&
m
,
typename
PFP
::
TVEC3
&
p
)
:
m_map
(
m
),
m_position
(
p
)
MCQ04Fac
eSubdivision
(
typename
PFP
::
MAP
&
m
,
typename
PFP
::
TVEC3
&
p
)
:
m_map
(
m
),
m_position
(
p
)
{}
{}
void
operator
()
()
void
operator
()
()
{
{
TraversorW
<
typename
PFP
::
MAP
>
trav
(
m_map
)
;
typename
PFP
::
REAL
omega
=
1.0
/
16.0
;
for
(
Dart
d
=
trav
.
begin
();
d
!=
trav
.
end
();
d
=
trav
.
next
())
TraversorF
<
typename
PFP
::
MAP
>
trav
(
m_map
)
;
for
(
Dart
ditF
=
trav
.
begin
();
ditF
!=
trav
.
end
();
ditF
=
trav
.
next
())
{
{
//cell points : these points are the average of the
if
(
m_map
.
isBoundaryFace
(
ditF
))
//vertices of the lattice that bound the cell
{
typename
PFP
::
VEC3
p
=
Algo
::
Geometry
::
volumeCentroid
<
PFP
>
(
m_map
,
d
,
m_position
);
typename
PFP
::
VEC3
p
=
Algo
::
Geometry
::
faceCentroid
<
PFP
>
(
m_map
,
ditF
,
m_position
);
m_map
.
incCurrentLevel
()
;
m_map
.
incCurrentLevel
()
;