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
6ad82bac
Commit
6ad82bac
authored
Nov 21, 2012
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added EmbeddedMap2::newFace to create needed cells
parent
45d8bfb6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
4 deletions
+38
-4
Apps/Tuto/tuto1.cpp
Apps/Tuto/tuto1.cpp
+4
-4
include/Topology/map/embeddedMap2.h
include/Topology/map/embeddedMap2.h
+5
-0
src/Topology/map/embeddedMap2.cpp
src/Topology/map/embeddedMap2.cpp
+29
-0
No files found.
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
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