00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __SOP_Capture__
00022 #define __SOP_Capture__
00023
00024 #include "SOP_API.h"
00025 #include <UT/UT_IntArray.h>
00026 #include <OP/OP_ParmMacros.h>
00027 #include <PRM/PRM_Include.h>
00028
00029 #include "SOP_CaptureBase.h"
00030
00031 enum SOP_CaptureIndices
00032 {
00033 I_PNTGRPS = 0,
00034 I_REGIONSOP,
00035 I_RBONE,
00036 I_CAPTFRAME,
00037 I_WEIGHTFRM,
00038 I_COLOR,
00039 I_ZEROWEIGHTCOLOR,
00040 I_ORFILE,
00041 I_SVFILE,
00042 I_AUTOINCR,
00043 I_NORMALIZEWEIGHT,
00044 I_DESTROYWEIGHTS,
00045 I_BLENDFACTOR,
00046 I_DOSUBNETS,
00047 I_RELSKELROOT,
00048 I_USECAPTPOSE,
00049 I_N_SOPCAPTURE_INDICES
00050 };
00051
00052 class OP_Node;
00053 class GEO_PrimTube;
00054
00055 class sop_CRegionIterator;
00056 class sop_CRegionTree;
00057
00058
00059
00060
00061
00062
00063
00064 class SOP_API SOP_Capture : public SOP_CaptureBase
00065 {
00066 public:
00067 SOP_Capture(OP_Network*, const char *, OP_Operator*);
00068 virtual ~SOP_Capture() {};
00069
00070 virtual int isRefInput(unsigned int i) const;
00071 static OP_Node *myConstructor(OP_Network*, const char *, OP_Operator*);
00072 static PRM_Template myTemplateList[];
00073 static PRM_Template myObsoleteList[];
00074
00075 virtual unsigned disableParms();
00076
00077 void setUseAllRegions(bool value);
00078
00079 protected:
00080 virtual OP_ERROR cookMySop(OP_Context &context);
00081 virtual OP_ERROR cookMyGuide1(OP_Context &context);
00082 virtual const char *inputLabel(unsigned idx) const;
00083
00084 virtual void resetCapture();
00085
00086 virtual OP_Node * getRootObjNode();
00087 virtual int getCaptureSopMethod() { return CAPTURE_REGION_SOP(); }
00088 virtual int getDoSubnets()
00089 { EVAL_INT("dosubnets",I_DOSUBNETS,0,0); }
00090 virtual float getCaptureFrame()
00091 { EVAL_FLT("captframe", I_CAPTFRAME,0,0);}
00092 virtual bool useCapturePose()
00093 { EVAL_INT("usecaptpose", I_USECAPTPOSE,0,0);}
00094
00095 private:
00096
00097
00098
00099
00100 static int saveAllOverrideCB( void *data, int index, float t,
00101 const PRM_Template *);
00102 static int saveSelectedOverrideCB( void *data, int index, float t,
00103 const PRM_Template *);
00104 void saveOverrideFile (int use_selection);
00105
00106
00107
00108
00109 void POINT_GROUPS( UT_String &str )
00110 { EVAL_STR((UT_String)PRMgroupName.getToken(), I_PNTGRPS,0,0);}
00111 int CAPTURE_REGION_SOP() { EVAL_INT("captregionsop", I_REGIONSOP,0,0);}
00112 void ROOT_PATH(UT_String &str){ EVAL_STR("rootpath", I_RBONE,0,0); }
00113
00114 int RELATIVE_SKEL_ROOT() { EVAL_INT("relativeskel", I_RELSKELROOT,0,0); }
00115
00116 int WEIGHTFROM() { EVAL_INT("weightFrom", I_WEIGHTFRM,0,0);}
00117 int NORMALIZEWEIGHT() { EVAL_INT("normweights", I_NORMALIZEWEIGHT,0,0);}
00118 int DESTROYWEIGHTS() { EVAL_INT("destroyweights", I_DESTROYWEIGHTS, 0, 0); }
00119 float BLENDFACTOR(float t) { EVAL_FLT("blendfactor", I_BLENDFACTOR, 0, t); }
00120 int COLORTYPE() { EVAL_INT("color", I_COLOR,0,0);}
00121
00122 float ZEROWEIGHTCOLOR_R() { EVAL_INT("zeroweightcolor", I_ZEROWEIGHTCOLOR,
00123 0, 0); }
00124 float ZEROWEIGHTCOLOR_G() { EVAL_INT("zeroweightcolor", I_ZEROWEIGHTCOLOR,
00125 1, 0); }
00126 float ZEROWEIGHTCOLOR_B() { EVAL_INT("zeroweightcolor", I_ZEROWEIGHTCOLOR,
00127 2, 0); }
00128
00129 int AUTOINCR() { EVAL_INT("autoincr", I_AUTOINCR,0,0);}
00130
00131 void OVERRIDEFILE(UT_String &str){ EVAL_STR("captfile", I_ORFILE,0,0);}
00132 void SAVEFILE(UT_String &str) { EVAL_STR("savefile", I_SVFILE,0,0);}
00133 CH_StringMeaning SAVEFILEmeaning()
00134 { return getStringMeaning("savefile",0,0.0f);}
00135
00136 void setSaveFile(UT_String &str, CH_StringMeaning meaning)
00137 {SET_STRING(str, meaning, "savefile",
00138 I_SVFILE,0,0);}
00139
00140
00141
00142
00143
00144 void bumpFileName(UT_String &filename) const;
00145
00146
00147 void getAllCregionNodes( OP_NodeList &nodes );
00148
00149
00150
00151 int createRegions(OP_Context &context,
00152 const OP_NodeList &nodes,
00153 sop_CRegionIterator &cregion_iter);
00154 int addRegions(OP_Node *region_node, OP_Context &context,
00155 sop_CRegionIterator &cregion_iter);
00156 int createExtraRegions(OP_Context &context,
00157 sop_CRegionIterator &cregion_iter);
00158
00159
00160
00161
00162 void weightPoint(OP_Context &context, int pt_num,
00163 const UT_Vector3 &pt_pos,
00164 const UT_IntArray ®ions);
00165 int weightPoints(OP_Context &context,
00166 const GB_PointGroup *pt_group,
00167 const sop_CRegionTree ®ion_tree);
00168
00169 void colorPoints(OP_Context &context);
00170
00171
00172 int buildGuide(OP_Context &context );
00173
00174 void setAllCaptureRegions(UT_IntArray& regions);
00175
00176
00177
00178
00179
00180
00181
00182 static int *parmIndirect;
00183
00184
00185
00186
00187 bool myCaptureAllRegions;
00188 };
00189
00190 #endif
00191