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
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
CGoGN
CGoGN
Commits
3619c00b
Commit
3619c00b
authored
Feb 22, 2011
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correction de bugs pour les Containers
parent
443b9e63
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
31 additions
and
64 deletions
+31
-64
include/Algo/ImplicitHierarchicalMesh/ihm.h
include/Algo/ImplicitHierarchicalMesh/ihm.h
+1
-1
include/Algo/ImplicitHierarchicalMesh/ihm.hpp
include/Algo/ImplicitHierarchicalMesh/ihm.hpp
+5
-6
include/Container/attributeContainer.h
include/Container/attributeContainer.h
+4
-4
include/Container/attributeContainer.hpp
include/Container/attributeContainer.hpp
+10
-10
include/Topology/generic/attribmap.hpp
include/Topology/generic/attribmap.hpp
+3
-4
include/Topology/generic/attributeHandler.hpp
include/Topology/generic/attributeHandler.hpp
+5
-7
include/Topology/generic/genericmap.h
include/Topology/generic/genericmap.h
+0
-16
include/Topology/generic/genericmap.hpp
include/Topology/generic/genericmap.hpp
+0
-13
src/Topology/generic/genericmap.cpp
src/Topology/generic/genericmap.cpp
+3
-3
No files found.
include/Algo/ImplicitHierarchicalMesh/ihm.h
View file @
3619c00b
...
@@ -211,7 +211,7 @@ public:
...
@@ -211,7 +211,7 @@ public:
AttributeHandler_IHM
()
:
AttributeHandler
<
T
>
()
AttributeHandler_IHM
()
:
AttributeHandler
<
T
>
()
{}
{}
AttributeHandler_IHM
(
GenericMap
*
m
,
unsigned
int
orbit
,
unsigned
int
index
)
:
AttributeHandler
<
T
>
(
m
,
orbit
,
index
)
AttributeHandler_IHM
(
GenericMap
*
m
,
AttributeMultiVector
<
T
>*
amv
)
:
AttributeHandler
<
T
>
(
m
,
amv
)
{}
{}
AttributeMultiVector
<
T
>*
getDataVector
()
const
AttributeMultiVector
<
T
>*
getDataVector
()
const
...
...
include/Algo/ImplicitHierarchicalMesh/ihm.hpp
View file @
3619c00b
...
@@ -47,21 +47,20 @@ AttributeHandler_IHM<T> ImplicitHierarchicalMap::addAttribute(unsigned int orbit
...
@@ -47,21 +47,20 @@ AttributeHandler_IHM<T> ImplicitHierarchicalMap::addAttribute(unsigned int orbit
if
(
addNextLevelCell
)
if
(
addNextLevelCell
)
{
{
AttributeContainer
&
cellCont
=
m_attribs
[
orbit
]
;
AttributeContainer
&
cellCont
=
m_attribs
[
orbit
]
;
unsigned
int
index
=
cellCont
.
addAttribute
<
unsigned
int
>
(
"nextLevelCell"
)
;
AttributeMultiVector
<
unsigned
int
>*
amv
=
cellCont
.
addAttribute
<
unsigned
int
>
(
"nextLevelCell"
)
;
AttributeMultiVector
<
unsigned
int
>&
amv
=
cellCont
.
getDataVector
<
unsigned
int
>
(
index
)
;
m_nextLevelCell
[
orbit
]
=
amv
;
m_nextLevelCell
[
orbit
]
=
&
amv
;
for
(
unsigned
int
i
=
cellCont
.
begin
();
i
<
cellCont
.
end
();
cellCont
.
next
(
i
))
for
(
unsigned
int
i
=
cellCont
.
begin
();
i
<
cellCont
.
end
();
cellCont
.
next
(
i
))
amv
[
i
]
=
EMBNULL
;
amv
->
operator
[](
i
)
=
EMBNULL
;
}
}
return
AttributeHandler_IHM
<
T
>
(
this
,
h
.
get
Orbit
(),
h
.
getIndex
())
;
return
AttributeHandler_IHM
<
T
>
(
this
,
h
.
get
DataVector
())
;
}
}
template
<
typename
T
>
template
<
typename
T
>
AttributeHandler_IHM
<
T
>
ImplicitHierarchicalMap
::
getAttribute
(
unsigned
int
orbit
,
const
std
::
string
&
nameAttr
)
AttributeHandler_IHM
<
T
>
ImplicitHierarchicalMap
::
getAttribute
(
unsigned
int
orbit
,
const
std
::
string
&
nameAttr
)
{
{
AttributeHandler
<
T
>
h
=
Map2
::
getAttribute
<
T
>
(
orbit
,
nameAttr
)
;
AttributeHandler
<
T
>
h
=
Map2
::
getAttribute
<
T
>
(
orbit
,
nameAttr
)
;
return
AttributeHandler_IHM
<
T
>
(
this
,
h
.
get
Orbit
(),
h
.
getIndex
())
;
return
AttributeHandler_IHM
<
T
>
(
this
,
h
.
get
DataVector
())
;
}
}
/***************************************************
/***************************************************
...
...
include/Container/attributeContainer.h
View file @
3619c00b
...
@@ -347,18 +347,18 @@ public:
...
@@ -347,18 +347,18 @@ public:
* @param attrIndex index of the attribute
* @param attrIndex index of the attribute
*/
*/
template
<
typename
T
>
template
<
typename
T
>
AttributeMultiVector
<
T
>
&
getDataVector
(
unsigned
int
attrIndex
);
AttributeMultiVector
<
T
>
*
getDataVector
(
unsigned
int
attrIndex
);
AttributeMultiVectorGen
&
getVirtualDataVector
(
unsigned
int
attrIndex
);
AttributeMultiVectorGen
*
getVirtualDataVector
(
unsigned
int
attrIndex
);
/**
/**
* get an AttributeMultiVector
* get an AttributeMultiVector
* @param attribName name of the attribute
* @param attribName name of the attribute
*/
*/
template
<
typename
T
>
template
<
typename
T
>
AttributeMultiVector
<
T
>
&
getDataVector
(
const
std
::
string
&
attribName
);
AttributeMultiVector
<
T
>
*
getDataVector
(
const
std
::
string
&
attribName
);
AttributeMultiVectorGen
&
getVirtualDataVector
(
const
std
::
string
&
attribName
);
AttributeMultiVectorGen
*
getVirtualDataVector
(
const
std
::
string
&
attribName
);
/**
/**
* get a given element of a given attribute
* get a given element of a given attribute
...
...
include/Container/attributeContainer.hpp
View file @
3619c00b
...
@@ -262,38 +262,38 @@ inline bool AttributeContainer::swapAttributes(unsigned int index1, unsigned int
...
@@ -262,38 +262,38 @@ inline bool AttributeContainer::swapAttributes(unsigned int index1, unsigned int
**************************************/
**************************************/
template
<
typename
T
>
template
<
typename
T
>
AttributeMultiVector
<
T
>
&
AttributeContainer
::
getDataVector
(
unsigned
int
attrIndex
)
AttributeMultiVector
<
T
>
*
AttributeContainer
::
getDataVector
(
unsigned
int
attrIndex
)
{
{
assert
(
attrIndex
<
m_tableAttribs
.
size
()
||
!
"getDataVector: attribute index out of bounds"
);
assert
(
attrIndex
<
m_tableAttribs
.
size
()
||
!
"getDataVector: attribute index out of bounds"
);
assert
(
m_tableAttribs
[
attrIndex
]
!=
NULL
||
!
"getDataVector: attribute does not exist"
);
assert
(
m_tableAttribs
[
attrIndex
]
!=
NULL
||
!
"getDataVector: attribute does not exist"
);
AttributeMultiVector
<
T
>*
atm
=
dynamic_cast
<
AttributeMultiVector
<
T
>*>
(
m_tableAttribs
[
attrIndex
]);
AttributeMultiVector
<
T
>*
atm
=
dynamic_cast
<
AttributeMultiVector
<
T
>*>
(
m_tableAttribs
[
attrIndex
]);
assert
((
atm
!=
NULL
)
||
!
"getDataVector: wrong type"
);
assert
((
atm
!=
NULL
)
||
!
"getDataVector: wrong type"
);
return
*
atm
;
return
atm
;
}
}
inline
AttributeMultiVectorGen
&
AttributeContainer
::
getVirtualDataVector
(
unsigned
int
attrIndex
)
inline
AttributeMultiVectorGen
*
AttributeContainer
::
getVirtualDataVector
(
unsigned
int
attrIndex
)
{
{
return
*
(
m_tableAttribs
[
attrIndex
])
;
return
m_tableAttribs
[
attrIndex
]
;
}
}
template
<
typename
T
>
template
<
typename
T
>
AttributeMultiVector
<
T
>
&
AttributeContainer
::
getDataVector
(
const
std
::
string
&
attribName
)
AttributeMultiVector
<
T
>
*
AttributeContainer
::
getDataVector
(
const
std
::
string
&
attribName
)
{
{
unsigned
int
index
=
getAttributeIndex
(
attribName
)
;
unsigned
int
index
=
getAttributeIndex
(
attribName
)
;
if
(
index
==
UNKNOWN
)
assert
(
index
!=
UNKNOWN
)
;
return
NULL
;
AttributeMultiVector
<
T
>*
atm
=
dynamic_cast
<
AttributeMultiVector
<
T
>*>
(
m_tableAttribs
[
index
]);
AttributeMultiVector
<
T
>*
atm
=
dynamic_cast
<
AttributeMultiVector
<
T
>*>
(
m_tableAttribs
[
index
]);
assert
((
atm
!=
NULL
)
||
!
"getDataVector: wrong type"
);
assert
((
atm
!=
NULL
)
||
!
"getDataVector: wrong type"
);
return
*
atm
;
return
atm
;
}
}
inline
AttributeMultiVectorGen
&
AttributeContainer
::
getVirtualDataVector
(
const
std
::
string
&
attribName
)
inline
AttributeMultiVectorGen
*
AttributeContainer
::
getVirtualDataVector
(
const
std
::
string
&
attribName
)
{
{
unsigned
int
index
=
getAttributeIndex
(
attribName
)
;
unsigned
int
index
=
getAttributeIndex
(
attribName
)
;
assert
(
index
!=
UNKNOWN
)
;
assert
(
index
!=
UNKNOWN
)
;
return
*
(
m_tableAttribs
[
index
])
;
return
m_tableAttribs
[
index
]
;
}
}
template
<
typename
T
>
template
<
typename
T
>
...
...
include/Topology/generic/attribmap.hpp
View file @
3619c00b
...
@@ -30,8 +30,7 @@ inline AttributeHandler<T> AttribMap::addAttribute(unsigned int orbit, const std
...
@@ -30,8 +30,7 @@ inline AttributeHandler<T> AttribMap::addAttribute(unsigned int orbit, const std
{
{
if
(
!
isOrbitEmbedded
(
orbit
))
if
(
!
isOrbitEmbedded
(
orbit
))
addEmbedding
(
orbit
)
;
addEmbedding
(
orbit
)
;
AttributeContainer
&
cellCont
=
m_attribs
[
orbit
]
;
AttributeMultiVector
<
T
>*
amv
=
m_attribs
[
orbit
].
addAttribute
<
T
>
(
nameAttr
)
;
AttributeMultiVector
<
T
>*
amv
=
cellCont
.
addAttribute
<
T
>
(
nameAttr
)
;
return
AttributeHandler
<
T
>
(
this
,
amv
)
;
return
AttributeHandler
<
T
>
(
this
,
amv
)
;
}
}
...
@@ -46,8 +45,8 @@ template <typename T>
...
@@ -46,8 +45,8 @@ template <typename T>
inline
AttributeHandler
<
T
>
AttribMap
::
getAttribute
(
unsigned
int
orbit
,
const
std
::
string
&
nameAttr
)
inline
AttributeHandler
<
T
>
AttribMap
::
getAttribute
(
unsigned
int
orbit
,
const
std
::
string
&
nameAttr
)
{
{
assert
(
isOrbitEmbedded
(
orbit
)
||
!
"Invalid parameter: orbit not embedded"
);
assert
(
isOrbitEmbedded
(
orbit
)
||
!
"Invalid parameter: orbit not embedded"
);
AttributeMultiVector
<
T
>
&
amv
=
m_attribs
[
orbit
].
getDataVector
<
T
>
(
nameAttr
)
;
AttributeMultiVector
<
T
>
*
amv
=
m_attribs
[
orbit
].
getDataVector
<
T
>
(
nameAttr
)
;
return
AttributeHandler
<
T
>
(
this
,
&
amv
)
;
return
AttributeHandler
<
T
>
(
this
,
amv
)
;
}
}
template
<
typename
T
>
template
<
typename
T
>
...
...
include/Topology/generic/attributeHandler.hpp
View file @
3619c00b
...
@@ -27,10 +27,8 @@ namespace CGoGN
...
@@ -27,10 +27,8 @@ namespace CGoGN
template
<
typename
T
>
template
<
typename
T
>
AttributeHandler
<
T
>::
AttributeHandler
(
GenericMap
*
m
,
AttributeMultiVector
<
T
>*
amv
)
:
AttributeHandler
<
T
>::
AttributeHandler
(
GenericMap
*
m
,
AttributeMultiVector
<
T
>*
amv
)
:
m_map
(
m
)
m_map
(
m
),
m_attrib
(
amv
)
{
{}
m_attrib
=
amv
;
}
template
<
typename
T
>
template
<
typename
T
>
AttributeHandler
<
T
>::
AttributeHandler
(
const
AttributeHandler
<
T
>&
ta
)
:
AttributeHandler
<
T
>::
AttributeHandler
(
const
AttributeHandler
<
T
>&
ta
)
:
...
@@ -81,9 +79,9 @@ const std::string& AttributeHandler<T>::name() const
...
@@ -81,9 +79,9 @@ const std::string& AttributeHandler<T>::name() const
template
<
typename
T
>
template
<
typename
T
>
bool
AttributeHandler
<
T
>::
isValid
()
const
bool
AttributeHandler
<
T
>::
isValid
()
const
{
{
return
(
m_
attrib
->
getIndex
()
!=
AttributeContainer
::
UNKNOWN
&&
return
(
m_
map
!=
NULL
&&
m_
map
!=
NULL
&&
m_
attrib
!=
NULL
&&
m_attrib
!=
NULL
)
;
m_attrib
->
getIndex
()
!=
AttributeContainer
::
UNKNOWN
)
;
}
}
template
<
typename
T
>
template
<
typename
T
>
...
...
include/Topology/generic/genericmap.h
View file @
3619c00b
...
@@ -230,22 +230,6 @@ public:
...
@@ -230,22 +230,6 @@ public:
*/
*/
AttributeContainer
&
getAttributeContainer
(
unsigned
int
orbit
);
AttributeContainer
&
getAttributeContainer
(
unsigned
int
orbit
);
/**
* get a multi vector of attribute (direct access with [i])
* @param orbit orbit of attribute
* @param index index of attribute
*/
template
<
typename
T
>
AttributeMultiVector
<
T
>&
getAttributeVector
(
unsigned
int
orbit
,
unsigned
int
index
);
/**
* get a virtual multi vector of attribute
* No access to data, useful for access to address (VBO)
* @param orbit orbit of attribute
* @param index index of attribute
*/
AttributeMultiVectorGen
&
getAttributeVectorGen
(
unsigned
int
orbit
,
unsigned
int
index
);
/**
/**
* get a multi vector of marker attribute (direct access with [i])
* get a multi vector of marker attribute (direct access with [i])
* @param orbit code
* @param orbit code
...
...
include/Topology/generic/genericmap.hpp
View file @
3619c00b
...
@@ -221,19 +221,6 @@ inline AttributeContainer& GenericMap::getAttributeContainer(unsigned int orbit)
...
@@ -221,19 +221,6 @@ inline AttributeContainer& GenericMap::getAttributeContainer(unsigned int orbit)
return
m_attribs
[
orbit
]
;
return
m_attribs
[
orbit
]
;
}
}
template
<
typename
T
>
inline
AttributeMultiVector
<
T
>&
GenericMap
::
getAttributeVector
(
unsigned
int
orbit
,
unsigned
int
index
)
{
assert
(
index
!=
AttributeContainer
::
UNKNOWN
)
;
return
m_attribs
[
orbit
].
getDataVector
<
T
>
(
index
)
;
}
inline
AttributeMultiVectorGen
&
GenericMap
::
getAttributeVectorGen
(
unsigned
int
orbit
,
unsigned
int
index
)
{
assert
(
index
!=
AttributeContainer
::
UNKNOWN
)
;
return
m_attribs
[
orbit
].
getVirtualDataVector
(
index
)
;
}
inline
AttributeMultiVector
<
Mark
>*
GenericMap
::
getMarkerVector
(
unsigned
int
orbit
)
inline
AttributeMultiVector
<
Mark
>*
GenericMap
::
getMarkerVector
(
unsigned
int
orbit
)
{
{
return
m_markerTables
[
orbit
]
;
return
m_markerTables
[
orbit
]
;
...
...
src/Topology/generic/genericmap.cpp
View file @
3619c00b
...
@@ -169,9 +169,9 @@ void GenericMap::update_m_emb_afterLoad()
...
@@ -169,9 +169,9 @@ void GenericMap::update_m_emb_afterLoad()
{
{
unsigned
int
orb
=
listeNames
[
i
][
4
]
-
'0'
;
// easy atoi computation for one char;
unsigned
int
orb
=
listeNames
[
i
][
4
]
-
'0'
;
// easy atoi computation for one char;
AttributeMultiVector
<
unsigned
int
>
&
amv
=
cont
.
getDataVector
<
unsigned
int
>
(
i
);
AttributeMultiVector
<
unsigned
int
>
*
amv
=
cont
.
getDataVector
<
unsigned
int
>
(
i
);
m_embeddings
[
orb
]
=
&
amv
;
m_embeddings
[
orb
]
=
amv
;
std
::
cout
<<
"Ajoute m_emb["
<<
orb
<<
"]:"
<<
i
<<
std
::
endl
;
std
::
cout
<<
"Ajoute m_emb["
<<
orb
<<
"] : "
<<
i
<<
std
::
endl
;
}
}
}
}
}
}
...
...
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