Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Gauthier Quesnel
irritator
Commits
e2a41b18
Commit
e2a41b18
authored
Nov 04, 2020
by
Gauthier Quesnel
Browse files
gui: fix coding style
parent
050ac29a
Pipeline
#21237
passed with stage
in 1 minute and 49 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
app/gui/node-editor.cpp
View file @
e2a41b18
...
...
@@ -43,7 +43,8 @@ static auto automatic_layout_y_distance = 350.f;
static
auto
grid_layout_x_distance
=
250.
f
;
static
auto
grid_layout_y_distance
=
250.
f
;
static
ImVec4
operator
*
(
const
ImVec4
&
lhs
,
const
float
rhs
)
noexcept
static
ImVec4
operator
*
(
const
ImVec4
&
lhs
,
const
float
rhs
)
noexcept
{
return
ImVec4
(
lhs
.
x
*
rhs
,
lhs
.
y
*
rhs
,
lhs
.
z
*
rhs
,
lhs
.
w
*
rhs
);
}
...
...
@@ -126,7 +127,6 @@ for_each(DataArray& d_array, Container& container, Function f) noexcept
}
}
static
window_logger
log_w
;
static
data_array
<
editor
,
editor_id
>
editors
;
...
...
@@ -564,49 +564,48 @@ struct copier
auto
ret
=
sim
.
dispatch
(
mdl
->
type
,
[
this
,
&
sim
,
mdl
,
&
mdl_id_dst
]
<
typename
DynamicsM
>
(
DynamicsM
&
dynamics_models
)
->
status
{
using
Dynamics
=
typename
DynamicsM
::
value_type
;
[
this
,
&
sim
,
mdl
,
&
mdl_id_dst
]
<
typename
DynamicsM
>
(
DynamicsM
&
dynamics_models
)
->
status
{
using
Dynamics
=
typename
DynamicsM
::
value_type
;
irt_return_if_fail
(
dynamics_models
.
can_alloc
(
1
),
status
::
dynamics_not_enough_memory
);
irt_return_if_fail
(
dynamics_models
.
can_alloc
(
1
),
status
::
dynamics_not_enough_memory
);
auto
*
dyn_ptr
=
dynamics_models
.
try_to_get
(
mdl
->
id
);
irt_return_if_fail
(
dyn_ptr
,
status
::
dynamics_unknown_id
);
auto
*
dyn_ptr
=
dynamics_models
.
try_to_get
(
mdl
->
id
);
irt_return_if_fail
(
dyn_ptr
,
status
::
dynamics_unknown_id
);
auto
&
new_dyn
=
dynamics_models
.
alloc
(
*
dyn_ptr
);
auto
new_dyn_id
=
dynamics_models
.
get_id
(
new_dyn
);
auto
&
new_dyn
=
dynamics_models
.
alloc
(
*
dyn_ptr
);
auto
new_dyn_id
=
dynamics_models
.
get_id
(
new_dyn
);
if
constexpr
(
is_detected_v
<
has_input_port_t
,
Dynamics
>
)
std
::
fill_n
(
new_dyn
.
x
,
std
::
size
(
new_dyn
.
x
),
static_cast
<
input_port_id
>
(
0
));
if
constexpr
(
is_detected_v
<
has_input_port_t
,
Dynamics
>
)
std
::
fill_n
(
new_dyn
.
x
,
std
::
size
(
new_dyn
.
x
),
static_cast
<
input_port_id
>
(
0
));
if
constexpr
(
is_detected_v
<
has_output_port_t
,
Dynamics
>
)
std
::
fill_n
(
new_dyn
.
y
,
std
::
size
(
new_dyn
.
y
),
static_cast
<
output_port_id
>
(
0
));
if
constexpr
(
is_detected_v
<
has_output_port_t
,
Dynamics
>
)
std
::
fill_n
(
new_dyn
.
y
,
std
::
size
(
new_dyn
.
y
),
static_cast
<
output_port_id
>
(
0
));
irt_return_if_bad
(
sim
.
alloc
(
new_dyn
,
new_dyn_id
,
mdl
->
name
.
c_str
()));
irt_return_if_bad
(
sim
.
alloc
(
new_dyn
,
new_dyn_id
,
mdl
->
name
.
c_str
()));
*
mdl_id_dst
=
new_dyn
.
id
;
*
mdl_id_dst
=
new_dyn
.
id
;
if
constexpr
(
is_detected_v
<
has_input_port_t
,
Dynamics
>
)
for
(
size_t
j
=
0
,
ej
=
std
::
size
(
new_dyn
.
x
);
j
!=
ej
;
++
j
)
this
->
c_input_ports
.
emplace_back
(
dyn_ptr
->
x
[
j
],
new_dyn
.
x
[
j
]);
if
constexpr
(
is_detected_v
<
has_input_port_t
,
Dynamics
>
)
for
(
size_t
j
=
0
,
ej
=
std
::
size
(
new_dyn
.
x
);
j
!=
ej
;
++
j
)
this
->
c_input_ports
.
emplace_back
(
dyn_ptr
->
x
[
j
],
new_dyn
.
x
[
j
]);
if
constexpr
(
is_detected_v
<
has_output_port_t
,
Dynamics
>
)
for
(
size_t
j
=
0
,
ej
=
std
::
size
(
new_dyn
.
y
);
j
!=
ej
;
++
j
)
this
->
c_output_ports
.
emplace_back
(
dyn_ptr
->
y
[
j
],
new_dyn
.
y
[
j
]);
if
constexpr
(
is_detected_v
<
has_output_port_t
,
Dynamics
>
)
for
(
size_t
j
=
0
,
ej
=
std
::
size
(
new_dyn
.
y
);
j
!=
ej
;
++
j
)
this
->
c_output_ports
.
emplace_back
(
dyn_ptr
->
y
[
j
],
new_dyn
.
y
[
j
]);
return
status
::
success
;
});
return
status
::
success
;
});
irt_return_if_bad
(
ret
);
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment