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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
KennethVanhoey
CGoGN
Commits
193a7dae
Commit
193a7dae
authored
Jul 03, 2014
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resolve bug of deleting marked dart
parent
fdfbd068
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
227 additions
and
52 deletions
+227
-52
include/Container/attributeContainer.h
include/Container/attributeContainer.h
+2
-0
include/Container/attributeMultiVectorBool.hpp
include/Container/attributeMultiVectorBool.hpp
+35
-0
include/Topology/generic/cellmarker.h
include/Topology/generic/cellmarker.h
+88
-8
include/Topology/generic/dartmarker.h
include/Topology/generic/dartmarker.h
+99
-17
include/Topology/generic/genericmap.h
include/Topology/generic/genericmap.h
+0
-27
include/Topology/map/map2.hpp
include/Topology/map/map2.hpp
+3
-0
No files found.
include/Container/attributeContainer.h
View file @
193a7dae
...
...
@@ -146,6 +146,8 @@ public:
void
setContainerBrowser
(
ContainerBrowser
*
bro
)
{
m_currentBrowser
=
bro
;}
bool
hasBrowser
()
{
return
m_currentBrowser
!=
NULL
;
}
/**************************************
* BASIC FEATURES *
**************************************/
...
...
include/Container/attributeMultiVectorBool.hpp
View file @
193a7dae
...
...
@@ -186,6 +186,41 @@ public:
//memset(m_tableData[i],0,_BLOCKSIZE_/8);
}
inline
void
allTrue
()
{
for
(
unsigned
int
i
=
0
;
i
<
m_tableData
.
size
();
++
i
)
{
unsigned
int
*
ptr
=
m_tableData
[
i
];
for
(
unsigned
int
j
=
0
;
j
<
_BLOCKSIZE_
/
32
;
++
j
)
*
ptr
++
=
0xffffffff
;
}
//memset(m_tableData[i],0,_BLOCKSIZE_/8);
}
inline
bool
isAllFalse
()
{
for
(
unsigned
int
i
=
0
;
i
<
m_tableData
.
size
();
++
i
)
{
unsigned
int
*
ptr
=
m_tableData
[
i
];
for
(
unsigned
int
j
=
0
;
j
<
_BLOCKSIZE_
/
32
;
++
j
)
if
(
*
ptr
++
!=
0
)
return
false
;
}
return
true
;
}
inline
bool
isAllTrue
()
{
for
(
unsigned
int
i
=
0
;
i
<
m_tableData
.
size
();
++
i
)
{
unsigned
int
*
ptr
=
m_tableData
[
i
];
for
(
unsigned
int
j
=
0
;
j
<
_BLOCKSIZE_
/
32
;
++
j
)
if
(
*
ptr
++
!=
0xffffffff
)
return
false
;
}
return
true
;
}
/**************************************
* DATA ACCESS *
**************************************/
...
...
include/Topology/generic/cellmarker.h
View file @
193a7dae
...
...
@@ -200,7 +200,13 @@ public:
inline
void
markAll
()
{
assert
(
m_markVector
!=
NULL
);
m_markVector
->
allFalse
();
AttributeContainer
&
cont
=
m_map
.
template
getAttributeContainer
<
CELL
>()
;
if
(
cont
.
hasBrowser
())
for
(
unsigned
int
i
=
cont
.
begin
();
i
!=
cont
.
end
();
cont
.
next
(
i
))
this
->
m_markVector
->
setTrue
(
i
);
else
m_markVector
->
allTrue
();
}
inline
bool
isAllUnmarked
()
...
...
@@ -208,10 +214,15 @@ public:
assert
(
m_markVector
!=
NULL
);
AttributeContainer
&
cont
=
m_map
.
template
getAttributeContainer
<
CELL
>()
;
for
(
unsigned
int
i
=
cont
.
begin
();
i
!=
cont
.
end
();
cont
.
next
(
i
))
if
(
m_markVector
->
operator
[](
i
))
if
(
cont
.
hasBrowser
())
{
for
(
unsigned
int
i
=
cont
.
begin
();
i
!=
cont
.
end
();
cont
.
next
(
i
))
if
(
m_markVector
->
operator
[](
i
))
return
false
;
return
true
;
return
true
;
}
//else
return
m_markVector
->
isAllFalse
();
}
};
...
...
@@ -244,7 +255,13 @@ public:
inline
void
unmarkAll
()
{
assert
(
this
->
m_markVector
!=
NULL
);
this
->
m_markVector
->
allFalse
();
AttributeContainer
&
cont
=
this
->
m_map
.
template
getAttributeContainer
<
CELL
>()
;
if
(
cont
.
hasBrowser
())
for
(
unsigned
int
i
=
cont
.
begin
();
i
!=
cont
.
end
();
cont
.
next
(
i
))
this
->
m_markVector
->
setFalse
(
i
);
else
this
->
m_markVector
->
allFalse
();
}
};
...
...
@@ -380,32 +397,95 @@ public:
template
<
typename
MAP
,
unsigned
int
CELL
>
class
CellMarkerNoUnmark
:
public
CellMarkerBase
<
MAP
,
CELL
>
{
#ifndef NDEBUG
int
m_counter
;
#endif
public:
CellMarkerNoUnmark
(
MAP
&
map
,
unsigned
int
thread
=
0
)
:
CellMarkerBase
<
MAP
,
CELL
>
(
map
,
thread
)
#ifndef NDEBUG
,
m_counter
(
0
)
#endif
{}
CellMarkerNoUnmark
(
const
MAP
&
map
,
unsigned
int
thread
=
0
)
:
CellMarkerBase
<
MAP
,
CELL
>
(
map
,
thread
)
#ifndef NDEBUG
,
m_counter
(
0
)
#endif
{}
virtual
~
CellMarkerNoUnmark
()
{
// assert(isAllUnmarked()) ;
// CGoGN_ASSERT(this->isAllUnmarked())
#ifndef NDEBUG
if
(
m_counter
!=
0
)
{
CGoGNerr
<<
"CellMarkerNoUnmark: Warning problem unmarking not complete"
<<
CGoGNendl
;
CGoGNerr
<<
"CellMarkerNoUnmark: -> calling unmarkAll()"
<<
CGoGNendl
;
unmarkAll
();
}
#endif
}
protected:
CellMarkerNoUnmark
(
const
CellMarkerNoUnmark
&
cm
)
:
CellMarkerBase
<
MAP
,
CELL
>
(
cm
)
#ifndef NDEBUG
,
m_counter
(
cm
.
m_counter
)
#endif
{}
public:
inline
void
unmarkAll
()
{
assert
(
this
->
m_markVector
!=
NULL
);
this
->
m_markVector
->
allFalse
();
AttributeContainer
&
cont
=
this
->
m_map
.
template
getAttributeContainer
<
CELL
>()
;
if
(
cont
.
hasBrowser
())
for
(
unsigned
int
i
=
cont
.
begin
();
i
!=
cont
.
end
();
cont
.
next
(
i
))
this
->
m_markVector
->
setFalse
(
i
);
else
this
->
m_markVector
->
allFalse
();
}
#ifndef NDEBUG
inline
void
mark
(
Cell
<
CELL
>
c
)
{
if
(
this
->
isMarked
(
c
))
return
;
CellMarkerBase
<
MAP
,
CELL
>::
mark
(
c
)
;
m_counter
++
;
}
inline
void
unmark
(
Cell
<
CELL
>
c
)
{
if
(
!
this
->
isMarked
(
c
))
return
;
CellMarkerBase
<
MAP
,
CELL
>::
unmark
(
c
)
;
m_counter
--
;
}
inline
void
mark
(
unsigned
int
i
)
{
if
(
this
->
isMarked
(
i
))
return
;
CellMarkerBase
<
MAP
,
CELL
>::
mark
(
i
)
;
m_counter
++
;
}
/**
* unmark the dart
*/
inline
void
unmark
(
unsigned
int
i
)
{
if
(
!
this
->
isMarked
(
i
))
return
;
CellMarkerBase
<
MAP
,
CELL
>::
unmark
(
i
)
;
m_counter
--
;
}
#endif
};
// Selector and count functors testing for marker existence
...
...
include/Topology/generic/dartmarker.h
View file @
193a7dae
...
...
@@ -173,26 +173,34 @@ public:
{
assert
(
m_markVector
!=
NULL
);
AttributeContainer
&
cont
=
m_map
.
template
getAttributeContainer
<
DART
>()
;
for
(
unsigned
int
i
=
cont
.
begin
();
i
!=
cont
.
end
();
cont
.
next
(
i
))
m_markVector
->
setTrue
(
i
);
if
(
cont
.
hasBrowser
())
for
(
unsigned
int
i
=
cont
.
begin
();
i
!=
cont
.
end
();
cont
.
next
(
i
))
m_markVector
->
setTrue
(
i
);
else
m_markVector
->
allTrue
();
}
/**
* unmark all darts
*/
// virtual void unmarkAll() = 0 ;
inline
bool
isAllUnmarked
()
{
assert
(
m_markVector
!=
NULL
);
AttributeContainer
&
cont
=
m_map
.
template
getAttributeContainer
<
DART
>()
;
for
(
unsigned
int
i
=
cont
.
begin
();
i
!=
cont
.
end
();
cont
.
next
(
i
))
if
((
*
m_markVector
)[
i
])
return
false
;
return
true
;
if
(
cont
.
hasBrowser
())
{
for
(
unsigned
int
i
=
cont
.
begin
();
i
!=
cont
.
end
();
cont
.
next
(
i
))
if
((
*
m_markVector
)[
i
])
return
false
;
return
true
;
}
//else
return
m_markVector
->
isAllFalse
();
}
};
/**
* class that allows the marking of darts
* \warning no default constructor
...
...
@@ -222,7 +230,12 @@ protected:
public:
inline
void
unmarkAll
()
{
this
->
m_markVector
->
allFalse
();
AttributeContainer
&
cont
=
this
->
m_map
.
template
getAttributeContainer
<
DART
>();
if
(
cont
.
hasBrowser
())
for
(
unsigned
int
i
=
cont
.
begin
();
i
!=
cont
.
end
();
cont
.
next
(
i
))
this
->
m_markVector
->
setFalse
(
i
);
else
this
->
m_markVector
->
allFalse
();
}
}
;
...
...
@@ -240,14 +253,12 @@ public:
DartMarkerStore
(
MAP
&
map
,
unsigned
int
thread
=
0
)
:
DartMarkerTmpl
<
MAP
>
(
map
,
thread
)
{
// m_markedDarts.reserve(128);
m_markedDarts
=
GenericMap
::
askUIntBuffer
(
thread
);
}
DartMarkerStore
(
const
MAP
&
map
,
unsigned
int
thread
=
0
)
:
DartMarkerTmpl
<
MAP
>
(
map
,
thread
)
{
// m_markedDarts.reserve(128);
m_markedDarts
=
GenericMap
::
askUIntBuffer
(
thread
);
}
...
...
@@ -255,8 +266,6 @@ public:
{
unmarkAll
()
;
GenericMap
::
releaseUIntBuffer
(
m_markedDarts
,
this
->
m_thread
);
// assert(isAllUnmarked) ;
// CGoGN_ASSERT(isAllUnmarked())
}
protected:
...
...
@@ -286,7 +295,7 @@ public:
inline
void
unmarkAll
()
{
for
(
std
::
vector
<
unsigned
int
>::
iterator
it
=
m_markedDarts
->
begin
();
it
!=
m_markedDarts
->
end
();
++
it
)
for
(
std
::
vector
<
unsigned
int
>::
iterator
it
=
m_markedDarts
->
begin
();
it
!=
m_markedDarts
->
end
();
++
it
)
this
->
m_markVector
->
setFalse
(
*
it
);
}
}
;
...
...
@@ -299,31 +308,104 @@ public:
template
<
typename
MAP
>
class
DartMarkerNoUnmark
:
public
DartMarkerTmpl
<
MAP
>
{
#ifndef NDEBUG
int
m_counter
;
#endif
public:
DartMarkerNoUnmark
(
const
MAP
&
map
)
:
DartMarkerTmpl
<
MAP
>
(
map
)
#ifndef NDEBUG
,
m_counter
(
0
)
#endif
{}
DartMarkerNoUnmark
(
const
MAP
&
map
,
unsigned
int
thread
)
:
DartMarkerTmpl
<
MAP
>
(
map
,
thread
)
#ifndef NDEBUG
,
m_counter
(
0
)
#endif
{}
virtual
~
DartMarkerNoUnmark
()
{
// assert(isAllUnmarked) ;
// CGoGN_ASSERT(isAllUnmarked())
#ifndef NDEBUG
if
(
m_counter
!=
0
)
{
CGoGNerr
<<
"DartMarkerNoUnmark: Warning problem unmarking not complete"
<<
CGoGNendl
;
CGoGNerr
<<
"DartMarkerNoUnmark: -> calling unmarkAll()"
<<
CGoGNendl
;
unmarkAll
();
}
#endif
}
protected:
DartMarkerNoUnmark
(
const
DartMarkerNoUnmark
&
dm
)
:
DartMarkerTmpl
<
MAP
>
(
dm
)
#ifndef NDEBUG
,
m_counter
(
dm
.
m_counter
)
#endif
{}
public:
inline
void
unmarkAll
()
{
this
->
m_markVector
->
allFalse
();
AttributeContainer
&
cont
=
this
->
m_map
.
template
getAttributeContainer
<
DART
>();
if
(
cont
.
hasBrowser
())
for
(
unsigned
int
i
=
cont
.
begin
();
i
!=
cont
.
end
();
cont
.
next
(
i
))
this
->
m_markVector
->
setFalse
(
i
);
else
this
->
m_markVector
->
allFalse
();
}
#ifndef NDEBUG
inline
void
mark
(
Dart
d
)
{
if
(
this
->
isMarked
(
d
))
return
;
DartMarkerTmpl
<
MAP
>::
mark
(
d
)
;
m_counter
++
;
}
/**
* unmark the dart
*/
inline
void
unmark
(
Dart
d
)
{
if
(
!
this
->
isMarked
(
d
))
return
;
DartMarkerTmpl
<
MAP
>::
unmark
(
d
)
;
m_counter
--
;
}
template
<
unsigned
int
ORBIT
>
inline
void
markOrbit
(
Cell
<
ORBIT
>
c
)
{
assert
(
this
->
m_markVector
!=
NULL
);
this
->
m_map
.
foreach_dart_of_orbit
(
c
,
[
&
]
(
Dart
d
)
{
if
(
!
this
->
isMarked
(
d
))
{
this
->
m_markVector
->
setTrue
(
this
->
m_map
.
dartIndex
(
d
));
m_counter
++
;
}
})
;
}
template
<
unsigned
int
ORBIT
>
inline
void
unmarkOrbit
(
Cell
<
ORBIT
>
c
)
{
assert
(
this
->
m_markVector
!=
NULL
);
this
->
m_map
.
foreach_dart_of_orbit
(
c
,
[
&
]
(
Dart
d
)
{
if
(
this
->
isMarked
(
d
))
{
this
->
m_markVector
->
setFalse
(
this
->
m_map
.
dartIndex
(
d
));
m_counter
--
;
}
})
;
}
#endif
}
;
// Selector and count functors testing for marker existence
...
...
include/Topology/generic/genericmap.h
View file @
193a7dae
...
...
@@ -501,33 +501,6 @@ public:
}
;
/**
* @brief The MapManipulator class
*/
class
MapManipulator
{
protected:
std
::
string
m_name
;
public:
MapManipulator
(
const
std
::
string
&
name
,
GenericMap
*
gm
)
:
m_name
(
name
)
{
gm
->
askManipulate
(
this
);
}
~
MapManipulator
()
:
m_name
(
name
)
{
gm
->
releaseManipulate
(
this
);
}
const
std
::
string
&
name
()
{
return
m_name
;}
virtual
MapManipulator
*
create
(
GenericMap
*
gm
);
};
}
//namespace CGoGN
#include "Topology/generic/genericmap.hpp"
...
...
include/Topology/map/map2.hpp
View file @
193a7dae
...
...
@@ -227,7 +227,10 @@ void Map2<MAP_IMPL>::deleteCC(Dart d)
}
for
(
std
::
vector
<
Dart
>::
iterator
it
=
visited
.
begin
();
it
!=
visited
.
end
();
++
it
)
{
mark
.
unmark
(
*
it
);
this
->
deleteDart
(
*
it
)
;
}
}
template
<
typename
MAP_IMPL
>
...
...
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