Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenFlipper-Free
Plugin-Color
Commits
725f03e6
Commit
725f03e6
authored
Oct 30, 2020
by
Jan Möbius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use ranges for Object Iteration to simplify code
parent
51eaa82b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
ColorPlugin.cc
ColorPlugin.cc
+3
-3
No files found.
ColorPlugin.cc
View file @
725f03e6
...
...
@@ -162,7 +162,7 @@ void ColorPlugin::setDefaultColor() {
// =============================================================================
// Apply to all objects
// =============================================================================
for
(
PluginFunctions
::
O
bject
Iterator
o_it
(
PluginFunctions
::
ALL_OBJECTS
)
;
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
{
for
(
auto
*
o_it
:
PluginFunctions
::
o
bject
s
(
PluginFunctions
::
ALL_OBJECTS
)
)
{
MaterialNode
*
mat
=
o_it
->
materialNode
();
mat
->
set_base_color
(
baseColorDefault_
);
mat
->
set_ambient_color
(
ambient_color
);
...
...
@@ -208,7 +208,7 @@ void ColorPlugin::setPresentationColor() {
// =============================================================================
// Apply to all objects
// =============================================================================
for
(
PluginFunctions
::
O
bject
Iterator
o_it
(
PluginFunctions
::
ALL_OBJECTS
)
;
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
{
for
(
auto
*
o_it
:
PluginFunctions
::
o
bject
s
(
PluginFunctions
::
ALL_OBJECTS
)
)
{
MaterialNode
*
mat
=
o_it
->
materialNode
();
mat
->
set_base_color
(
baseColorPresentation_
);
mat
->
set_ambient_color
(
ambient_color
);
...
...
@@ -254,7 +254,7 @@ void ColorPlugin::setPaperColor() {
// =============================================================================
// Apply to all objects
// =============================================================================
for
(
PluginFunctions
::
O
bject
Iterator
o_it
(
PluginFunctions
::
ALL_OBJECTS
)
;
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
{
for
(
auto
*
o_it
:
PluginFunctions
::
o
bject
s
(
PluginFunctions
::
ALL_OBJECTS
)
)
{
MaterialNode
*
mat
=
o_it
->
materialNode
();
mat
->
set_base_color
(
baseColorPaper_
);
mat
->
set_ambient_color
(
ambient_color
);
...
...
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