HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CH_TimeGroup.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: CH library (C++)
7  *
8  * COMMENTS: Keyframe Group container
9  *
10  */
11 
12 #ifndef __CH_TimeGroup_h__
13 #define __CH_TimeGroup_h__
14 
15 #include "CH_API.h"
16 #include "CH_Types.h"
17 #include <UT/UT_String.h>
18 #include <UT/UT_Array.h>
19 #include <SYS/SYS_Types.h>
20 #include <iosfwd>
21 
23 public:
24  CH_TimeGroup(const char *name, fpreal time);
25  ~CH_TimeGroup();
26 
27  const UT_String &getName() const { return myName; }
28  fpreal getTime() const { return myTime; }
29  void setTime(fpreal t) { myTime = t; }
30  int getIndex() const;
31 
32  void setSelect(bool state) { mySelectState = state; }
33  bool isSelected() const { return mySelectState; }
34 
35  void clearAndDestroy();
36 
37  // returns a sorted channel list
38  const CH_ChannelList&getChannels() { return myChannels; }
39  CH_Segment *getEntry( CH_Channel *chp, int i );
40  int numEntries( CH_Channel *chp ) const;
41  int numEntries() const;
42 
43  bool findEntry(const CH_Segment *segp) const;
44  // this will check for duplicates
45  void addEntry(CH_Segment *segp, bool affect_segments=true);
46  void removeEntry(CH_Segment *segp,
47  bool affect_segments = true);
48 
49  bool testShift( bool snap_to_frame,
50  fpreal accepted_dt, fpreal &attempted_dt );
51  void shift(fpreal t);
52 
53  void save(std::ostream &os, int binary) const;
54  bool load(UT_IStream &is);
55  void printEntries(std::ostream &os, bool use_time,
56  bool show_keys=true) const;
57 
58  void setAcceptedDt( fpreal a ) { myAcceptedDt = a; }
59  fpreal getAcceptedDt() const { return myAcceptedDt; }
60 
61 #ifdef INTEL_COMPILER
62 private:
63  void operator=(const CH_TimeGroup& ) { }
64  CH_TimeGroup(const CH_TimeGroup& ) { }
65 #endif
66 
67 private:
68 
69  friend class CH_Manager;
70  void setName(const char *name) { myName.harden(name); }
71 
72  int findChannel(const CH_Channel *) const;
73  int addChannel(CH_Channel *);
74 
75  UT_String myName;
76  fpreal myTime;
77  fpreal myAcceptedDt;
78  CH_ChannelList myChannels;
79  UT_Array< CH_SegmentList > mySegments;
80  unsigned mySelectState:1;
81 };
82 
83 #endif
fpreal getAcceptedDt() const
Definition: CH_TimeGroup.h:59
const GLuint GLenum const void * binary
Definition: glcorearb.h:1923
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1221
void setAcceptedDt(fpreal a)
Definition: CH_TimeGroup.h:58
png_uint_32 i
Definition: png.h:2877
void setSelect(bool state)
Definition: CH_TimeGroup.h:32
bool isSelected() const
Definition: CH_TimeGroup.h:33
void setTime(fpreal t)
Definition: CH_TimeGroup.h:29
GLuint const GLchar * name
Definition: glcorearb.h:785
double fpreal
Definition: SYS_Types.h:263
fpreal getTime() const
Definition: CH_TimeGroup.h:28
#define CH_API
Definition: CH_API.h:10
const UT_String & getName() const
Definition: CH_TimeGroup.h:27
const CH_ChannelList & getChannels()
Definition: CH_TimeGroup.h:38