HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CHOP_Fitter.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: CHOP_Fitter.h ( CHOP Library, C++)
7  *
8  * COMMENTS:
9  *
10  * Utilities to convert between raw tracks and channels
11  */
12 
13 #ifndef __CHOP_Fitter__
14 #define __CHOP_Fitter__
15 
16 #include "CHOP_API.h"
17 
18 #include <CH/CH_Filters.h>
19 #include <CL/CL_Clip.h>
20 #include <OP/OP_Channels.h>
21 #include <UT/UT_StringArray.h>
22 
23 class CHOP_Node;
24 
26 {
27 
28 public:
29 
30  CHOP_Fitter();
31  ~CHOP_Fitter();
32 
33  int convertToCollection(const CL_Clip &clip,
34  OP_Channels &coll,
35  fpreal error2,
36  int start, int end);
37 
38  void convertToTrack(CH_Channel *channel, CL_Track &track,
39  int istart, int iend);
40 
41  void setScope(OP_Channels &coll, const char *scope);
42 
43  static const char *fixName(const char *input);
44 
45 private:
46 
47  UT_Vector2R *myPoints; // simple array
48  fpreal *myValues;
49  int myPointSize;
50 
51  int growArray(int size);
52 
53 };
54 
55 // Implementation of CH_FilterRangeBuilder
56 // begin, end and copyChopChannels.
57 // Needed to be in a shared library other than CH because
58 // it accesses OP_Node and CHOP.
60 {
61 public:
63  virtual ~CHOP_CopyChannels();
64 
65  virtual void begin(CH_BakeChop mode);
66  virtual void end();
67  virtual void copy(CH_Channel *chp, fpreal global_start, fpreal global_end);
68 
69 private:
70  CH_BakeChop myMode; // Bake mode
71  int myCount; // to check for balanced calls
72 
74  chopExportsMap myExports; // Baked Exports
75  void append( OP_Node *chop, const UT_String &track );
76 };
77 
78 // Create a channel with an expression pointing back to the chop export channel.
79 // It creates the channel only if a chop export is in effect.
80 // The returned CH_Channel won't be added to its parm.
81 //
82 // For example, if sphere_object1 tx parameter is overriden by a chop export from a motionfx,
83 // a new channel will be created and it will have a segment with the following expression.
84 // `channel('/obj/motionfx/add1/sphere_object:tx`
85 //
86 // This is used by the Animation Editor to create temporary channels to visualize CHOP exports.
87 // It's also used by HOMF_Parm::keyframesRefit() to bake chop exports.
88 CHOP_API extern CH_Channel *
90 
91 // Create a channel with a given expression.
92 // The returned CH_Channel won't be added to its parm.
93 // This is used by HOMF_Parm::keyframesRefit() to bake expressions.
94 CHOP_API extern CH_Channel *
95 CHOPcreateExpressionChannel( const CH_ChannelRef &ref, const char *expr );
96 
97 #endif
98 
CHOP_API CH_Channel * CHOPcreateExpressionChannel(const CH_ChannelRef &ref, fpreal t, int thread)
#define CHOP_API
Definition: CHOP_API.h:10
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
GLuint start
Definition: glcorearb.h:475
GLint ref
Definition: glcorearb.h:124
GLuint GLuint end
Definition: glcorearb.h:475
CH_BakeChop
Definition: CH_Filters.h:26
GLdouble t
Definition: glad.h:2397
GLenum mode
Definition: glcorearb.h:99
GLsizeiptr size
Definition: glcorearb.h:664
**Note that the tasks the is the thread number *for the or if it s being executed by a non pool thread(this *can happen in cases where the whole pool is occupied and the calling *thread contributes to running the work load).**Thread pool.Have fun
fpreal64 fpreal
Definition: SYS_Types.h:277
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T clip(const T &p, const Box< T > &box) IMATH_NOEXCEPT
Definition: ImathBoxAlgo.h:29
PcpNodeRef_ChildrenIterator begin(const PcpNodeRef::child_const_range &r)
Support for range-based for loops for PcpNodeRef children ranges.
Definition: node.h:483