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
Etienne Schmitt
CGoGN
Commits
e7e2e4e8
Commit
e7e2e4e8
authored
Apr 06, 2011
by
Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removeAttribute corriger pour mettre a jour le cout mémoire
parent
73378a04
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
68 additions
and
54 deletions
+68
-54
include/Algo/MovingObjects/particle_cell_2D.h
include/Algo/MovingObjects/particle_cell_2D.h
+1
-0
include/Container/attributeContainer.h
include/Container/attributeContainer.h
+7
-0
include/Container/attributeContainer.hpp
include/Container/attributeContainer.hpp
+57
-1
include/Geometry/orientation.hpp
include/Geometry/orientation.hpp
+1
-1
include/Topology/generic/attribmap.hpp
include/Topology/generic/attribmap.hpp
+1
-1
src/Container/attributeContainer.cpp
src/Container/attributeContainer.cpp
+0
-50
src/Topology/generic/genericmap.cpp
src/Topology/generic/genericmap.cpp
+1
-1
No files found.
include/Algo/MovingObjects/particle_cell_2D.h
View file @
e7e2e4e8
...
...
@@ -75,6 +75,7 @@ class ParticleCell2D : public ParticleBase
{
changeCell
=
false
;
if
(
!
Geom
::
arePointsEquals
(
newCurrent
,
m_position
))
{
// std::cout << "-- " << m_position << "--" << newCurrent << std::endl;
prevPos
=
m_position
;
switch
(
state
)
{
...
...
include/Container/attributeContainer.h
View file @
e7e2e4e8
...
...
@@ -159,6 +159,7 @@ public:
* @param attribName name of the attribute to remove
* @return removed or not
*/
template
<
typename
T
>
bool
removeAttribute
(
const
std
::
string
&
attribName
);
/**
...
...
@@ -166,6 +167,7 @@ public:
* @param index index of the attribute to remove
* @return removed or not
*/
template
<
typename
T
>
bool
removeAttribute
(
unsigned
int
index
);
/**************************************
...
...
@@ -192,6 +194,11 @@ public:
*/
unsigned
int
memoryTotalSize
()
const
;
/**
* Memory cost of every used line
*/
unsigned
int
memorySize
()
const
;
/**
* is the line used in the container
*/
...
...
include/Container/attributeContainer.hpp
View file @
e7e2e4e8
...
...
@@ -139,6 +139,57 @@ void AttributeContainer::addAttribute(const std::string& attribName, const std::
m_nbAttributes
++
;
}
template
<
typename
T
>
bool
AttributeContainer
::
removeAttribute
(
const
std
::
string
&
attribName
)
{
unsigned
int
index
=
getAttributeIndex
(
attribName
)
;
if
(
index
==
UNKNOWN
)
{
std
::
cerr
<<
"removeAttribute by name: attribute not found"
<<
std
::
endl
;
return
false
;
}
// delete the attribute
delete
m_tableAttribs
[
index
]
;
m_tableAttribs
[
index
]
=
NULL
;
if
(
index
==
m_tableAttribs
.
size
()
-
1
)
m_tableAttribs
.
pop_back
()
;
else
m_freeIndices
.
push_back
(
index
)
;
--
m_nbAttributes
;
m_lineCost
-=
sizeof
(
T
);
return
true
;
}
template
<
typename
T
>
bool
AttributeContainer
::
removeAttribute
(
unsigned
int
index
)
{
if
(
m_tableAttribs
[
index
]
==
NULL
)
{
std
::
cerr
<<
"removeAttribute by index: attribute not found"
<<
std
::
endl
;
return
false
;
}
// delete the attribute
delete
m_tableAttribs
[
index
]
;
m_tableAttribs
[
index
]
=
NULL
;
if
(
index
==
m_tableAttribs
.
size
()
-
1
)
m_tableAttribs
.
pop_back
()
;
else
m_freeIndices
.
push_back
(
index
)
;
--
m_nbAttributes
;
m_lineCost
-=
sizeof
(
T
);
return
true
;
}
/**************************************
* INFO ABOUT THE CONTAINER *
**************************************/
...
...
@@ -160,7 +211,12 @@ inline unsigned int AttributeContainer::capacity() const
inline
unsigned
int
AttributeContainer
::
memoryTotalSize
()
const
{
return
_BLOCKSIZE_
*
(
m_holesBlocks
.
size
()
*
m_lineCost
+
8
);
return
capacity
()
*
(
m_lineCost
+
8
);
}
inline
unsigned
int
AttributeContainer
::
memorySize
()
const
{
return
size
()
*
(
m_lineCost
+
8
);
}
inline
bool
AttributeContainer
::
used
(
unsigned
int
index
)
const
...
...
include/Geometry/orientation.hpp
View file @
e7e2e4e8
...
...
@@ -36,7 +36,7 @@ Orientation2D testOrientation2D(const VEC3& P, const VEC3& Pa, const VEC3& Pb)
typedef
typename
VEC3
::
DATA_TYPE
T
;
// const T min = std::numeric_limits<T>::min()*T(100);
const
T
min
=
0.000
00
1
;
const
T
min
=
0.0001
;
// T wsof = (Pa[0]-P[0])*(P[1]-Pb[1])-(P[0]-Pb[0])*(Pa[1]-P[1]);
T
wsof
=
(
P
[
0
]
-
Pa
[
0
])
*
(
Pb
[
1
]
-
Pa
[
1
])
-
(
Pb
[
0
]
-
Pa
[
0
])
*
(
P
[
1
]
-
Pa
[
1
]);
...
...
include/Topology/generic/attribmap.hpp
View file @
e7e2e4e8
...
...
@@ -38,7 +38,7 @@ template <typename T>
inline
bool
AttribMap
::
removeAttribute
(
AttributeHandler
<
T
>&
attr
)
{
assert
(
attr
.
isValid
()
||
!
"Invalid attribute handler"
)
;
return
m_attribs
[
attr
.
getOrbit
()].
removeAttribute
(
attr
.
getIndex
())
;
return
m_attribs
[
attr
.
getOrbit
()].
removeAttribute
<
T
>
(
attr
.
getIndex
())
;
}
template
<
typename
T
>
...
...
src/Container/attributeContainer.cpp
View file @
e7e2e4e8
...
...
@@ -50,56 +50,6 @@ AttributeContainer::~AttributeContainer()
{
}
/**************************************
* BASIC FEATURES *
**************************************/
bool
AttributeContainer
::
removeAttribute
(
const
std
::
string
&
attribName
)
{
unsigned
int
index
=
getAttributeIndex
(
attribName
)
;
if
(
index
==
UNKNOWN
)
{
std
::
cerr
<<
"removeAttribute by name: attribute not found"
<<
std
::
endl
;
return
false
;
}
// delete the attribute
delete
m_tableAttribs
[
index
]
;
m_tableAttribs
[
index
]
=
NULL
;
if
(
index
==
m_tableAttribs
.
size
()
-
1
)
m_tableAttribs
.
pop_back
()
;
else
m_freeIndices
.
push_back
(
index
)
;
--
m_nbAttributes
;
return
true
;
}
bool
AttributeContainer
::
removeAttribute
(
unsigned
int
index
)
{
if
(
m_tableAttribs
[
index
]
==
NULL
)
{
std
::
cerr
<<
"removeAttribute by index: attribute not found"
<<
std
::
endl
;
return
false
;
}
// delete the attribute
delete
m_tableAttribs
[
index
]
;
m_tableAttribs
[
index
]
=
NULL
;
if
(
index
==
m_tableAttribs
.
size
()
-
1
)
m_tableAttribs
.
pop_back
()
;
else
m_freeIndices
.
push_back
(
index
)
;
--
m_nbAttributes
;
return
true
;
}
/**************************************
* INFO ABOUT ATTRIBUTES *
**************************************/
...
...
src/Topology/generic/genericmap.cpp
View file @
e7e2e4e8
...
...
@@ -194,7 +194,7 @@ void GenericMap::removeThreadMarker(unsigned int nb)
std
::
stringstream
ss
;
ss
<<
"Mark_"
<<
th
;
AttributeContainer
&
cellCont
=
m_attribs
[
i
]
;
cellCont
.
removeAttribute
(
ss
.
str
())
;
cellCont
.
removeAttribute
<
Mark
>
(
ss
.
str
())
;
m_markerTables
[
i
][
th
]
=
NULL
;
}
}
...
...
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