Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
KennethVanhoey
CGoGN
Commits
9e2ce59c
Commit
9e2ce59c
authored
Dec 15, 2011
by
untereiner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change subdiv algo for no_boundary
parent
7f08b177
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
688 additions
and
560 deletions
+688
-560
include/Algo/ImplicitHierarchicalMesh/ihm3.h
include/Algo/ImplicitHierarchicalMesh/ihm3.h
+217
-139
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
+95
-124
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
+225
-254
include/Topology/gmap/embeddedGMap3.h
include/Topology/gmap/embeddedGMap3.h
+5
-0
include/Topology/map/embeddedMap3.h
include/Topology/map/embeddedMap3.h
+16
-16
include/Topology/map/map3.h
include/Topology/map/map3.h
+1
-1
src/Algo/ImplicitHierarchicalMesh/ihm3.cpp
src/Algo/ImplicitHierarchicalMesh/ihm3.cpp
+101
-6
src/Topology/gmap/embeddedGMap3.cpp
src/Topology/gmap/embeddedGMap3.cpp
+13
-0
src/Topology/map/embeddedMap3.cpp
src/Topology/map/embeddedMap3.cpp
+2
-2
src/Topology/map/map3.cpp
src/Topology/map/map3.cpp
+13
-18
No files found.
include/Algo/ImplicitHierarchicalMesh/ihm3.h
View file @
9e2ce59c
...
@@ -36,11 +36,11 @@ namespace Algo
...
@@ -36,11 +36,11 @@ namespace Algo
namespace
IHM
namespace
IHM
{
{
//
template<typename T> class AttributeHandler_IHM ;
template
<
typename
T
>
class
AttributeHandler_IHM
;
class
ImplicitHierarchicalMap3
:
public
EmbeddedMap3
class
ImplicitHierarchicalMap3
:
public
EmbeddedMap3
{
{
//
template<typename T> friend class AttributeHandler_IHM ;
template
<
typename
T
>
friend
class
AttributeHandler_IHM
;
public:
public:
unsigned
int
m_curLevel
;
unsigned
int
m_curLevel
;
...
@@ -59,23 +59,37 @@ public:
...
@@ -59,23 +59,37 @@ public:
~
ImplicitHierarchicalMap3
()
;
~
ImplicitHierarchicalMap3
()
;
//!
/*!
*
*/
void
init
()
;
void
init
()
;
/***************************************************
/*! @name Attributes Management
* ATTRIBUTES MANAGEMENT *
* To handles Attributes for each level of an implicit 3-map
***************************************************/
*************************************************************************/
//template <typename T>
//AttributeHandler_IHM<T> addAttribute(unsigned int orbit, const std::string& nameAttr) ;
//template <typename T>
//@{
//AttributeHandler_IHM<T> getAttribute(unsigned int orbit, const std::string& nameAttr) ;
//!
/*!
*
*/
template
<
typename
T
>
AttributeHandler_IHM
<
T
>
addAttribute
(
unsigned
int
orbit
,
const
std
::
string
&
nameAttr
)
;
//!
/*!
*
*/
template
<
typename
T
>
AttributeHandler_IHM
<
T
>
getAttribute
(
unsigned
int
orbit
,
const
std
::
string
&
nameAttr
)
;
//@}
/*
**************************************************
/*
! @name Basic Topological Operators
*
MAP TRAVERSAL *
*
Redefinition of the basic topological operators
***************************************************/
***************************************************
**********************
/
//@{
virtual
Dart
newDart
()
;
virtual
Dart
newDart
()
;
Dart
phi1
(
Dart
d
)
;
Dart
phi1
(
Dart
d
)
;
...
@@ -97,214 +111,278 @@ public:
...
@@ -97,214 +111,278 @@ public:
Dart
alpha2
(
Dart
d
);
Dart
alpha2
(
Dart
d
);
Dart
alpha_2
(
Dart
d
);
Dart
alpha_2
(
Dart
d
);
//@}
virtual
Dart
begin
()
;
// /*! @name Topological Operators with Cells id management
// * Topological operations on Hierarchical Implicit 3-maps
virtual
Dart
end
()
;
// *************************************************************************/
//
virtual
void
next
(
Dart
&
d
)
;
// //@{
// //!
virtual
bool
foreach_dart_of_vertex
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
)
;
// /*!
// *
virtual
bool
foreach_dart_of_edge
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
)
;
// */
// virtual Dart cutEdge(Dart d);
bool
foreach_dart_of_oriented_face
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
);
//
virtual
bool
foreach_dart_of_face
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
)
;
// //!
// /*!
bool
foreach_dart_of_oriented_volume
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
);
// *
virtual
bool
foreach_dart_of_volume
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
)
;
// */
// virtual bool uncutEdge(Dart d);
virtual
bool
foreach_dart_of_cc
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
)
;
//
// //!
// /*!
/***************************************************
// *
* LEVELS MANAGEMENT *
// */
***************************************************/
// virtual void splitFace(Dart d, Dart e);
//
// //!
// /*!
// *
// */
// virtual void sewVolumes(Dart d, Dart e, bool withBoundary = true);
//
// //!
// /*!
// *
// */
// virtual void splitVolume(std::vector<Dart>& vd);
// //@}
/*! @name Levels Management
* Operations to manage the levels of an Implicit Hierarchical 3-map
*************************************************************************/
//@{
//!
/*!
*
*/
unsigned
int
getCurrentLevel
()
;
unsigned
int
getCurrentLevel
()
;
//!
/*!
*
*/
void
setCurrentLevel
(
unsigned
int
l
)
;
void
setCurrentLevel
(
unsigned
int
l
)
;
//!
/*!
*
*/
unsigned
int
getMaxLevel
()
;
unsigned
int
getMaxLevel
()
;
//!
/*!
*
*/
unsigned
int
getDartLevel
(
Dart
d
)
;
unsigned
int
getDartLevel
(
Dart
d
)
;
//!
/*!
*
*/
void
setDartLevel
(
Dart
d
,
unsigned
int
i
)
;
void
setDartLevel
(
Dart
d
,
unsigned
int
i
)
;
//@}
/*
**************************************************
/*
! @name Id Management
*
EDGE ID MANAGEMENT *
*
Operations to manage the ids of edges and faces
***************************************************/
***************************************************
**********************
/
/**
//@{
* Give a new unique id to all the edges of the map
//! Give a new unique id to all the edges of the map
/*!
*/
*/
void
initEdgeId
()
;
void
initEdgeId
()
;
/
**
/
/! Return the next available edge id
* Return the next available edge id
/*!
*/
*/
unsigned
int
getNewEdgeId
()
;
unsigned
int
getNewEdgeId
()
;
/
**
/
/! Return the id of the edge of d
* Return the id of the edge of d
/*!
*/
*/
unsigned
int
getEdgeId
(
Dart
d
)
;
unsigned
int
getEdgeId
(
Dart
d
)
;
/
**
/
/! Set an edge id to all darts from an orbit of d
* Set an edge id to all darts from an orbit of d
/*!
*/
*/
//TODO changer l'ordre des parametres
void
setEdgeId
(
Dart
d
,
unsigned
int
i
,
unsigned
int
orbit
);
//TODO a virer
void
setEdgeId
(
Dart
d
,
unsigned
int
i
,
unsigned
int
orbit
);
void
setEdgeId
(
Dart
d
,
unsigned
int
i
);
/***************************************************
//! Give a new unique id to all the faces of the map
* FACE ID MANAGEMENT *
/*!
***************************************************/
/**
* Give a new unique id to all the faces of the map
*/
*/
void
initFaceId
()
;
void
initFaceId
()
;
/
**
/
/! Return the next available face id
* Return the next available face id
/*!
*/
*/
unsigned
int
getNewFaceId
()
;
unsigned
int
getNewFaceId
()
;
/
**
/
/! Return the id of the face of d
* Return the id of the face of d
/*!
*/
*/
unsigned
int
getFaceId
(
Dart
d
)
;
unsigned
int
getFaceId
(
Dart
d
)
;
/
**
/
/! Set a face id to all darts from an orbit of d
* Set a face id to all darts from an orbit of d
/*!
*/
*/
//TODO changer l'ordre des parametres
void
setFaceId
(
Dart
d
,
unsigned
int
i
,
unsigned
int
orbit
);
//TODO a virer
void
setFaceId
(
Dart
d
,
unsigned
int
i
,
unsigned
int
orbit
);
void
setFaceId
(
unsigned
int
orbit
,
Dart
d
);
void
setFaceId
(
unsigned
int
orbit
,
Dart
d
);
//@}
/*
**************************************************
/*
! @name Cells Information
*
CELLS INFORMATION *
*
Operations to manage the cells informations :
***************************************************/
***************************************************
**********************
/
/**
//@{
* Return the level of insertion of the vertex of d
//! Return the level of insertion of the vertex of d
/*!
*/
*/
unsigned
int
vertexInsertionLevel
(
Dart
d
)
;
unsigned
int
vertexInsertionLevel
(
Dart
d
)
;
/
**
/
/! Return the level of the edge of d in the current level map
* Return the level of the edge of d in the current level map
/*!
*/
*/
unsigned
int
edgeLevel
(
Dart
d
)
;
unsigned
int
edgeLevel
(
Dart
d
)
;
/
**
/
/! Return the level of the face of d in the current level map
* Return the level of the face of d in the current level map
/*!
*/
*/
unsigned
int
faceLevel
(
Dart
d
);
unsigned
int
faceLevel
(
Dart
d
);
/
**
/
/! Return the level of the volume of d in the current level map
* Return the level of the volume of d in the current level map
/*!
*/
*/
unsigned
int
volumeLevel
(
Dart
d
);
unsigned
int
volumeLevel
(
Dart
d
);
/
**
/
/! Return the oldest dart of the face of d in the current level map
* Return the oldest dart of the face of d in the current level map
/*!
*/
*/
Dart
faceOldestDart
(
Dart
d
);
Dart
faceOldestDart
(
Dart
d
);
/
**
/
/! Return the oldest dart of the volume of d in the current level map
* Return the oldest dart of the volume of d in the current level map
/*!
*/
*/
Dart
volumeOldestDart
(
Dart
d
);
Dart
volumeOldestDart
(
Dart
d
);
/
**
/
/! Return true if the edge of d in the current level map
* Return true if the edge of d in the curren
t level
map
//! has already been subdivided to the nex
t level
* has already been subdivided to the next level
/*!
*/
*/
bool
edgeIsSubdivided
(
Dart
d
)
;
bool
edgeIsSubdivided
(
Dart
d
)
;
/
**
/
/! Return true if the face of d in the current level map
* Return true if the face of d in the curren
t level
map
//! has already been subdivided to the nex
t level
* has already been subdivided to the next level
/*!
*/
*/
bool
faceIsSubdivided
(
Dart
d
)
;
bool
faceIsSubdivided
(
Dart
d
)
;
/
**
/
/! Return true if the volume of d in the current level map
* Return true if the volume of d in the curren
t level
map
//! has already been subdivided to the nex
t level
* has already been subdivided to the next level
/*!
*/
*/
bool
volumeIsSubdivided
(
Dart
d
);
bool
volumeIsSubdivided
(
Dart
d
);
/
**
/
/! Return true if the edge of d in the current level map
* Return true if the edge of d in the curren
t level
map
//! is subdivided to the nex
t level
,
*
is subdivided to the next level
,
//! none of
i
t
s
resulting edges is in turn
subdivided to the next level
* none of its resulting edges is in turn subdivided to the next level
//! and the middle vertex is of degree 2
* and the middle vertex is of degree 2
/*!
*/
*/
bool
edgeCanBeCoarsened
(
Dart
d
);
bool
edgeCanBeCoarsened
(
Dart
d
);
/
**
/
/!
*
/*!
*/
*/
bool
faceCanBeCoarsened
(
Dart
d
);
bool
faceCanBeCoarsened
(
Dart
d
);
/
**
/
/!
*
/*!
*/
*/
bool
faceIsSubdividedOnce
(
Dart
d
);
bool
faceIsSubdividedOnce
(
Dart
d
);
/
**
/
/!
*
/*!
*/
*/
bool
volumeIsSubdividedOnce
(
Dart
d
);
bool
volumeIsSubdividedOnce
(
Dart
d
);
/
**
/
/!
*
/*!
*/
*/
bool
neighborhoodLevelDiffersByOne
(
Dart
d
);
bool
neighborhoodLevelDiffersByOne
(
Dart
d
);
/
**
/
/! wired !!!
* wired !!
!
/*
!
*/
*/
bool
coarsenNeighborhoodLevelDiffersByOne
(
Dart
d
);
bool
coarsenNeighborhoodLevelDiffersByOne
(
Dart
d
);
//@}
/*! @name Cell Functors
* Redefition of the 3-maps map traversor
*************************************************************************/
//@{
virtual
Dart
begin
()
;
virtual
Dart
end
()
;
virtual
void
next
(
Dart
&
d
)
;
virtual
bool
foreach_dart_of_vertex
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
)
;
virtual
bool
foreach_dart_of_edge
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
)
;
bool
foreach_dart_of_oriented_face
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
);
virtual
bool
foreach_dart_of_face
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
)
;
bool
foreach_dart_of_oriented_volume
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
);
virtual
bool
foreach_dart_of_volume
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
)
;
virtual
bool
foreach_dart_of_cc
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
)
;
//@}
}
;
}
;
//
template <typename T>
template
<
typename
T
>
//
class AttributeHandler_IHM : public AttributeHandler<T>
class
AttributeHandler_IHM
:
public
AttributeHandler
<
T
>
//
{
{
//
public:
public:
//
typedef T DATA_TYPE ;
typedef
T
DATA_TYPE
;
//
//
AttributeHandler_IHM() : AttributeHandler<T>()
AttributeHandler_IHM
()
:
AttributeHandler
<
T
>
()
//
{}
{}
//
//
AttributeHandler_IHM(GenericMap* m, AttributeMultiVector<T>* amv) : AttributeHandler<T>(m, amv)
AttributeHandler_IHM
(
GenericMap
*
m
,
AttributeMultiVector
<
T
>*
amv
)
:
AttributeHandler
<
T
>
(
m
,
amv
)
//
{}
{}
//
//
AttributeMultiVector<T>* getDataVector() const
AttributeMultiVector
<
T
>*
getDataVector
()
const
//
{
{
//
return AttributeHandler<T>::getDataVector() ;
return
AttributeHandler
<
T
>::
getDataVector
()
;
//
}
}
//
//
bool isValid() const
bool
isValid
()
const
//
{
{
//
return AttributeHandler<T>::isValid() ;
return
AttributeHandler
<
T
>::
isValid
()
;
//
}
}
//
//
T& operator[](Dart d) ;
T
&
operator
[](
Dart
d
)
;
//
//
const T& operator[](Dart d) const ;
const
T
&
operator
[](
Dart
d
)
const
;
//
//
T& operator[](unsigned int a)
T
&
operator
[](
unsigned
int
a
)
//
{
{
//
return AttributeHandler<T>::operator[](a) ;
return
AttributeHandler
<
T
>::
operator
[](
a
)
;
//
}
}
//
//
const T& operator[](unsigned int a) const
const
T
&
operator
[](
unsigned
int
a
)
const
//
{
{
//
return AttributeHandler<T>::operator[](a) ;
return
AttributeHandler
<
T
>::
operator
[](
a
)
;
//
}
}
//
} ;
}
;
}
//namespace IHM
}
//namespace IHM
...
...
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
View file @
9e2ce59c
...
@@ -31,37 +31,37 @@ namespace Algo
...
@@ -31,37 +31,37 @@ namespace Algo
namespace
IHM
namespace
IHM
{
{
//
/***************************************************
/***************************************************
//
* ATTRIBUTES MANAGEMENT *
* ATTRIBUTES MANAGEMENT *
//
***************************************************/
***************************************************/
//
//
template <typename T>
template
<
typename
T
>
//
AttributeHandler_IHM<T> ImplicitHierarchicalMap3::addAttribute(unsigned int orbit, const std::string& nameAttr)
AttributeHandler_IHM
<
T
>
ImplicitHierarchicalMap3
::
addAttribute
(
unsigned
int
orbit
,
const
std
::
string
&
nameAttr
)
//
{
{
//
bool addNextLevelCell = false ;
bool
addNextLevelCell
=
false
;
//
if(!isOrbitEmbedded(orbit))
if
(
!
isOrbitEmbedded
(
orbit
))
//
addNextLevelCell = true ;
addNextLevelCell
=
true
;
//
//
AttributeHandler<T> h = Map3::addAttribute<T>(orbit, nameAttr) ;
AttributeHandler
<
T
>
h
=
Map3
::
addAttribute
<
T
>
(
orbit
,
nameAttr
)
;
//
//
if(addNextLevelCell)
if
(
addNextLevelCell
)
//
{
{
//
AttributeContainer& cellCont = m_attribs[orbit] ;
AttributeContainer
&
cellCont
=
m_attribs
[
orbit
]
;
//
AttributeMultiVector<unsigned int>* amv = cellCont.addAttribute<unsigned int>("nextLevelCell") ;
AttributeMultiVector
<
unsigned
int
>*
amv
=
cellCont
.
addAttribute
<
unsigned
int
>
(
"nextLevelCell"
)
;
//
m_nextLevelCell[orbit] = amv ;
m_nextLevelCell
[
orbit
]
=
amv
;
//
for(unsigned int i = cellCont.begin(); i < cellCont.end(); cellCont.next(i))
for
(
unsigned
int
i
=
cellCont
.
begin
();
i
<
cellCont
.
end
();
cellCont
.
next
(
i
))
//
amv->operator[](i) = EMBNULL ;
amv
->
operator
[](
i
)
=
EMBNULL
;
//
}
}
//
//
return AttributeHandler_IHM<T>(this, h.getDataVector()) ;
return
AttributeHandler_IHM
<
T
>
(
this
,
h
.
getDataVector
())
;
//
}
}
//
//
template <typename T>
template
<
typename
T
>
//
AttributeHandler_IHM<T> ImplicitHierarchicalMap3::getAttribute(unsigned int orbit, const std::string& nameAttr)
AttributeHandler_IHM
<
T
>
ImplicitHierarchicalMap3
::
getAttribute
(
unsigned
int
orbit
,
const
std
::
string
&
nameAttr
)
//
{
{
//
AttributeHandler<T> h = Map
2
::getAttribute<T>(orbit, nameAttr) ;
AttributeHandler
<
T
>
h
=
Map
3
::
getAttribute
<
T
>
(
orbit
,
nameAttr
)
;
//
return AttributeHandler_IHM<T>(this, h.getDataVector()) ;
return
AttributeHandler_IHM
<
T
>
(
this
,
h
.
getDataVector
())
;
//
}
}
/***************************************************
/***************************************************
* MAP TRAVERSAL *
* MAP TRAVERSAL *
...
@@ -171,50 +171,21 @@ inline Dart ImplicitHierarchicalMap3::alpha1(Dart d)
...
@@ -171,50 +171,21 @@ inline Dart ImplicitHierarchicalMap3::alpha1(Dart d)
{
{
//assert(m_dartLevel[d] <= m_curLevel || !"Access to a dart introduced after current level") ;
//assert(m_dartLevel[d] <= m_curLevel || !"Access to a dart introduced after current level") ;
return
Map3
::
alpha
1
(
d
)
;
return
phi3
(
phi_
1
(
d
)
)
;
}
}
inline
Dart
ImplicitHierarchicalMap3
::
alpha2
(
Dart
d
)
inline
Dart
ImplicitHierarchicalMap3
::
alpha2
(
Dart
d
)
{
{
assert
(
m_dartLevel
[
d
]
<=
m_curLevel
||
!
"Access to a dart introduced after current level"
)
;