00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #pragma once
00018
00019 #include "iparamm.h"
00020 #include "object.h"
00021 #include "GraphicsConstants.h"
00022
00023
00024 class SimpleSpline;
00025
00026 class SimpleSplineDlgProc : public ParamMapUserDlgProc {
00027 private:
00028 SimpleSpline *spl;
00029 public:
00030 SimpleSplineDlgProc(SimpleSpline *s) { spl = s; }
00031 CoreExport INT_PTR DlgProc(TimeValue t,IParamMap *map,HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam);
00032 CoreExport void DeleteThis();
00033 };
00034
00035 #pragma warning(push)
00036 #pragma warning(disable:4239)
00037
00066 class SimpleSpline: public ShapeObject {
00067 private:
00068 public:
00069 IParamBlock *ipblock;
00070 IParamBlock *pblock;
00071
00072 static IParamMap *ipmapParam;
00073 static int dlgSteps;
00074 static BOOL dlgOptimize;
00075 static BOOL dlgAdaptive;
00076
00077
00078 BezierShape shape;
00079 Interval ivalid;
00080
00081
00082 BOOL suspendSnap;
00083
00084 CoreExport void UpdateShape(TimeValue t);
00085
00086 static SimpleSpline *editOb;
00087
00090 CoreExport SimpleSpline();
00093 CoreExport ~SimpleSpline();
00094
00095 void ShapeInvalid() { ivalid.SetEmpty(); }
00096
00097
00098
00099
00100 CoreExport int HitTest(TimeValue t, INode* inode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt);
00101 CoreExport void Snap(TimeValue t, INode* inode, SnapInfo *snap, IPoint2 *p, ViewExp *vpt);
00102 CoreExport int Display(TimeValue t, INode* inode, ViewExp *vpt, int flags);
00103 CoreExport virtual void BeginEditParams( IObjParam *ip, ULONG flags,Animatable *prev);
00125 CoreExport virtual void EndEditParams( IObjParam *ip, ULONG flags,Animatable *next);
00126 IParamArray* GetParamBlock() {return (IParamArray*)pblock;}
00127 CoreExport int GetParamBlockIndex(int id);
00128
00129
00130 CoreExport ObjectState Eval(TimeValue time);
00131 CoreExport Interval ObjectValidity(TimeValue t);
00132 CoreExport int CanConvertToType(Class_ID obtype);
00133 CoreExport Object* ConvertToType(TimeValue t, Class_ID obtype);
00134 CoreExport void GetCollapseTypes(Tab<Class_ID> &clist,Tab<MSTR*> &nlist);
00135
00136 CoreExport void BuildMesh(TimeValue t, Mesh &mesh);
00137
00138
00139 CoreExport ObjectHandle CreateTriObjRep(TimeValue t);
00140 CoreExport void GetWorldBoundBox(TimeValue t, INode* inode, ViewExp* vpt, Box3& box );
00141 CoreExport void GetLocalBoundBox(TimeValue t, INode* inode, ViewExp* vxt, Box3& box );
00142 CoreExport void GetDeformBBox(TimeValue t, Box3& box, Matrix3 *tm, BOOL useSel );
00143 CoreExport int NumberOfVertices(TimeValue t, int curve);
00144 CoreExport int NumberOfCurves();
00145 CoreExport BOOL CurveClosed(TimeValue t, int curve);
00146 CoreExport Point3 InterpCurve3D(TimeValue t, int curve, float param, int ptype=PARAM_SIMPLE);
00147 CoreExport Point3 TangentCurve3D(TimeValue t, int curve, float param, int ptype=PARAM_SIMPLE);
00148 CoreExport float LengthOfCurve(TimeValue t, int curve);
00149 CoreExport int NumberOfPieces(TimeValue t, int curve);
00150 CoreExport Point3 InterpPiece3D(TimeValue t, int curve, int piece, float param, int ptype=PARAM_SIMPLE);
00151 CoreExport Point3 TangentPiece3D(TimeValue t, int curve, int piece, float param, int ptype=PARAM_SIMPLE);
00152 CoreExport MtlID GetMatID(TimeValue t, int curve, int piece);
00153 BOOL CanMakeBezier() { return TRUE; }
00154 CoreExport void MakeBezier(TimeValue t, BezierShape &shape);
00155 CoreExport ShapeHierarchy &OrganizeCurves(TimeValue t, ShapeHierarchy *hier=NULL);
00156 CoreExport void MakePolyShape(TimeValue t, PolyShape &shape, int steps = PSHAPE_BUILTIN_STEPS, BOOL optimize = FALSE);
00157 CoreExport int MakeCap(TimeValue t, MeshCapInfo &capInfo, int capType);
00158 CoreExport int MakeCap(TimeValue t, PatchCapInfo &capInfo);
00159
00160 int NumRefs() { return 2 + ShapeObject::NumRefs();}
00161 CoreExport RefTargetHandle GetReference(int i);
00162 protected:
00163 CoreExport virtual void SetReference(int i, RefTargetHandle rtarg);
00164 public:
00165 CoreExport RefResult NotifyRefChanged(Interval changeInt,RefTargetHandle hTarget,
00166 PartID& partID, RefMessage message);
00167
00168 CoreExport void ReadyInterpParameterBlock();
00169 void UnReadyInterpParameterBlock() { ipblock = NULL; }
00170
00171
00172
00173
00174 CoreExport void SimpleSplineClone( SimpleSpline *ssplSource );
00175
00176
00177
00178 CoreExport void SimpleSplineClone( SimpleSpline *ssplSource, RemapDir& remap );
00179
00180 int NumSubs() { return 2 + ShapeObject::NumSubs(); }
00181 CoreExport Animatable* SubAnim(int i);
00182 CoreExport MSTR SubAnimName(int i);
00183
00184
00185 CoreExport void DeleteThis();
00186 CoreExport void FreeCaches();
00187
00188
00189 CoreExport IOResult Save(ISave *isave);
00190 CoreExport IOResult Load(ILoad *iload);
00191 #pragma warning(push)
00192 #pragma warning(disable:4100)
00193 LRESULT CALLBACK TrackViewWinProc( HWND hwnd, UINT message,
00194 WPARAM wParam, LPARAM lParam ){return(0);}
00195
00201 void GetClassName(MSTR& s) {s = GetObjectName();}
00206 void InitNodeName(MSTR& s) {s = GetObjectName();}
00207
00208
00209
00212 virtual Class_ID ClassID() = 0;
00220 virtual void BuildShape(TimeValue t,BezierShape& ashape) = 0;
00229 virtual RefTargetHandle Clone(RemapDir& remap) = 0;
00230
00238 virtual CreateMouseCallBack* GetCreateMouseCallBack() = 0;
00245 virtual BOOL ValidForDisplay(TimeValue t) = 0;
00269 virtual void InvalidateUI() {}
00279 virtual ParamDimension *GetParameterDim(int pbIndex) {return defaultDim;}
00287 virtual MSTR GetParameterName(int pbIndex) {return MSTR(_M("Parameter"));}
00288 #pragma warning(pop)
00289
00293 virtual BOOL DisplayVertTicksDuringCreation() { return TRUE; }
00294 };
00295 #pragma warning(pop)
00296
00297