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
Hurstel
CGoGN
Commits
55462258
Commit
55462258
authored
Nov 07, 2011
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
traversor with thread
parent
58858e5a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
18 deletions
+22
-18
include/Algo/Geometry/normal.hpp
include/Algo/Geometry/normal.hpp
+17
-12
include/Algo/Render/GL2/mapRender.hpp
include/Algo/Render/GL2/mapRender.hpp
+0
-1
include/Topology/generic/traversorCell.h
include/Topology/generic/traversorCell.h
+5
-5
No files found.
include/Algo/Geometry/normal.hpp
View file @
55462258
...
...
@@ -24,6 +24,9 @@
#include "Algo/Geometry/basic.h"
#include "Algo/Geometry/area.h"
#include "Topology/generic/traversor2.h"
#include <cmath>
namespace
CGoGN
...
...
@@ -53,20 +56,22 @@ typename PFP::VEC3 triangleNormal(typename PFP::MAP& map, Dart d, const typename
template
<
typename
PFP
>
typename
PFP
::
VEC3
newellNormal
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
typename
PFP
::
TVEC3
&
position
)
{
Dart
e
=
d
;
typename
PFP
::
VEC3
normal
(
0
);
Dart
it
=
d
;
typename
PFP
::
VEC3
N
(
0
);
Traversor2FV
<
typename
PFP
::
MAP
>
t
(
map
,
d
)
;
do
{
const
typename
PFP
::
VEC3
&
P
=
position
[
e
];
e
=
map
.
phi1
(
e
);
const
typename
PFP
::
VEC3
&
Q
=
position
[
e
];
normal
[
0
]
+=
(
P
[
1
]
-
Q
[
1
])
*
(
P
[
2
]
+
Q
[
2
]);
normal
[
1
]
+=
(
P
[
2
]
-
Q
[
2
])
*
(
P
[
0
]
+
Q
[
0
]);
normal
[
2
]
+=
(
P
[
0
]
-
Q
[
0
])
*
(
P
[
1
]
+
Q
[
1
]);
}
while
(
e
!=
d
);
normal
.
normalize
();
return
normal
;
const
typename
PFP
::
VEC3
&
P
=
position
[
it
];
it
=
map
.
phi1
(
it
);
const
typename
PFP
::
VEC3
&
Q
=
position
[
it
];
N
[
0
]
+=
(
P
[
1
]
-
Q
[
1
])
*
(
P
[
2
]
+
Q
[
2
]);
N
[
1
]
+=
(
P
[
2
]
-
Q
[
2
])
*
(
P
[
0
]
+
Q
[
0
]);
N
[
2
]
+=
(
P
[
0
]
-
Q
[
0
])
*
(
P
[
1
]
+
Q
[
1
]);
}
while
(
it
!=
d
);
N
.
normalize
();
return
N
;
}
template
<
typename
PFP
>
...
...
include/Algo/Render/GL2/mapRender.hpp
View file @
55462258
...
...
@@ -297,7 +297,6 @@ inline void MapRender::addTri(typename PFP::MAP& map, Dart d, std::vector<GLuint
if
(
map
.
phi1
(
c
)
!=
a
)
{
std
::
cout
<<
"non triangle face"
<<
std
::
endl
;
addEarTri
<
PFP
>
(
map
,
d
,
tableIndices
);
return
;
}
...
...
include/Topology/generic/traversorCell.h
View file @
55462258
...
...
@@ -40,7 +40,7 @@ private:
Dart
current
;
public:
TraversorCell
(
MAP
&
map
)
:
m
(
map
),
mark
(
map
)
TraversorCell
(
MAP
&
map
,
unsigned
int
thread
=
0
)
:
m
(
map
),
mark
(
map
,
thread
)
{}
Dart
begin
()
...
...
@@ -77,28 +77,28 @@ template <typename MAP>
class
TraversorV
:
public
TraversorCell
<
MAP
,
VERTEX
>
{
public:
TraversorV
(
MAP
&
m
)
:
TraversorCell
<
MAP
,
VERTEX
>
(
m
)
{}
TraversorV
(
MAP
&
m
,
unsigned
int
thread
=
0
)
:
TraversorCell
<
MAP
,
VERTEX
>
(
m
,
thread
)
{}
};
template
<
typename
MAP
>
class
TraversorE
:
public
TraversorCell
<
MAP
,
EDGE
>
{
public:
TraversorE
(
MAP
&
m
)
:
TraversorCell
<
MAP
,
EDGE
>
(
m
)
{}
TraversorE
(
MAP
&
m
,
unsigned
int
thread
=
0
)
:
TraversorCell
<
MAP
,
EDGE
>
(
m
,
thread
)
{}
};
template
<
typename
MAP
>
class
TraversorF
:
public
TraversorCell
<
MAP
,
FACE
>
{
public:
TraversorF
(
MAP
&
m
)
:
TraversorCell
<
MAP
,
FACE
>
(
m
)
{}
TraversorF
(
MAP
&
m
,
unsigned
int
thread
=
0
)
:
TraversorCell
<
MAP
,
FACE
>
(
m
,
thread
)
{}
};
template
<
typename
MAP
>
class
TraversorW
:
public
TraversorCell
<
MAP
,
VOLUME
>
{
public:
TraversorW
(
MAP
&
m
)
:
TraversorCell
<
MAP
,
VOLUME
>
(
m
)
{}
TraversorW
(
MAP
&
m
,
unsigned
int
thread
=
0
)
:
TraversorCell
<
MAP
,
VOLUME
>
(
m
,
thread
)
{}
};
}
// namespace CGoGN
...
...
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