HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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_Array.h>
18 #include <UT/UT_NonCopyable.h>
19 #include <UT/UT_String.h>
20 #include <SYS/SYS_Types.h>
21 #include <iosfwd>
22 
24 {
25 public:
26  CH_TimeGroup(const char *name, fpreal time);
27  ~CH_TimeGroup();
28 
30 
31  const UT_String &getName() const { return myName; }
32  fpreal getTime() const { return myTime; }
33  void setTime(fpreal t) { myTime = t; }
34  int getIndex() const;
35 
36  void setSelect(bool state) { mySelectState = state; }
37  bool isSelected() const { return mySelectState; }
38 
39  void clearAndDestroy();
40 
41  // returns a sorted channel list
42  const CH_ChannelList&getChannels() { return myChannels; }
43  CH_Segment *getEntry( CH_Channel *chp, int i );
44  int numEntries( CH_Channel *chp ) const;
45  int numEntries() const;
46 
47  bool findEntry(const CH_Segment *segp) const;
48  // this will check for duplicates
49  void addEntry(CH_Segment *segp, bool affect_segments=true);
50  void removeEntry(CH_Segment *segp,
51  bool affect_segments = true);
52 
53  bool testShift( bool snap_to_frame,
54  fpreal accepted_dt, fpreal &attempted_dt );
55  void shift(fpreal t);
56 
57  void save(std::ostream &os, int binary) const;
58  bool load(UT_IStream &is);
59  void printEntries(std::ostream &os, bool use_time,
60  bool show_keys=true) const;
61 
62  void setAcceptedDt( fpreal a ) { myAcceptedDt = a; }
63  fpreal getAcceptedDt() const { return myAcceptedDt; }
64 
65 #ifdef INTEL_COMPILER
66 private:
67  void operator=(const CH_TimeGroup& ) { }
68  CH_TimeGroup(const CH_TimeGroup& ) { }
69 #endif
70 
71 private:
72 
73  friend class CH_Manager;
74  void setName(const char *name) { myName.harden(name); }
75 
76  int findChannel(const CH_Channel *) const;
77  int addChannel(CH_Channel *);
78 
79  UT_String myName;
80  fpreal myTime;
81  fpreal myAcceptedDt;
82  CH_ChannelList myChannels;
83  UT_Array< CH_SegmentList > mySegments;
84  unsigned mySelectState:1;
85 };
86 
87 #endif
fpreal getAcceptedDt() const
Definition: CH_TimeGroup.h:63
GT_API const UT_StringHolder time
const GLuint GLenum const void * binary
Definition: glcorearb.h:1924
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1222
void setAcceptedDt(fpreal a)
Definition: CH_TimeGroup.h:62
void setSelect(bool state)
Definition: CH_TimeGroup.h:36
bool isSelected() const
Definition: CH_TimeGroup.h:37
PXL_API const char * getName(const ColorSpace *space)
Return the name of the color space.
void setTime(fpreal t)
Definition: CH_TimeGroup.h:33
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
GLuint const GLchar * name
Definition: glcorearb.h:786
GLdouble t
Definition: glad.h:2397
fpreal getTime() const
Definition: CH_TimeGroup.h:32
fpreal64 fpreal
Definition: SYS_Types.h:277
#define CH_API
Definition: CH_API.h:10
LeafData & operator=(const LeafData &)=delete
const CH_ChannelList & getChannels()
Definition: CH_TimeGroup.h:42