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
OpenFlipper-Free
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
23
Issues
23
List
Boards
Labels
Service Desk
Milestones
Merge Requests
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
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
OpenFlipper-Free
Commits
a922437c
Commit
a922437c
authored
Nov 09, 2016
by
Jan Möbius
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'warnings' into 'master'
Warnings See merge request
!193
parents
d2966516
b3ef320b
Pipeline
#3588
passed with stage
in 42 minutes and 1 second
Changes
17
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
97 additions
and
99 deletions
+97
-99
ACG/Scenegraph/CoordsysNode.cc
ACG/Scenegraph/CoordsysNode.cc
+1
-1
ACG/Scenegraph/GlutPrimitiveNode.cc
ACG/Scenegraph/GlutPrimitiveNode.cc
+3
-3
ACG/Scenegraph/GlutPrimitiveNode.hh
ACG/Scenegraph/GlutPrimitiveNode.hh
+1
-1
ACG/Scenegraph/LineNode.cc
ACG/Scenegraph/LineNode.cc
+9
-9
ACG/Scenegraph/TextNode.cc
ACG/Scenegraph/TextNode.cc
+1
-1
ObjectTypes/Plane/QtPlaneSelect.hh
ObjectTypes/Plane/QtPlaneSelect.hh
+4
-4
ObjectTypes/Skeleton/Animation/AnimationHandle.hh
ObjectTypes/Skeleton/Animation/AnimationHandle.hh
+6
-6
ObjectTypes/Skeleton/Helper/SkeletonTransform.cc
ObjectTypes/Skeleton/Helper/SkeletonTransform.cc
+1
-1
ObjectTypes/Skeleton/JointT.cc
ObjectTypes/Skeleton/JointT.cc
+8
-8
ObjectTypes/Skeleton/JointT.hh
ObjectTypes/Skeleton/JointT.hh
+8
-8
ObjectTypes/Skeleton/PoseT.cc
ObjectTypes/Skeleton/PoseT.cc
+9
-9
ObjectTypes/Skeleton/PoseT.hh
ObjectTypes/Skeleton/PoseT.hh
+7
-7
ObjectTypes/Skeleton/SkeletonNodeT.cc
ObjectTypes/Skeleton/SkeletonNodeT.cc
+1
-1
ObjectTypes/Skeleton/SkeletonT.cc
ObjectTypes/Skeleton/SkeletonT.cc
+20
-22
ObjectTypes/Skeleton/SkeletonT.hh
ObjectTypes/Skeleton/SkeletonT.hh
+13
-13
Plugin-InfoSkeleton/SkeletonObjectInfoPlugin.cc
Plugin-InfoSkeleton/SkeletonObjectInfoPlugin.cc
+4
-4
Plugin-SkeletalAnimation/SkeletalAnimationPlugin.cc
Plugin-SkeletalAnimation/SkeletalAnimationPlugin.cc
+1
-1
No files found.
ACG/Scenegraph/CoordsysNode.cc
View file @
a922437c
...
...
@@ -863,7 +863,7 @@ void CoordsysNode::boundingCircle(std::vector<Vec2f> &_in, Vec2f &_center, float
for
(
unsigned
int
i
=
0
;
i
<
_in
.
size
()
-
1
;
i
++
)
for
(
unsigned
int
j
=
i
+
1
;
j
<
_in
.
size
();
j
++
)
{
Vec2f
cen
=
(
_in
[
i
]
+
_in
[
j
])
*
0.5
;
Vec2f
cen
=
(
_in
[
i
]
+
_in
[
j
])
*
0.5
f
;
float
rad
=
(
_in
[
i
]
-
cen
).
length
();
bool
allin
=
true
;
...
...
ACG/Scenegraph/GlutPrimitiveNode.cc
View file @
a922437c
...
...
@@ -301,9 +301,9 @@ add_primitive(GlutPrimitiveType _type, Vec3d _pos, Vec3d _axis, ACG::Vec4f _colo
//----------------------------------------------------------------------------
void
GlutPrimitiveNode
::
draw_obj
(
in
t
_idx
)
const
GlutPrimitiveNode
::
draw_obj
(
size_
t
_idx
)
const
{
if
(
_idx
<
0
||
_idx
>=
(
int
)
primitives_
.
size
())
// range check
if
(
_idx
>=
primitives_
.
size
())
// range check
return
;
Vec3d
axis
=
primitives_
[
_idx
].
axis
;
...
...
@@ -390,7 +390,7 @@ pick(GLState& _state , PickTarget _target)
case
PICK_ANYTHING
:
case
PICK_FACE
:
{
for
(
int
i
=
0
;
i
<
(
int
)
primitives_
.
size
();
++
i
)
for
(
size_t
i
=
0
;
i
<
primitives_
.
size
();
++
i
)
{
_state
.
pick_set_name
(
i
);
glPushMatrix
();
...
...
ACG/Scenegraph/GlutPrimitiveNode.hh
View file @
a922437c
...
...
@@ -217,7 +217,7 @@ public:
/// drawing the primitive
void
draw
(
GLState
&
_state
,
const
DrawModes
::
DrawMode
&
_drawMode
);
void
draw_obj
(
in
t
_idx
)
const
;
void
draw_obj
(
size_
t
_idx
)
const
;
/// picking
void
pick
(
GLState
&
_state
,
PickTarget
_target
);
...
...
ACG/Scenegraph/LineNode.cc
View file @
a922437c
...
...
@@ -372,7 +372,7 @@ void LineNode::pick(GLState& _state , PickTarget _target)
ACG
::
GLState
::
vertexPointer
(
&
(
points_
)[
0
]
);
ACG
::
GLState
::
enableClientState
(
GL_VERTEX_ARRAY
);
const
unsigned
in
t
n_edges
=
n_points
()
-
1
;
const
size_
t
n_edges
=
n_points
()
-
1
;
switch
(
_target
)
{
...
...
@@ -414,25 +414,25 @@ void LineNode::pick_edges(GLState& _state, unsigned int _offset)
if
(
line_mode_
==
PolygonMode
)
{
const
unsigned
in
t
n_edges
=
n_points
()
-
1
;
for
(
unsigned
in
t
i
=
0
;
i
<
n_edges
;
++
i
)
const
size_
t
n_edges
=
n_points
()
-
1
;
for
(
size_
t
i
=
0
;
i
<
n_edges
;
++
i
)
{
_state
.
pick_set_name
(
i
+
_offset
);
glBegin
(
GL_LINES
);
glArrayElement
(
i
);
glArrayElement
(
i
+
1
);
glArrayElement
(
static_cast
<
GLint
>
(
i
)
);
glArrayElement
(
static_cast
<
GLint
>
(
i
+
1
)
);
glEnd
();
}
}
else
if
(
line_mode_
==
LineSegmentsMode
)
{
const
unsigned
in
t
n_edges
=
n_points
()
/
2
;
for
(
unsigned
in
t
i
=
0
;
i
<
n_edges
;
++
i
)
const
size_
t
n_edges
=
n_points
()
/
2
;
for
(
size_
t
i
=
0
;
i
<
n_edges
;
++
i
)
{
_state
.
pick_set_name
(
i
+
_offset
);
glBegin
(
GL_LINES
);
glArrayElement
(
2
*
i
);
glArrayElement
(
2
*
i
+
1
);
glArrayElement
(
static_cast
<
GLint
>
(
2
*
i
)
);
glArrayElement
(
static_cast
<
GLint
>
(
2
*
i
+
1
)
);
glEnd
();
}
}
...
...
ACG/Scenegraph/TextNode.cc
View file @
a922437c
...
...
@@ -266,7 +266,7 @@ enter(GLState& _state, const DrawModes::DrawMode& /*_drawmode*/) {
ACG
::
GLState
::
enable
(
GL_TEXTURE_2D
);
ACG
::
GLState
::
enable
(
GL_BLEND
);
ACG
::
GLState
::
enable
(
GL_ALPHA_TEST
);
ACG
::
GLState
::
alphaFunc
(
GL_GREATER
,
0.2
);
ACG
::
GLState
::
alphaFunc
(
GL_GREATER
,
0.2
f
);
ACG
::
GLState
::
blendFunc
(
GL_SRC_ALPHA
,
GL_ONE_MINUS_SRC_ALPHA
);
if
(
alwaysOnTop_
)
ACG
::
GLState
::
disable
(
GL_DEPTH_TEST
);
...
...
ObjectTypes/Plane/QtPlaneSelect.hh
View file @
a922437c
...
...
@@ -106,8 +106,8 @@ class DLLEXPORT QtPlaneSelect : public QObject
public:
ACG
::
Vec3d
getNormal
(
)
{
return
normal
;
}
ACG
::
Vec3d
getSourcePoint
(
)
{
return
sourcePoint3D
;
}
unsigned
int
getNode
()
{
return
nodeIdx_
;
};
unsigned
int
getTargetIndex
()
{
return
targetIdx_
;
};
size_t
getNode
()
{
return
nodeIdx_
;
};
size_t
getTargetIndex
()
{
return
targetIdx_
;
};
/*******************************************************************************
...
...
@@ -117,8 +117,8 @@ class DLLEXPORT QtPlaneSelect : public QObject
ACG
::
GLState
&
glState
;
ACG
::
Vec3d
sourcePoint3D
;
ACG
::
Vec3d
normal
;
unsigned
int
nodeIdx_
;
unsigned
int
targetIdx_
;
size_t
nodeIdx_
;
size_t
targetIdx_
;
bool
isDragging
;
PlaneNode
*
planeNode_
;
...
...
ObjectTypes/Skeleton/Animation/AnimationHandle.hh
View file @
a922437c
...
...
@@ -59,16 +59,16 @@ public:
/// Constructs an invalid animation handle (interpreted as handle of the reference pose)
AnimationHandle
()
:
idAnimation
(
0
),
iFrame
(
0
)
{};
/// Constructs a valid handle for the given animation and frame
AnimationHandle
(
unsigned
int
idAnimation
,
unsigned
in
t
iFrame
=
0
)
:
idAnimation
(
idAnimation
+
1
),
iFrame
(
iFrame
)
{};
AnimationHandle
(
size_t
idAnimation
,
size_
t
iFrame
=
0
)
:
idAnimation
(
idAnimation
+
1
),
iFrame
(
iFrame
)
{};
/// Returns true if the handle is valid
inline
bool
isValid
()
const
{
return
idAnimation
>
0
;
}
/// Returns the animation index (zero based)
inline
unsigned
in
t
animationIndex
()
const
{
return
idAnimation
-
1
;
}
inline
size_
t
animationIndex
()
const
{
return
idAnimation
-
1
;
}
/// Returns the selected frame (zero based)
inline
unsigned
in
t
frame
()
const
{
return
iFrame
;
}
inline
size_
t
frame
()
const
{
return
iFrame
;
}
/// Sets the current animation frame (not failsafe)
inline
void
setFrame
(
unsigned
in
t
_iFrame
)
{
iFrame
=
_iFrame
;
}
inline
void
setFrame
(
size_
t
_iFrame
)
{
iFrame
=
_iFrame
;
}
/// Returns to the first frame
inline
void
firstFrame
()
{
iFrame
=
0
;
}
...
...
@@ -82,9 +82,9 @@ public:
private:
/// The one based index of the animation, set to 0 for invalid (or reference pose)
unsigned
in
t
idAnimation
;
size_
t
idAnimation
;
/// The frame number
unsigned
in
t
iFrame
;
size_
t
iFrame
;
};
#endif // ANIMATIONHANDLE_HH
ObjectTypes/Skeleton/Helper/SkeletonTransform.cc
View file @
a922437c
...
...
@@ -82,7 +82,7 @@ void SkeletonTransform::scaleSkeleton(double _factor, Skeleton::Pose* _pose) {
// if given pose is refPose
if
(
_pose
==
refPose_
){
//scale bones in the animations
for
(
unsigned
in
t
a
=
0
;
a
<
skeleton_
.
animationCount
();
a
++
)
for
(
size_
t
a
=
0
;
a
<
skeleton_
.
animationCount
();
a
++
)
for
(
unsigned
int
iFrame
=
0
;
iFrame
<
skeleton_
.
animation
(
a
)
->
frameCount
();
iFrame
++
){
Skeleton
::
Pose
*
pose
=
skeleton_
.
animation
(
a
)
->
pose
(
iFrame
);
...
...
ObjectTypes/Skeleton/JointT.cc
View file @
a922437c
...
...
@@ -100,7 +100,7 @@ JointT<PointT>::~JointT()
* not to change, unless joints are deleted from the skeleton.
*/
template
<
class
PointT
>
inline
unsigned
int
JointT
<
PointT
>::
id
()
inline
size_t
JointT
<
PointT
>::
id
()
const
{
return
id_
;
}
...
...
@@ -108,7 +108,7 @@ inline unsigned int JointT<PointT>::id()
//-----------------------------------------------------------------------------------------------------
template
<
class
PointT
>
inline
void
JointT
<
PointT
>::
setId
(
unsigned
in
t
_id
)
inline
void
JointT
<
PointT
>::
setId
(
const
size_
t
_id
)
{
id_
=
_id
;
}
...
...
@@ -167,9 +167,9 @@ inline JointT<PointT> *JointT<PointT>::parent()
//-----------------------------------------------------------------------------------------------------
template
<
class
PointT
>
inline
bool
JointT
<
PointT
>::
isRoot
()
inline
bool
JointT
<
PointT
>::
isRoot
()
const
{
return
parent_
==
NULL
;
return
(
parent_
==
NULL
)
;
}
//-----------------------------------------------------------------------------------------------------
...
...
@@ -200,7 +200,7 @@ inline typename JointT<PointT>::ChildIter JointT<PointT>::end()
* @brief Returns the number of children
*/
template
<
typename
PointT
>
inline
size_t
JointT
<
PointT
>::
size
()
inline
size_t
JointT
<
PointT
>::
size
()
const
{
return
children_
.
size
();
}
...
...
@@ -230,7 +230,7 @@ inline JointT<PointT> *JointT<PointT>::child(size_t _index)
*
*/
template
<
class
PointT
>
inline
bool
JointT
<
PointT
>::
selected
()
inline
bool
JointT
<
PointT
>::
selected
()
const
{
return
selected_
;
}
...
...
@@ -250,14 +250,14 @@ inline void JointT<PointT>::setSelected(bool _selected)
//-----------------------------------------------------------------------------------------------------
template
<
typename
PointT
>
inline
std
::
string
JointT
<
PointT
>::
name
()
{
inline
std
::
string
JointT
<
PointT
>::
name
()
const
{
return
name_
;
}
//-----------------------------------------------------------------------------------------------------
template
<
typename
PointT
>
inline
void
JointT
<
PointT
>::
setName
(
std
::
string
_name
)
{
inline
void
JointT
<
PointT
>::
setName
(
const
std
::
string
_name
)
{
name_
=
_name
;
}
...
...
ObjectTypes/Skeleton/JointT.hh
View file @
a922437c
...
...
@@ -82,13 +82,13 @@ public:
~
JointT
();
/// returns the joint id
inline
unsigned
int
id
()
;
inline
size_t
id
()
const
;
/// access parent of the joint
inline
void
setParent
(
Joint
*
_newParent
,
SkeletonT
<
PointT
>
&
_skeleton
);
inline
Joint
*
parent
();
inline
bool
isRoot
();
inline
bool
isRoot
()
const
;
public:
/**
...
...
@@ -98,7 +98,7 @@ public:
//@{
inline
ChildIter
begin
();
inline
ChildIter
end
();
inline
size_t
size
();
inline
size_t
size
()
const
;
inline
Joint
*
child
(
size_t
_index
);
//@}
...
...
@@ -107,21 +107,21 @@ public:
* change and access selection state
*/
//@{
inline
bool
selected
();
inline
bool
selected
()
const
;
inline
void
setSelected
(
bool
_selected
);
//@}
/// Access the name of the joint
inline
std
::
string
name
();
inline
void
setName
(
std
::
string
_name
);
inline
std
::
string
name
()
const
;
inline
void
setName
(
const
std
::
string
_name
);
private:
/// An unique identifier, guaranteed to be part of a continuous sequence starting from 0
unsigned
in
t
id_
;
size_
t
id_
;
bool
selected_
;
protected:
inline
void
setId
(
unsigned
in
t
_id
);
inline
void
setId
(
const
size_
t
_id
);
/// The parent joint; this joint is in its parents JointT::children_ vector. It's 0 for the root node.
Joint
*
parent_
;
...
...
ObjectTypes/Skeleton/PoseT.cc
View file @
a922437c
...
...
@@ -284,7 +284,7 @@ typename PoseT<PointT>::Matrix PoseT<PointT>::globalMatrixInv(unsigned int _join
//-----------------------------------------------------------------------------
template
<
typename
PointT
>
void
PoseT
<
PointT
>::
insertJointAt
(
unsigned
in
t
_index
)
void
PoseT
<
PointT
>::
insertJointAt
(
size_
t
_index
)
{
Matrix
id
;
id
.
identity
();
...
...
@@ -301,7 +301,7 @@ void PoseT<PointT>::insertJointAt(unsigned int _index)
//-----------------------------------------------------------------------------
template
<
typename
PointT
>
void
PoseT
<
PointT
>::
removeJointAt
(
unsigned
in
t
_index
)
void
PoseT
<
PointT
>::
removeJointAt
(
size_
t
_index
)
{
local_
.
erase
(
local_
.
begin
()
+
_index
);
global_
.
erase
(
global_
.
begin
()
+
_index
);
...
...
@@ -318,7 +318,7 @@ void PoseT<PointT>::removeJointAt(unsigned int _index)
* @param _keepChildPositions Do the children stay at the same position or do they move with their parent joint
*/
template
<
typename
PointT
>
void
PoseT
<
PointT
>::
updateFromLocal
(
unsigned
in
t
_joint
,
bool
_keepChildPositions
)
void
PoseT
<
PointT
>::
updateFromLocal
(
size_
t
_joint
,
bool
_keepChildPositions
)
{
// first update the global coordinate system
if
(
skeleton_
->
parent
(
_joint
)
==
-
1
)
...
...
@@ -336,7 +336,7 @@ void PoseT<PointT>::updateFromLocal(unsigned int _joint, bool _keepChildPosition
// update children
if
(
_keepChildPositions
)
{
// finally update all children as well
for
(
unsigned
in
t
i
=
0
;
i
<
skeleton_
->
childCount
(
_joint
);
++
i
)
{
for
(
size_
t
i
=
0
;
i
<
skeleton_
->
childCount
(
_joint
);
++
i
)
{
updateFromLocal
(
skeleton_
->
child
(
_joint
,
i
));
}
}
else
{
...
...
@@ -356,7 +356,7 @@ void PoseT<PointT>::updateFromLocal(unsigned int _joint, bool _keepChildPosition
* @param _keepChildPositions Do the children stay at the same global position or do they move with their parent joint
*/
template
<
typename
PointT
>
void
PoseT
<
PointT
>::
updateFromGlobal
(
unsigned
in
t
_joint
,
bool
_keepChildPositions
)
void
PoseT
<
PointT
>::
updateFromGlobal
(
size_
t
_joint
,
bool
_keepChildPositions
)
{
// first update the local coordinate system
if
(
skeleton_
->
parent
(
_joint
)
==
-
1
)
...
...
@@ -373,7 +373,7 @@ void PoseT<PointT>::updateFromGlobal(unsigned int _joint, bool _keepChildPositio
// update children
if
(
_keepChildPositions
)
{
for
(
unsigned
in
t
i
=
0
;
i
<
skeleton_
->
childCount
(
_joint
);
++
i
)
{
for
(
size_
t
i
=
0
;
i
<
skeleton_
->
childCount
(
_joint
);
++
i
)
{
updateFromGlobal
(
skeleton_
->
child
(
_joint
,
i
));
}
}
else
{
...
...
@@ -400,7 +400,7 @@ void PoseT<PointT>::updateFromGlobal(unsigned int _joint, bool _keepChildPositio
* @param _joint The joints index, same as for SkeletonT<>::joint
*/
template
<
typename
PointT
>
inline
const
typename
PoseT
<
PointT
>::
Matrix
&
PoseT
<
PointT
>::
unifiedMatrix
(
unsigned
in
t
_joint
)
inline
const
typename
PoseT
<
PointT
>::
Matrix
&
PoseT
<
PointT
>::
unifiedMatrix
(
size_
t
_joint
)
{
return
unified_
[
_joint
];
}
...
...
@@ -418,7 +418,7 @@ inline const typename PoseT<PointT>::Matrix& PoseT<PointT>::unifiedMatrix(unsign
* @return The rotational part of the unified matrix
*/
template
<
typename
PointT
>
inline
const
typename
PoseT
<
PointT
>::
Quaternion
&
PoseT
<
PointT
>::
unifiedRotation
(
unsigned
in
t
_joint
)
inline
const
typename
PoseT
<
PointT
>::
Quaternion
&
PoseT
<
PointT
>::
unifiedRotation
(
size_
t
_joint
)
{
return
unifiedDualQuaternion_
[
_joint
].
real
();
}
...
...
@@ -434,7 +434,7 @@ inline const typename PoseT<PointT>::Quaternion& PoseT<PointT>::unifiedRotation(
* @return The rotational part of the unified matrix
*/
template
<
typename
PointT
>
inline
const
typename
PoseT
<
PointT
>::
DualQuaternion
&
PoseT
<
PointT
>::
unifiedDualQuaternion
(
unsigned
in
t
_joint
)
inline
const
typename
PoseT
<
PointT
>::
DualQuaternion
&
PoseT
<
PointT
>::
unifiedDualQuaternion
(
size_
t
_joint
)
{
return
unifiedDualQuaternion_
[
_joint
];
}
...
...
ObjectTypes/Skeleton/PoseT.hh
View file @
a922437c
...
...
@@ -135,7 +135,7 @@ public:
* @param _index The new joint is inserted at this position. Insert new joints at the end by passing
* SkeletonT<>::jointCount() as parameter.
*/
virtual
void
insertJointAt
(
unsigned
in
t
_index
);
virtual
void
insertJointAt
(
size_
t
_index
);
/**
* \brief Called by the skeleton/animation as a joint is removed
...
...
@@ -148,7 +148,7 @@ public:
* @param _index The new joint is inserted at this position. Insert new joints at the end by passing
* SkeletonT<>::jointCount() as parameter.
*/
virtual
void
removeJointAt
(
unsigned
in
t
_index
);
virtual
void
removeJointAt
(
size_
t
_index
);
/** @} */
...
...
@@ -161,8 +161,8 @@ protected:
* @{ */
// =======================================================================================
void
updateFromLocal
(
unsigned
in
t
_joint
,
bool
_keepChildPositions
=
true
);
void
updateFromGlobal
(
unsigned
in
t
_joint
,
bool
_keepChildPositions
=
true
);
void
updateFromLocal
(
size_
t
_joint
,
bool
_keepChildPositions
=
true
);
void
updateFromGlobal
(
size_
t
_joint
,
bool
_keepChildPositions
=
true
);
/** @} */
...
...
@@ -175,9 +175,9 @@ public:
* @{ */
// =======================================================================================
inline
const
Matrix
&
unifiedMatrix
(
unsigned
in
t
_joint
);
inline
const
Quaternion
&
unifiedRotation
(
unsigned
in
t
_joint
);
inline
const
DualQuaternion
&
unifiedDualQuaternion
(
unsigned
in
t
_joint
);
inline
const
Matrix
&
unifiedMatrix
(
size_
t
_joint
);
inline
const
Quaternion
&
unifiedRotation
(
size_
t
_joint
);
inline
const
DualQuaternion
&
unifiedDualQuaternion
(
size_
t
_joint
);
/** @} */
...
...
ObjectTypes/Skeleton/SkeletonNodeT.cc
View file @
a922437c
...
...
@@ -860,7 +860,7 @@ void SkeletonNodeT<SkeletonType>::getRenderObjects(IRenderer* _renderer,
_state
));
GLMatrixf
modelview
=
ro
.
modelview
;
modelview
.
translate
(
globalPosD
[
0
],
globalPosD
[
1
],
globalPosD
[
2
]
);
modelview
.
translate
(
static_cast
<
float
>
(
globalPosD
[
0
]),
static_cast
<
float
>
(
globalPosD
[
1
]),
static_cast
<
float
>
(
globalPosD
[
2
])
);
modelview
.
scale
(
sphereSize
,
sphereSize
,
sphereSize
);
// store matrix
...
...
ObjectTypes/Skeleton/SkeletonT.cc
View file @
a922437c
...
...
@@ -308,7 +308,7 @@ SkeletonT<PointT>::AnimationIterator::AnimationIterator(std::vector<Animation*>&
*
*/
template
<
typename
PointT
>
SkeletonT
<
PointT
>::
AnimationIterator
::
AnimationIterator
(
std
::
vector
<
Animation
*>&
_animations
,
unsigned
in
t
_animationIndex
)
:
SkeletonT
<
PointT
>::
AnimationIterator
::
AnimationIterator
(
std
::
vector
<
Animation
*>&
_animations
,
size_
t
_animationIndex
)
:
animations_
(
_animations
)
{
currentIndex_
=
_animationIndex
;
...
...
@@ -493,7 +493,7 @@ SkeletonT<PointT>::~SkeletonT( )
template
<
typename
PointT
>
void
SkeletonT
<
PointT
>::
addJoint
(
typename
SkeletonT
<
PointT
>::
Joint
*
_pParent
,
typename
SkeletonT
<
PointT
>::
Joint
*
_pJoint
)
{
unsigned
in
t
newJointID
;
size_
t
newJointID
;
if
(
_pParent
==
0
)
{
...
...
@@ -639,7 +639,7 @@ inline typename SkeletonT<PointT>::Joint *SkeletonT<PointT>::root()
* @return Returns a pointer to the joint or 0 if the index does not exist.
*/
template
<
typename
PointT
>
inline
typename
SkeletonT
<
PointT
>::
Joint
*
SkeletonT
<
PointT
>::
joint
(
const
unsigned
in
t
&
_index
)
inline
typename
SkeletonT
<
PointT
>::
Joint
*
SkeletonT
<
PointT
>::
joint
(
const
size_
t
&
_index
)
{
if
(
_index
>=
joints_
.
size
())
return
0
;
...
...
@@ -655,7 +655,7 @@ inline typename SkeletonT<PointT>::Joint *SkeletonT<PointT>::joint(const unsigne
* @return The parent nodes index or -1 if \e _joint is the root node
*/
template
<
typename
PointT
>
int
SkeletonT
<
PointT
>::
parent
(
unsigned
in
t
_joint
)
int
SkeletonT
<
PointT
>::
parent
(
size_
t
_joint
)
{
if
(
joints_
[
_joint
]
->
parent
()
==
0
)
return
-
1
;
...
...
@@ -668,7 +668,7 @@ int SkeletonT<PointT>::parent(unsigned int _joint)
* @brief Returns the number of children of the given node
*/
template
<
typename
PointT
>
unsigned
int
SkeletonT
<
PointT
>::
childCount
(
unsigned
in
t
_joint
)
size_t
SkeletonT
<
PointT
>::
childCount
(
size_
t
_joint
)
{
if
(
_joint
>=
joints_
.
size
()
){
std
::
cerr
<<
"SkeletonT : childCount() called with non-existing joint "
<<
_joint
<<
std
::
endl
;
...
...
@@ -687,7 +687,7 @@ unsigned int SkeletonT<PointT>::childCount(unsigned int _joint)
* @param _child An index identifying a child of that joint
*/
template
<
typename
PointT
>
unsigned
int
SkeletonT
<
PointT
>::
child
(
unsigned
int
_joint
,
unsigned
in
t
_child
)
size_t
SkeletonT
<
PointT
>::
child
(
size_t
_joint
,
size_
t
_child
)
{
return
joints_
[
_joint
]
->
child
(
_child
)
->
id
();
}
...
...
@@ -698,7 +698,7 @@ unsigned int SkeletonT<PointT>::child(unsigned int _joint, unsigned int _child)
* @brief Returns the number of joints
*/
template
<
typename
PointT
>
unsigned
in
t
SkeletonT
<
PointT
>::
jointCount
()
size_
t
SkeletonT
<
PointT
>::
jointCount
()
{
return
joints_
.
size
();
}
...
...
@@ -783,11 +783,11 @@ AnimationHandle SkeletonT<PointT>::addAnimation(std::string _name, Animation *_a
if
(
f
==
animations_
.
end
())
{
// all in use, append
names_
.
insert
(
std
::
pair
<
std
::
string
,
unsigned
in
t
>
(
_name
,
animations_
.
size
())
);
names_
.
insert
(
std
::
pair
<
std
::
string
,
size_
t
>
(
_name
,
animations_
.
size
())
);
animations_
.
push_back
(
_animation
);
}
else
{
// found an empty one, use it
names_
.
insert
(
std
::
pair
<
std
::
string
,
unsigned
in
t
>
(
_name
,
f
-
animations_
.
begin
())
);
names_
.
insert
(
std
::
pair
<
std
::
string
,
size_
t
>
(
_name
,
f
-
animations_
.
begin
())
);
*
f
=
_animation
;
}
...
...
@@ -817,14 +817,14 @@ AnimationHandle SkeletonT<PointT>::cloneAnimation(std::string _name, const Anima
if
(
f
==
animations_
.
end
())
{
// all in use, append
names_
.
insert
(
std
::
pair
<
std
::
string
,
unsigned
in
t
>
(
_name
,
animations_
.
size
())
);
names_
.
insert
(
std
::
pair
<
std
::
string
,
size_
t
>
(
_name
,
animations_
.
size
())
);
if
(
animation
(
_hAni
)
!=
0
)
animations_
.
push_back
((
*
animation
(
_hAni
)).
copy
());
else
animations_
.
push_back
(
new
FrameAnimationT
<
Point
>
(
referencePose_
));
}
else
{
// found an empty one, use it
names_
.
insert
(
std
::
pair
<
std
::
string
,
unsigned
in
t
>
(
_name
,
f
-
animations_
.
begin
())
);
names_
.
insert
(
std
::
pair
<
std
::
string
,
size_
t
>
(
_name
,
f
-
animations_
.
begin
())
);
if
(
animation
(
_hAni
)
!=
0
)
*
f
=
(
*
animation
(
_hAni
)).
copy
();
else
...
...
@@ -842,7 +842,7 @@ AnimationHandle SkeletonT<PointT>::cloneAnimation(std::string _name, const Anima
template
<
typename
PointT
>
AnimationHandle
SkeletonT
<
PointT
>::
animationHandle
(
std
::
string
_name
)
{
std
::
map
<
std
::
string
,
unsigned
in
t
>::
iterator
f
=
names_
.
find
(
_name
);
std
::
map
<
std
::
string
,
size_
t
>::
iterator
f
=
names_
.
find
(
_name
);
if
(
f
==
names_
.
end
())
return
AnimationHandle
();
...
...
@@ -857,7 +857,7 @@ AnimationHandle SkeletonT<PointT>::animationHandle(std::string _name)
template
<
typename
PointT
>
typename
SkeletonT
<
PointT
>::
Animation
*
SkeletonT
<
PointT
>::
animation
(
std
::
string
_name
)
{
std
::
map
<
std
::
string
,
unsigned
in
t
>::
iterator
f
=
names_
.
find
(
_name
);
std
::
map
<
std
::
string
,
size_
t
>::
iterator
f
=
names_
.
find
(
_name
);
if
(
f
==
names_
.
end
())
return
0
;
...
...
@@ -886,7 +886,7 @@ template<typename PointT>
void
SkeletonT
<
PointT
>::
removeAnimation
(
std
::
string
_name
)
{
// get an iterator for the animation
std
::
map
<
std
::
string
,
unsigned
in
t
>::
iterator
f
=
names_
.
find
(
_name
);
std
::
map
<
std
::
string
,
size_
t
>::
iterator
f
=
names_
.
find
(
_name
);
if
(
f
==
names_
.
end
())
return
;
...
...
@@ -910,7 +910,7 @@ void SkeletonT<PointT>::removeAnimation(const AnimationHandle &_hAni)
animations_
[
_hAni
.
animationIndex
()]
=
0
;
// remove the name entry
for
(
typename
std
::
map
<
std
::
string
,
unsigned
in
t
>::
iterator
it
=
names_
.
begin
();
it
!=
names_
.
end
();
++
it
)
for
(
typename
std
::
map
<
std
::
string
,
size_
t
>::
iterator
it
=
names_
.
begin
();
it
!=
names_
.
end
();
++
it
)
{
if
(
it
->
second
==
_hAni
.
animationIndex
())
{
...
...
@@ -968,7 +968,7 @@ typename SkeletonT<PointT>::AnimationIterator SkeletonT<PointT>::animationsEnd()
* @see animationName
*/
template
<
typename
PointT
>
unsigned
in
t
SkeletonT
<
PointT
>::
animationCount
()
size_
t
SkeletonT
<
PointT
>::
animationCount
()
{
return
names_
.
size
();
}
...
...
@@ -981,14 +981,12 @@ unsigned int SkeletonT<PointT>::animationCount()
* @see animationCount
*/
template
<
typename
PointT
>
const
std
::
string
&
SkeletonT
<
PointT
>::
animationName
(
unsigned
in
t
_index
)
const
std
::
string
&
SkeletonT
<
PointT
>::
animationName
(
size_
t
_index
)
{
unsigned
int
i
=
0
;
std
::
map
<
std
::
string
,
unsigned
int
>::
iterator
pos
=
names_
.
begin
();
std
::
map
<
std
::
string
,
size_t
>::
iterator
pos
=
names_
.
begin
();
while
(
pos
->
second
!=
_index
&&
pos
!=
names_
.
end
())
{
++
i
;
++
pos
;
}
...
...
@@ -1003,7 +1001,7 @@ const std::string &SkeletonT<PointT>::animationName(unsigned int _index)
* @param _idJoint The joints index
*/
template
<
typename
PointT
>
void
SkeletonT
<
PointT
>::
updateFromGlobal
(
unsigned
in
t
_idJoint
)
void
SkeletonT
<
PointT
>::
updateFromGlobal
(
size_
t
_idJoint
)
{
referencePose_
.
updateFromGlobal
(
_idJoint
);
for
(
typename
std
::
vector
<
Animation
*>::
iterator
it
=
animations_
.
begin
();
it
!=
animations_
.
end
();
++
it
)
{
...
...
@@ -1029,7 +1027,7 @@ void SkeletonT<PointT>::insertJoint(typename SkeletonT<PointT>::Joint *_pChild,
Joint
*
parent
=
_pChild
->
parent
();
//update IDs of our joints
unsigned
in
t
childID
=
_pChild
->
id
();
size_
t
childID
=
_pChild
->
id
();
for
(
typename
std
::
vector
<
Joint
*>::
iterator
it
=
joints_
.
begin
()
+
childID
;
it
!=
joints_
.
end
();
++
it
)
(
*
it
)
->
setId
((
*
it
)
->
id
()
+
1
);
...
...
ObjectTypes/Skeleton/SkeletonT.hh
View file @
a922437c
...
...
@@ -120,7 +120,7 @@ public:
class
AnimationIterator
{
public:
AnimationIterator
(
std
::
vector
<
Animation
*>&
_animations
);
AnimationIterator
(
std
::
vector
<
Animation
*>&
_animations
,
unsigned
in
t
_animationIndex
);
AnimationIterator
(
std
::
vector
<
Animation
*>&
_animations
,
size_
t
_animationIndex
);
public:
AnimationIterator
&
operator
++
();
...
...
@@ -129,7 +129,7 @@ public:
operator
bool
()
const
;
private:
unsigned
in
t
currentIndex_
;
size_
t
currentIndex_
;
std
::
vector
<
Animation
*>&
animations_
;
};
...
...
@@ -164,11 +164,11 @@ public:
*/
///@{
inline
Joint
*
root
();
inline
Joint
*
joint
(
const
unsigned
in
t
&
_index
);
int
parent
(
unsigned
in
t
_joint
);
unsigned
int
childCount
(
unsigned
in
t
_joint
);
unsigned
int
child
(
unsigned
int
_joint
,
unsigned