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
P
Plugin-Datacontrol
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
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenFlipper-Free
Plugin-Datacontrol
Commits
ec82e26a
Commit
ec82e26a
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
1a6970ce
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
21 deletions
+17
-21
DataControlPlugin.cc
DataControlPlugin.cc
+1
-1
DataControlPluginScripting.cc
DataControlPluginScripting.cc
+14
-16
Popup.cc
Popup.cc
+2
-4
No files found.
DataControlPlugin.cc
View file @
ec82e26a
...
...
@@ -863,7 +863,7 @@ void DataControlPlugin::propagateDownwards(BaseObject* _obj, int _column ){
*/
void
DataControlPlugin
::
slotBoundingBoxChange
(
)
{
for
(
PluginFunctions
::
ObjectIterator
o_it
;
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
{
for
(
auto
*
o_it
:
PluginFunctions
::
objects
())
{
updateBoundingBox
(
o_it
);
}
...
...
DataControlPluginScripting.cc
View file @
ec82e26a
...
...
@@ -454,8 +454,7 @@ void DataControlPlugin::setAllTarget() {
if
(
action
!=
0
&&
action
->
data
().
isValid
()
)
type
=
(
DataType
)
action
->
data
().
toUInt
();
for
(
PluginFunctions
::
ObjectIterator
o_it
(
PluginFunctions
::
ALL_OBJECTS
,
type
)
;
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
){
for
(
auto
*
o_it
:
PluginFunctions
::
objects
(
PluginFunctions
::
ALL_OBJECTS
,
type
)
)
{
o_it
->
target
(
true
);
}
}
...
...
@@ -476,8 +475,7 @@ void DataControlPlugin::setAllSource() {
if
(
action
!=
0
&&
action
->
data
().
isValid
()
)
type
=
(
DataType
)
action
->
data
().
toUInt
();
for
(
PluginFunctions
::
ObjectIterator
o_it
(
PluginFunctions
::
ALL_OBJECTS
,
type
)
;
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
){
for
(
auto
*
o_it
:
PluginFunctions
::
objects
(
PluginFunctions
::
ALL_OBJECTS
,
type
)
)
{
o_it
->
source
(
true
);
}
}
...
...
@@ -498,8 +496,7 @@ void DataControlPlugin::clearAllTarget() {
if
(
action
!=
0
&&
action
->
data
().
isValid
()
)
type
=
(
DataType
)
action
->
data
().
toUInt
();
for
(
PluginFunctions
::
ObjectIterator
o_it
(
PluginFunctions
::
ALL_OBJECTS
,
type
)
;
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
){
for
(
auto
*
o_it
:
PluginFunctions
::
objects
(
PluginFunctions
::
ALL_OBJECTS
,
type
)
)
{
o_it
->
target
(
false
);
}
}
...
...
@@ -520,8 +517,7 @@ void DataControlPlugin::clearAllSource() {
if
(
action
!=
0
&&
action
->
data
().
isValid
()
)
type
=
(
DataType
)
action
->
data
().
toUInt
();
for
(
PluginFunctions
::
ObjectIterator
o_it
(
PluginFunctions
::
ALL_OBJECTS
,
type
)
;
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
){
for
(
auto
*
o_it
:
PluginFunctions
::
objects
(
PluginFunctions
::
ALL_OBJECTS
,
type
)
)
{
o_it
->
source
(
false
);
}
}
...
...
@@ -545,8 +541,7 @@ void DataControlPlugin::hideAll() {
if
(
action
!=
0
&&
action
->
data
().
isValid
()
)
type
=
(
DataType
)
action
->
data
().
toUInt
();
for
(
PluginFunctions
::
ObjectIterator
o_it
(
PluginFunctions
::
ALL_OBJECTS
,
type
)
;
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
){
for
(
auto
*
o_it
:
PluginFunctions
::
objects
(
PluginFunctions
::
ALL_OBJECTS
,
type
)
)
{
o_it
->
hide
();
}
...
...
@@ -571,7 +566,7 @@ void DataControlPlugin::showAll() {
if
(
action
!=
0
&&
action
->
data
().
isValid
()
)
type
=
(
DataType
)
action
->
data
().
toUInt
();
for
(
PluginFunctions
::
ObjectIterator
o_it
(
PluginFunctions
::
ALL_OBJECTS
,
type
);
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
{
for
(
auto
*
o_it
:
PluginFunctions
::
objects
(
PluginFunctions
::
ALL_OBJECTS
,
type
)
)
{
o_it
->
show
();
}
...
...
@@ -586,8 +581,9 @@ IdList DataControlPlugin::getTargetObjects(DataType _type) {
IdList
list
;
for
(
PluginFunctions
::
ObjectIterator
o_it
(
PluginFunctions
::
TARGET_OBJECTS
,
_type
);
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
for
(
auto
*
o_it
:
PluginFunctions
::
objects
(
PluginFunctions
::
TARGET_OBJECTS
,
_type
)
)
{
list
.
push_back
(
o_it
->
id
()
);
}
return
list
;
}
...
...
@@ -601,8 +597,9 @@ IdList DataControlPlugin::getSourceObjects(DataType _type) {
IdList
list
;
for
(
PluginFunctions
::
ObjectIterator
o_it
(
PluginFunctions
::
SOURCE_OBJECTS
,
_type
);
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
for
(
auto
*
o_it
:
PluginFunctions
::
objects
(
PluginFunctions
::
SOURCE_OBJECTS
,
_type
)
)
{
list
.
push_back
(
o_it
->
id
()
);
}
return
list
;
}
...
...
@@ -614,8 +611,9 @@ IdList DataControlPlugin::getSourceObjects(DataType _type) {
*/
void
DataControlPlugin
::
printObjectInfoToLog
()
{
for
(
PluginFunctions
::
ObjectIterator
o_it
(
PluginFunctions
::
ALL_OBJECTS
);
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
for
(
auto
*
o_it
:
PluginFunctions
::
objects
(
PluginFunctions
::
ALL_OBJECTS
)
)
{
emit
log
(
LOGINFO
,
tr
(
"Object
\"
%1
\"
with ID %2 of type %3 "
).
arg
(
o_it
->
name
()).
arg
(
o_it
->
id
()).
arg
(
o_it
->
dataType
().
name
()));
}
}
//******************************************************************************
...
...
@@ -628,8 +626,8 @@ void DataControlPlugin::printObjectInfoToLog() {
*/
unsigned
int
DataControlPlugin
::
groupCount
()
const
{
unsigned
int
count
=
0
;
for
(
PluginFunctions
::
BaseObjectIterator
o_it
(
PluginFunctions
::
ALL_OBJECTS
,
DATA_GROUP
);
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
++
count
;
for
(
auto
*
o_it
:
PluginFunctions
::
objects
(
PluginFunctions
::
ALL_OBJECTS
,
DATA_GROUP
)
)
++
count
;
return
count
;
}
...
...
Popup.cc
View file @
ec82e26a
...
...
@@ -321,8 +321,7 @@ void DataControlPlugin::slotHeaderCustomContextMenuRequested ( const QPoint & _p
//get all used types
QVector
<
DataType
>
types
;
for
(
PluginFunctions
::
ObjectIterator
o_it
(
PluginFunctions
::
ALL_OBJECTS
)
;
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
for
(
auto
*
o_it
:
PluginFunctions
::
objects
(
PluginFunctions
::
ALL_OBJECTS
)
)
if
(
!
types
.
contains
(
o_it
->
dataType
()
)
)
types
.
push_back
(
o_it
->
dataType
()
);
...
...
@@ -478,8 +477,7 @@ void DataControlPlugin::slotCopyMaterialToTargeted() {
BaseObjectData
*
itemData
=
dynamic_cast
<
BaseObjectData
*
>
(
item
);
const
ACG
::
SceneGraph
::
Material
&
sourceMaterial
=
itemData
->
materialNode
()
->
material
();
for
(
PluginFunctions
::
ObjectIterator
o_it
(
PluginFunctions
::
TARGET_OBJECTS
);
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
{
for
(
auto
*
o_it
:
PluginFunctions
::
objects
(
PluginFunctions
::
TARGET_OBJECTS
)
)
{
MaterialNode
*
const
materialNode
=
o_it
->
materialNode
();
if
(
materialNode
)
{
...
...
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