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
62612054
Commit
62612054
authored
Oct 27, 2011
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
premier ajout traversors
parent
adcec296
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
283 additions
and
0 deletions
+283
-0
include/Topology/generic/traversor1.h
include/Topology/generic/traversor1.h
+125
-0
include/Topology/generic/traversor2.h
include/Topology/generic/traversor2.h
+158
-0
No files found.
include/Topology/generic/traversor1.h
0 → 100644
View file @
62612054
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2011, 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.u-strasbg.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#ifndef __TRAVERSOR1_H__
#define __TRAVERSOR1_H__
#include "Topology/generic/dart.h"
namespace
CGoGN
{
// Traverse the edges incident to a given vertex
template
<
typename
MAP
>
class
Traversor1VE
{
private:
MAP
&
m
;
Dart
start
;
Dart
current
;
public:
Traversor1VE
(
MAP
&
map
,
Dart
dart
)
:
m
(
map
),
start
(
dart
)
{}
Dart
begin
()
{
current
=
start
;
return
current
;
}
Dart
end
()
{
return
NIL
;
}
Dart
next
()
{
current
=
current
==
start
?
m
.
phi_1
(
start
)
:
NIL
;
return
current
;
}
}
;
// Traverse the vertices adjacent to a given vertex through sharing a common edge
class
Traversor1VVaE
{
private:
MAP
&
m
;
Dart
start
;
Dart
current
;
public:
Traversor1VVaE
(
MAP
&
map
,
Dart
dart
)
:
m
(
map
)
{
start
=
m
.
phi_1
(
dart
)
;
}
Dart
begin
()
{
current
=
start
;
return
current
;
}
Dart
end
()
{
return
NIL
;
}
Dart
next
()
{
current
=
current
==
start
?
m
.
phi1
(
m
.
phi1
(
start
))
:
NIL
;
return
current
;
}
}
;
// Traverse the vertices incident to a given edge
template
<
typename
MAP
>
class
Traversor1EV
{
private:
MAP
&
m
;
Dart
start
;
Dart
current
;
public:
Traversor1EV
(
MAP
&
map
,
Dart
dart
)
:
m
(
map
),
start
(
dart
)
{}
Dart
begin
()
{
current
=
start
;
return
current
;
}
Dart
end
()
{
return
NIL
;
}
Dart
next
()
{
current
=
current
==
start
?
m
.
phi1
(
start
)
:
NIL
;
return
current
;
}
}
;
// Traverse the edges adjacent to a given edge through sharing a common vertex
class
Traversor1EEaV
{
private:
MAP
&
m
;
Dart
start
;
Dart
current
;
public:
Traversor1EEaV
(
MAP
&
map
,
Dart
dart
)
:
m
(
map
)
{
start
=
m
.
phi_1
(
dart
)
;
}
Dart
begin
()
{
current
=
start
;
return
current
;
}
Dart
end
()
{
return
NIL
;
}
Dart
next
()
{
current
=
current
==
start
?
m
.
phi1
(
m
.
phi1
(
start
))
:
NIL
;
return
current
;
}
}
;
}
// namespace CGoGN
#endif
include/Topology/generic/traversor2.h
0 → 100644
View file @
62612054
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2011, 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.u-strasbg.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#ifndef __TRAVERSOR2_H__
#define __TRAVERSOR2_H__
#include "Topology/generic/dart.h"
namespace
CGoGN
{
// Traverse the edges incident to a given vertex
template
<
typename
MAP
>
class
Traversor2VE
{
private:
MAP
&
m
;
Dart
start
;
Dart
current
;
public:
Traversor2VE
(
MAP
&
map
,
Dart
dart
)
:
m
(
map
),
start
(
dart
)
{}
Dart
begin
()
{
current
=
start
;
return
current
;
}
Dart
end
()
{
return
NIL
;
}
Dart
next
()
{
if
(
current
!=
NIL
)
{
current
=
m
.
alpha1
(
current
)
;
if
(
current
==
start
)
current
=
NIL
;
}
return
current
;
}
}
;
// Traverse the faces incident to a given vertex
template
<
typename
MAP
>
class
Traversor2VF
{
private:
MAP
&
m
;
Dart
start
;
Dart
current
;
public:
Traversor2VF
(
MAP
&
map
,
Dart
dart
)
:
m
(
map
),
start
(
dart
)
{}
Dart
begin
()
{
current
=
start
;
return
current
;
}
Dart
end
()
{
return
NIL
;
}
Dart
next
()
{
if
(
current
!=
NIL
)
{
current
=
m
.
alpha1
(
current
)
;
if
(
m
.
isBoundarymarked
(
current
))
current
=
m
.
alpha1
(
current
)
;
if
(
current
==
start
)
current
=
NIL
;
}
return
current
;
}
}
;
// Traverse the vertices adjacent to a given vertex through sharing a common edge
template
<
typename
MAP
>
class
Traversor2VVaE
{
private:
MAP
&
m
;
Dart
start
;
Dart
current
;
public:
Traversor2VVaE
(
MAP
&
map
,
Dart
dart
)
:
m
(
map
)
{
start
=
m
.
phi2
(
dart
)
;
}
Dart
begin
()
{
current
=
start
;
return
current
;
}
Dart
end
()
{
return
NIL
;
}
Dart
next
()
{
if
(
current
!=
NIL
)
{
current
=
m
.
phi_1
(
m
.
phi2
(
current
))
;
if
(
current
==
start
)
current
=
NIL
;
}
return
current
;
}
}
;
// Traverse the vertices adjacent to a given vertex through sharing a common face
template
<
typename
MAP
>
class
Traversor2VVaF
{
private:
MAP
&
m
;
Dart
start
;
Dart
current
;
Dart
stop
;
public:
Traversor2VVaF
(
MAP
&
map
,
Dart
dart
)
:
m
(
map
)
{
start
=
m
.
phi1
(
dart
)
;
stop
=
m
.
phi_1
(
dart
)
;
}
Dart
begin
()
{
current
=
start
;
return
current
;
}
Dart
end
()
{
return
NIL
;
}
Dart
next
()
{
if
(
current
!=
NIL
)
{
current
=
m
.
phi1
(
current
)
;
if
(
current
==
stop
)
{
Dart
d
=
m
.
phi2
(
current
)
;
current
=
m
.
phi1
(
d
)
;
stop
=
m
.
phi_1
(
d
)
;
}
if
(
current
==
start
)
current
=
NIL
;
}
return
current
;
}
}
;
}
// namespace CGoGN
#endif
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