Developer Documentation

SkeletonObject.hh
Go to the documentation of this file.
1 /*===========================================================================*\
2 * *
3 * OpenFlipper *
4 * Copyright (c) 2001-2015, RWTH-Aachen University *
5 * Department of Computer Graphics and Multimedia *
6 * All rights reserved. *
7 * www.openflipper.org *
8 * *
9 *---------------------------------------------------------------------------*
10 * This file is part of OpenFlipper. *
11 *---------------------------------------------------------------------------*
12 * *
13 * Redistribution and use in source and binary forms, with or without *
14 * modification, are permitted provided that the following conditions *
15 * are met: *
16 * *
17 * 1. Redistributions of source code must retain the above copyright notice, *
18 * this list of conditions and the following disclaimer. *
19 * *
20 * 2. Redistributions in binary form must reproduce the above copyright *
21 * notice, this list of conditions and the following disclaimer in the *
22 * documentation and/or other materials provided with the distribution. *
23 * *
24 * 3. Neither the name of the copyright holder nor the names of its *
25 * contributors may be used to endorse or promote products derived from *
26 * this software without specific prior written permission. *
27 * *
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
30 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
31 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
32 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
33 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
34 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
35 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
36 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
37 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
38 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
39 * *
40 \*===========================================================================*/
41
42 //=============================================================================
43 //
44 // Types
45 //
46 //=============================================================================
47
53 #pragma once
54
55
56 //== INCLUDES =================================================================
57
58 #include "SkeletonTypes.hh"
59 #include <OpenFlipper/common/BaseObjectData.hh>
60 #include <OpenFlipper/common/ObjectTypeDLLDefines.hh>
61 #include <OpenFlipper/common/GlobalOptions.hh>
62
63 #include "SkeletonNodeT.hh"
64
65
66 //== TYPEDEFS =================================================================
67
68 //== CLASS DEFINITION =========================================================
69
72 class OBJECTTYPEDLLEXPORT SkeletonObject : public BaseObjectData {
73
74 friend class TypeSkeletonPlugin;
75
76 public:
78 SkeletonObject();
80 SkeletonObject(const SkeletonObject &_other);
82 virtual ~SkeletonObject();
84 virtual void cleanup();
85
86 virtual BaseObject* copy();
87
88 protected:
90 virtual void init();
91 void init(Skeleton* _pSkeleton);
92
97 public:
99 void setName( QString _name );
101
106 public:
108 Skeleton* skeleton();
109
110 private:
112 Skeleton* skeleton_;
114
119 public:
121 ACG::SceneGraph::SkeletonNodeT< Skeleton >* skeletonNode();
122
123 private:
125 ACG::SceneGraph::SkeletonNodeT< Skeleton >* skeletonNode_;
127
132 public:
134 QString getObjectinfo();
136
141 public:
143 bool picked( uint _node_idx );
145 void enablePicking( bool _enable );
147 bool pickingEnabled();
149
150 AnimationHandle activePose();
151 void setActivePose(const AnimationHandle &_hAni);
152
153 void showIndices(bool _bVisible = true);
154 bool indicesVisible();
155
156 void updateIndices();
157 void updateIndices(const AnimationHandle &_hAni);
158
159 void showMotionPath(bool _visible = true);
160 bool motionPathVisible();
161
162 void updateMotionPath();
163 void updateMotionPath(const AnimationHandle &_hAni);
164
165
166 //===========================================================================
173 //===========================================================================
174
175 protected:
183 void update(UpdateType _type = UPDATE_ALL );
184
186 };
187
UpdateType
Update type class.
Definition: UpdateType.hh:60
BaseObject::getObjectinfo
virtual QString getObjectinfo()
Get all Info for the Object as a string.
Definition: BaseObject.cc:244
UPDATE_ALL
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
SkeletonObject::skeletonNode_
ACG::SceneGraph::SkeletonNodeT< Skeleton > * skeletonNode_
A pointer to the scenegraph node.
Definition: SkeletonObject.hh:125
BaseObjectData::update
virtual void update(UpdateType _type=UPDATE_ALL)
This function is called to update the object.
Definition: BaseObjectData.cc:329
ObjectTypeDLLDefines.hh
SkeletonT
Definition: JointT.hh:50
SkeletonTypes.hh
BaseObjectData::cleanup
virtual void cleanup()
Definition: BaseObjectData.cc:102
BaseObjectData.hh
BaseObjectData::pickingEnabled
virtual bool pickingEnabled()
Definition: BaseObjectData.cc:318
GlobalOptions.hh
ACG::SceneGraph::SkeletonNodeT
Definition: SkeletonNodeT.hh:77
BaseObjectData::setName
virtual void setName(QString _name)
path to the file from which the object is loaded ( defaults to "." )
Definition: BaseObjectData.cc:355
AnimationHandle
A handle used to refer to an animation or to a specific frame in an animation.
Definition: AnimationHandle.hh:47
SkeletonObject::skeleton_
Skeleton * skeleton_
A pointer to the skeleton data.
Definition: SkeletonObject.hh:112
BaseObjectData::enablePicking
virtual void enablePicking(bool _enable)
Definition: BaseObjectData.cc:315
BaseObject
Definition: BaseObject.hh:82
TypeSkeletonPlugin
Definition: TypeSkeleton.hh:60
BaseObject::copy
virtual BaseObject * copy()
Returns a full copy of the object.
Definition: BaseObject.cc:769
BaseObjectData::picked
virtual bool picked(uint _node_idx)
detect if the node has been picked
Definition: BaseObjectData.cc:311
SkeletonObject
Definition: SkeletonObject.hh:72
BaseObjectData
Definition: BaseObjectData.hh:102