Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CGoGN
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
CGoGN
CGoGN
Commits
549f0bff
Commit
549f0bff
authored
Dec 16, 2014
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resolve bug of deleted marked darts
parent
09aaaf4e
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
228 additions
and
82 deletions
+228
-82
CMakeLists.txt
CMakeLists.txt
+3
-3
include/Container/attributeContainer.h
include/Container/attributeContainer.h
+15
-1
include/Container/attributeContainer.hpp
include/Container/attributeContainer.hpp
+21
-3
include/Topology/generic/genericmap.hpp
include/Topology/generic/genericmap.hpp
+1
-2
include/Utils/xml.h
include/Utils/xml.h
+1
-1
src/Container/attributeContainer.cpp
src/Container/attributeContainer.cpp
+169
-56
src/Topology/generic/genericmap.cpp
src/Topology/generic/genericmap.cpp
+18
-16
No files found.
CMakeLists.txt
View file @
549f0bff
...
...
@@ -59,6 +59,7 @@ find_package(OpenGL REQUIRED)
find_package
(
Boost COMPONENTS regex REQUIRED
)
find_package
(
ZLIB REQUIRED
)
#find_package(LibXml2 REQUIRED)
find_package
(
TinyXml2 REQUIRED
)
find_package
(
GLEW REQUIRED
)
# MESSAGE HERE FOR MORE EASY USER READING
...
...
@@ -98,7 +99,7 @@ SET (CGoGN_EXT_INCLUDES
${
OPENGL_INCLUDE_DIR
}
${
GLEW_INCLUDE_DIRS
}
${
ZLIB_INCLUDE_DIRS
}
# ${LIB
XML2_INCLUDE_DIR}
${
TINY
XML2_INCLUDE_DIR
}
${
Boost_INCLUDE_DIRS
}
)
...
...
@@ -108,8 +109,7 @@ SET (CGoGN_EXT_LIBS
${
OPENGL_LIBRARY
}
${
GLEW_LIBRARIES
}
${
ZLIB_LIBRARIES
}
# ${LIBXML2_LIBRARIES}
tinyxml2
${
TINYXML2_LIBRARY
}
${
Boost_REGEX_LIBRARY
}
)
...
...
include/Container/attributeContainer.h
View file @
549f0bff
...
...
@@ -38,7 +38,6 @@ namespace CGoGN
class
RegisteredBaseAttribute
;
class
AttributeContainer
;
class
ContainerBrowser
{
public:
...
...
@@ -73,6 +72,11 @@ protected:
*/
std
::
vector
<
AttributeMultiVectorGen
*>
m_tableAttribs
;
/**
* vector of pointers to AttributeMultiVectors of MarkerBool
*/
std
::
vector
<
AttributeMultiVector
<
MarkerBool
>*>
m_tableMarkerAttribs
;
/**
* vector of free indices in the vector of AttributeMultiVectors
*/
...
...
@@ -158,6 +162,10 @@ public:
template
<
typename
T
>
AttributeMultiVector
<
T
>*
addAttribute
(
const
std
::
string
&
attribName
);
/// special version for marker
AttributeMultiVector
<
MarkerBool
>*
addMarkerAttribute
(
const
std
::
string
&
attribName
);
/**
* add a new attribute to the container
* @param typeName type of the new attribute in a string
...
...
@@ -187,6 +195,8 @@ public:
template
<
typename
T
>
bool
removeAttribute
(
const
std
::
string
&
attribName
);
bool
removeMarkerAttribute
(
const
std
::
string
&
attribName
);
/**
* Remove an attribute (destroys data)
* @param index index of the attribute to remove
...
...
@@ -322,6 +332,7 @@ public:
*/
unsigned
int
getAttributesNames
(
std
::
vector
<
std
::
string
>&
names
)
const
;
/**
* fill a vector with attribute type names
* @param types vector of type names
...
...
@@ -329,6 +340,8 @@ public:
*/
unsigned
int
getAttributesTypes
(
std
::
vector
<
std
::
string
>&
types
);
std
::
vector
<
AttributeMultiVector
<
MarkerBool
>*>&
getMarkerAttributes
();
/**************************************
* CONTAINER MANAGEMENT *
**************************************/
...
...
@@ -444,6 +457,7 @@ public:
AttributeMultiVectorGen
*
getVirtualDataVector
(
unsigned
int
attrIndex
);
/**
* get an AttributeMultiVector
* @param attribName name of the attribute
...
...
include/Container/attributeContainer.hpp
View file @
549f0bff
...
...
@@ -43,6 +43,11 @@ inline void AttributeContainer::setOrbit(unsigned int orbit)
if
(
m_tableAttribs
[
i
]
!=
NULL
)
m_tableAttribs
[
i
]
->
setOrbit
(
orbit
);
}
for
(
unsigned
int
i
=
0
;
i
<
m_tableMarkerAttribs
.
size
();
++
i
)
{
m_tableMarkerAttribs
[
i
]
->
setOrbit
(
orbit
);
}
}
inline
void
AttributeContainer
::
setRegistry
(
std
::
map
<
std
::
string
,
RegisteredBaseAttribute
*
>*
re
)
...
...
@@ -340,10 +345,9 @@ inline void AttributeContainer::initLine(unsigned int index)
inline
void
AttributeContainer
::
initMarkersOfLine
(
unsigned
int
index
)
{
for
(
unsigned
int
i
=
0
;
i
<
m_tableAttribs
.
size
();
++
i
)
for
(
unsigned
int
i
=
0
;
i
<
m_table
Marker
Attribs
.
size
();
++
i
)
{
if
((
m_tableAttribs
[
i
]
!=
NULL
)
&&
(
m_tableAttribs
[
i
]
->
isMarkerBool
()))
m_tableAttribs
[
i
]
->
initElt
(
index
);
m_tableMarkerAttribs
[
i
]
->
initElt
(
index
);
}
}
...
...
@@ -355,6 +359,12 @@ inline void AttributeContainer::copyLine(unsigned int dstIndex, unsigned int src
if
(
m_tableAttribs
[
i
]
!=
NULL
)
m_tableAttribs
[
i
]
->
copyElt
(
dstIndex
,
srcIndex
);
}
for
(
unsigned
int
i
=
0
;
i
<
m_tableMarkerAttribs
.
size
();
++
i
)
{
m_tableMarkerAttribs
[
i
]
->
copyElt
(
dstIndex
,
srcIndex
);
}
}
inline
void
AttributeContainer
::
refLine
(
unsigned
int
index
)
...
...
@@ -490,4 +500,12 @@ inline void AttributeContainer::setData(unsigned int attrIndex, unsigned int elt
atm
->
operator
[](
eltIndex
)
=
data
;
}
inline
std
::
vector
<
AttributeMultiVector
<
MarkerBool
>*>&
AttributeContainer
::
getMarkerAttributes
()
{
return
m_tableMarkerAttribs
;
}
}
// namespace CGoGN
include/Topology/generic/genericmap.hpp
View file @
549f0bff
...
...
@@ -211,7 +211,6 @@ inline unsigned int GenericMap::newCell()
unsigned
int
c
=
m_attribs
[
ORBIT
].
insertLine
();
m_attribs
[
ORBIT
].
initMarkersOfLine
(
c
);
return
c
;
// return m_attribs[ORBIT].insertLine();
}
template
<
unsigned
int
ORBIT
>
...
...
@@ -291,7 +290,7 @@ AttributeMultiVector<MarkerBool>* GenericMap::askMarkVector()
x
=
x
/
10
;
number
[
0
]
=
'0'
+
x
%
10
;
AttributeMultiVector
<
MarkerBool
>*
amv
=
m_attribs
[
ORBIT
].
add
Attribute
<
MarkerBool
>
(
"marker_"
+
orbitName
(
ORBIT
)
+
number
);
AttributeMultiVector
<
MarkerBool
>*
amv
=
m_attribs
[
ORBIT
].
add
MarkerAttribute
(
"marker_"
+
orbitName
(
ORBIT
)
+
number
);
return
amv
;
}
}
...
...
include/Utils/xml.h
View file @
549f0bff
...
...
@@ -49,7 +49,7 @@ inline std::string XMLAttribute(tinyxml2::XMLElement* node, const char* attName)
const
char
*
ptr
=
node
->
Attribute
(
attName
);
if
(
ptr
==
NULL
)
{
CGoGNerr
<<
"Warning attrbute "
<<
attName
<<
" not found"
<<
CGoGNendl
;
CGoGNerr
<<
"Warning attr
i
bute "
<<
attName
<<
" not found"
<<
CGoGNendl
;
return
""
;
}
return
std
::
string
(
ptr
);
...
...
src/Container/attributeContainer.cpp
View file @
549f0bff
This diff is collapsed.
Click to expand it.
src/Topology/generic/genericmap.cpp
View file @
549f0bff
...
...
@@ -235,8 +235,8 @@ void GenericMap::init(bool addBoundaryMarkers)
if
(
addBoundaryMarkers
)
{
m_boundaryMarkers
[
0
]
=
m_attribs
[
DART
].
add
Attribute
<
MarkerBool
>
(
"BoundaryMark0"
)
;
m_boundaryMarkers
[
1
]
=
m_attribs
[
DART
].
add
Attribute
<
MarkerBool
>
(
"BoundaryMark1"
)
;
m_boundaryMarkers
[
0
]
=
m_attribs
[
DART
].
add
MarkerAttribute
(
"BoundaryMark0"
)
;
m_boundaryMarkers
[
1
]
=
m_attribs
[
DART
].
add
MarkerAttribute
(
"BoundaryMark1"
)
;
}
...
...
@@ -405,17 +405,16 @@ void GenericMap::restore_shortcuts()
}
// MARKERS
m_attribs
[
DART
].
getAttributesNames
(
listeNames
);
for
(
unsigned
int
i
=
0
;
i
<
listeNames
.
size
();
++
i
)
std
::
vector
<
AttributeMultiVector
<
MarkerBool
>*>&
amvv
=
m_attribs
[
DART
].
getMarkerAttributes
();
for
(
auto
it
=
amvv
.
begin
();
it
!=
amvv
.
end
();
++
it
)
{
if
(
listeNames
[
i
]
==
"BoundaryMark0"
)
m_boundaryMarkers
[
0
]
=
cont
.
getDataVector
<
MarkerBool
>
(
i
);
if
(
listeNames
[
i
]
==
"BoundaryMark1"
)
m_boundaryMarkers
[
1
]
=
cont
.
getDataVector
<
MarkerBool
>
(
i
);
if
((
*
it
)
->
getName
()
==
"BoundaryMark0"
)
m_boundaryMarkers
[
0
]
=
*
it
;
if
((
*
it
)
->
getName
()
==
"BoundaryMark1"
)
m_boundaryMarkers
[
1
]
=
*
it
;
}
// QUICK TRAVERSAL
for
(
unsigned
int
orbit
=
0
;
orbit
<
NB_ORBITS
;
++
orbit
)
...
...
@@ -603,17 +602,20 @@ void GenericMap::garbageMarkVectors()
for
(
unsigned
int
orbit
=
0
;
orbit
<
NB_ORBITS
;
++
orbit
)
{
std
::
vector
<
std
::
string
>
attNames
;
m_attribs
[
orbit
].
getAttributesNames
(
attNames
);
for
(
auto
sit
=
attNames
.
begin
();
sit
!=
attNames
.
end
();
++
sit
)
std
::
vector
<
AttributeMultiVector
<
MarkerBool
>*>&
amvv
=
m_attribs
[
orbit
].
getMarkerAttributes
()
;
for
(
auto
it
=
amvv
.
begin
();
it
!=
amvv
.
end
();
++
it
)
{
if
(
sit
->
substr
(
0
,
7
)
==
"marker_"
)
AttributeMultiVector
<
MarkerBool
>*
amv
=
*
it
;
const
std
::
string
&
name
=
amv
->
getName
();
if
(
name
.
substr
(
0
,
7
)
==
"marker_"
)
{
std
::
string
num
=
sit
->
substr
(
sit
->
length
()
-
3
,
3
);
// store tne next free index for unique numbering
std
::
string
num
=
name
.
substr
(
name
.
length
()
-
3
,
3
);
unsigned
int
id
=
100
*
(
num
[
0
]
-
'0'
)
+
10
*
(
num
[
1
]
-
'0'
)
+
(
num
[
2
]
-
'0'
);
if
(
id
>
maxId
)
maxId
=
id
;
AttributeMultiVector
<
MarkerBool
>*
amv
=
m_attribs
[
orbit
].
getDataVector
<
MarkerBool
>
(
*
sit
);
amv
->
allFalse
();
m_markVectors_free
[
orbit
][
0
].
push_back
(
amv
);
}
...
...
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