Gizmo3D

gzFrame.h

Go to the documentation of this file.
00001 //*****************************************************************************
00002 // File         : gzFrame.h
00003 // Module       : 
00004 // Description  : Class definition of the gzFrame class
00005 // Author       : Anders Modén      
00006 // Product      : Gizmo3D 2.1.1
00007 //      
00008 // Copyright © 2003- Saab Training Systems AB, Sweden
00009 //          
00010 // NOTE:    Gizmo3D is a high performance 3D Scene Graph and effect visualisation 
00011 //          C++ toolkit for Linux, Mac OS X, Windows (Win32) and IRIX® for  
00012 //          usage in Game or VisSim development.
00013 //
00014 //
00015 // Revision History...                          
00016 //                                  
00017 // Who  Date    Description                     
00018 //                                  
00019 // AMO  990519  Created file 
00020 // AMO  000516  Updated with CYCLE and SWING modes  
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 // Class    : gzFrame
00042 //                                  
00043 // Purpose  : -
00044 //                                  
00045 // Notes    : - 
00046 //                                  
00047 // Revision History...                          
00048 //                                  
00049 // Who  Date    Description                     
00050 //                                  
00051 // AMO  990519  Created 
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);  // typed interface
00062 
00063 
00064     // ---------- Clone interface ---------------------------------------
00065     GZ_GRAPH_EXPORT virtual gzReference* clone() const;
00066 
00067     // ---------- gzFrame commands --------------------------------------
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     // ---------- Equal Frame Duration ----------------------------------
00075     GZ_GRAPH_EXPORT gzVoid      setFrameDuration(gzDouble length);
00076     GZ_GRAPH_EXPORT gzDouble    getFrameDuration();
00077 
00078     // ---------- Non Equal frame Duration ------------------------------
00079     GZ_GRAPH_EXPORT gzVoid      setFrameDuration(gzULong frame , gzDouble length);
00080     GZ_GRAPH_EXPORT gzDouble    getFrameDuration(gzULong frame);
00081 
00082     // ---------- Common settings ---------------------------------------
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     // ----------- gzGroup interface ------------------------------------
00108 
00109     GZ_GRAPH_EXPORT virtual gzBool  isChildOrderDependant();
00110 
00111     // ---------- Action Interface --------------------------------------
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 // Class    : gzActiveFrame
00141 //                                  
00142 // Purpose  : Hold frame activation
00143 //                                  
00144 // Notes    : - 
00145 //                                  
00146 // Revision History...                          
00147 //                                  
00148 // Who  Date    Description                     
00149 //                                  
00150 // AMO  990607  Created 
00151 //                                  
00152 //******************************************************************************
00153 class gzActiveFrame
00154 {
00155 public:
00156     gzActiveFrame():isActive(FALSE){};
00157     gzBool  isActive;
00158 };
00159 
00160 //******************************************************************************
00161 // Class    : gzFrameKey
00162 //                                  
00163 // Purpose  : -
00164 //                                  
00165 // Notes    : - 
00166 //                                  
00167 // Revision History...                          
00168 //                                  
00169 // Who  Date    Description                     
00170 //                                  
00171 // AMO  990607  Created 
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);  // typed interface
00180 
00181 
00182     // ---------- Clone interface ---------------------------------------
00183     GZ_GRAPH_EXPORT virtual gzReference* clone() const;
00184 
00185     // ---------- gzFrame commands -------------------------------------
00186 
00187     GZ_GRAPH_EXPORT gzVoid  activateFrame( gzULong count);
00188     GZ_GRAPH_EXPORT gzVoid  deactivateFrame( gzULong count);
00189 
00190 
00191     // ---------- Action Interface --------------------------------------
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

Documentation for Gizmo3D generated at Wed Feb 20 11:54:04 2008 by   Saab Training Systems AB, ¸ (c) 2003-and beyond