Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RobotAPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lennard Hofmann
RobotAPI
Commits
40003e44
Commit
40003e44
authored
4 years ago
by
Fabian Paus
Browse files
Options
Downloads
Patches
Plain Diff
ArViz Performance: Do not copy data for point cloud visu
parent
54062065
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/RobotAPI/components/ArViz/Coin/VisualizationPointCloud.h
+18
-16
18 additions, 16 deletions
.../RobotAPI/components/ArViz/Coin/VisualizationPointCloud.h
with
18 additions
and
16 deletions
source/RobotAPI/components/ArViz/Coin/VisualizationPointCloud.h
+
18
−
16
View file @
40003e44
...
...
@@ -23,48 +23,50 @@ namespace armarx::viz::coin
pclMatBind
->
value
=
SoMaterialBinding
::
PER_PART
;
pclCoords
=
new
SoCoordinate3
;
pclStye
=
new
SoDrawStyle
;
pclSty
l
e
=
new
SoDrawStyle
;
node
->
addChild
(
pclMat
);
node
->
addChild
(
pclMatBind
);
node
->
addChild
(
pclCoords
);
node
->
addChild
(
pclStye
);
node
->
addChild
(
pclSty
l
e
);
node
->
addChild
(
new
SoPointSet
);
}
bool
update
(
ElementType
const
&
element
)
{
auto
&
pcl
=
element
.
points
;
data
::
ColoredPointList
const
&
pcl
=
element
.
points
;
colors
.
clear
();
colors
.
reserve
(
pcl
.
size
());
coords
.
clear
();
coords
.
reserve
(
pcl
.
size
());
int
pclSize
=
(
int
)
pcl
.
size
();
colors
.
resize
(
pclSize
);
coords
.
resize
(
pclSize
);
const
float
conv
=
1.0
f
/
255.0
f
;
for
(
auto
&
point
:
pcl
)
SbColor
*
colorsData
=
colors
.
data
();
SbVec3f
*
coordsData
=
coords
.
data
();
for
(
int
i
=
0
;
i
<
pclSize
;
++
i
)
{
data
::
ColoredPoint
point
=
pcl
[
i
];
float
r
=
point
.
color
.
r
*
conv
;
float
g
=
point
.
color
.
g
*
conv
;
float
b
=
point
.
color
.
b
*
conv
;
colors
.
emplace_back
(
r
,
g
,
b
);
coords
.
emplace_back
(
point
.
x
,
point
.
y
,
point
.
z
);
colors
Data
[
i
].
setValue
(
r
,
g
,
b
);
coords
Data
[
i
].
setValue
(
point
.
x
,
point
.
y
,
point
.
z
);
}
pclMat
->
diffuseColor
.
setValues
(
0
,
colors
.
s
ize
()
,
colors
.
data
());
pclMat
->
ambientColor
.
setValues
(
0
,
colors
.
s
ize
()
,
colors
.
data
());
pclMat
->
diffuseColor
.
setValues
Pointer
(
pclS
ize
,
colors
.
data
());
pclMat
->
ambientColor
.
setValues
Pointer
(
pclS
ize
,
colors
.
data
());
pclMat
->
transparency
=
element
.
transparency
;
pclCoords
->
point
.
setValues
(
0
,
coords
.
s
ize
()
,
coords
.
data
());
pclCoords
->
point
.
setNum
(
coords
.
s
ize
()
);
pclCoords
->
point
.
setValues
Pointer
(
pclS
ize
,
coords
.
data
());
pclCoords
->
point
.
setNum
(
pclS
ize
);
pclStye
->
pointSize
=
element
.
pointSizeInPixels
;
pclSty
l
e
->
pointSize
=
element
.
pointSizeInPixels
;
return
true
;
}
SoMaterial
*
pclMat
;
SoCoordinate3
*
pclCoords
;
SoDrawStyle
*
pclStye
;
SoDrawStyle
*
pclSty
l
e
;
std
::
vector
<
SbColor
>
colors
;
std
::
vector
<
SbVec3f
>
coords
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment