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
e0942ffc
Commit
e0942ffc
authored
Feb 10, 2012
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
boolean to chose to share vertex embeddings
parent
03b5d009
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
19 deletions
+41
-19
include/Topology/map/map2MR/map2MR_Primal.h
include/Topology/map/map2MR/map2MR_Primal.h
+14
-14
src/Topology/map/map2MR/map2MR_Primal.cpp
src/Topology/map/map2MR/map2MR_Primal.cpp
+27
-5
No files found.
include/Topology/map/map2MR/map2MR_Primal.h
View file @
e0942ffc
...
...
@@ -32,23 +32,12 @@ namespace CGoGN
class
Map2MR_Primal
:
public
EmbeddedMap2
{
protected:
bool
shareVertexEmbeddings
;
public:
Map2MR_Primal
()
;
void
copyVertexEmbeddings
()
{
unsigned
int
maxL
=
getMaxLevel
()
;
for
(
unsigned
int
i
=
m_mrattribs
.
begin
();
i
!=
m_mrattribs
.
end
();
m_mrattribs
.
next
(
i
))
{
unsigned
int
previdx
=
(
*
m_mrDarts
[
maxL
-
1
])[
i
]
;
unsigned
int
newidx
=
(
*
m_mrDarts
[
maxL
])[
i
]
;
unsigned
int
emb
=
(
*
m_embeddings
[
VERTEX
])[
previdx
]
;
(
*
m_embeddings
[
VERTEX
])[
newidx
]
=
emb
;
if
(
emb
!=
EMBNULL
)
m_attribs
[
VERTEX
].
refLine
(
emb
);
}
}
/***************************************************
* CELLS INFORMATION *
***************************************************/
...
...
@@ -106,10 +95,21 @@ public:
*/
bool
faceIsSubdividedOnce
(
Dart
d
)
;
/***************************************************
* EMBEDDINGS MANAGEMENT *
***************************************************/
void
copyVertexEmbeddings
()
;
/***************************************************
* SUBDIVISION *
***************************************************/
/**
* add a new resolution level
*/
void
addNewLevel
()
;
/**
* subdivide the edge of d to the next level
*/
...
...
src/Topology/map/map2MR/map2MR_Primal.cpp
View file @
e0942ffc
...
...
@@ -27,7 +27,7 @@
namespace
CGoGN
{
Map2MR_Primal
::
Map2MR_Primal
()
Map2MR_Primal
::
Map2MR_Primal
()
:
shareVertexEmbeddings
(
true
)
{
initMR
()
;
}
...
...
@@ -248,10 +248,35 @@ bool Map2MR_Primal::faceIsSubdividedOnce(Dart d)
return
false
;
}
/***************************************************
* EMBEDDINGS MANAGEMENT *
***************************************************/
void
Map2MR_Primal
::
copyVertexEmbeddings
()
{
unsigned
int
maxL
=
getMaxLevel
()
;
for
(
unsigned
int
i
=
m_mrattribs
.
begin
();
i
!=
m_mrattribs
.
end
();
m_mrattribs
.
next
(
i
))
{
unsigned
int
previdx
=
(
*
m_mrDarts
[
maxL
-
1
])[
i
]
;
unsigned
int
newidx
=
(
*
m_mrDarts
[
maxL
])[
i
]
;
unsigned
int
emb
=
(
*
m_embeddings
[
VERTEX
])[
previdx
]
;
(
*
m_embeddings
[
VERTEX
])[
newidx
]
=
emb
;
if
(
emb
!=
EMBNULL
)
m_attribs
[
VERTEX
].
refLine
(
emb
);
}
}
/***************************************************
* SUBDIVISION *
***************************************************/
void
Map2MR_Primal
::
addNewLevel
()
{
addLevel
()
;
if
(
shareVertexEmbeddings
)
copyVertexEmbeddings
()
;
}
void
Map2MR_Primal
::
subdivideEdge
(
Dart
d
)
{
assert
(
getDartLevel
(
d
)
<=
getCurrentLevel
()
||
!
"subdivideEdge : called with a dart introduced after current level"
)
;
...
...
@@ -262,10 +287,7 @@ void Map2MR_Primal::subdivideEdge(Dart d)
pushLevel
()
;
if
(
eLevel
==
getMaxLevel
())
{
addLevel
()
;
copyVertexEmbeddings
()
;
}
addNewLevel
()
;
setCurrentLevel
(
eLevel
+
1
)
;
cutEdge
(
d
)
;
...
...
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