00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __GZ_FRAME_H__
00024 #define __GZ_FRAME_H__
00025
00032 #include "gzGroup.h"
00033
00034 typedef enum {
00035 GZ_FRAME_CYCLE ,
00036 GZ_FRAME_SWING
00037
00038 } gzFrameType;
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 class gzFrame : public gzGroup
00055 {
00056 public:
00057 GZ_GRAPH_EXPORT gzFrame(const gzString & name=GZ_EMPTY_STRING);
00058
00059 GZ_GRAPH_EXPORT virtual ~gzFrame(){};
00060
00061 GZ_DECLARE_TYPE_INTERFACE_EXPORT(GZ_GRAPH_EXPORT);
00062
00063
00064
00065 GZ_GRAPH_EXPORT virtual gzReference* clone() const;
00066
00067
00068
00069 GZ_GRAPH_EXPORT gzVoid startFrameCounter(const gzDouble &startTime=0);
00070 GZ_GRAPH_EXPORT gzVoid stopFrameCounter();
00071
00072 GZ_GRAPH_EXPORT gzBool isRunning();
00073
00074
00075 GZ_GRAPH_EXPORT gzVoid setFrameDuration(gzDouble length);
00076 GZ_GRAPH_EXPORT gzDouble getFrameDuration();
00077
00078
00079 GZ_GRAPH_EXPORT gzVoid setFrameDuration(gzULong frame , gzDouble length);
00080 GZ_GRAPH_EXPORT gzDouble getFrameDuration(gzULong frame);
00081
00082
00083 GZ_GRAPH_EXPORT gzVoid setFrameType(gzFrameType type);
00084 GZ_GRAPH_EXPORT gzFrameType getFrameType();
00085
00086 GZ_GRAPH_EXPORT gzVoid selectChildPerFrame(gzBool flag);
00087 GZ_GRAPH_EXPORT gzBool selectChildPerFrame();
00088
00089 GZ_GRAPH_EXPORT gzVoid setNumberOfFrames( gzULong count);
00090 GZ_GRAPH_EXPORT gzULong getNumberOfFrames();
00091
00092 GZ_GRAPH_EXPORT gzVoid setStartFrameOffset( gzULong count);
00093 GZ_GRAPH_EXPORT gzULong getStartFrameOffset();
00094
00095 GZ_GRAPH_EXPORT gzVoid setFrameIndex( gzULong index);
00096 GZ_GRAPH_EXPORT gzULong getFrameIndex();
00097
00098 GZ_GRAPH_EXPORT gzVoid setNextFrameIndex( gzULong index);
00099 GZ_GRAPH_EXPORT gzULong getNextFrameIndex();
00100
00101 GZ_GRAPH_EXPORT gzVoid setFrameFraction(gzDouble fraction);
00102 GZ_GRAPH_EXPORT gzDouble getFrameFraction();
00103
00104 GZ_GRAPH_EXPORT gzVoid setRepeatCount(gzULong repeatCount);
00105 GZ_GRAPH_EXPORT gzVoid setSpeedFactor(gzDouble factor);
00106
00107
00108
00109 GZ_GRAPH_EXPORT virtual gzBool isChildOrderDependant();
00110
00111
00112
00113 GZ_GRAPH_EXPORT virtual gzBool isTraversable( gzTraverseAction *action , gzNode *node , gzULong index, gzContext *context);
00114 GZ_GRAPH_EXPORT virtual gzVoid preTraverseAction( gzTraverseAction *actionclass , gzContext *context);
00115 GZ_GRAPH_EXPORT virtual gzVoid postTraverseAction( gzTraverseAction *actionclass , gzContext *context);
00116
00117 private:
00118
00119 gzULong m_frameIndex;
00120 gzULong m_nextFrameIndex;
00121 gzULong m_startFrameOffset;
00122 gzULong m_frames;
00123 gzULong m_repeatCount;
00124
00125 gzBool m_running:1;
00126 gzBool m_uniformFrames:1;
00127 gzBool m_selectChildPerFrame:1;
00128 gzBool m_calculatedSweepTime:1;
00129
00130 gzDynamicArray<gzDouble> m_frameLength;
00131
00132 gzDouble m_frameFraction;
00133 gzDouble m_sweepTime;
00134 gzDouble m_startTime;
00135 gzDouble m_speedFactor;
00136 gzFrameType m_frameType;
00137 };
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153 class gzActiveFrame
00154 {
00155 public:
00156 gzActiveFrame():isActive(FALSE){};
00157 gzBool isActive;
00158 };
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174 class gzFrameKey : public gzGroup
00175 {
00176 public:
00177 GZ_GRAPH_EXPORT gzFrameKey(const gzString & name=GZ_EMPTY_STRING);
00178
00179 GZ_DECLARE_TYPE_INTERFACE_EXPORT(GZ_GRAPH_EXPORT);
00180
00181
00182
00183 GZ_GRAPH_EXPORT virtual gzReference* clone() const;
00184
00185
00186
00187 GZ_GRAPH_EXPORT gzVoid activateFrame( gzULong count);
00188 GZ_GRAPH_EXPORT gzVoid deactivateFrame( gzULong count);
00189
00190
00191
00192
00193 GZ_GRAPH_EXPORT virtual gzBool isTraversable( gzTraverseAction *action , gzNode *node , gzULong index, gzContext *context);
00194
00195 private:
00196 gzDynamicArray<gzActiveFrame> m_activeFrames;
00197 };
00198
00199 #endif