00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __SOP_CaptureBase__
00023 #define __SOP_CaptureBase__
00024
00025 #include "SOP_API.h"
00026 #include <GEO/GEO_CaptureData.h>
00027 #include "SOP_Node.h"
00028
00029
00030 class SOP_CaptureRegion;
00031
00032 class SOP_API SOP_CaptureBase : public SOP_Node
00033 {
00034 friend class SOP_UndoCaptureOpDepend;
00035
00036 public:
00037 SOP_CaptureBase( OP_Network *parent, const char *name, OP_Operator *entry );
00038 virtual ~SOP_CaptureBase();
00039
00040 virtual void setVisualization( int onoff )
00041 {
00042
00043 if( myVisualization != onoff )
00044 {
00045 myVisualization = onoff;
00046 forceRecook();
00047 }
00048 }
00049
00050 virtual void setForceCapture( int onoff )
00051 {
00052
00053 if( myForceCapture != onoff )
00054 {
00055 myForceCapture = onoff;
00056 if( onoff )
00057 forceRecook();
00058 }
00059 }
00060
00061 static void buildObjectMenu(void *, PRM_Name *, int, void *, PRM_Parm *);
00062
00063 virtual int changeString(const char *from, const char *to,
00064 bool fullword);
00065
00066 virtual void resolveObsoleteParms(PRM_ParmList *obsolete_parms);
00067
00068 protected:
00069
00070
00071 enum {
00072 SOP_REGION_DISPLAY = 0,
00073 SOP_REGION_RENDER,
00074 SOP_REGION_CREGION
00075 };
00076
00077 enum {
00078 SOP_INPUT_GEOMETRY = 0,
00079 SOP_INPUT_CREGION,
00080 SOP_NUM_INPUTS
00081 };
00082
00083
00084
00085 virtual void buildParmDependency( int parm_index );
00086 virtual void handleOpDependency( int referenced_op_id,
00087 const OP_Dependency &op_dep,
00088 OP_InterestType interest_type,
00089 bool &need_cook,
00090 const char *old_fullpath,
00091 const char *old_cwd,
00092 const char *old_chan_name );
00093
00094
00095
00096 virtual bool handleTimeChange( float t );
00097
00098 virtual void resetCapture();
00099
00100 virtual OP_Node * getRootObjNode() = 0;
00101 virtual int getCaptureSopMethod() = 0;
00102 virtual int getDoSubnets() = 0;
00103 virtual float getCaptureFrame() = 0;
00104 virtual bool useCapturePose() = 0;
00105
00106 static int forceRecapture( void *data, int index, float t,
00107 const PRM_Template * );
00108
00109 void getCregionNodes( OP_Node *root, OP_NodeList &nodes );
00110 void getCregionNodesFromString( const UT_String &str,
00111 OP_NodeList &nodes );
00112 SOP_Node * getRegionNode( OP_Node *bone,
00113 bool add_extra_input = false );
00114
00115 bool getRegionData( float t,
00116 const OP_Node *region_sop,
00117 const GEO_Detail *region_gdp,
00118 int capt_atr_offset,
00119 const GEO_Primitive *tube_prim,
00120 float *atr_data,
00121 UT_Matrix4 &xform );
00122
00123 GU_DetailHandle getRegionGdh( OP_Context &context, int region_idx,
00124 int add_error = 1 );
00125 bool validateCaptureRegions( OP_Context &context );
00126
00127 protected:
00128
00129 GEO_CaptureData myCaptureData;
00130 int myNumPtsAtCaptureFrame;
00131
00132 unsigned myVisualization : 1,
00133 myForceCapture : 1;
00134
00135 private:
00136 void buildCRegionDependencies(OP_RefId ref, OP_Node *node);
00137
00138
00139 void getCaptureRegionInstances( const OP_NodeList &nodes,
00140 UT_PtrArray< SOP_CaptureRegion *> &cregions);
00141
00142 private:
00143 bool myOldCaptureOverride;
00144
00145 };
00146
00147 #endif // __SOP_CaptureBase__