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
OpenFlipper-Free
OpenFlipper-Free
Commits
59fb6ef8
Commit
59fb6ef8
authored
Oct 24, 2016
by
Jan Möbius
Browse files
Merge branch 'master' into bsp-fix-attempt
parents
40e2dda8
564202f9
Pipeline
#3336
failed with stage
in 90 minutes and 46 seconds
Changes
48
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ACG/GL/DrawMeshT.cc
View file @
59fb6ef8
...
...
@@ -626,7 +626,7 @@ DrawMeshT<Mesh>::rebuild()
if
(
baseProp
)
{
in
t
numAttribs
=
baseProp
->
n_elements
();
size_
t
numAttribs
=
baseProp
->
n_elements
();
const
void
*
attribData
=
propDesc
->
propDataPtr_
;
meshComp_
->
setAttribVec
(
propDesc
->
declElementID_
,
numAttribs
,
attribData
);
...
...
ACG/GL/GLState.hh
View file @
59fb6ef8
...
...
@@ -193,7 +193,7 @@ public:
void
set
(
GLint
_size
,
GLenum
_type
,
GLsizei
_stride
,
const
GLvoid
*
_ptr
)
{
size
=
_size
;
type
=
_type
;
stride
=
_stride
,
pointer
=
_ptr
;
size
=
_size
;
type
=
_type
;
stride
=
_stride
;
pointer
=
_ptr
;
}
};
...
...
ACG/GL/IRenderer.cc
View file @
59fb6ef8
...
...
@@ -1461,8 +1461,8 @@ void IRenderer::renderLineThicknessGL42()
Texture2D
*
lineColorImg2D
=
0
;
TextureBuffer
*
lineColorImgBuf
=
0
;
GL
size
i
w
=
prevViewport_
[
2
],
h
=
prevViewport_
[
3
];
GL
size
i
lineBPP
=
useIntegerTexture
?
4
:
16
;
// bytes per pixel
size
_t
w
=
static_cast
<
size_t
>
(
prevViewport_
[
2
]
)
,
h
=
static_cast
<
size_t
>
(
prevViewport_
[
3
]
)
;
size
_t
lineBPP
=
static_cast
<
size_t
>
(
useIntegerTexture
?
4
:
16
)
;
// bytes per pixel
if
(
useBufferTexture
)
...
...
@@ -1491,7 +1491,7 @@ void IRenderer::renderLineThicknessGL42()
}
// resize
if
(
lineColorImg2D
->
getWidth
()
!=
w
||
lineColorImg2D
->
getHeight
()
!=
h
)
if
(
lineColorImg2D
->
getWidth
()
!=
static_cast
<
int
>
(
w
)
||
lineColorImg2D
->
getHeight
()
!=
static_cast
<
int
>
(
h
)
)
lineColorImg2D
->
setData
(
0
,
useIntegerTexture
?
GL_R32UI
:
GL_RGBA32F
,
w
,
h
,
...
...
ACG/GL/MeshCompiler.cc
View file @
59fb6ef8
...
...
@@ -256,23 +256,23 @@ void MeshCompiler::computeAdjacency(bool _forceRecompute)
}
void
MeshCompiler
::
setVertices
(
in
t
_num
,
const
void
*
_data
,
in
t
_stride
,
bool
_internalCopy
/*= false*/
,
GLuint
_fmt
,
int
_elementSize
)
void
MeshCompiler
::
setVertices
(
size_
t
_num
,
const
void
*
_data
,
size_
t
_stride
,
bool
_internalCopy
/*= false*/
,
GLuint
_fmt
,
int
_elementSize
)
{
setAttribVec
(
inputIDPos_
,
_num
,
_data
,
_stride
,
_internalCopy
,
_fmt
,
_elementSize
);
}
void
MeshCompiler
::
setNormals
(
in
t
_num
,
const
void
*
_data
,
in
t
_stride
,
bool
_internalCopy
/*= false*/
,
GLuint
_fmt
,
int
_elementSize
)
void
MeshCompiler
::
setNormals
(
size_
t
_num
,
const
void
*
_data
,
size_
t
_stride
,
bool
_internalCopy
/*= false*/
,
GLuint
_fmt
,
int
_elementSize
)
{
setAttribVec
(
inputIDNorm_
,
_num
,
_data
,
_stride
,
_internalCopy
,
_fmt
,
_elementSize
);
}
void
MeshCompiler
::
setTexCoords
(
in
t
_num
,
const
void
*
_data
,
in
t
_stride
,
bool
_internalCopy
/*= false*/
,
GLuint
_fmt
,
int
_elementSize
)
void
MeshCompiler
::
setTexCoords
(
size_
t
_num
,
const
void
*
_data
,
size_
t
_stride
,
bool
_internalCopy
/*= false*/
,
GLuint
_fmt
,
int
_elementSize
)
{
setAttribVec
(
inputIDTexC_
,
_num
,
_data
,
_stride
,
_internalCopy
,
_fmt
,
_elementSize
);
}
void
MeshCompiler
::
setAttribVec
(
int
_attrIdx
,
in
t
_num
,
const
void
*
_data
,
in
t
_stride
,
bool
_internalCopy
/*= false*/
,
GLuint
_fmt
,
int
_elementSize
)
void
MeshCompiler
::
setAttribVec
(
int
_attrIdx
,
size_
t
_num
,
const
void
*
_data
,
size_
t
_stride
,
bool
_internalCopy
/*= false*/
,
GLuint
_fmt
,
int
_elementSize
)
{
// sets vertex data for each attribute individually
// Example:
...
...
@@ -307,7 +307,7 @@ void MeshCompiler::setAttribVec(int _attrIdx, int _num, const void* _data, int _
if
(
_data
)
{
// copy elementwise because of striding
for
(
in
t
i
=
0
;
i
<
_num
;
++
i
)
for
(
size_
t
i
=
0
;
i
<
_num
;
++
i
)
{
memcpy
(
inbuf
->
internalBuf
+
(
size_t
)(
size
*
i
),
(
const
char
*
)
_data
+
(
size_t
)(
_stride
*
i
),
...
...
ACG/GL/MeshCompiler.hh
View file @
59fb6ef8
...
...
@@ -265,7 +265,7 @@ public:
* @param _fmt data format of one element (must be set if input data does not match vertex declaration)
* @param _elementSize number of elements per attribute (i.e. 3 for vec3 .., -1 if unknown)
*/
void
setVertices
(
in
t
_num
,
const
void
*
_data
,
in
t
_stride
=
0
,
bool
_internalCopy
=
false
,
GLuint
_fmt
=
0
,
int
_elementSize
=
-
1
);
void
setVertices
(
size_
t
_num
,
const
void
*
_data
,
size_
t
_stride
=
0
,
bool
_internalCopy
=
false
,
GLuint
_fmt
=
0
,
int
_elementSize
=
-
1
);
/** set input normals
*
...
...
@@ -276,7 +276,7 @@ public:
* @param _fmt data format of one element (must be set if input data does not match vertex declaration)
* @param _elementSize number of elements per attribute (i.e. 3 for vec3 .., -1 if unknown)
*/
void
setNormals
(
in
t
_num
,
const
void
*
_data
,
in
t
_stride
=
0
,
bool
_internalCopy
=
false
,
GLuint
_fmt
=
0
,
int
_elementSize
=
-
1
);
void
setNormals
(
size_
t
_num
,
const
void
*
_data
,
size_
t
_stride
=
0
,
bool
_internalCopy
=
false
,
GLuint
_fmt
=
0
,
int
_elementSize
=
-
1
);
/** set input texture coords
*
...
...
@@ -287,7 +287,7 @@ public:
* @param _fmt data format of one element (must be set if input data does not match vertex declaration)
* @param _elementSize number of elements per attribute (i.e. 3 for vec3 .., -1 if unknown)
*/
void
setTexCoords
(
in
t
_num
,
const
void
*
_data
,
in
t
_stride
=
0
,
bool
_internalCopy
=
false
,
GLuint
_fmt
=
0
,
int
_elementSize
=
-
1
);
void
setTexCoords
(
size_
t
_num
,
const
void
*
_data
,
size_
t
_stride
=
0
,
bool
_internalCopy
=
false
,
GLuint
_fmt
=
0
,
int
_elementSize
=
-
1
);
/** Set custom input attribute.
*
...
...
@@ -300,7 +300,7 @@ public:
* @param _fmt data format of one element (must be set if input data does not match vertex declaration)
* @param _elementSize number of elements per attribute (i.e. 3 for vec3 .., -1 if unknown)
*/
void
setAttribVec
(
int
_attrIdx
,
in
t
_num
,
const
void
*
_data
,
in
t
_stride
=
0
,
bool
_internalCopy
=
false
,
GLuint
_fmt
=
0
,
int
_elementSize
=
-
1
);
void
setAttribVec
(
int
_attrIdx
,
size_
t
_num
,
const
void
*
_data
,
size_
t
_stride
=
0
,
bool
_internalCopy
=
false
,
GLuint
_fmt
=
0
,
int
_elementSize
=
-
1
);
/** Set single custom input attributes.
*
...
...
@@ -971,10 +971,10 @@ private:
// final buffers used for drawing
/// # vertices in vbo
in
t
numDrawVerts_
;
size_
t
numDrawVerts_
;
/// # isolated vertices
in
t
numIsolatedVerts_
;
size_
t
numIsolatedVerts_
;
/// index buffer
std
::
vector
<
int
>
indices_
;
...
...
ACG/QtWidgets/QtPrincipalAxisDialog.cc
View file @
59fb6ef8
...
...
@@ -213,7 +213,7 @@ const QtPrincipalAxisDialog::ColorScheme &QtPrincipalAxisDialog::getSelectedColo
void
QtPrincipalAxisDialog
::
setColorScheme
(
ColorScheme
cs
)
{
float
best_match
=
std
::
numeric_limits
<
float
>::
infinity
();
in
t
best_match_i
=
-
1
;
size_
t
best_match_i
=
std
::
numeric_limits
<
size_t
>::
max
()
;
for
(
size_t
i
=
0
;
i
<
N_COLOR_SCHEMES
;
++
i
)
{
float
match
=
colorSchemeDistance
(
cs
,
color_schemes_
[
i
]);
...
...
ACG/Scenegraph/PrincipalAxisNode.cc
View file @
59fb6ef8
...
...
@@ -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
;
...
...
@@ -586,15 +586,12 @@ void
PrincipalAxisNode
::
draw_arrow
(
const
Vec3d
&
_axis
,
double
_r
)
{
double
base_radius
=
_r
;
double
top_radius
=
_r
;
double
size
=
_axis
.
norm
();
if
(
size
>
1e-10
)
{
glPushMatrix
();
unsigned
int
slices
(
8
);
Vec3d
direction
=
_axis
;
Vec3d
z_axis
(
0
,
0
,
1
);
...
...
@@ -640,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
();
}
...
...
@@ -676,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
];
}
}
...
...
@@ -687,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
];
}
}
...
...
@@ -854,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
;
...
...
@@ -1120,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 @
59fb6ef8
...
...
@@ -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
);
...
...
CI/ci-cppcheck.sh
View file @
59fb6ef8
...
...
@@ -59,7 +59,7 @@ echo "CPPCHECK Summary"
echo
"=============================================================================="
echo
-e
"
${
NC
}
"
if
[
$COUNT
-gt
5
4
]
;
then
if
[
$COUNT
-gt
4
5
]
;
then
echo
-e
${
WARNING
}
echo
"Total CPPCHECK error Count is
$COUNT
, which is too High! CPPCHECK Run failed"
;
echo
-e
"
${
NC
}
"
...
...
ObjectTypes/Plane/QtPlaneSelect.cc
View file @
59fb6ef8
...
...
@@ -127,7 +127,7 @@ void QtPlaneSelect::slotMouseEvent(QMouseEvent* event)
return
;
unsigned
in
t
node_idx
,
target_idx
;
size_
t
node_idx
,
target_idx
;
if
(
PluginFunctions
::
scenegraphPick
(
ACG
::
SceneGraph
::
PICK_FACE
,
event
->
pos
(),
...
...
ObjectTypes/PolyLine/PolyLineBezierSplineData.hh
View file @
59fb6ef8
...
...
@@ -69,7 +69,7 @@ public:
std
::
vector
<
InterpolatePoint
>
points_
;
std
::
vector
<
ACG
::
Vec3d
>
handles_
;
/// Index of the corresponding mesh
unsigned
in
t
meshIndex_
;
size_
t
meshIndex_
;
public:
...
...
ObjectTypes/PolyLine/PolyLineCircleData.hh
View file @
59fb6ef8
...
...
@@ -64,7 +64,7 @@ public:
ACG
::
Vec3d
circleSideAxis_
;
double
circleMainRadius_
;
double
circleSideRadius_
;
unsigned
int
circleMeshIndex_
;
size_t
circleMeshIndex_
;
public:
PolyLineCircleData
(
ACG
::
Vec3d
center
,
ACG
::
Vec3d
normal
,
ACG
::
Vec3d
mainAxis
,
ACG
::
Vec3d
sideAxis
,
double
mainR
,
double
sideR
,
unsigned
int
mesh
);
...
...
OpenFlipper/BasePlugin/PluginFunctions.cc
View file @
59fb6ef8
...
...
@@ -260,7 +260,7 @@ void setSceneGraphRootNodeGlobal( SeparatorNode* _root_node ) {
PluginFunctions
::
sceneGraphRootNodeGlobal_
=
_root_node
;
}
bool
getPickedObject
(
const
unsigned
in
t
_node_idx
,
BaseObjectData
*&
_object
)
{
bool
getPickedObject
(
const
size_
t
_node_idx
,
BaseObjectData
*&
_object
)
{
for
(
ObjectIterator
o_it
(
PluginFunctions
::
ALL_OBJECTS
)
;
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
{
if
(
o_it
->
picked
(
_node_idx
)
)
{
_object
=
*
o_it
;
...
...
@@ -479,13 +479,13 @@ void viewingRay(int _x, int _y,
}
// Pick returning node index
bool
scenegraphPick
(
ACG
::
SceneGraph
::
PickTarget
_pickTarget
,
const
QPoint
&
_mousePos
,
unsigned
in
t
&
_nodeIdx
,
unsigned
in
t
&
_targetIdx
,
ACG
::
Vec3d
*
_hitPointPtr
=
0
)
{
bool
scenegraphPick
(
ACG
::
SceneGraph
::
PickTarget
_pickTarget
,
const
QPoint
&
_mousePos
,
size_
t
&
_nodeIdx
,
size_
t
&
_targetIdx
,
ACG
::
Vec3d
*
_hitPointPtr
=
0
)
{
return
examiner_widgets_
[
activeExaminer_
]
->
pick
(
_pickTarget
,
_mousePos
,
_nodeIdx
,
_targetIdx
,
_hitPointPtr
);
}
// Pick returning node index
bool
scenegraphPick
(
const
unsigned
int
_examiner
,
ACG
::
SceneGraph
::
PickTarget
_pickTarget
,
const
QPoint
&
_mousePos
,
unsigned
in
t
&
_nodeIdx
,
unsigned
in
t
&
_targetIdx
,
ACG
::
Vec3d
*
_hitPointPtr
=
0
)
{
bool
scenegraphPick
(
const
unsigned
int
_examiner
,
ACG
::
SceneGraph
::
PickTarget
_pickTarget
,
const
QPoint
&
_mousePos
,
size_
t
&
_nodeIdx
,
size_
t
&
_targetIdx
,
ACG
::
Vec3d
*
_hitPointPtr
=
0
)
{
if
(
_examiner
>=
examiner_widgets_
.
size
()
)
{
std
::
cerr
<<
"Wrong examiner id"
<<
std
::
endl
;
...
...
@@ -500,13 +500,13 @@ bool scenegraphPick( const unsigned int _examiner ,
ACG
::
SceneGraph
::
PickTarget
_pickTarget
,
const
QPoint
&
_mousePos
,
BaseObjectData
*&
_object
,
unsigned
int
&
_targetIdx
,
size_t
&
_targetIdx
,
const
bool
_refine
,
ACG
::
Vec3d
*
_hitPointPtr
)
{
unsigned
in
t
nodeIdx
=
0
;
size_
t
nodeIdx
=
0
;
bool
ok
=
scenegraphPick
(
_examiner
,
_pickTarget
,
_mousePos
,
nodeIdx
,
_targetIdx
,
_hitPointPtr
);
bool
ok
=
scenegraphPick
(
_examiner
,
_pickTarget
,
_mousePos
,
nodeIdx
,
_targetIdx
,
_hitPointPtr
);
// If successfully picked and object is found
if
(
ok
&&
PluginFunctions
::
getPickedObject
(
nodeIdx
,
_object
)
)
{
...
...
@@ -535,7 +535,7 @@ bool scenegraphPick( const unsigned int _examiner ,
bool
scenegraphPick
(
ACG
::
SceneGraph
::
PickTarget
_pickTarget
,
const
QPoint
&
_mousePos
,
BaseObjectData
*&
_object
,
unsigned
int
&
_targetIdx
,
size_t
&
_targetIdx
,
const
bool
_refine
,
ACG
::
Vec3d
*
_hitPointPtr
)
{
...
...
@@ -548,7 +548,7 @@ bool scenegraphPick( ACG::SceneGraph::PickTarget _pickTarget,
bool
scenegraphRegionPick
(
ACG
::
SceneGraph
::
PickTarget
_pickTarget
,
const
QRegion
&
_region
,
QList
<
QPair
<
unsigned
int
,
unsigned
int
>
>&
_list
,
QList
<
QPair
<
size_t
,
size_t
>
>&
_list
,
QVector
<
float
>*
_depths
,
QVector
<
ACG
::
Vec3d
>*
_points
)
{
...
...
@@ -558,7 +558,7 @@ bool scenegraphRegionPick( ACG::SceneGraph::PickTarget _pickTarge
bool
scenegraphRegionPick
(
const
unsigned
int
_examiner
,
ACG
::
SceneGraph
::
PickTarget
_pickTarget
,
const
QRegion
&
_region
,
QList
<
QPair
<
unsigned
int
,
unsigned
int
>
>&
_list
,
QList
<
QPair
<
size_t
,
size_t
>
>&
_list
,
QVector
<
float
>*
_depths
,
QVector
<
ACG
::
Vec3d
>*
_points
)
{
...
...
OpenFlipper/BasePlugin/PluginFunctions.hh
View file @
59fb6ef8
...
...
@@ -93,7 +93,7 @@ namespace PluginFunctions {
* @return true if mesh was found, false if picked object is not a mesh or not found
*/
DLLEXPORT
bool
getPickedObject
(
const
unsigned
in
t
_node_idx
,
BaseObjectData
*&
_object
);
bool
getPickedObject
(
const
size_
t
_node_idx
,
BaseObjectData
*&
_object
);
/** @} */
...
...
@@ -250,14 +250,14 @@ void setSceneCenter(const ACG::Vec3d& _center, int _viewer );
* set by the last mouse event from the core
*/
DLLEXPORT
bool
scenegraphPick
(
ACG
::
SceneGraph
::
PickTarget
_pickTarget
,
const
QPoint
&
_mousePos
,
unsigned
in
t
&
_nodeIdx
,
unsigned
in
t
&
_targetIdx
,
ACG
::
Vec3d
*
_hitPointPtr
);
bool
scenegraphPick
(
ACG
::
SceneGraph
::
PickTarget
_pickTarget
,
const
QPoint
&
_mousePos
,
size_
t
&
_nodeIdx
,
size_
t
&
_targetIdx
,
ACG
::
Vec3d
*
_hitPointPtr
);
/** \brief Execute picking operation on scenegraph
*
* This picking function will pick in the specified examiner context
*/
DLLEXPORT
bool
scenegraphPick
(
const
unsigned
int
_examiner
,
ACG
::
SceneGraph
::
PickTarget
_pickTarget
,
const
QPoint
&
_mousePos
,
unsigned
in
t
&
_nodeIdx
,
unsigned
in
t
&
_targetIdx
,
ACG
::
Vec3d
*
_hitPointPtr
);
bool
scenegraphPick
(
const
unsigned
int
_examiner
,
ACG
::
SceneGraph
::
PickTarget
_pickTarget
,
const
QPoint
&
_mousePos
,
size_
t
&
_nodeIdx
,
size_
t
&
_targetIdx
,
ACG
::
Vec3d
*
_hitPointPtr
);
/** \brief Execute picking operation on scenegraph and return object
*
...
...
@@ -266,7 +266,7 @@ bool scenegraphPick( const unsigned int _examiner ,ACG::SceneGraph::PickTarget _
* the picked object will be called in order to achieve higher picking accuracy
*/
DLLEXPORT
bool
scenegraphPick
(
const
unsigned
int
_examiner
,
ACG
::
SceneGraph
::
PickTarget
_pickTarget
,
const
QPoint
&
_mousePos
,
BaseObjectData
*&
_object
,
unsigned
in
t
&
_targetIdx
,
const
bool
_refine
,
ACG
::
Vec3d
*
_hitPointPtr
);
bool
scenegraphPick
(
const
unsigned
int
_examiner
,
ACG
::
SceneGraph
::
PickTarget
_pickTarget
,
const
QPoint
&
_mousePos
,
BaseObjectData
*&
_object
,
size_
t
&
_targetIdx
,
const
bool
_refine
,
ACG
::
Vec3d
*
_hitPointPtr
);
/** \brief Execute picking operation on scenegraph and return object
*
...
...
@@ -275,7 +275,7 @@ bool scenegraphPick( const unsigned int _examiner ,ACG::SceneGraph::PickTarget _
* the picked object will be called in order to achieve higher picking accuracy
*/
DLLEXPORT
bool
scenegraphPick
(
ACG
::
SceneGraph
::
PickTarget
_pickTarget
,
const
QPoint
&
_mousePos
,
BaseObjectData
*&
_object
,
unsigned
in
t
&
_targetIdx
,
const
bool
_refine
,
ACG
::
Vec3d
*
_hitPointPtr
);
bool
scenegraphPick
(
ACG
::
SceneGraph
::
PickTarget
_pickTarget
,
const
QPoint
&
_mousePos
,
BaseObjectData
*&
_object
,
size_
t
&
_targetIdx
,
const
bool
_refine
,
ACG
::
Vec3d
*
_hitPointPtr
);
/** Execute picking operation on scenegraph
...
...
@@ -285,7 +285,7 @@ bool scenegraphPick( ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mou
DLLEXPORT
bool
scenegraphRegionPick
(
ACG
::
SceneGraph
::
PickTarget
_pickTarget
,
const
QRegion
&
_region
,
QList
<
QPair
<
unsigned
int
,
unsigned
int
>
>&
_list
,
QList
<
QPair
<
size_t
,
size_t
>
>&
_list
,
QVector
<
float
>*
_depths
=
0
,
QVector
<
ACG
::
Vec3d
>*
_points
=
0
);
...
...
@@ -296,7 +296,7 @@ DLLEXPORT
bool
scenegraphRegionPick
(
const
unsigned
int
_examiner
,
ACG
::
SceneGraph
::
PickTarget
_pickTarget
,
const
QRegion
&
_region
,
QList
<
QPair
<
unsigned
int
,
unsigned
int
>
>&
_list
,
QList
<
QPair
<
size_t
,
size_t
>
>&
_list
,
QVector
<
float
>*
_depths
=
0
,
QVector
<
ACG
::
Vec3d
>*
_points
=
0
);
...
...
OpenFlipper/Core/Core.cc
View file @
59fb6ef8
...
...
@@ -114,7 +114,8 @@ Core() :
nextBackupId_
(
0
),
nextBackupGroupId_
(
0
),
objectRoot_
(
0
),
coreWidget_
(
0
)
coreWidget_
(
0
),
splash_
(
0
)
{
//init logFile
...
...
@@ -608,7 +609,7 @@ Core::init() {
QStringList
optionFiles
=
OpenFlipper
::
Options
::
optionFiles
();
for
(
int
i
=
0
;
i
<
(
int
)
optionFiles
.
size
();
++
i
)
{
if
(
OpenFlipper
::
Options
::
gui
()
&&
OpenFlipperSettings
().
value
(
"Core/Gui/splash"
,
true
).
toBool
()
)
{
if
(
splash_
)
{
splash_
->
showMessage
(
tr
(
"Loading Configuration File %1/%2"
).
arg
(
i
+
1
).
arg
(
optionFiles
.
size
()),
Qt
::
AlignBottom
|
Qt
::
AlignLeft
,
Qt
::
white
);
}
...
...
@@ -621,7 +622,7 @@ Core::init() {
openIniFile
(
optionFiles
[
i
]
,
false
,
true
,
false
);
}
if
(
OpenFlipper
::
Options
::
gui
()
&&
OpenFlipperSettings
().
value
(
"Core/Gui/splash"
,
true
).
toBool
()
)
if
(
splash_
)
splash_
->
clearMessage
();
// ===============================================================================================
...
...
@@ -674,7 +675,7 @@ Core::init() {
}
if
(
OpenFlipperSettings
().
value
(
"Core/Gui/splash"
,
true
).
toBool
()
)
{
if
(
splash_
)
{
splash_
->
raise
();
splash_
->
showMessage
(
tr
(
"Ready."
),
Qt
::
AlignBottom
|
Qt
::
AlignLeft
,
Qt
::
white
);
finishSplash
();
...
...
@@ -742,7 +743,7 @@ Core::slotMouseEventIdentify( QMouseEvent* _event )
PluginFunctions
::
setActiveExaminer
(
examinerId
);
// Do picking
unsigned
in
t
node_idx
,
target_idx
;
size_
t
node_idx
,
target_idx
;
ACG
::
Vec3d
hit_point
;
if
(
PluginFunctions
::
scenegraphPick
(
ACG
::
SceneGraph
::
PICK_ANYTHING
,
_event
->
pos
(),
node_idx
,
target_idx
,
&
hit_point
))
{
...
...
@@ -2041,7 +2042,7 @@ void Core::showReducedMenuBar(bool reduced) {
}
void
Core
::
finishSplash
()
{
splash_
->
finish
(
coreWidget_
);
if
(
splash_
)
splash_
->
finish
(
coreWidget_
);
}
...
...
OpenFlipper/Core/PluginLoader.cc
View file @
59fb6ef8
...
...
@@ -389,7 +389,7 @@ void Core::loadPlugins()
loadedPlugins
.
push_back
(
loader
);
if
(
OpenFlipper
::
Options
::
gui
()
&&
OpenFlipperSettings
().
value
(
"Core/Gui/splash"
,
true
).
toBool
()
)
{
if
(
splash_
)
{
splashMessage_
=
tr
(
"Loading Plugin %1/%2"
).
arg
(
loadedPlugins
.
size
()).
arg
(
pluginlist
.
size
())
;
splash_
->
showMessage
(
splashMessage_
,
Qt
::
AlignBottom
|
Qt
::
AlignLeft
,
Qt
::
white
);
}
...
...
@@ -411,7 +411,7 @@ void Core::loadPlugins()
for
(
std
::
vector
<
QPluginLoader
*>::
iterator
it
=
loadedPlugins
.
begin
();
it
!=
loadedPlugins
.
end
();
++
it
)
{