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
A
acgl
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
ACGL
acgl
Commits
d6ad6ee1
Commit
d6ad6ee1
authored
Mar 29, 2012
by
Janis Born
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add ArrayBufferControlFile::nameAttribute
parent
70431458
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletion
+24
-1
include/ACGL/OpenGL/Controller/ArrayBufferControlFile.hh
include/ACGL/OpenGL/Controller/ArrayBufferControlFile.hh
+16
-0
src/ACGL/OpenGL/Controller/ArrayBufferControlFile.cc
src/ACGL/OpenGL/Controller/ArrayBufferControlFile.cc
+8
-1
No files found.
include/ACGL/OpenGL/Controller/ArrayBufferControlFile.hh
View file @
d6ad6ee1
...
...
@@ -11,11 +11,19 @@
#include <ACGL/OpenGL/Objects/ArrayBuffer.hh>
#include <ACGL/OpenGL/Controller/DataControlFile.hh>
#include <map>
#include <string>
namespace
ACGL
{
namespace
OpenGL
{
class
ArrayBufferControlFile
:
public
Resource
::
FileController
<
ArrayBuffer
>
{
// ===================================================================================================== \/
// ============================================================================================ TYPEDEFS \/
// ===================================================================================================== \/
typedef
std
::
map
<
uint_t
,
std
::
string
>
AttributeNameMap
;
// ========================================================================================================= \/
// ============================================================================================ CONSTRUCTORS \/
// ========================================================================================================= \/
...
...
@@ -33,6 +41,13 @@ public:
// ==================================================================================================== \/
// ============================================================================================ METHODS \/
// ==================================================================================================== \/
public:
ArrayBufferControlFile
&
nameAttribute
(
uint_t
_attributeIndex
,
const
std
::
string
&
_name
)
{
mAttributeNameMap
[
_attributeIndex
]
=
_name
;
return
*
this
;
}
private:
bool
load
(
SharedArrayBuffer
&
_ab
);
...
...
@@ -48,6 +63,7 @@ public:
// =================================================================================================== \/
protected:
SharedGeometryDataControlFile
mDataController
;
AttributeNameMap
mAttributeNameMap
;
};
}
// OpenGL
...
...
src/ACGL/OpenGL/Controller/ArrayBufferControlFile.cc
View file @
d6ad6ee1
...
...
@@ -35,9 +35,16 @@ bool ArrayBufferControlFile::load(SharedArrayBuffer& _ab)
if
(
!
tempData
)
return
false
;
_ab
->
removeAttributes
();
for
(
uint_t
i
=
0
;
i
<
tempData
->
mAttributes
.
size
();
++
i
)
{
_ab
->
defineAttribute
(
tempData
->
mAttributes
[
i
]);
ArrayBuffer
::
Attribute
attribute
=
tempData
->
mAttributes
[
i
];
// Rename attribute if so specified
if
(
mAttributeNameMap
.
find
(
i
)
!=
mAttributeNameMap
.
end
())
attribute
.
name
=
mAttributeNameMap
[
i
];
_ab
->
defineAttribute
(
attribute
);
}
_ab
->
setDataElements
(
tempData
->
getSize
()
/
tempData
->
getStrideSize
(),
tempData
->
getData
());
...
...
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