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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hurstel
CGoGN
Commits
f9ef10ef
Commit
f9ef10ef
authored
Oct 27, 2011
by
Thomas
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of cgogn.u-strasbg.fr:~untereiner/CGoGN
parents
f9dac96f
917105e2
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
659 additions
and
473 deletions
+659
-473
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
+414
-393
include/Algo/Modelisation/polyhedron.h
include/Algo/Modelisation/polyhedron.h
+10
-0
include/Algo/Modelisation/polyhedron.hpp
include/Algo/Modelisation/polyhedron.hpp
+86
-0
include/Algo/Selection/collector.h
include/Algo/Selection/collector.h
+1
-1
include/Topology/generic/embeddedMap3.hpp
include/Topology/generic/embeddedMap3.hpp
+8
-0
include/Topology/generic/genericmap.h
include/Topology/generic/genericmap.h
+4
-4
include/Topology/map/map2.h
include/Topology/map/map2.h
+8
-9
include/Topology/map/map3.h
include/Topology/map/map3.h
+8
-0
src/Topology/map/map2.cpp
src/Topology/map/map2.cpp
+14
-15
src/Topology/map/map3.cpp
src/Topology/map/map3.cpp
+106
-51
No files found.
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
View file @
f9ef10ef
This diff is collapsed.
Click to expand it.
include/Algo/Modelisation/polyhedron.h
View file @
f9ef10ef
...
...
@@ -60,6 +60,16 @@ enum { NONE,GRID, CUBE, CYLINDER, CONE, SPHERE, TORE, COMPOSED };
// template <typename PFP>
// Dart triangleFan_topo(typename PFP::MAP& the_map, int n);
/**
* Unsex the Umbrella aroud a vertex, close the hole and then
* create a symetric to construct a polyedron
* @param d a dart from the vertex
*/
template
<
typename
PFP
>
void
explodPolyhedron
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
typename
PFP
::
TVEC3
position
);
/**
* class of geometric Polyhedron
* It alloaw the creation of:
...
...
include/Algo/Modelisation/polyhedron.hpp
View file @
f9ef10ef
...
...
@@ -31,6 +31,92 @@ namespace Algo
namespace Modelisation
{
template <typename PFP>
void explodPolyhedron(typename PFP::MAP& map, Dart d, typename PFP::TVEC3 position)
{
map.unsewVertexUmbrella(d);
unsigned int newFaceDegree = map.closeHole(map.phi1(d));
if(newFaceDegree != 3)
{
//chercher le brin ou demarer
std::multimap<Dart, int> edges ;
typename std::multimap<Dart, int>::iterator it ;
Dart d12 = map.phi2(map.phi1(d));
Dart fit = d12;
int i;
do
{
i = map.faceDegree(map.phi2(fit));
std::cout << "edge(" << fit << "," << i << ")" << std::endl;
edges.insert(std::make_pair(fit, i));
fit = map.phi1(fit);
}
while(fit != d12);
do
{
//44 44
if(edges.find(fit)->second == 4 && edges.find(map.phi1(fit))->second == 4
&& !map.sameFace(map.phi2(fit), map.phi2(map.phi1(fit))))
{
map.splitFace(fit, map.phi1(map.phi1(fit)));
fit = map.phi2(map.phi_1(fit));
int i = map.faceDegree(fit);
edges.insert(std::make_pair(fit, i));
// Dart fit2 = map.phi2(fit) ;
// typename PFP::VEC3 p1 = position[fit] ;
// typename PFP::VEC3 p2 = position[fit2] ;
//
// map.cutEdge(fit) ;
// position[map.phi1(fit)] = typename PFP::REAL(0.5) * (p1 + p2);
std::cout << "flip cas quad quad " << std::endl;
}
//3 3
if(edges.find(fit)->second == 3 && edges.find(map.phi1(fit))->second == 3
&& !map.sameFace(map.phi2(fit), map.phi2(map.phi1(fit))))
{
map.splitFace(fit, map.phi1(fit));
fit = map.phi2(map.phi_1(fit));
int i = map.faceDegree(fit);
edges.insert(std::make_pair(fit, i));
std::cout << "flip cas tri tri" << std::endl;
}
//3 44 ou 44 3
if( ((edges.find(fit)->second == 4 && edges.find(map.phi1(fit))->second == 3)
|| (edges.find(fit)->second == 3 && edges.find(map.phi1(fit))->second == 4))
&& !map.sameFace(map.phi2(fit), map.phi2(map.phi1(fit))))
{
map.splitFace(fit, map.phi1(map.phi1(fit)));
fit = map.phi2(map.phi_1(fit));
int i = map.faceDegree(fit);
edges.insert(std::make_pair(fit, i));
std::cout << "flip cas quad tri" << std::endl;
}
fit = map.phi1(fit);
}
while(map.faceDegree(fit) > 4 && fit != d12);
}
}
template <typename PFP>
Polyhedron<PFP>::Polyhedron(const Polyhedron<PFP>& p1, const Polyhedron<PFP>& p2):
m_map(p1.m_map),
...
...
include/Algo/Selection/collector.h
View file @
f9ef10ef
...
...
@@ -117,7 +117,7 @@ public:
* insideVertices = centerDart
* insideEdges = star (edges incident to centerDart)
* insideFaces = triangles incident to centerDart
* border = vertices of 1-ring
* border = vertices of 1-ring
-> link (set of adjacent vertices)
* = edges of 1-ring
*/
template
<
typename
PFP
>
...
...
include/Topology/generic/embeddedMap3.hpp
View file @
f9ef10ef
...
...
@@ -173,6 +173,13 @@ void EmbeddedMap3<MAP3>::cutEdge(Dart d)
{
MAP3
::
cutEdge
(
d
);
if
(
MAP3
::
isOrbitEmbedded
(
VERTEX
))
{
Dart
nd
=
MAP3
::
phi1
(
d
)
;
MAP3
::
embedNewCell
(
VERTEX
,
nd
)
;
}
if
(
MAP3
::
isOrbitEmbedded
(
EDGE
))
{
Dart
nd
=
MAP3
::
phi1
(
d
)
;
...
...
@@ -218,6 +225,7 @@ void EmbeddedMap3<MAP3>::cutEdge(Dart d)
f
=
MAP3
::
alpha2
(
f
);
}
while
(
f
!=
d
);
}
}
...
...
include/Topology/generic/genericmap.h
View file @
f9ef10ef
...
...
@@ -204,7 +204,7 @@ public:
void
embedOrbit
(
unsigned
int
orbit
,
Dart
d
,
unsigned
int
em
)
;
/**
* Associate an new embedding to all darts of a
vertex
* Associate an new embedding to all darts of a
n orbit
* @param orbit orbit to embed
* @param d a dart of the topological cell
* @return index of the attribute in table
...
...
@@ -212,10 +212,10 @@ public:
unsigned
int
embedNewCell
(
unsigned
int
orbit
,
Dart
d
)
;
/**
* Copy the cell associated to a dart over an other dart
* Copy the cell associated to a dart over an other dart
* @param orbit attribute orbit to use
* @param d the dart to overwrite (dest)
* @param e the dart to copy (src)
* @param d the dart to overwrite (dest)
* @param e the dart to copy (src)
*/
void
copyCell
(
unsigned
int
orbit
,
Dart
d
,
Dart
e
)
;
...
...
include/Topology/map/map2.h
View file @
f9ef10ef
...
...
@@ -237,18 +237,11 @@ public:
void
insertTrianglePair
(
Dart
d
,
Dart
v1
,
Dart
v2
)
;
/**
* Unsew
opposite edges from the faces around
a vertex
* Unsew
the faces consisting of the umbrella of
a vertex
* \warning Darts may have
* @param d a dart from the vertex
*/
void
unsewAroundVertex
(
Dart
d
)
;
/**
* Unsex the Umbrella aroud a vertex, close the hole and then
* create a symetric to construct a polyedron
* @param d a dart from the vertex
*/
void
explodPolyhedron
(
Dart
d
);
virtual
void
unsewVertexUmbrella
(
Dart
d
)
;
//! Merge two volumes along two faces.
/*! Works only if the two faces have the same number of edges.
...
...
@@ -292,6 +285,12 @@ public:
*/
bool
sameOrientedVertex
(
Dart
d
,
Dart
e
)
;
//!Test if dart d and e belong to the same oriented face
/*! @param d a dart
* @param e a dart
*/
bool
sameOrientedFace
(
Dart
d
,
Dart
e
);
//! Test if dart d and e belong to the same vertex
/*! @param d a dart
* @param e a dart
...
...
include/Topology/map/map3.h
View file @
f9ef10ef
...
...
@@ -346,6 +346,14 @@ public:
*************************************************************************/
//@{
//! Test if dart d and e belong to the same oriented face
/*! @param d a dart
* @param e a dart
*/
bool
sameFace
(
Dart
d
,
Dart
e
);
// TODO devrait disparaitre
// pour les mêmes raisons que dans map2
virtual
bool
check
();
...
...
src/Topology/map/map2.cpp
View file @
f9ef10ef
...
...
@@ -298,7 +298,7 @@ void Map2::insertTrianglePair(Dart d, Dart v1, Dart v2)
phi2sew
(
phi1
(
d
),
vv1
)
;
}
void
Map2
::
unsew
AroundVertex
(
Dart
d
)
void
Map2
::
unsew
VertexUmbrella
(
Dart
d
)
{
Dart
e
=
d
;
...
...
@@ -318,20 +318,6 @@ void Map2::unsewAroundVertex(Dart d)
while
(
e
!=
d
);
}
void
Map2
::
explodPolyhedron
(
Dart
d
)
{
unsewAroundVertex
(
d
);
closeHole
(
phi1
(
d
));
//Recherche du (ou un des) sommet oppose
//tourner autour du sommet
//si quad alors sommet oppose
//
//si pas de quad alors un sommet du trian
//
}
bool
Map2
::
mergeVolumes
(
Dart
d
,
Dart
e
)
{
// First traversal of both faces to check the face sizes
...
...
@@ -441,6 +427,19 @@ bool Map2::sameOrientedVertex(Dart d, Dart e)
return
false
;
// None is equal to e => vertices are distinct
}
bool
Map2
::
sameOrientedFace
(
Dart
d
,
Dart
e
)
{
Dart
dNext
=
d
;
do
//Foreach dart dNext of the face
{
if
(
dNext
==
e
)
//Test equality with e
return
true
;
dNext
=
phi1
(
dNext
);
}
while
(
dNext
!=
d
);
return
false
;
// None is equal to e => Faces are distinct
}
unsigned
int
Map2
::
vertexDegree
(
Dart
d
)
{
unsigned
int
count
=
0
;
...
...
src/Topology/map/map3.cpp
View file @
f9ef10ef
...
...
@@ -203,67 +203,111 @@ void Map3::uncutEdge(Dart d)
}
//besoin d'un iterator pour chaque face autour d'un sommet
bool Map3::deleteVertex(Dart d)
{
DartMarkerStore
mv
(
*
this
);
// Lock a marker
std
::
vector
<
Dart
>
darts_list
;
//Darts that are traversed
darts_list
.
reserve
(
512
);
darts_list
.
push_back
(
d
);
//Start with the dart d
std
::
vector
<
Dart
>::
iterator
darts
;
mv
.
mark
(
d
);
std
::
vector
<
Dart
>
unique_darts_list
;
unique_darts_list
.
reserve
(
512
);
unique_darts_list
.
push_back
(
d
);
bool
boundary
=
false
;
if
(
isBoundaryVertex
(
d
))
boundary
=
true
;
for
(
darts
=
darts_list
.
begin
();
darts
!=
darts_list
.
end
()
;
++
darts
)
//is boundary
if(phi3(d) != d)
{
Dart
dc
=
*
darts
;
//add phi21 and phi23 successor if they are not marked yet
Dart
d2
=
phi2
(
dc
);
Dart
d21
=
phi1
(
d2
);
// turn in volume
Dart
d23
=
phi3
(
d2
);
// change volume
if
(
!
mv
.
isMarked
(
d21
))
{
darts_list
.
push_back
(
d21
);
mv
.
mark
(
d21
);
}
Dart e = d;
Dart d3 = phi2(phi3(d));
if
((
d23
!=
d2
)
&&
!
mv
.
isMarked
(
d23
))
do
{
darts_list
.
push_back
(
d23
);
unique_darts_list
.
push_back
(
d23
);
mv
.
mark
(
d23
);
}
}
unsewVolumes(e);
e = phi2(phi_1(e));
}while(e != d);
for
(
darts
=
unique_darts_list
.
begin
();
darts
!=
unique_darts_list
.
end
()
;
++
darts
)
{
mergeVolumes
(
*
darts
);
Map2::deleteVertex(d3);
}
if
(
boundary
)
{
Dart
vit
=
d
;
do
{
Dart
f
=
phi_1
(
phi2
(
vit
))
;
phi1sew
(
vit
,
f
)
;
vit
=
phi2
(
phi_1
((
vit
)))
;
}
while
(
vit
!=
d
)
;
Map1
::
deleteFace
(
d
)
;
}
Map2::deleteVertex(d);
return true;
// std::cout << "map3::deleteVertex" << std::endl;
//
// DartMarkerStore mv(*this); // Lock a marker
//
// std::vector<Dart> darts_list; //Darts that are traversed
// darts_list.reserve(512);
// darts_list.push_back(d); //Start with the dart d
// std::vector<Dart>::iterator darts;
//
// mv.mark(d);
//
// std::vector<Dart> unique_darts_list;
// unique_darts_list.reserve(512);
// unique_darts_list.push_back(d);
//
//
// bool boundary = false;
// if(isBoundaryVertex(d))
// boundary = true;
//
// std::cout << "isBoundary ? " << boundary << std::endl;
//
// CellMarker mvolume(*this, VOLUME);
//
// for(darts = darts_list.begin(); darts != darts_list.end() ; ++darts)
// {
// Dart dc = *darts;
//
// //add phi21 and phi23 successor if they are not marked yet
// Dart d2 = phi2(dc);
// Dart d21 = phi1(d2); // turn in volume
// Dart d23 = phi3(d2); // change volume
//
// if(!mv.isMarked(d21))
// {
// darts_list.push_back(d21);
// mv.mark(d21);
// }
//
// if((d23!=d2) && !mv.isMarked(d23))
// {
// darts_list.push_back(d23);
// //if(!mvolume.isMarked(d23))
// //{
// unique_darts_list.push_back(d23);
// // mvolume.mark(d23);
// //}
// mv.mark(d23);
// }
//
// std::cout << "save a dart" << std::endl;
// }
//
// std::cout << "unique_darts_list size = " << unique_darts_list.size() << std::endl;
//
// for(darts = unique_darts_list.begin(); darts != unique_darts_list.end() ; ++darts)
// {
// //std::cout << "merged ? " << mergeVolumes(*darts) << std::endl;
//
// //if(!mergeVolumes(*darts))
// // return false;
//
// std::cout << "mergevolumes" << std::endl;
// }
//
// std::cout << "end merging" << std::endl;
//
// if(boundary)
// {
// std::cout << "is Boundary " << std::endl;
// Dart vit = d ;
// do
// {
// Dart f = phi_1(phi2(vit)) ;
// phi1sew(vit, f) ;
// vit = phi2(phi_1((vit))) ;
// } while(vit != d) ;
// Map1::deleteFace(d) ;
// }
//
// std::cout << "return" << std::endl;
//
// return true;
}
//TODO
...
...
@@ -1142,6 +1186,17 @@ void Map3::closeMap(DartMarker& marker)
// this->releaseMarker(DART,mf3);
//}
//
bool Map3::sameFace(Dart d, Dart e)
{
if(phi3(d) != d)
if(Map2::sameOrientedFace(phi3(d), e))
return true;
return Map2::sameOrientedFace(d,e);
}
bool Map3::check()
{
CGoGNout << "Check: topology begin" << CGoGNendl;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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