Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenFlipper-Free
OpenFlipper-Free
Commits
4ddcbbe8
Commit
4ddcbbe8
authored
Oct 24, 2016
by
Jan Möbius
Browse files
Fixed some warnings
parent
fc46e7b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
ACG/Scenegraph/PrincipalAxisNode.cc
View file @
4ddcbbe8
...
...
@@ -102,9 +102,9 @@ PrincipalAxisNode::PrincipalAxisNode( BaseNode* _parent,
updateVBO_
(
true
)
{
static
const
Vec4f
default_cols
[
3
]
=
{
Vec4f
(
0.91
,
0.11
,
0.09
,
1.0
),
Vec4f
(
0.0
,
.43
,
1.0
,
1.0
),
Vec4f
(
0.0
,
0.70
,
0.0
,
1.0
)
Vec4f
(
0.91
f
,
0.11
f
,
0.09
f
,
1.0
f
),
Vec4f
(
0.0
f
,
.43
f
,
1.0
f
,
1.0
f
),
Vec4f
(
0.0
f
,
0.70
f
,
0.0
f
,
1.0
f
)
};
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
for
(
int
j
=
0
;
j
<
4
;
++
j
)
{
...
...
@@ -172,15 +172,15 @@ show_tensor_component(unsigned int _i, unsigned char _show)
void
PrincipalAxisNode
::
resize
(
unsigned
in
t
_n
)
resize
(
size_
t
_n
)
{
unsigned
in
t
old_n
=
pc_
.
size
();
size_
t
old_n
=
pc_
.
size
();
pc_
.
resize
(
_n
);
draw_pc_
.
resize
(
_n
);
// initialize new draw_pc_ values
for
(
unsigned
in
t
i
=
old_n
;
i
<
_n
;
++
i
)
for
(
size_
t
i
=
old_n
;
i
<
_n
;
++
i
)
draw_pc_
[
i
]
=
false
;
auto_update_range
();
...
...
@@ -192,7 +192,7 @@ resize(unsigned int _n)
void
PrincipalAxisNode
::
enable
(
unsigned
in
t
_i
)
enable
(
size_
t
_i
)
{
if
(
_i
<
draw_pc_
.
size
())
{
...
...
@@ -211,7 +211,7 @@ enable ( unsigned int _i)
void
PrincipalAxisNode
::
disable
(
unsigned
in
t
_i
)
disable
(
size_
t
_i
)
{
if
(
_i
<
draw_pc_
.
size
())
{
...
...
@@ -232,7 +232,7 @@ void
PrincipalAxisNode
::
disable_all
()
{
for
(
unsigned
in
t
i
=
0
;
i
<
pc_
.
size
();
++
i
)
for
(
size_
t
i
=
0
;
i
<
pc_
.
size
();
++
i
)
disable
(
i
);
}
...
...
@@ -242,7 +242,7 @@ disable_all()
void
PrincipalAxisNode
::
set
(
unsigned
in
t
_i
,
const
PrincipalComponent
&
_pc
)
set
(
size_
t
_i
,
const
PrincipalComponent
&
_pc
)
{
if
(
_i
<
pc_
.
size
())
{
...
...
@@ -269,7 +269,7 @@ set(unsigned int _i, const PrincipalComponent& _pc)
void
PrincipalAxisNode
::
get
(
unsigned
in
t
_i
,
PrincipalComponent
&
_pc
)
get
(
size_
t
_i
,
PrincipalComponent
&
_pc
)
{
if
(
_i
<
pc_
.
size
())
{
...
...
@@ -379,9 +379,9 @@ auto_update_range()
min_abs_value_
=
std
::
numeric_limits
<
double
>::
max
();
max_abs_value_
=
0.0
;
for
(
unsigned
in
t
i
=
0
;
i
<
pc_
.
size
();
++
i
)
for
(
size_
t
i
=
0
;
i
<
pc_
.
size
();
++
i
)
if
(
draw_pc_
[
i
])
for
(
unsigned
j
=
0
;
j
<
3
;
++
j
)
for
(
size_t
j
=
0
;
j
<
3
;
++
j
)
if
(
show_tensor_component_
[
j
])
{
max_abs_value_
=
std
::
max
(
max_abs_value_
,
pc_
[
i
].
a
[
j
].
norm
()
);
...
...
@@ -404,7 +404,7 @@ update_bounding_box()
bbMin_
=
Vec3d
(
FLT_MAX
,
FLT_MAX
,
FLT_MAX
);
bbMax_
=
Vec3d
(
-
FLT_MAX
,
-
FLT_MAX
,
-
FLT_MAX
);
for
(
unsigned
in
t
i
=
0
;
i
<
pc_
.
size
();
++
i
)
for
(
size_
t
i
=
0
;
i
<
pc_
.
size
();
++
i
)
{
Vec3d
lmin
=
(
pc_
[
i
].
p
)
-
Vec3d
(
1
,
1
,
1
)
*
max_draw_radius_
;
Vec3d
lmax
=
(
pc_
[
i
].
p
)
+
Vec3d
(
1
,
1
,
1
)
*
max_draw_radius_
;
...
...
@@ -413,14 +413,14 @@ update_bounding_box()
{
if
(
uninitialized
)
{
bbMin_
=
lmin
;
bbMax_
=
lmax
;
uninitialized
=
false
;
bbMin_
=
lmin
;
bbMax_
=
lmax
;
uninitialized
=
false
;
}
else
{
bbMin_
.
minimize
(
lmin
);
bbMax_
.
maximize
(
lmax
);
bbMin_
.
minimize
(
lmin
);
bbMax_
.
maximize
(
lmax
);
}
}
...
...
@@ -494,7 +494,7 @@ draw_principal_component(const PrincipalComponent& _pc)
glTranslated
(
_pc
.
p
[
0
],
_pc
.
p
[
1
],
_pc
.
p
[
2
]);
// for(unsigned int i=0; i<1; ++i)
for
(
unsigned
in
t
i
=
0
;
i
<
3
;
++
i
)
for
(
size_
t
i
=
0
;
i
<
3
;
++
i
)
{
if
(
!
show_tensor_component_
[
i
])
continue
;
...
...
@@ -637,7 +637,7 @@ draw_line( const Vec3d& _axis, double _w)
glLineWidth
(
_w
);
glBegin
(
GL_LINES
);
glVertex3f
(
0
,
0
,
0
);
glVertex3f
(
0
.0
f
,
0.0
f
,
0.0
f
);
glVertex3f
(
_axis
[
0
],
_axis
[
1
],
_axis
[
2
]);
glEnd
();
}
...
...
@@ -673,8 +673,8 @@ pick(GLState& /*_state*/, PickTarget _target)
void
PrincipalAxisNode
::
set_axes_colors
(
const
Vec4f
colors
[
3
])
{
for
(
in
t
i
=
0
;
i
<
3
;
++
i
)
{
for
(
in
t
j
=
0
;
j
<
4
;
++
j
)
{
for
(
size_
t
i
=
0
;
i
<
3
;
++
i
)
{
for
(
size_
t
j
=
0
;
j
<
4
;
++
j
)
{
axes_colors
[
i
][
j
]
=
colors
[
i
][
j
];
}
}
...
...
@@ -684,8 +684,8 @@ void PrincipalAxisNode::set_axes_colors(const Vec4f colors[3]) {
}
void
PrincipalAxisNode
::
get_axes_colors
(
Vec4f
out_colors
[
3
])
const
{
for
(
in
t
i
=
0
;
i
<
3
;
++
i
)
{
for
(
in
t
j
=
0
;
j
<
4
;
++
j
)
{
for
(
size_
t
i
=
0
;
i
<
3
;
++
i
)
{
for
(
size_
t
j
=
0
;
j
<
4
;
++
j
)
{
out_colors
[
i
][
j
]
=
axes_colors
[
i
][
j
];
}
}
...
...
@@ -851,7 +851,7 @@ void PrincipalAxisNode::getRenderObjects(IRenderer* _renderer, GLState& _state,
int
numInstances
=
0
;
int
visibleTensors
=
0
;
for
(
unsigned
in
t
k
=
0
;
k
<
3
;
++
k
)
for
(
size_
t
k
=
0
;
k
<
3
;
++
k
)
{
if
(
show_tensor_component_
[
k
])
++
visibleTensors
;
...
...
@@ -1117,7 +1117,7 @@ void PrincipalAxisNode::emitIndividualRenderobjects(IRenderer* _renderer, GLStat
}
for
(
unsigned
in
t
i
=
0
;
i
<
pc_
.
size
();
++
i
)
for
(
size_
t
i
=
0
;
i
<
pc_
.
size
();
++
i
)
{
if
(
draw_pc_
[
i
])
{
...
...
ACG/Scenegraph/PrincipalAxisNode.hh
View file @
4ddcbbe8
...
...
@@ -166,15 +166,15 @@ public:
void
show_tensor_component
(
unsigned
int
_i
,
unsigned
char
_show
);
// number of tensors to display
unsigned
in
t
size
()
{
return
pc_
.
size
();}
size_
t
size
()
{
return
pc_
.
size
();}
void
resize
(
unsigned
in
t
_n
);
void
resize
(
size_
t
_n
);
void
clear
()
{
pc_
.
clear
();
invalidateInstanceData_
=
true
;
}
// enable/disable drawing the _i'th PC
void
enable
(
unsigned
in
t
_i
);
void
disable
(
unsigned
in
t
_i
);
void
enable
(
size_
t
_i
);
void
disable
(
size_
t
_i
);
void
disable_all
();
// set properties of Principal component
...
...
@@ -182,8 +182,8 @@ public:
void
set_vector
(
unsigned
int
_i
,
const
Vec3d
_p
,
const
VectorT
&
_v
);
template
<
class
MatrixT
>
void
set_matrix
(
unsigned
int
_i
,
const
Vec3d
_p
,
const
MatrixT
&
_m
);
void
set
(
unsigned
in
t
_i
,
const
PrincipalComponent
&
_pc
);
void
get
(
unsigned
in
t
_i
,
PrincipalComponent
&
_pc
);
void
set
(
size_
t
_i
,
const
PrincipalComponent
&
_pc
);
void
get
(
size_
t
_i
,
PrincipalComponent
&
_pc
);
void
add
(
const
PrincipalComponent
&
_pc
,
bool
_enable
=
true
);
// enable automatic range clamping
void
set_auto_range
(
bool
_b
);
...
...
Write
Preview
Supports
Markdown
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