Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Hurstel
CGoGN
Commits
6ad82bac
Commit
6ad82bac
authored
Nov 21, 2012
by
Pierre Kraemer
Browse files
added EmbeddedMap2::newFace to create needed cells
parent
45d8bfb6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Apps/Tuto/tuto1.cpp
View file @
6ad82bac
...
...
@@ -46,6 +46,10 @@ int main(int argc, char **argv)
void
MyQT
::
createMap
()
{
// creation of a new attribute on vertices of type 3D vector for position.
// a handler to this attribute is returned
position
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
>
(
"position"
);
// creation of 2 new faces: 1 triangle and 1 square
Dart
d1
=
myMap
.
newFace
(
3
);
Dart
d2
=
myMap
.
newFace
(
4
);
...
...
@@ -53,10 +57,6 @@ void MyQT::createMap()
// sew these faces along one of their edge
myMap
.
sewFaces
(
d1
,
d2
);
// creation of a new attribute on vertices of type 3D vector for position.
// a handler to this attribute is returned
position
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
>
(
"position"
);
// affect position by moving in the map
position
[
d1
]
=
VEC3
(
0
,
0
,
0
);
position
[
PHI1
(
d1
)]
=
VEC3
(
2
,
0
,
0
);
...
...
include/Topology/map/embeddedMap2.h
View file @
6ad82bac
...
...
@@ -39,6 +39,11 @@ class EmbeddedMap2 : public Map2
public:
typedef
Map2
TOPO_MAP
;
/*
*
*/
virtual
Dart
newFace
(
unsigned
int
nbEdges
,
bool
withBoundary
=
true
)
;
/**
* The attributes attached to the old vertex are duplicated on both resulting vertices
*/
...
...
src/Topology/map/embeddedMap2.cpp
View file @
6ad82bac
...
...
@@ -30,6 +30,35 @@
namespace
CGoGN
{
Dart
EmbeddedMap2
::
newFace
(
unsigned
int
nbEdges
,
bool
withBoundary
)
{
Dart
d
=
Map2
::
newFace
(
nbEdges
,
withBoundary
);
if
(
withBoundary
)
{
if
(
isOrbitEmbedded
<
VERTEX
>
())
{
Traversor2FV
<
EmbeddedMap2
>
t
(
*
this
,
d
);
for
(
Dart
it
=
t
.
begin
();
it
!=
t
.
end
();
it
=
t
.
next
())
initOrbitEmbeddingNewCell
<
VERTEX
>
(
it
)
;
}
if
(
isOrbitEmbedded
<
EDGE
>
())
{
Traversor2FE
<
EmbeddedMap2
>
t
(
*
this
,
d
);
for
(
Dart
it
=
t
.
begin
();
it
!=
t
.
end
();
it
=
t
.
next
())
initOrbitEmbeddingNewCell
<
EDGE
>
(
it
)
;
}
if
(
isOrbitEmbedded
<
FACE
>
())
{
initOrbitEmbeddingNewCell
<
FACE
>
(
d
)
;
initOrbitEmbeddingNewCell
<
FACE
>
(
phi2
(
d
))
;
}
}
return
d
;
}
void
EmbeddedMap2
::
splitVertex
(
Dart
d
,
Dart
e
)
{
Dart
dd
=
phi2
(
d
)
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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