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
Thomas Pitiot
CGoGN
Commits
6b6e2669
Commit
6b6e2669
authored
May 20, 2014
by
Lionel Untereiner
Committed by
untereiner
Jul 18, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
begin triangular map feature :
- adding triangular map2
parent
10d60820
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
463 additions
and
6 deletions
+463
-6
Apps/Examples/volumeExplorer.cpp
Apps/Examples/volumeExplorer.cpp
+3
-0
include/Algo/Modelisation/tetrahedralization.hpp
include/Algo/Modelisation/tetrahedralization.hpp
+24
-4
include/Topology/map/map2t.h
include/Topology/map/map2t.h
+349
-0
include/Topology/map/map2t.hpp
include/Topology/map/map2t.hpp
+79
-0
src/Topology/map/embeddedMap3.cpp
src/Topology/map/embeddedMap3.cpp
+8
-2
No files found.
Apps/Examples/volumeExplorer.cpp
View file @
6b6e2669
...
...
@@ -191,6 +191,9 @@ void MyQT::cb_Open()
// }
// SelectorDartNoBoundary<MAP> nb(myMap);
myMap
.
check
();
m_topo_render
->
updateData
(
myMap
,
position
,
0.8
f
,
0.8
f
,
0.8
f
);
m_explode_render
->
updateData
<
PFP
>
(
myMap
,
position
,
color
);
...
...
include/Algo/Modelisation/tetrahedralization.hpp
View file @
6b6e2669
...
...
@@ -646,8 +646,6 @@ Dart swapGen3To2(typename PFP::MAP& map, Dart d)
Dart stop = map.phi1(map.phi2(map.phi_1(d)));
if(map.deleteEdge(d) == NIL)
{
std::cout << "boundary" << std::endl;
std::vector<Dart> edges;
Dart dbegin = map.findBoundaryFaceOfEdge(d);
Traversor3EW<typename PFP::MAP> t(map, d);
...
...
@@ -663,11 +661,23 @@ Dart swapGen3To2(typename PFP::MAP& map, Dart d)
map.template copyDartEmbedding<VERTEX>(d, map.phi1(e)) ;
map.template copyDartEmbedding<VERTEX>(e, map.phi1(d)) ;
if (map.template isOrbitEmbedded<FACE>())
{
map.template copyDartEmbedding<FACE>(map.phi1(d), d) ;
map.template copyDartEmbedding<FACE>(map.phi1(e), e) ;
}
d = map.phi3(dbegin);
e = map.phi2(d);
map.flipEdge(d);
map.template copyDartEmbedding<VERTEX>(d, map.phi1(e)) ;
map.template copyDartEmbedding<VERTEX>(e, map.phi1(d)) ;
if (map.template isOrbitEmbedded<FACE>())
{
map.template copyDartEmbedding<FACE>(map.phi_1(d), d) ;
map.template copyDartEmbedding<FACE>(map.phi_1(e), e) ;
}
}
std::vector<Dart> edges;
...
...
@@ -716,8 +726,6 @@ std::vector<Dart> swapGen3To2Optimized(typename PFP::MAP& map, Dart d)
Dart stop = map.phi1(map.phi2(map.phi_1(d)));
if(map.deleteEdge(d) == NIL)
{
std::cout << "boundary" << std::endl;
std::vector<Dart> edges;
Dart dbegin = map.findBoundaryFaceOfEdge(d);
Traversor3EW<typename PFP::MAP> t(map, d);
...
...
@@ -733,11 +741,23 @@ std::vector<Dart> swapGen3To2Optimized(typename PFP::MAP& map, Dart d)
map.template copyDartEmbedding<VERTEX>(d, map.phi1(e)) ;
map.template copyDartEmbedding<VERTEX>(e, map.phi1(d)) ;
if (map.template isOrbitEmbedded<FACE>())
{
map.template copyDartEmbedding<FACE>(map.phi1(d), d) ;
map.template copyDartEmbedding<FACE>(map.phi1(e), e) ;
}
d = map.phi3(dbegin);
e = map.phi2(d);
map.flipEdge(d);
map.template copyDartEmbedding<VERTEX>(d, map.phi1(e)) ;
map.template copyDartEmbedding<VERTEX>(e, map.phi1(d)) ;
if (map.template isOrbitEmbedded<FACE>())
{
map.template copyDartEmbedding<FACE>(map.phi_1(d), d) ;
map.template copyDartEmbedding<FACE>(map.phi_1(e), e) ;
}
}
std::vector<Dart> edges;
...
...
include/Topology/map/map2t.h
0 → 100644
View file @
6b6e2669
/*******************************************************************************
* 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 __MAP2_TRIANGULAR_H__
#define __MAP2_TRIANGULAR_H__
#include "Topology/generic/mapCommon.h"
#include "Topology/generic/dartmarker.h"
#include "Topology/generic/cellmarker.h"
namespace
CGoGN
{
namespace
Simplex
{
template
<
typename
MAP_IMPL
>
class
Map2
:
public
MapCommon
<
MAP_IMPL
>
{
protected:
init
();
public:
typedef
MAP_IMPL
IMPL
;
typedef
MapCommon
<
MAP_IMPL
>
ParentMap
;
Map2
();
static
const
unsigned
int
DIMENSION
=
2
;
virtual
std
::
string
mapTypeName
()
const
;
virtual
unsigned
int
dimension
()
const
;
virtual
void
clear
(
bool
removeAttrib
);
virtual
unsigned
int
getNbInvolutions
()
const
;
virtual
unsigned
int
getNbPermutations
()
const
;
/*! @name Basic Topological Operators
* Access and Modification
*************************************************************************/
Dart
phi1
(
Dart
d
)
const
;
Dart
phi_1
(
Dart
d
)
const
;
Dart
phi2
(
Dart
d
)
const
;
template
<
int
N
>
Dart
phi
(
Dart
d
)
const
;
Dart
alpha0
(
Dart
d
)
const
;
Dart
alpha1
(
Dart
d
)
const
;
Dart
alpha_1
(
Dart
d
)
const
;
protected:
//! Link dart d with dart e by an involution
/* @param d,e the darts to link
* - Before: d->d and e->e
* - After: d->e and e->d
*/
void
phi2sew
(
Dart
d
,
Dart
e
);
//! Unlink the current dart by an involution
/* @param d the dart to unlink
* - Before: d->e and e->d
* - After: d->d and e->e
*/
void
phi2unsew
(
Dart
d
);
public:
/*! @name Generator and Deletor
* To generate or delete faces in a 1-map
*************************************************************************/
//@{
//! Create an new face made of 3 linked darts.
/*! @return return a dart of the face
*/
Dart
newFace
()
;
//! Delete an oriented face erasing its 3 darts
/*! @param d a dart of the face
*/
void
deleteFace
(
Dart
d
)
;
//@}
/*! @name Topological Operators
* Topological operations on 1-maps
*************************************************************************/
//@{
//! Split a vertex v between d and e inserting an edge after d and e
/*! \pre Darts d & e MUST belong to the same vertex
* @param d first dart in vertex v
* @param e second dart in vertex v
*/
void
splitVertex
(
Dart
d
,
Dart
e
);
//TODO deleteVertex can create a Hole or must retriangulate the polygonal face
//! Delete the vertex of d (works only for internal vertices)
/*! Does not create a hole -> all the faces
* around the vertex are merged into one face
* @param d a dart of the vertex to delete
* @return a dart of the resulting face (NIL if the deletion has not been executed)
*/
Dart
deleteVertex
(
Dart
d
);
//! Collapse an edge of a cycle
/*! \warning Dart d no longer exists after the call
* @param d the edge
*/
void
collapseEdge
(
Dart
d
);
/**
* Flip the edge of d (rotation in phi1 order)
* WARNING : Works only for non-border edges
* @param d a dart of the edge to flip
* @return true if the flip has been executed, false otherwise
*/
bool
flipEdge
(
Dart
d
);
/**
* Flip the edge of d (rotation in phi_1 order)
* WARNING : Works only for non-border edges
* @param d a dart of the edge to flip
* @return true if the flipBack has been executed, false otherwise
*/
bool
flipBackEdge
(
Dart
d
);
//! Sew two oriented faces along oriented edges
/*! \pre Edges of darts d & e MUST be boundary edges
* @param d a dart of the first face
* @param e a dart of the second face
* @param withBoundary: if false, faces must have phi2 fixed points (only for construction: import/primitives)
*/
void
sewFaces
(
Dart
d
,
Dart
e
,
bool
withBoundary
=
true
);
//! Unsew two oriented faces
/*! \pre Edge of dart d MUST NOT be a boundary edge
* @param d a dart of a face
*/
virtual
void
unsewFaces
(
Dart
d
,
bool
withBoundary
=
true
);
/**
* Extract a pair of sewed triangles and sew their adjacent faces
* d is a dart of the common edge of the pair of triangles
*/
void
extractTrianglePair
(
Dart
d
)
;
/**
* Insert a pair of sewed triangles in a vertex by exploding the edges of v1 and v2
* v1 and v2 belong to the same vertex
* d is a dart of the common edge of the pair of triangles
*/
void
insertTrianglePair
(
Dart
d
,
Dart
v1
,
Dart
v2
)
;
/*! @name Topological Queries
* Return or set various topological information
*************************************************************************/
//@{
//! Test if vertices v1 and v2 represent the same oriented vertex
/*! @param v1 a vertex
* @param v2 a vertex
*/
bool
sameOrientedVertex
(
Vertex
v1
,
Vertex
v2
)
const
;
//! Test if vertices v1 and v2 represent the same vertex
/*! @param v1 a vertex
* @param v2 a vertex
*/
bool
sameVertex
(
Vertex
v1
,
Vertex
v2
)
const
;
//! Compute the number of edges of the vertex v
/*! @param v a vertex
*/
unsigned
int
vertexDegree
(
Vertex
v
)
const
;
//! Check number of edges of the vertex v with given parameter
/*! @param v a vertex
* @param vd degree to compare with
* @return negative/null/positive if vertex degree is less/equal/greater than given degree
*/
int
checkVertexDegree
(
Vertex
v
,
unsigned
int
vd
)
const
;
//! Tell if the vertex v is on the boundary of the map
/*! @param v a vertex
*/
bool
isBoundaryVertex
(
Vertex
v
)
const
;
/**
* find the dart of vertex v that belongs to the boundary
* return NIL if the vertex is not on the boundary
*/
Dart
findBoundaryEdgeOfVertex
(
Vertex
v
)
const
;
//! Test if edges e1 and e2 represent the same edge
/*! @param e1 an edge
* @param e2 an edge
*/
bool
sameEdge
(
Edge
e1
,
Edge
e2
)
const
;
/**
* tell if the edge e is on the boundary of the map
*/
bool
isBoundaryEdge
(
Edge
e
)
const
;
//! Test if faces f1 and f2 represent the same oriented face
/*! @param f1 a face
* @param f2 a face
*/
bool
sameOrientedFace
(
Face
f1
,
Face
f2
)
const
;
//! Test if faces f1 and f2 represent the same face
/*! @param f1 a face
* @param f2 a face
*/
bool
sameFace
(
Face
f1
,
Face
f2
)
const
;
/**
* compute the number of edges of the face f
*/
unsigned
int
faceDegree
(
Face
f
)
const
;
//! Check number of edges of the face f with given parameter
/*! @param f a face
* @param fd degree to compare with
* @return negative/null/positive if face degree is less/equal/greater than given degree
*/
int
checkFaceDegree
(
Face
f
,
unsigned
int
fd
)
const
;
/**
* tell if the face f is incident to the boundary of the map
*/
bool
isFaceIncidentToBoundary
(
Face
f
)
const
;
/**
* find the dart of face f that belongs to the boundary
* return NIL if the face is not incident to the boundary
*/
Dart
findBoundaryEdgeOfFace
(
Face
f
)
const
;
//! Test if volumes v1 and v2 represent the same oriented volume
/*! @param d a dart
* @param e a dart
*/
bool
sameOrientedVolume
(
Vol
v1
,
Vol
v2
)
const
;
//! Test if volumes v1 and v2 represent the same volume
/*! @param d a dart
* @param e a dart
*/
bool
sameVolume
(
Vol
v1
,
Vol
v2
)
const
;
//! Compute the number of faces in the volume v
/*! @param d a dart
*/
unsigned
int
volumeDegree
(
Vol
v
)
const
;
//! Check number of faces of the volume v with given parameter
/*! @param v a volume
* @param vd degree to compare with
* @return negative/null/positive if volume degree is less/equal/greater than given degree
*/
int
checkVolumeDegree
(
Vol
v
,
unsigned
int
vd
)
const
;
/*! @name Cell Functors
* Apply functors to all darts of a cell
*************************************************************************/
//@{
//! Apply a functor on every dart of a vertex
/*! @param d a dart of the vertex
* @param f the functor to apply
*/
void
foreach_dart_of_vertex
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>&
f
,
unsigned
int
thread
=
0
)
const
;
//! Apply a functor on every dart of an edge
/*! @param d a dart of the edge
* @param f the functor to apply
*/
void
foreach_dart_of_edge
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>&
f
,
unsigned
int
thread
=
0
)
const
;
//! Apply a functor on every dart of an face
/*! @param d a dart of the volume
* @param f the functor to apply
*/
void
foreach_dart_of_face
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>&
f
,
unsigned
int
thread
=
0
)
const
;
//! Apply a functor on every dart of an face
/*! @param d a dart of the volume
* @param f the functor to apply
*/
void
foreach_dart_of_volume
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>&
f
,
unsigned
int
thread
=
0
)
const
;
//! Apply a functor on every dart of a connected component
/*! @param d a dart of the connected component
* @param f the functor to apply
*/
void
foreach_dart_of_cc
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>&
f
,
unsigned
int
thread
=
0
)
const
;
//! Apply a functor on every dart of a vertex of map1 representing the face of d
/*! @param d a dart of the vertex
* @param f the functor to apply
*/
void
foreach_dart_of_vertex1
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>&
f
,
unsigned
int
thread
=
0
)
const
;
//! Apply a functor on every dart of an edge of map1 representing the face of d
/*! @param d a dart of the edge
* @param f the functor to apply
*/
void
foreach_dart_of_edge1
(
Dart
d
,
std
::
function
<
void
(
Dart
)
>&
f
,
unsigned
int
thread
=
0
)
const
;
//@}
};
}
// namespace Simplex
}
// namespace CGoGN
#include "Topology/map/map2t.hpp"
#endif
include/Topology/map/map2t.hpp
0 → 100644
View file @
6b6e2669
/*******************************************************************************
* 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 *
* *
*******************************************************************************/
namespace
CGoGN
{
namespace
Simplex
{
template
<
typename
MAP_IMPL
>
inline
void
Map2
<
MAP_IMPL
>::
init
()
{
MAP_IMPL
::
addInvolution
()
;
}
template
<
typename
MAP_IMPL
>
inline
Map2
<
MAP_IMPL
>::
Map2
()
:
MapCommon
<
MAP_IMPL
>
()
{
init
()
;
}
template
<
typename
MAP_IMPL
>
inline
std
::
string
Map2
<
MAP_IMPL
>::
mapTypeName
()
const
{
return
"Map2"
;
}
template
<
typename
MAP_IMPL
>
inline
unsigned
int
Map2
<
MAP_IMPL
>::
dimension
()
const
{
return
2
;
}
template
<
typename
MAP_IMPL
>
inline
void
Map2
<
MAP_IMPL
>::
clear
(
bool
removeAttrib
)
{
ParentMap
::
clear
(
removeAttrib
)
;
if
(
removeAttrib
)
init
()
;
}
template
<
typename
MAP_IMPL
>
inline
unsigned
int
Map2
<
MAP_IMPL
>::
getNbInvolutions
()
const
{
return
1
;
}
template
<
typename
MAP_IMPL
>
inline
unsigned
int
Map2
<
MAP_IMPL
>::
getNbPermutations
()
const
{
return
1
;
}
}
// namespace Simplex
}
// namespace CGoGN
src/Topology/map/embeddedMap3.cpp
View file @
6b6e2669
...
...
@@ -77,7 +77,7 @@ Dart EmbeddedMap3::cutEdge(Dart d)
// if(isOrbitEmbedded<VERTEX>())
// {
// initOrbitEmbeddingNewCell<VERTEX>(nd) ;
// initOrbitEmbedding
On
NewCell<VERTEX>(nd) ;
// }
if(isOrbitEmbedded<EDGE>())
...
...
@@ -235,7 +235,7 @@ void EmbeddedMap3::splitFace(Dart d, Dart e)
// if(isOrbitEmbedded<EDGE>())
// {
// initOrbitEmbeddingNewCell<EDGE>(phi_1(d)) ;
// initOrbitEmbedding
On
NewCell<EDGE>(phi_1(d)) ;
// }
if(isOrbitEmbedded<FACE2>())
...
...
@@ -479,6 +479,12 @@ void EmbeddedMap3::splitVolume(std::vector<Dart>& vd)
}
}
// if(isOrbitEmbedded<FACE>())
// {
// Dart v = vd.front() ;
// initOrbitEmbeddingNewCell<FACE>(phi2(v));
// }
if(isOrbitEmbedded<VOLUME>())
{
Dart v = vd.front() ;
...
...
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