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
Thomas Pitiot
CGoGN
Commits
58858e5a
Commit
58858e5a
authored
Nov 07, 2011
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correctif traversorCell
parent
109bf033
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
27 deletions
+40
-27
Apps/Examples/viewer.cpp
Apps/Examples/viewer.cpp
+1
-1
include/Algo/Import/importMesh.hpp
include/Algo/Import/importMesh.hpp
+1
-1
include/Algo/Render/GL2/mapRender.hpp
include/Algo/Render/GL2/mapRender.hpp
+17
-18
include/Topology/generic/genericmap.h
include/Topology/generic/genericmap.h
+2
-2
include/Topology/generic/traversorCell.h
include/Topology/generic/traversorCell.h
+19
-5
No files found.
Apps/Examples/viewer.cpp
View file @
58858e5a
...
...
@@ -187,7 +187,7 @@ void Viewer::importMesh(std::string& filename)
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
allDarts
,
Algo
::
Render
::
GL2
::
POINTS
)
;
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
allDarts
,
Algo
::
Render
::
GL2
::
LINES
)
;
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
allDarts
,
Algo
::
Render
::
GL2
::
TRIANGLES
)
;
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
allDarts
,
Algo
::
Render
::
GL2
::
TRIANGLES
,
false
)
;
bb
=
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
myMap
,
position
)
;
normalBaseSize
=
bb
.
diagSize
()
/
100.0
f
;
...
...
include/Algo/Import/importMesh.hpp
View file @
58858e5a
...
...
@@ -123,8 +123,8 @@ bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts)
if
(
nbnm
>
0
)
{
map
.
closeMap
();
CGoGNout
<<
"Map closed ("
<<
nbnm
<<
" boundary edges)"
<<
CGoGNendl
;
}
CGoGNout
<<
"Warning "
<<
nbnm
<<
" darts with phi2 fix points"
<<
CGoGNendl
;
return
true
;
}
...
...
include/Algo/Render/GL2/mapRender.hpp
View file @
58858e5a
...
...
@@ -297,6 +297,7 @@ 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
;
}
...
...
@@ -321,29 +322,27 @@ inline void MapRender::addTri(typename PFP::MAP& map, Dart d, std::vector<GLuint
template
<
typename
PFP
>
void
MapRender
::
initTriangles
(
typename
PFP
::
MAP
&
map
,
const
FunctorSelect
&
good
,
std
::
vector
<
GLuint
>&
tableIndices
,
unsigned
int
thread
)
{
DartMarker
m
(
map
,
thread
);
tableIndices
.
reserve
(
4
*
map
.
getNbDarts
()
/
3
);
for
(
Dart
dd
=
map
.
begin
();
dd
!=
map
.
end
();
map
.
next
(
dd
))
{
if
(
!
m
.
isMarked
(
dd
)
&&
good
(
dd
))
{
addTri
<
PFP
>
(
map
,
dd
,
tableIndices
);
m
.
markOrbit
(
FACE
,
dd
);
}
}
// DartMarker m(map, thread);
// tableIndices.reserve(4 * map.getNbDarts() / 3);
//
//// TraversorF<typename PFP::MAP> trav(map);
// TraversorCell<typename PFP::MAP,FACE> trav(map);
//
// for (Dart d = trav.begin(); d!= trav.end(); d = trav.next())
// for(Dart dd = map.begin(); dd != map.end(); map.next(dd))
// {
// if (good(d))
// addTri<PFP>(map, d, tableIndices);
// if(!m.isMarked(dd) && good(dd))
// {
// addTri<PFP>(map, dd, tableIndices);
// m.markOrbit(FACE, dd);
// }
// }
DartMarker
m
(
map
,
thread
);
tableIndices
.
reserve
(
4
*
map
.
getNbDarts
()
/
3
);
TraversorF
<
typename
PFP
::
MAP
>
trav
(
map
);
for
(
Dart
d
=
trav
.
begin
();
d
!=
trav
.
end
();
d
=
trav
.
next
())
{
if
(
good
(
d
))
addTri
<
PFP
>
(
map
,
d
,
tableIndices
);
}
}
template
<
typename
PFP
>
...
...
include/Topology/generic/genericmap.h
View file @
58858e5a
...
...
@@ -75,10 +75,8 @@ class AttributeHandlerGen ;
class
GenericMap
:
public
MapBrowser
{
template
<
typename
T
>
friend
class
AttributeHandler
;
template
<
typename
T
>
friend
class
AutoAttributeHandler
;
template
<
typename
T
>
friend
class
SelectorNoBoundary
;
protected:
/**
...
...
@@ -419,11 +417,13 @@ protected:
*/
void
boundaryUnmark
(
Dart
d
);
public:
/**
* test if a dart belong to the boundary
*/
bool
isBoundaryMarked
(
Dart
d
);
protected:
/**
* mark an orbit of dart as belonging to boundary
*/
...
...
include/Topology/generic/traversorCell.h
View file @
58858e5a
...
...
@@ -47,6 +47,8 @@ public:
{
mark
.
unmarkAll
()
;
current
=
m
.
begin
()
;
while
(
m
.
isBoundaryMarked
(
current
))
m
.
next
(
current
)
;
if
(
current
==
m
.
end
())
current
=
NIL
;
else
...
...
@@ -58,7 +60,7 @@ public:
{
if
(
current
!=
NIL
)
{
while
(
current
!=
NIL
&&
mark
.
isMarked
(
current
))
while
(
current
!=
NIL
&&
(
mark
.
isMarked
(
current
)
||
m
.
isBoundaryMarked
(
current
))
)
{
m
.
next
(
current
)
;
if
(
current
==
m
.
end
())
...
...
@@ -73,19 +75,31 @@ public:
template
<
typename
MAP
>
class
TraversorV
:
public
TraversorCell
<
MAP
,
VERTEX
>
{};
{
public:
TraversorV
(
MAP
&
m
)
:
TraversorCell
<
MAP
,
VERTEX
>
(
m
)
{}
};
template
<
typename
MAP
>
class
TraversorE
:
public
TraversorCell
<
MAP
,
EDGE
>
{};
{
public:
TraversorE
(
MAP
&
m
)
:
TraversorCell
<
MAP
,
EDGE
>
(
m
)
{}
};
template
<
typename
MAP
>
class
TraversorF
:
public
TraversorCell
<
MAP
,
FACE
>
{};
{
public:
TraversorF
(
MAP
&
m
)
:
TraversorCell
<
MAP
,
FACE
>
(
m
)
{}
};
template
<
typename
MAP
>
class
TraversorW
:
public
TraversorCell
<
MAP
,
VOLUME
>
{};
{
public:
TraversorW
(
MAP
&
m
)
:
TraversorCell
<
MAP
,
VOLUME
>
(
m
)
{}
};
}
// 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