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
CGoGN
CGoGN
Commits
8c66db32
Commit
8c66db32
authored
May 12, 2014
by
Sylvain Thery
Browse files
Merge branch 'develop' of cgogn.u-strasbg.fr:~kraemer/CGoGN into develop
parents
248431e8
5fa57ec1
Changes
6
Hide whitespace changes
Inline
Side-by-side
SCHNApps/include/mapHandler.h
View file @
8c66db32
...
...
@@ -99,39 +99,11 @@ public:
const
AttributeSet
&
getAttributeSet
(
unsigned
int
orbit
)
const
{
return
m_attribs
[
orbit
];
}
void
notifyAttributeModification
(
const
AttributeHandlerGen
&
attr
)
{
QString
nameAttr
=
QString
::
fromStdString
(
attr
.
name
());
if
(
m_vbo
.
contains
(
nameAttr
))
m_vbo
[
nameAttr
]
->
updateData
(
attr
);
emit
(
attributeModified
(
attr
.
getOrbit
(),
nameAttr
));
foreach
(
View
*
view
,
l_views
)
view
->
updateGL
();
}
void
notifyConnectivityModification
()
{
if
(
m_render
)
{
m_render
->
setPrimitiveDirty
(
Algo
::
Render
::
GL2
::
POINTS
);
m_render
->
setPrimitiveDirty
(
Algo
::
Render
::
GL2
::
LINES
);
m_render
->
setPrimitiveDirty
(
Algo
::
Render
::
GL2
::
TRIANGLES
);
m_render
->
setPrimitiveDirty
(
Algo
::
Render
::
GL2
::
BOUNDARY
);
}
for
(
unsigned
int
orbit
=
0
;
orbit
<
NB_ORBITS
;
++
orbit
)
{
foreach
(
CellSelectorGen
*
cs
,
m_cellSelectors
[
orbit
])
cs
->
rebuild
();
}
void
notifyAttributeModification
(
const
AttributeHandlerGen
&
attr
);
emit
(
c
onnectivityModifi
ed
()
);
void
notifyC
onnectivityModifi
cation
(
);
foreach
(
View
*
view
,
l_views
)
view
->
updateGL
();
}
void
clear
(
bool
removeAttrib
);
/*********************************************************
* MANAGE VBOs
...
...
@@ -184,6 +156,7 @@ signals:
void
attributeAdded
(
unsigned
int
orbit
,
const
QString
&
nameAttr
);
void
attributeModified
(
unsigned
int
orbit
,
QString
nameAttr
);
void
attributeRemoved
(
unsigned
int
orbit
,
const
QString
&
nameAttr
);
void
vboAdded
(
Utils
::
VBO
*
vbo
);
void
vboRemoved
(
Utils
::
VBO
*
vbo
);
...
...
SCHNApps/src/mapHandler.cpp
View file @
8c66db32
...
...
@@ -29,6 +29,96 @@ MapHandlerGen::~MapHandlerGen()
delete
vbo
;
}
/*********************************************************
* MANAGE ATTRIBUTES
*********************************************************/
void
MapHandlerGen
::
notifyAttributeModification
(
const
AttributeHandlerGen
&
attr
)
{
QString
nameAttr
=
QString
::
fromStdString
(
attr
.
name
());
if
(
m_vbo
.
contains
(
nameAttr
))
m_vbo
[
nameAttr
]
->
updateData
(
attr
);
emit
(
attributeModified
(
attr
.
getOrbit
(),
nameAttr
));
foreach
(
View
*
view
,
l_views
)
view
->
updateGL
();
}
void
MapHandlerGen
::
notifyConnectivityModification
()
{
if
(
m_render
)
{
m_render
->
setPrimitiveDirty
(
Algo
::
Render
::
GL2
::
POINTS
);
m_render
->
setPrimitiveDirty
(
Algo
::
Render
::
GL2
::
LINES
);
m_render
->
setPrimitiveDirty
(
Algo
::
Render
::
GL2
::
TRIANGLES
);
m_render
->
setPrimitiveDirty
(
Algo
::
Render
::
GL2
::
BOUNDARY
);
}
for
(
unsigned
int
orbit
=
0
;
orbit
<
NB_ORBITS
;
++
orbit
)
{
foreach
(
CellSelectorGen
*
cs
,
m_cellSelectors
[
orbit
])
cs
->
rebuild
();
}
emit
(
connectivityModified
());
foreach
(
View
*
view
,
l_views
)
view
->
updateGL
();
}
void
MapHandlerGen
::
clear
(
bool
removeAttrib
)
{
if
(
m_render
)
{
m_render
->
setPrimitiveDirty
(
Algo
::
Render
::
GL2
::
POINTS
);
m_render
->
setPrimitiveDirty
(
Algo
::
Render
::
GL2
::
LINES
);
m_render
->
setPrimitiveDirty
(
Algo
::
Render
::
GL2
::
TRIANGLES
);
m_render
->
setPrimitiveDirty
(
Algo
::
Render
::
GL2
::
BOUNDARY
);
}
for
(
unsigned
int
orbit
=
0
;
orbit
<
NB_ORBITS
;
++
orbit
)
{
foreach
(
CellSelectorGen
*
cs
,
m_cellSelectors
[
orbit
])
cs
->
rebuild
();
}
std
::
vector
<
std
::
string
>
attrs
[
NB_ORBITS
];
for
(
unsigned
int
orbit
=
0
;
orbit
<
NB_ORBITS
;
++
orbit
)
{
if
(
m_map
->
isOrbitEmbedded
(
orbit
))
{
AttributeContainer
&
cont
=
m_map
->
getAttributeContainer
(
orbit
);
cont
.
getAttributesNames
(
attrs
[
orbit
]);
}
}
m_map
->
clear
(
removeAttrib
);
for
(
unsigned
int
orbit
=
0
;
orbit
<
NB_ORBITS
;
++
orbit
)
{
for
(
unsigned
int
i
=
0
;
i
<
attrs
[
orbit
].
size
();
++
i
)
{
QString
name
=
QString
::
fromStdString
(
attrs
[
orbit
][
i
]);
if
(
removeAttrib
)
{
if
(
orbit
==
VERTEX
)
deleteVBO
(
name
);
emit
(
attributeRemoved
(
orbit
,
name
));
}
else
{
if
(
orbit
==
VERTEX
)
updateVBO
(
name
);
emit
(
attributeModified
(
orbit
,
name
));
}
}
}
emit
(
connectivityModified
());
}
/*********************************************************
* MANAGE VBOs
*********************************************************/
...
...
include/Topology/generic/mapImpl/mapMono.h
View file @
8c66db32
...
...
@@ -126,9 +126,13 @@ public:
/**
* Apply a functor on each dart of the map
* @param f a
ref to the functor obj
* @param f a
callable taking a Dart parameter
*/
bool
foreach_dart
(
FunctorType
&
f
)
;
template
<
typename
FUNC
>
void
foreach_dart
(
FUNC
f
)
;
template
<
typename
FUNC
>
void
foreach_dart
(
FUNC
&
f
)
;
/****************************************
* SAVE & LOAD *
...
...
include/Topology/generic/mapImpl/mapMono.hpp
View file @
8c66db32
...
...
@@ -228,7 +228,19 @@ inline void MapMono::next(Dart& d) const
m_attribs
[
DART
].
next
(
d
.
index
)
;
}
inline
bool
MapMono
::
foreach_dart
(
FunctorType
&
f
)
template
<
typename
FUNC
>
inline
void
MapMono
::
foreach_dart
(
FUNC
f
)
{
for
(
Dart
d
=
begin
();
d
!=
end
();
next
(
d
))
{
if
(
f
(
d
))
return
true
;
}
return
false
;
}
template
<
typename
FUNC
>
inline
void
MapMono
::
foreach_dart
(
FUNC
&
f
)
{
for
(
Dart
d
=
begin
();
d
!=
end
();
next
(
d
))
{
...
...
include/Topology/generic/mapImpl/mapMulti.h
View file @
8c66db32
...
...
@@ -280,9 +280,13 @@ public:
/**
* Apply a functor on each dart of the map
* @param f a
ref to the functor obj
* @param f a
callable taking a Dart parameter
*/
bool
foreach_dart
(
FunctorType
&
f
)
;
template
<
typename
FUNC
>
void
foreach_dart
(
FUNC
f
)
;
template
<
typename
FUNC
>
void
foreach_dart
(
FUNC
&
f
)
;
/****************************************
* SAVE & LOAD *
...
...
include/Topology/generic/mapImpl/mapMulti.hpp
View file @
8c66db32
...
...
@@ -439,7 +439,19 @@ inline void MapMulti::next(Dart& d) const
d
.
index
=
m_mrattribs
.
end
();
}
inline
bool
MapMulti
::
foreach_dart
(
FunctorType
&
f
)
template
<
typename
FUNC
>
inline
void
MapMulti
::
foreach_dart
(
FUNC
f
)
{
for
(
Dart
d
=
begin
();
d
!=
end
();
next
(
d
))
{
if
(
f
(
d
))
return
true
;
}
return
false
;
}
template
<
typename
FUNC
>
inline
void
MapMulti
::
foreach_dart
(
FUNC
&
f
)
{
for
(
Dart
d
=
begin
();
d
!=
end
();
next
(
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