00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Dale Ducharme 00008 * Side Effects 00009 * 477 Richmond Street West 00010 * Toronto, Ontario 00011 * Canada M5V 3E7 00012 * 416-504-9876 00013 * 00014 * NAME: CH library (C++) 00015 * 00016 * COMMENTS: Keyframe Group container 00017 * 00018 */ 00019 00020 #ifndef __CH_TimeGroup_h__ 00021 #define __CH_TimeGroup_h__ 00022 00023 #include "CH_API.h" 00024 #include <iostream.h> 00025 #include <UT/UT_String.h> 00026 #include <UT/UT_RefArray.h> 00027 #include <UT/UT_FloatArray.h> 00028 #include "CH_Types.h" 00029 00030 class CH_API CH_TimeGroup { 00031 public: 00032 CH_TimeGroup(const char *name, float time); 00033 ~CH_TimeGroup(); 00034 00035 const UT_String &getName() const { return myName; } 00036 float getTime() const { return myTime; } 00037 void setTime(float t) { myTime = t; } 00038 int getIndex() const; 00039 00040 void setSelect(bool state) { mySelectState = state; } 00041 bool isSelected() const { return mySelectState; } 00042 00043 void clearAndDestroy(); 00044 00045 // returns a sorted channel list 00046 const CH_ChannelList&getChannels() { return myChannels; } 00047 CH_Segment *getEntry( CH_Channel *chp, int i ); 00048 int numEntries( CH_Channel *chp ) const; 00049 int numEntries() const; 00050 00051 bool findEntry(const CH_Segment *segp) const; 00052 // this will check for duplicates 00053 void addEntry(CH_Segment *segp, bool affect_segments=true); 00054 void removeEntry(CH_Segment *segp, 00055 bool affect_segments = true); 00056 00057 bool testShift( bool snap_to_frame, 00058 float accepted_dt, float &attempted_dt ); 00059 void shift(float t); 00060 00061 void save(ostream &os, int binary) const; 00062 bool load(UT_IStream &is); 00063 void printEntries(ostream &os, bool use_time, 00064 bool show_keys=true) const; 00065 00066 void setAcceptedDt( float a ) { myAcceptedDt = a; } 00067 float getAcceptedDt() const { return myAcceptedDt; } 00068 00069 #ifdef INTEL_COMPILER 00070 private: 00071 void operator=(const CH_TimeGroup& ) { } 00072 CH_TimeGroup(const CH_TimeGroup& ) { } 00073 #endif 00074 00075 private: 00076 00077 friend class CH_Manager; 00078 void setName(const char *name) { myName.harden(name); } 00079 00080 int findChannel(const CH_Channel *) const; 00081 int addChannel(CH_Channel *); 00082 00083 UT_String myName; 00084 float myTime; 00085 float myAcceptedDt; 00086 CH_ChannelList myChannels; 00087 UT_RefArray< CH_SegmentList > mySegments; 00088 unsigned mySelectState:1; 00089 }; 00090 00091 #endif
1.5.9