00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __SOP_CaptureEdit_h__
00021 #define __SOP_CaptureEdit_h__
00022
00023 #include "SOP_API.h"
00024 #include <UT/UT_HashTable.h>
00025 #include <UT/UT_IntArray.h>
00026 #include <UT/UT_PtrArray.h>
00027 #include <UT/UT_String.h>
00028 #include <PRM/PRM_Name.h>
00029 #include <PRM/PRM_Parm.h>
00030
00031 #include "SOP_CaptureData.h"
00032 #include "SOP_GDT.h"
00033
00034
00035 class UT_Matrix4;
00036 class OP_Context;
00037
00038
00039 class SOP_API SOP_CaptureEdit : public SOP_GDT
00040 {
00041 public:
00042 SOP_CaptureEdit(OP_Network *net, const char *name, OP_Operator *entry);
00043 virtual ~SOP_CaptureEdit();
00044
00045 static OP_Node * ourConstructor(OP_Network*, const char*, OP_Operator*);
00046 static PRM_Template ourTemplateList[];
00047
00048 virtual unsigned disableParms();
00049
00050 virtual OP_ERROR cookInputGroups( OP_Context &context, int alone );
00051
00052 #if 0
00053 void pointWeightChange( float t, int point_num,
00054 const char *cregion, float weight );
00055 #endif
00056
00057 void startNewChange( const int *points, int num_points,
00058 int clamp_negative, int normalize = 0 );
00059 void changeWeight( float t, const char *cregion,
00060 float weight, int add_weight );
00061
00062 int addAverageCaptureWeight( OP_Context &context,
00063 const UT_IntArray &points,
00064 UT_HashTable &averages );
00065
00066 virtual void setVisualization( int onoff );
00067
00068 protected:
00069 virtual OP_ERROR cookMySop( OP_Context &context );
00070
00071 virtual void applyAndClearCurrentDelta();
00072
00073 virtual void buildOpDependencies();
00074 virtual void buildParmDependency( int parm_index );
00075 virtual void handleOpDependency( int referenced_op_id,
00076 const OP_Dependency &op_dep,
00077 OP_InterestType interest_type,
00078 bool &need_cook,
00079 const char *old_fullpath,
00080 const char *old_cwd,
00081 const char *old_chan_name );
00082
00083
00084
00085
00086 virtual OP_ERROR save(ostream &os, const OP_SaveFlags &flags,
00087 const char *path_prefix);
00088 virtual bool load(UT_IStream &is, const char *extension,
00089 const char *path=0);
00090
00091 private:
00092 PRM_Parm & getParmByName( PRM_Name &name )
00093 { return getParm( name.getToken() ); }
00094 const PRM_Parm & getParmByName( PRM_Name &name ) const
00095 { return getParm( name.getToken() ); }
00096
00097 OP_ERROR createCurrentDelta( OP_Context &context,
00098 const GB_PointGroup *pt_group );
00099
00100 int addCaptureRegion( UT_String &cregion_name );
00101
00102
00103 static void buildCregionMenu( void *, PRM_Name *, int,
00104 const PRM_SpareData *, PRM_Parm * );
00105 static int getCaptureRegion( void *user_data,
00106 char *cregion,
00107 UT_Matrix4 &parent_xform,
00108 GU_DetailHandle &tube_gdh );
00109
00110 void checkCaptureRegions();
00111
00112 private:
00113 SOP_CaptureData myCaptureData;
00114 float myCaptureFrame;
00115 UT_String myRootPath;
00116 unsigned int myUpdatedColors : 1,
00117 myForceUpdateColors : 1;
00118
00119 static PRM_ChoiceList theCregionMenu;
00120 static int theCregionIndex;
00121 };
00122
00123 #endif // __SOP_CaptureEdit_h__
00124