splshape.h

Go to the documentation of this file.
00001 //**************************************************************************/
00002 // Copyright (c) 1998-2006 Autodesk, Inc.
00003 // All rights reserved.
00004 // 
00005 // These coded instructions, statements, and computer programs contain
00006 // unpublished proprietary information written by Autodesk, Inc., and are
00007 // protected by Federal copyright law. They may not be disclosed to third
00008 // parties or copied or duplicated in any form, in whole or in part, without
00009 // the prior written consent of Autodesk, Inc.
00010 //**************************************************************************/
00011 // FILE:        splshape.h
00012 // DESCRIPTION: Defines a Spline Object Class
00013 // AUTHOR:      Tom Hudson
00014 // HISTORY:     created 23 February 1995
00015 //**************************************************************************/
00016 
00017 #pragma once
00018 
00019 #include "maxheap.h"
00020 #include "shape.h"
00021 #include "istdplug.h"
00022 #include "sbmtlapi.h"
00023 #include "objmode.h"
00024 
00025 extern CoreExport Class_ID  splineShapeClassID; 
00026 
00027 extern HINSTANCE hInstance;
00028 
00029 // The boolean operations
00030 #define BOOL_UNION 0
00031 #define BOOL_SUBTRACTION 1
00032 #define BOOL_INTERSECTION 2
00033 
00034 // The mirror operations
00035 #define MIRROR_HORIZONTAL 3
00036 #define MIRROR_VERTICAL 4
00037 #define MIRROR_BOTH 5
00038 
00039 // Flags used for boolean polygons
00040 #define POLYBOOL (1 << 0)
00041 #define POLYOUTSIDE (1 << 1)
00042 #define POLYINSIDE (1 << 2)
00043 
00044 // Flags:
00045 // Disp Result keeps track of "Show End Result" button for this Editable Spline
00046 #define ES_DISP_RESULT 0x0100
00047 // Use additional vertex selection (marked as SPLINEKNOT_ADD_SEL) in SplineShape::XFormVerts()
00048 #define ES_ADDED_SELECT 0x0200
00049 
00050 // References
00051 // NOTE: Reference 0 is the ShapeObject's rendering parameter block!
00052 #define ES_MASTER_CONTROL_REF SHAPE_OBJ_NUM_REFS
00053 #define ES_VERT_BASE_REF (SHAPE_OBJ_NUM_REFS + 1)
00054 
00055 // These are values for selLevel.
00056 #define SS_OBJECT   0
00057 #define SS_VERTEX   1
00058 #define SS_SEGMENT  2
00059 #define SS_SPLINE   3
00060 
00061 #define CID_OUTLINE     CID_USER + 201
00062 #define CID_SEGBREAK    CID_USER + 202
00063 #define CID_SEGREFINE   CID_USER + 203
00064 #define CID_VERTCONNECT CID_USER + 204
00065 #define CID_VERTINSERT  CID_USER + 205
00066 #define CID_BOOLEAN     CID_USER + 206
00067 #define CID_CREATELINE  CID_USER + 207
00068 #define CID_CROSSINSERT CID_USER + 208
00069 #define CID_FILLET      CID_USER + 209
00070 #define CID_CHAMFER     CID_USER + 210
00071 #define CID_TRIM        CID_USER + 211
00072 #define CID_EXTEND      CID_USER + 212
00073 
00074 //watje
00075 #define CID_SPLINEBIND  CID_USER + 213
00076 #define CID_REFINECONNECT   CID_USER + 214
00077 
00078 // CAL-02/24/03: Add Cross Section. (FID #827)
00079 #define CID_CROSSSECTION    CID_USER + 215
00080 // CAL-02/27/03: copy/paste tangent. (FID #827)
00081 #define CID_COPYTANGENT     CID_USER + 216
00082 #define CID_PASTETANGENT    CID_USER + 217
00083 
00084 
00085 // General-purpose shape point table -- Maintains point table for each of n polygons
00086 class SplineShapePointTab: public MaxHeapOperators {
00087     public:
00088         int polys;
00089         int *pUsed; // Tells whether polygon is affected
00090         Point3Tab *ptab;
00091         IntTab *ktab;
00092         IntTab *ltab;
00093         SplineShapePointTab();
00094         ~SplineShapePointTab();
00095         void Empty();
00096         void Zero();
00097         void MakeCompatible(BezierShape& shape, BOOL clear=TRUE);
00098         SplineShapePointTab& operator=(SplineShapePointTab& from);
00099         BOOL IsCompatible(BezierShape &shape);
00100         IOResult Save(ISave *isave);
00101         IOResult Load(ILoad *iload);
00102     };
00103 
00104 class SplineShapeVertexDelta: public MaxHeapOperators {
00105     public:
00106         SplineShapePointTab dtab;
00107 
00108         void SetSize(BezierShape& shape, BOOL load=TRUE);
00109         void Empty() { dtab.Empty(); }
00110         void Zero() { dtab.Zero(); }
00111         void SetPoint(int poly, int i, const Point3& p) { dtab.pUsed[poly] = 1; dtab.ptab[poly][i] = p; }
00112         void SetKType(int poly, int i, int k) { dtab.pUsed[poly] = 1; dtab.ktab[poly][i] = k; }
00113         void SetLType(int poly, int i, int l) { dtab.pUsed[poly] = 1; dtab.ltab[poly][i] = l; }
00114         void Move(int poly, int i, const Point3& p) { dtab.pUsed[poly] = 1; dtab.ptab[poly][i] += p; }
00115         void Apply(BezierShape& shape);
00116         void UnApply(BezierShape& shape);
00117         void ClearUsed(int poly) { dtab.pUsed[poly] = 0; }
00118         void SetUsed(int poly) { dtab.pUsed[poly] = 1; }
00119         int IsUsed(int poly) { return dtab.pUsed[poly] ? 1 : 0; }
00120         SplineShapeVertexDelta& operator=(SplineShapeVertexDelta& from) { dtab = from.dtab; return *this; }
00121         void ApplyHandlesAndZero(BezierShape &shape, int handlePoly, int handleVert);
00122         BOOL IsCompatible(BezierShape &shape) { return dtab.IsCompatible(shape); }
00123         IOResult Save(ISave *isave);
00124         IOResult Load(ILoad *iload);
00125     };
00126 
00127 class NamedVertSelSetList: public MaxHeapOperators {
00128     public:
00129         Tab<ShapeVSel*> sets;
00130         Tab<MSTR*>     names;
00131 
00132         CoreExport ~NamedVertSelSetList();
00133         ShapeVSel &operator[](int i) {return *sets[i];}
00134         int Count() {return sets.Count();}
00135         CoreExport void AppendSet(ShapeVSel &nset,MSTR &name);
00136         CoreExport BOOL DeleteSet(MSTR &name);
00137         CoreExport void DeleteSet(int i);
00138         CoreExport IOResult Load(ILoad *iload);
00139         CoreExport IOResult Save(ISave *isave);
00140         CoreExport void SetSize(BezierShape& shape);
00141         CoreExport NamedVertSelSetList& operator=(NamedVertSelSetList& from);
00142         CoreExport void DeleteSetElements(ShapeVSel &set,int m=1);
00143         CoreExport int FindSet(MSTR &name);
00144         CoreExport BOOL RenameSet(MSTR &oldName, MSTR &newName);
00145     };
00146 
00147 class NamedSegSelSetList: public MaxHeapOperators {
00148     public:
00149         Tab<ShapeSSel*> sets;
00150         Tab<MSTR*>     names;
00151 
00152         CoreExport ~NamedSegSelSetList();
00153         ShapeSSel &operator[](int i) {return *sets[i];}
00154         int Count() {return sets.Count();}
00155         CoreExport void AppendSet(ShapeSSel &nset,MSTR &name);
00156         CoreExport BOOL DeleteSet(MSTR &name);
00157         CoreExport void DeleteSet(int i);
00158         CoreExport IOResult Load(ILoad *iload);
00159         CoreExport IOResult Save(ISave *isave);
00160         CoreExport void SetSize(BezierShape& shape);
00161         CoreExport NamedSegSelSetList& operator=(NamedSegSelSetList& from);
00162         CoreExport void DeleteSetElements(ShapeSSel &set,int m=1);
00163         CoreExport int FindSet(MSTR &name);
00164         CoreExport BOOL RenameSet(MSTR &oldName, MSTR &newName);
00165     };
00166 
00167 class NamedPolySelSetList: public MaxHeapOperators {
00168     public:
00169         Tab<ShapePSel*> sets;
00170         Tab<MSTR*>     names;
00171 
00172         CoreExport ~NamedPolySelSetList();
00173         ShapePSel &operator[](int i) {return *sets[i];}
00174         int Count() {return sets.Count();}
00175         CoreExport void AppendSet(ShapePSel &nset,MSTR &name);
00176         CoreExport BOOL DeleteSet(MSTR &name);
00177         CoreExport void DeleteSet(int i);
00178         CoreExport IOResult Load(ILoad *iload);
00179         CoreExport IOResult Save(ISave *isave);
00180         CoreExport void SetSize(BezierShape& shape);
00181         CoreExport NamedPolySelSetList& operator=(NamedPolySelSetList& from);
00182         CoreExport void DeleteSetElements(ShapePSel &set,int m=1);
00183         CoreExport int FindSet(MSTR &name);
00184         CoreExport BOOL RenameSet(MSTR &oldName, MSTR &newName);
00185     };
00186 
00187 // Named selection set list types for SplineShape
00188 #define NS_SS_VERT 0
00189 #define NS_SS_SEG 1
00190 #define NS_SS_POLY 2
00191 
00192 class SSNamedSelSetList: public MaxHeapOperators {
00193     public:
00194         int type;
00195         void *ptr;
00196         SSNamedSelSetList(int type, void *ptr) {this->type=type; this->ptr=ptr;}
00197         CoreExport int Count();
00198         CoreExport MSTR* Names(int i);
00199     };
00200 
00201 class SingleRefMakerSplineNode;
00202 class SingleRefMakerSplineMtl;
00203 
00204 class IntersectPt;  // Internal class
00205 
00206 #pragma warning(push)
00207 #pragma warning(disable:4239)
00208 
00219 class SplineShape : public ShapeObject, ISplineOps, ISplineSelect, ISplineSelectData, ISubMtlAPI, AttachMatDlgUser {
00220     friend INT_PTR CALLBACK SplineGenDlgProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam );
00221     friend INT_PTR CALLBACK SplineSelectDlgProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam );
00222     friend INT_PTR CALLBACK SplineOpsDlgProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam );
00223     friend INT_PTR CALLBACK SplineSurfDlgProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam );
00224     friend INT_PTR CALLBACK SelectByDlgProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam );
00225     friend class SSXFormProc;
00226     friend class SSOutlineCMode;
00227     friend class SSFilletCMode;
00228     friend class SSChamferCMode;
00229     friend class SSSegBreakCMode;
00230     friend class SSSegRefineCMode;
00231     friend class SSCrossInsertCMode;
00232     friend class SSVertConnectCMode;
00233     friend class SSVertInsertCMode;
00234     friend class SSCreateLineCMode;
00235     friend class SSCrossSectionCMode;
00236     friend class SSBooleanCMode;
00237     friend class SSTrimCMode;
00238     friend class SSExtendCMode;
00239     friend class SSCopyTangentCMode;
00240     friend class SSPasteTangentCMode;
00241     friend class SSOutlineMouseProc;
00242     friend class SSFilletMouseProc;
00243     friend class SSChamferMouseProc;
00244     friend class SSSegBreakMouseProc;
00245     friend class SSSegRefineMouseProc;
00246     friend class SSCrossInsertMouseProc;
00247     friend class SSVertConnectMouseProc;
00248     friend class SSVertInsertMouseProc;
00249     friend class SSCreateLineMouseProc;
00250     friend class SSBooleanMouseProc;
00251     friend class SSTrimMouseProc;
00252     friend class SSExtendMouseProc;
00253     friend class SplineShapeRestore;
00254     friend class SSRightMenu;
00255     friend class SSMBackspaceUser;
00256     friend class SSIBackspaceUser;
00257     friend class SSPickSplineAttach;
00258     friend class SSAttachHitByName;
00259     friend class SplineShapeClassDesc;
00260 //watje
00261     friend class SSBindMouseProc;
00262     friend class SSBindCMode;
00263     friend class SSRefineConnectMouseProc;
00264     friend class SSRefineConnectCMode;
00265     friend class SSActionCallback;
00266 
00267     private:
00268         static HWND hGenPanel, hSelectPanel, hOpsPanel, hSurfPanel, hSelectBy, hSoftSelPanel;
00269         static BOOL rsGen, rsSel, rsSoftSel, rsOps, rsSurf; // rollup states (FALSE = rolled up)
00270         static MoveModBoxCMode *moveMode;
00271         static RotateModBoxCMode *rotMode;
00272         static UScaleModBoxCMode *uscaleMode;
00273         static NUScaleModBoxCMode *nuscaleMode;
00274         static SquashModBoxCMode *squashMode;
00275         static SelectModBoxCMode *selectMode;
00276         static SSOutlineCMode *outlineMode;
00277         static SSFilletCMode *filletMode;
00278         static SSChamferCMode *chamferMode;
00279         static SSSegBreakCMode *segBreakMode;
00280         static SSSegRefineCMode *segRefineMode;
00281         static SSCrossInsertCMode *crossInsertMode;
00282         static SSVertConnectCMode *vertConnectMode;
00283         static SSVertInsertCMode *vertInsertMode;
00284         static SSCreateLineCMode *createLineMode;
00285         static SSCrossSectionCMode *crossSectionMode;
00286         static SSBooleanCMode *booleanMode;
00287         static SSTrimCMode *trimMode;
00288         static SSExtendCMode *extendMode;
00289         static SSCopyTangentCMode *copyTangentMode;
00290         static SSPasteTangentCMode *pasteTangentMode;
00291         static ISpinnerControl *divSpin;
00292         static ISpinnerControl *outlineSpin;
00293         static ISpinnerControl *filletSpin;
00294         static ISpinnerControl *chamferSpin;
00295         static ISpinnerControl *weldSpin;
00296         static ISpinnerControl *crossSpin;
00297         static ISpinnerControl *stepsSpin;
00298         static ISpinnerControl *matSpin;
00299         static ISpinnerControl *matSpinSel;
00300 
00301 //2-1-99 watje
00302         static ISpinnerControl *selectAreaSpin;
00303 
00304         // CAL-05/23/03: Threshold for extending existing splines when Shift-Move Copy. (FID #827)
00305         static ISpinnerControl *pConnectCopyThreshSpinner;
00306 
00307         // endpoint autoweld controls
00308         static ISpinnerControl *pEndPointAutoConnectWeldSpinner;
00309         static float mEndPointAutoWeldThreshold;
00310         static UINT mUsingAutoConnect;
00311         static UINT mUseConfirmationPopUp;
00312 
00313         static ICustButton *iUnion;
00314         static ICustButton *iSubtraction;
00315         static ICustButton *iIntersection;
00316         static ICustButton *iMirrorHorizontal;
00317         static ICustButton *iMirrorVertical;
00318         static ICustButton *iMirrorBoth;
00319         static BOOL inOutline;
00320         static BOOL inFillet;
00321         static BOOL inChamfer;
00322         static BOOL inSegBreak;
00323         static int boolType;
00324         static int mirrorType;
00325         static SSPickSplineAttach pickCB;
00326         static BOOL segUIValid;
00327         static int attachMat;
00328         static BOOL condenseMat;
00329 
00330         Interval geomValid;
00331         Interval topoValid;
00332         Interval selectValid;
00333         ChannelMask validBits; // for the remaining constant channels
00334         void CopyValidity(SplineShape *fromOb, ChannelMask channels);
00335 
00336         // Remembered info
00337         BezierShape *rememberedShape;   // NULL if using all selected verts
00338         int rememberedPoly;
00339         int rememberedIndex;
00340         int rememberedData;
00341 
00342         // Vertex insertion information
00343         Spline3D *insertSpline;
00344         BezierShape *insertShape;
00345         int insertPoly;
00346         int insertVert;
00347         INode *insertNode;
00348         Matrix3 insertTM;   // Transform for the insert node
00349 
00350         // Create line data
00351         BezierShape *createShape;
00352         INode *createNode;
00353         Matrix3 createTM;   // Transform for the create node
00354 
00355         // Boolean info
00356         int boolPoly1;
00357         // Transform stuff
00358         BOOL doingHandles;
00359         int handlePoly;
00360         int handleVert;
00361         // Fillet and chamfer upper limit
00362         float FCLimit;
00363         // Load reference version
00364         int loadRefVersion;
00365 
00366         // CAL-05/23/03: Add Connecting Splines when Shift-Move Copy. (FID #827)
00367         BOOL connectCopy;
00368         float connectCopyThreshold;
00369 
00370         // CAL-02/24/03: Add Cross Section mode. (FID #827)
00371         int newKnotType;
00372 
00373         // CAL-02/27/03: copy/paste tangent info. (FID #827)
00374         BOOL copyTanLength;
00375         BOOL tangentCopied;
00376         Point3 copiedTangent;
00377 
00378     protected:
00379         //  inherited virtual methods for Reference-management
00380         CoreExport RefResult NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message );
00381         // Special flag -- If TRUE, overrides for vertex tick display
00382         BOOL drawTicks;
00383         BOOL generalUIDisplayed;
00384 
00385     public:
00386         static IObjParam *ip;       
00387         static SplineShape *editObj;
00388 
00389         // additonal references
00390         SingleRefMakerSplineNode* noderef;                  
00391         SingleRefMakerSplineMtl* mtlref; 
00392 
00393         BezierShape     shape;
00394 
00395         // Local storage of steps value -- Retains steps value when shape is adaptive
00396         int steps;
00397 
00398         BOOL showVertNumbers;
00399         BOOL SVNSelectedOnly;
00400 
00401         DWORD esFlags;
00402 
00403         NamedVertSelSetList vselSet;
00404         NamedSegSelSetList sselSet;
00405         NamedPolySelSetList pselSet;        
00406 
00407         MasterPointControl  *masterCont;        // Master track controller
00408         Tab<Control*> cont;
00409 
00411         CoreExport SplineShape();
00412         CoreExport SplineShape(SplineShape &from);
00413 
00414         CoreExport void SplineShapeInit();  // Constructor helper
00415 
00417         CoreExport ~SplineShape();
00418 
00419         CoreExport SplineShape &operator=(SplineShape &from);
00420 
00421         // Flag methods.
00422         void SetFlag (DWORD fl, BOOL val=TRUE) { if (val) esFlags |= fl; else esFlags &= ~fl; }
00423         void ClearFlag (DWORD fl) { esFlags &= (~fl); }
00424         bool GetFlag (DWORD fl) { return (esFlags&fl) ? TRUE : FALSE; }
00425 
00426         //  inherited virtual methods:
00427 
00428         // From BaseObject
00429         CoreExport virtual int HitTest(TimeValue t, INode* inode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt);
00430         CoreExport virtual int HitTest(TimeValue t, INode* inode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt, ModContext* mc);
00431         CoreExport virtual void Snap(TimeValue t, INode* inode, SnapInfo *snap, IPoint2 *p, ViewExp *vpt);
00432         CoreExport virtual int Display(TimeValue t, INode* inode, ViewExp *vpt, int flags);
00433         CoreExport virtual CreateMouseCallBack* GetCreateMouseCallBack();
00434         CoreExport virtual RefTargetHandle Clone(RemapDir& remap);
00435 
00436         // Gizmo versions:
00437         CoreExport int Display(TimeValue t, INode* inode, ViewExp *vpt, int flags, ModContext *mc);
00438         CoreExport void GetWorldBoundBox (TimeValue t, INode * inode, ViewExp* vp, Box3& box, ModContext *mc);
00439 
00440         // NS: New SubObjType API
00441         CoreExport int NumSubObjTypes();
00442         CoreExport ISubObjType *GetSubObjType(int i);
00443 
00444         // Specialized xform for bezier handles
00445         CoreExport void XFormHandles( SSXFormProc *xproc, TimeValue t, Matrix3& partm, Matrix3& tmAxis );
00446 
00447         // Generic xform procedure.
00448         CoreExport void XFormVerts( SSXFormProc *xproc, TimeValue t, Matrix3& partm, Matrix3& tmAxis );
00449 
00450         // Affine transform methods     
00451         CoreExport void Move( TimeValue t, Matrix3& partm, Matrix3& tmAxis, Point3& val, BOOL localOrigin=FALSE );
00452         CoreExport void Rotate( TimeValue t, Matrix3& partm, Matrix3& tmAxis, Quat& val, BOOL localOrigin=FALSE );
00453         CoreExport void Scale( TimeValue t, Matrix3& partm, Matrix3& tmAxis, Point3& val, BOOL localOrigin=FALSE );
00454         
00455         // The following is called before the first Move(), Rotate() or Scale() call
00456         CoreExport void TransformStart(TimeValue t);
00457 
00458         // The following is called after the user has completed the Move, Rotate or Scale operation and
00459         // the undo object has been accepted.
00460         CoreExport void TransformFinish(TimeValue t);       
00461 
00462         // The following is called when the transform operation is cancelled by a right-click and the undo
00463         // has been cancelled.
00464         CoreExport void TransformCancel(TimeValue t);       
00465 
00466         // From Object           
00467         CoreExport ObjectState Eval(TimeValue time);
00468         CoreExport Interval ObjectValidity(TimeValue t);
00469         CoreExport void MaybeEnlargeViewportRect(GraphicsWindow *gw, Rect &rect);
00470         CoreExport virtual void InitNodeName(MSTR& s);
00471 
00472         // Named selection set support:
00473         BOOL SupportsNamedSubSels() {return TRUE;}
00474         CoreExport void ActivateSubSelSet(MSTR &setName);
00475         CoreExport void NewSetFromCurSel(MSTR &setName);
00476         CoreExport void RemoveSubSelSet(MSTR &setName);
00477         CoreExport void SetupNamedSelDropDown();
00478         CoreExport int NumNamedSelSets();
00479         CoreExport MSTR GetNamedSelSetName(int i);
00480         CoreExport void SetNamedSelSetName(int i,MSTR &newName);
00481         CoreExport void NewSetByOperator(MSTR &newName,Tab<int> &sets,int op);
00482         CoreExport BOOL GetUniqueSetName(MSTR &name);
00483         CoreExport INT_PTR SelectNamedSet();
00484             // WIN64 Cleanup: Shuler
00485         CoreExport void NSCopy();
00486         CoreExport void NSPaste();
00487         CoreExport SSNamedSelSetList GetSelSet();
00488 
00489         // The validty interval of channels necessary to do a convert to type
00490         CoreExport Interval ConvertValidity(TimeValue t);
00491 
00492         // get and set the validity interval for the nth channel
00493         CoreExport Interval ChannelValidity(TimeValue t, int nchan);
00494         CoreExport void SetChannelValidity(int i, Interval v);
00495         CoreExport void InvalidateChannels(ChannelMask channels);
00496 
00497         // Deformable object procs  
00498         int IsDeformable() { return 1; }  
00499         CoreExport int NumPoints();
00500         CoreExport Point3 GetPoint(int i);
00501         CoreExport void SetPoint(int i, const Point3& p);
00502         CoreExport BOOL IsPointSelected (int i);
00503         
00504         CoreExport void PointsWereChanged();
00505         CoreExport void GetDeformBBox(TimeValue t, Box3& box, Matrix3 *tm=NULL,BOOL useSel=FALSE );
00506         CoreExport void Deform(Deformer *defProc, int useSel);
00507 
00508         CoreExport int CanConvertToType(Class_ID obtype);
00509         CoreExport Object* ConvertToType(TimeValue t, Class_ID obtype);
00510         CoreExport void GetCollapseTypes(Tab<Class_ID> &clist,Tab<MSTR*> &nlist);
00511 
00512 
00513         CoreExport void FreeChannels(ChannelMask chan);
00514         CoreExport Object *MakeShallowCopy(ChannelMask channels);
00515         CoreExport void ShallowCopy(Object* fromOb, ChannelMask channels);
00516         CoreExport void NewAndCopyChannels(ChannelMask channels);
00517 
00518         CoreExport DWORD GetSubselState();
00519 
00520         // From ShapeObject
00521         CoreExport ObjectHandle CreateTriObjRep(TimeValue t);  // for rendering, also for deformation       
00522         CoreExport void GetWorldBoundBox(TimeValue t, INode *inode, ViewExp* vpt, Box3& box );
00523         CoreExport void GetLocalBoundBox(TimeValue t, INode *inode, ViewExp* vpt, Box3& box );
00524         CoreExport int NumberOfVertices(TimeValue t, int curve);
00525         CoreExport int NumberOfCurves();
00526         CoreExport BOOL CurveClosed(TimeValue t, int curve);
00527         CoreExport Point3 InterpCurve3D(TimeValue t, int curve, float param, int ptype=PARAM_SIMPLE);
00528         CoreExport Point3 TangentCurve3D(TimeValue t, int curve, float param, int ptype=PARAM_SIMPLE);
00529         CoreExport float LengthOfCurve(TimeValue t, int curve);
00530         CoreExport int NumberOfPieces(TimeValue t, int curve);
00531         CoreExport Point3 InterpPiece3D(TimeValue t, int curve, int piece, float param, int ptype=PARAM_SIMPLE);
00532         CoreExport Point3 TangentPiece3D(TimeValue t, int curve, int piece, float param, int ptype=PARAM_SIMPLE);
00533         CoreExport MtlID GetMatID(TimeValue t, int curve, int piece);
00534         BOOL CanMakeBezier() { return TRUE; }
00535         CoreExport void MakeBezier(TimeValue t, BezierShape &shape);
00536         CoreExport ShapeHierarchy &OrganizeCurves(TimeValue t, ShapeHierarchy *hier = NULL);
00537         CoreExport void MakePolyShape(TimeValue t, PolyShape &shape, int steps = PSHAPE_BUILTIN_STEPS, BOOL optimize = FALSE);
00538         CoreExport int MakeCap(TimeValue t, MeshCapInfo &capInfo, int capType);
00539         CoreExport int MakeCap(TimeValue t, PatchCapInfo &capInfo);
00540 
00543         BezierShape& GetShape() { return shape; }
00544 
00545         // Animatable methods
00546 
00547         CoreExport void DeleteThis();
00548         void FreeCaches() { shape.InvalidateGeomCache(); }
00549         virtual Class_ID ClassID() { return splineShapeClassID; }
00550         CoreExport virtual void GetClassName(MSTR& s);
00551 
00552         using ShapeObject::GetInterface;
00553         CoreExport void* GetInterface(ULONG id);
00554 
00555         // This is the name that will appear in the history browser.
00556         CoreExport virtual MCHAR *GetObjectName();
00557 
00558         // Controller stuff for animatable points
00559         CoreExport int NumSubs();
00560         CoreExport Animatable* SubAnim(int i);
00561         CoreExport MSTR SubAnimName(int i);
00562         CoreExport BOOL AssignController(Animatable *control,int subAnim);
00563         int SubNumToRefNum(int subNum) {return subNum;}
00564         CoreExport BOOL SelectSubAnim(int subNum);
00565 
00566         // Reference methods
00567         CoreExport void RescaleWorldUnits(float f);
00568         CoreExport int RemapRefOnLoad(int iref);
00569         CoreExport int NumRefs();
00570         CoreExport RefTargetHandle GetReference(int i);
00571 protected:
00572         CoreExport virtual void SetReference(int i, RefTargetHandle rtarg);
00573 public:
00574         CoreExport void CreateContArray();
00575         CoreExport void SynchContArray();
00576         CoreExport void AllocContArray(int count);
00577         CoreExport void ReplaceContArray(Tab<Control *> &nc);
00578         CoreExport void InsertPointConts(int index, int count);
00579         CoreExport void DeletePointConts(BitArray &set);
00580         CoreExport void ReversePointConts(int index, int count, BOOL keepFirst);
00581         CoreExport void NullPointConts(int index, int count);
00582         CoreExport void NullPolyPointConts(int poly);
00583         CoreExport void PlugControllersSel(TimeValue t);
00584         CoreExport BOOL PlugControl(TimeValue t,int i);
00585         CoreExport void SetPtCont(int i, Control *c);
00586         CoreExport void SetPointAnim(TimeValue t, int poly, int vert, Point3 pt);
00587         CoreExport BOOL CloneVertCont(int from, int to);
00588 
00589         // Editable spline stuff follows...
00590         CoreExport void SetRollupPage(IObjParam *ip, BOOL creating);
00591         CoreExport void RemoveRollupPage(IObjParam *ip);
00592         CoreExport virtual void BeginEditParams( IObjParam  *ip, ULONG flags,Animatable *prev);
00593         CoreExport virtual void EndEditParams( IObjParam *ip, ULONG flags,Animatable *next);
00594         CoreExport int GetSubobjectLevel();
00595         CoreExport void SetSubobjectLevel(int level);
00596         CoreExport void ActivateSubobjSel(int level, XFormModes& modes );
00597         int NeedUseSubselButton() { return 0; }
00598         CoreExport void SelectSubComponent( HitRecord *hitRec, BOOL selected, BOOL all, BOOL invert );
00599         CoreExport void ClearSelection(int level);      
00600         CoreExport void SelectAll(int level);
00601         CoreExport void InvertSelection(int level);
00602         CoreExport void GetSubObjectCenters(SubObjAxisCallback *cb,TimeValue t,INode *node,ModContext *mc);
00603         CoreExport void GetSubObjectTMs(SubObjAxisCallback *cb,TimeValue t,INode *node,ModContext *mc);
00604         CoreExport void ShowEndResultChanged (BOOL showEndResult);
00605         CoreExport int SubObjectIndex(HitRecord *hitRec);
00606         CoreExport void MultiAttachObject(INodeTab &nodeTab);
00607         CoreExport void BeginOutlineMove(TimeValue t);
00608         CoreExport void BeginFilletMove(TimeValue t);
00609         CoreExport void BeginChamferMove(TimeValue t);
00610         CoreExport void OutlineMove( TimeValue t, float amount );
00611         CoreExport void FilletMove( TimeValue t, float amount );
00612         CoreExport void ChamferMove( TimeValue t, float amount );
00613         CoreExport void EndMoveModes(TimeValue t, BOOL accept=TRUE);    // End all Moves (below)
00614         CoreExport void EndOutlineMove(TimeValue t,BOOL accept=TRUE);
00615         CoreExport void EndFilletMove(TimeValue t,BOOL accept=TRUE);
00616         CoreExport void EndChamferMove(TimeValue t,BOOL accept=TRUE);
00617         CoreExport void StartOutlineMode();
00618         CoreExport void StartFilletMode();
00619         CoreExport void StartChamferMode();
00620         CoreExport void DoOutline();
00621         CoreExport void DoFillet();
00622         CoreExport void DoChamfer();
00623         CoreExport void StartSegBreakMode();
00624         CoreExport void DoSegBreak(ViewExp *vpt, BezierShape *shape, int poly, int seg, IPoint2 p, INode *inode=NULL);
00625         CoreExport void StartSegRefineMode();
00626         CoreExport void DoSegRefine(ViewExp *vpt, BezierShape *shape, int poly, int seg, IPoint2 p, INode *inode=NULL);
00627         CoreExport void StartCrossInsertMode();
00628         CoreExport void DoCrossInsert(ViewExp *vpt, BezierShape *shape, int poly1, int seg1, int poly2, int seg2, IPoint2 p);
00629         CoreExport void StartVertConnectMode();
00630         CoreExport void DoVertConnect(ViewExp *vpt, BezierShape *shape, int poly1, int vert1, int poly2, int vert2);
00631         CoreExport void StartVertInsertMode(int controlID);
00632         CoreExport int StartVertInsert(ViewExp *vpt, BezierShape *shape, int poly, int seg, int vert, INode *inode=NULL);
00633         CoreExport void EndVertInsert(BOOL acceptUndo);
00634         CoreExport void StartCreateLineMode();
00635         CoreExport BOOL StartCreateLine(BezierShape **shape);
00636         CoreExport void EndCreateLine();
00637 
00638 
00639         CoreExport void StartCrossSectionMode();            
00640         CoreExport void StartCrossSection();                
00641         CoreExport void EndCrossSection(BOOL acceptUndo);   
00642         CoreExport BOOL BooleanStartUp();
00643         CoreExport void StartBooleanMode();
00644         CoreExport void DoBoolean(int poly2);
00645         CoreExport void StartTrimMode();
00646         CoreExport void StartExtendMode();
00647         CoreExport void HandleTrimExtend(ViewExp *vpt, ShapeHitData *hit, IPoint2 &m, int operation);
00648 
00649         // from AttachMatDlgUser
00650         CoreExport int GetAttachMat();
00651         CoreExport void SetAttachMat(int value);
00652         CoreExport BOOL GetCondenseMat();
00653         CoreExport void SetCondenseMat(BOOL sw);
00654 
00655         CoreExport int DoAttach(INode *node, bool & canUndo);
00656 
00660         CoreExport void DoCrossSection(Tab<int> &splineIndices);
00661         CoreExport void DoVertBreak();
00662         CoreExport void DoVertWeld();
00663         CoreExport void DoMakeFirst();
00664         CoreExport void DoVertDelete();
00665         CoreExport void DoSegDelete();
00666         CoreExport void DoSegDetach(int sameShape, int copy, int reorient);
00667         CoreExport void DoSegDivide(int divisions);
00668         CoreExport void DoPolyClose();
00669         CoreExport void DoPolyDetach(int copy, int reorient);
00670         CoreExport void DoPolyMirror(int type, int copy);
00671         CoreExport void DoPolyDelete();
00672         CoreExport void DoPolyReverse();
00673         CoreExport void DoPolyExplode();
00674         CoreExport void DoExplodeToObjects();
00675         CoreExport void SetBoolOperation(int type) { boolType = type; }
00676         CoreExport void SetMirrorOperation(int type) { mirrorType = type; }
00677         CoreExport int GetBoolOperation() { return boolType; }
00678         CoreExport int GetMirrorOperation() { return mirrorType; }
00679         CoreExport int GetBoolCursorID();
00680         CoreExport int GetBoolMirrString(UINT_PTR type);
00681             // WIN64 Cleanup: Shuler
00682         CoreExport void SetBooleanButton();
00683         CoreExport void SetMirrorButton();
00684         CoreExport void ChangeSelVerts(int type);
00685         CoreExport void ChangeRememberedVert(int type);
00686         CoreExport int RememberVertThere(HWND hWnd, IPoint2 m);
00687         CoreExport void SetRememberedVertType(int type);
00688         CoreExport void ChangeSelSegs(int type);
00689         CoreExport void ChangeRememberedSeg(int type);
00690         CoreExport int RememberSegThere(HWND hWnd, IPoint2 m);
00691         CoreExport void SetRememberedSegType(int type);
00692         CoreExport void ChangeSelPolys(int type);
00693         CoreExport void ChangeRememberedPoly(int type);
00694         CoreExport int RememberPolyThere(HWND hWnd, IPoint2 m);
00695         CoreExport void SetRememberedPolyType(int type);
00696 
00697         CoreExport void SplineShapeClone( SplineShape *source );
00698 
00700         CoreExport int GetPointIndex(const Tab<Point3> &vertList, const Point3 &point) const;
00701 
00702         // The following methods do the job and update controllers, named selections, etc.
00703         CoreExport void DeleteSpline(int poly);
00704         CoreExport void InsertSpline(Spline3D *spline, int poly);
00705         CoreExport void Reverse(int poly, BOOL keepFirst = FALSE);
00706         CoreExport void DeleteKnot(int poly, int index);
00707         CoreExport void AddKnot(int poly, SplineKnot &k, int where = -1);
00708         CoreExport BOOL Append(int poly, Spline3D *spline, BOOL weldCoincidentFirstVertex=TRUE);
00709         CoreExport BOOL Prepend(int poly, Spline3D *spline, BOOL weldCoincidentLastVertex=TRUE);
00710         CoreExport void ReplaceSpline(int poly, Spline3D *spline);
00711         CoreExport BOOL DeleteSelVerts(int poly);
00712         CoreExport BOOL DeleteSelSegs(int poly);
00713         CoreExport void MakeFirst(int poly, int index);
00714 
00715         // Support for general parameters
00716         CoreExport void SetOptimize(BOOL sw);
00717         CoreExport void SetAdaptive(BOOL sw);
00718         CoreExport void SetSteps(int n);
00719 
00720         // Store current topology in the BezierShape
00721         CoreExport void RecordTopologyTags();
00722 
00723         // Re-match named selection sets, etc. with changed topology (Call RecordTopologyTags
00724         // before making the changes to the shape, then call this)
00725         //bindTrackingOptions  0 =  no update
00726         //bindTrackingOptions  1 =  update based on geometry
00727         //bindTrackingOptions  2 =  update based on selection
00728         CoreExport void ResolveTopoChanges(BezierShape *shape = NULL, int bindTrackingOptions = 1);
00729 
00730         CoreExport void RefreshSelType();
00731         CoreExport void UpdateSelectDisplay();
00732         CoreExport void SetSelDlgEnables();
00733         CoreExport void SetOpsDlgEnables();
00734         CoreExport void SetSurfDlgEnables();
00735         CoreExport void SetSoftSelDlgEnables( HWND hSoftSel = NULL );
00736         CoreExport void SelectionChanged();
00737         CoreExport BOOL MaybeSelectSingleSpline(BOOL makeUndo = FALSE); // Returns TRUE if selected
00738         CoreExport void SetFCLimit();
00739 
00740         // Materials
00741         CoreExport int GetSelMatIndex();
00742         CoreExport void SetSelMatIndex(int index);
00743         CoreExport void SelectByMat(int index,BOOL clear);
00744         CoreExport void InvalidateSurfaceUI();
00745 
00746         // IO
00747         CoreExport IOResult Save(ISave *isave);
00748         CoreExport IOResult Load(ILoad *iload);
00749 
00750 //watje
00751         
00752         BOOL showVerts;
00753         BOOL showSelected;
00754         BOOL smoothRefineConnect;
00755         BOOL closedRefineConnect;
00756         BOOL bindFirst, bindLast;
00757 
00758 //2-1-99 watje
00759         BOOL rConnect;
00760         BOOL useAreaSelect;
00761         float areaSelect;
00762 
00763 //2-21-99 watje 
00764         SplineKnot knotPoint1, knotPoint2;
00765 
00766 
00767         int startSegRC, startSegSplineRC;
00768         int startSplineRC;
00769         int endSegRC, endSegSplineRC;
00770         int endSplineRC;
00771         Tab<Point3> pointList;
00772 
00773         static SSBindCMode *bindMode;
00774         static SSRefineConnectCMode *refineConnectMode;
00775         CoreExport void StartBindMode();
00776         CoreExport void DoBind(int poly1, int vert1, int poly2, int vert2);
00777         CoreExport void DoUnBind();
00778         CoreExport void DoHide();
00779         CoreExport void DoUnhide();
00780         CoreExport void DoCycleVerts();
00781 
00782         CoreExport void StartRefineConnectMode();
00783         CoreExport void EndRefineConnectMode();
00784         CoreExport void DoRefineConnect(ViewExp *vpt, BezierShape *shape, int poly, int seg, IPoint2 p, INode *inode=NULL);
00785 
00786 //2-1-99 watje
00787         CoreExport void DoVertFuse();
00788         
00789         CoreExport void StartCopyTangentMode();     
00790         CoreExport void StartPasteTangentMode();    
00791         CoreExport void StartPasteTangent();        
00792         CoreExport void EndPasteTangent();          
00793 
00794         CoreExport BOOL CopyTangent(int poly, int vert);    
00795         CoreExport BOOL PasteTangent(int poly, int vert);   
00796 
00797         // spline select and operations interfaces, JBW 2/1/99
00798         CoreExport void StartCommandMode(splineCommandMode mode);
00799         CoreExport void ButtonOp(splineButtonOp opcode);
00800 // LAM: added 9/3/00
00801     // UI controls access
00813         CoreExport void GetUIParam (splineUIParam uiCode, int & ret);
00825         CoreExport void SetUIParam (splineUIParam uiCode, int val);
00837         CoreExport void GetUIParam (splineUIParam uiCode, float & ret);
00849         CoreExport void SetUIParam (splineUIParam uiCode, float val);
00856         bool Editing () { return (ip && (editObj==this)) ? TRUE : FALSE; }
00857 
00858         CoreExport DWORD GetSelLevel();
00859         CoreExport void SetSelLevel(DWORD level);
00860         CoreExport void LocalDataChanged();
00861 
00862         CoreExport BitArray GetVertSel();
00863         CoreExport BitArray GetSegmentSel();
00864         CoreExport BitArray GetSplineSel();
00865 
00875         CoreExport void SelectBySegment(BOOL interactive = TRUE);
00887         CoreExport void SelectBySpline(BOOL interactive = TRUE);
00888 
00889         CoreExport void SetVertSel(BitArray &set, ISplineSelect *imod, TimeValue t);
00890         CoreExport void SetSegmentSel(BitArray &set, ISplineSelect *imod, TimeValue t);
00891         CoreExport void SetSplineSel(BitArray &set, ISplineSelect *imod, TimeValue t);
00892 
00893         CoreExport GenericNamedSelSetList& GetNamedVertSelList();
00894         CoreExport GenericNamedSelSetList& GetNamedSegmentSelList();
00895         CoreExport GenericNamedSelSetList& GetNamedSplineSelList();
00896 
00897         // ISubMtlAPI methods:
00898         CoreExport MtlID GetNextAvailMtlID(ModContext* mc);
00899         CoreExport BOOL HasFaceSelection(ModContext* mc);
00900         CoreExport void SetSelFaceMtlID(ModContext* mc, MtlID id, BOOL bResetUnsel = FALSE);
00901         CoreExport int GetSelFaceUniqueMtlID(ModContext* mc);
00902         CoreExport int GetSelFaceAnyMtlID(ModContext* mc);
00903         CoreExport int GetMaxMtlID(ModContext* mc);
00904         // Flush all caches
00905         CoreExport void InvalidateGeomCache();
00906 
00907         // soft selection support
00908         //
00909         CoreExport int  UseEdgeDists();
00910         CoreExport void SetUseEdgeDists( int useSoftSelections );
00911         CoreExport int  UseSoftSelections();
00912         CoreExport void SetUseSoftSelections( int useSoftSelections );
00913         CoreExport void InvalidateVertexWeights();
00914 
00915         CoreExport void UpdateVertexDists();
00916         CoreExport void UpdateEdgeDists( );
00917         CoreExport void UpdateVertexWeights();
00918 
00919         // Enpoint Auto Connect controls
00920         CoreExport static void InitSplineShapeAutoConnectControls();
00921         CoreExport static void SetUseEndPointAutoConnect(UINT i);
00922         CoreExport static UINT GetUseEndPointAutoConnect();
00923         CoreExport static void SetPromptForEndPointAutoConnect(UINT i);
00924         CoreExport static UINT GetPromptForEndPointAutoConnect();
00925         CoreExport static void SetEndPointAutoWeldThreshold(float f);
00926         CoreExport static float GetEndPointAutoWeldThreshold();
00927     };              
00928 
00929 #pragma warning(pop)
00930 
00931 
00932 class SSPickSplineAttach : 
00933         public PickModeCallback,
00934         public PickNodeCallback {
00935     public:     
00936         SplineShape *ss;
00937         
00938         SSPickSplineAttach() {ss=NULL;}
00939 
00940         BOOL HitTest(IObjParam *ip,HWND hWnd,ViewExp *vpt,IPoint2 m,int flags);
00941         BOOL Pick(IObjParam *ip,ViewExp *vpt);
00942 
00943         void EnterMode(IObjParam *ip);
00944         void ExitMode(IObjParam *ip);
00945 
00946         HCURSOR GetHitCursor(IObjParam *ip);
00947 
00948         BOOL Filter(INode *node);
00949         
00950         PickNodeCallback *GetFilter() {return this;}
00951 
00952         BOOL RightClick(IObjParam* ip,ViewExp* vpt) { UNUSED_PARAM(ip); UNUSED_PARAM(vpt); return TRUE;}
00953     };
00954 
00955 class SSOutlineTransformer : public Transformer {
00956     public:
00957         CoreExport Point3 Eval(ViewExp *vpt);
00958         SSOutlineTransformer(IObjParam *i) : Transformer(i) {}
00959         };  
00960 
00961 class SSOutlineMouseProc : public MouseCallBack {
00962     private:
00963         SSOutlineTransformer outlineTrans;
00964         SplineShape *ss;
00965         IObjParam *ip;
00966         Point3 p0, p1;
00967         IPoint2 sp0;
00968 
00969     public:
00970         SSOutlineMouseProc(SplineShape* shp, IObjParam *i)
00971             : outlineTrans(i) {ss=shp;ip=i;}
00972         int proc( 
00973             HWND hwnd, 
00974             int msg, 
00975             int point, 
00976             int flags, 
00977             IPoint2 m );
00978     };
00979 
00980 class SSOutlineSelectionProcessor : public GenModSelectionProcessor {
00981     protected:
00982         HCURSOR GetTransformCursor();
00983         
00984     public:
00985         SSOutlineSelectionProcessor(SSOutlineMouseProc *mc, SplineShape *s, IObjParam *i) 
00986             : GenModSelectionProcessor(mc,s,i) {}
00987     };
00988 
00989 
00990 class SSOutlineCMode : public CommandMode {
00991     private:
00992         ChangeFGObject fgProc;
00993         SSOutlineSelectionProcessor mouseProc;
00994         SSOutlineMouseProc eproc;
00995         SplineShape* ss;
00996 
00997     public:
00998         SSOutlineCMode(SplineShape* ss, IObjParam *i) :
00999             fgProc(ss), mouseProc(&eproc,ss,i), eproc(ss,i) {this->ss=ss;}
01000 
01001         int Class() { return MODIFY_COMMAND; }
01002         int ID() { return CID_OUTLINE; }
01003         MouseCallBack *MouseProc(int *numPoints) { *numPoints=2; return &mouseProc; }
01004         ChangeForegroundCallback *ChangeFGProc() { return &fgProc; }
01005         BOOL ChangeFG( CommandMode *oldMode ) { return oldMode->ChangeFGProc() != &fgProc; }
01006         void EnterMode();
01007         void ExitMode();
01008     };
01009 
01010 /*-------------------------------------------------------------------*/
01011 
01012 class SSFilletTransformer : public Transformer {
01013     public:
01014         CoreExport Point3 Eval(ViewExp *vpt);
01015         SSFilletTransformer(IObjParam *i) : Transformer(i) {}
01016         };  
01017 
01018 class SSFilletMouseProc : public MouseCallBack {
01019     private:
01020         SSFilletTransformer filletTrans;
01021         SplineShape *ss;
01022         IObjParam *ip;
01023         Point3 p0, p1;
01024         IPoint2 sp0;
01025 
01026     public:
01027         SSFilletMouseProc(SplineShape* shp, IObjParam *i)
01028             : filletTrans(i) {ss=shp;ip=i;}
01029         int proc( 
01030             HWND hwnd, 
01031             int msg, 
01032             int point, 
01033             int flags, 
01034             IPoint2 m );
01035     };
01036 
01037 class SSFilletSelectionProcessor : public GenModSelectionProcessor {
01038     protected:
01039         HCURSOR GetTransformCursor();
01040         
01041     public:
01042         SSFilletSelectionProcessor(SSFilletMouseProc *mc, SplineShape *s, IObjParam *i) 
01043             : GenModSelectionProcessor(mc,s,i) {}
01044     };
01045 
01046 
01047 class SSFilletCMode : public CommandMode {
01048     private:
01049         ChangeFGObject fgProc;
01050         SSFilletSelectionProcessor mouseProc;
01051         SSFilletMouseProc eproc;
01052         SplineShape* ss;
01053 
01054     public:
01055         SSFilletCMode(SplineShape* ss, IObjParam *i) :
01056             fgProc(ss), mouseProc(&eproc,ss,i), eproc(ss,i) {this->ss=ss;}
01057 
01058         int Class() { return MODIFY_COMMAND; }
01059         int ID() { return CID_OUTLINE; }
01060         MouseCallBack *MouseProc(int *numPoints) { *numPoints=2; return &mouseProc; }
01061         ChangeForegroundCallback *ChangeFGProc() { return &fgProc; }
01062         BOOL ChangeFG( CommandMode *oldMode ) { return oldMode->ChangeFGProc() != &fgProc; }
01063         void EnterMode();
01064         void ExitMode();
01065     };
01066 
01067 /*-------------------------------------------------------------------*/
01068 
01069 class SSChamferTransformer : public Transformer {
01070     public:
01071         CoreExport Point3 Eval(ViewExp *vpt);
01072         SSChamferTransformer(IObjParam *i) : Transformer(i) {}
01073         };  
01074 
01075 class SSChamferMouseProc : public MouseCallBack {
01076     private:
01077         SSChamferTransformer chamferTrans;
01078         SplineShape *ss;
01079         IObjParam *ip;
01080         Point3 p0, p1;
01081         IPoint2 sp0;
01082 
01083     public:
01084         SSChamferMouseProc(SplineShape* shp, IObjParam *i)
01085             : chamferTrans(i) {ss=shp;ip=i;}
01086         int proc( 
01087             HWND hwnd, 
01088             int msg, 
01089             int point, 
01090             int flags, 
01091             IPoint2 m );
01092     };
01093 
01094 class SSChamferSelectionProcessor : public GenModSelectionProcessor {
01095     protected:
01096         HCURSOR GetTransformCursor();
01097         
01098     public:
01099         SSChamferSelectionProcessor(SSChamferMouseProc *mc, SplineShape *s, IObjParam *i) 
01100             : GenModSelectionProcessor(mc,s,i) {}
01101     };
01102 
01103 
01104 class SSChamferCMode : public CommandMode {
01105     private:
01106         ChangeFGObject fgProc;
01107         SSChamferSelectionProcessor mouseProc;
01108         SSChamferMouseProc eproc;
01109         SplineShape* ss;
01110 
01111     public:
01112         SSChamferCMode(SplineShape* ss, IObjParam *i) :
01113             fgProc(ss), mouseProc(&eproc,ss,i), eproc(ss,i) {this->ss=ss;}
01114 
01115         int Class() { return MODIFY_COMMAND; }
01116         int ID() { return CID_OUTLINE; }
01117         MouseCallBack *MouseProc(int *numPoints) { *numPoints=2; return &mouseProc; }
01118         ChangeForegroundCallback *ChangeFGProc() { return &fgProc; }
01119         BOOL ChangeFG( CommandMode *oldMode ) { return oldMode->ChangeFGProc() != &fgProc; }
01120         void EnterMode();
01121         void ExitMode();
01122     };
01123 
01124 /*-------------------------------------------------------------------*/
01125 
01126 class SSSegBreakTransformer : public Transformer {
01127     public:
01128         CoreExport Point3 Eval(ViewExp *vpt);
01129         SSSegBreakTransformer(IObjParam *i) : Transformer(i) {}
01130         };  
01131 
01132 class SSSegBreakMouseProc : public MouseCallBack {
01133     private:
01134         SplineShape *ss;
01135         IObjParam *ip;
01136         IPoint2 om;
01137 
01138     protected:
01139         HCURSOR GetTransformCursor();
01140         BOOL HitTest( ViewExp *vpt, IPoint2 *p, int type, int flags );
01141         BOOL AnyHits( ViewExp *vpt ) { return vpt->NumSubObjHits(); }       
01142 
01143     public:
01144         SSSegBreakMouseProc(SplineShape* spl, IObjParam *i) { ss=spl; ip=i; }
01145         int proc( 
01146             HWND hwnd, 
01147             int msg, 
01148             int point, 
01149             int flags, 
01150             IPoint2 m );
01151 //      int override(int mode) { return CLICK_DOWN_POINT; }
01152     };
01153 
01154 class SSSegBreakCMode : public CommandMode {
01155     private:
01156         ChangeFGObject fgProc;
01157         SSSegBreakMouseProc eproc;
01158         SplineShape* ss;
01159 
01160     public:
01161         SSSegBreakCMode(SplineShape* spl, IObjParam *i) :
01162             fgProc(spl), eproc(spl,i) {ss=spl;}
01163 
01164         int Class() { return MODIFY_COMMAND; }
01165         int ID() { return CID_SEGBREAK; }
01166         MouseCallBack *MouseProc(int *numPoints) { *numPoints=1; return &eproc; }
01167         ChangeForegroundCallback *ChangeFGProc() { return &fgProc; }
01168         BOOL ChangeFG( CommandMode *oldMode ) { return oldMode->ChangeFGProc() != &fgProc; }
01169         void EnterMode();
01170         void ExitMode();
01171     };
01172 
01173 /*-------------------------------------------------------------------*/
01174 
01175 #define REFINE_VERT 0
01176 #define REFINE_SEG 1
01177 
01178 class SSSegRefineMouseProc : public MouseCallBack {
01179     private:
01180         SplineShape *ss;
01181         IObjParam *ip;
01182         IPoint2 om;
01183         int type; // See above
01184     
01185     protected:
01186         HCURSOR GetTransformCursor();
01187         BOOL HitTest( ViewExp *vpt, IPoint2 *p, int type, int flags );
01188         BOOL AnyHits( ViewExp *vpt ) { return vpt->NumSubObjHits(); }       
01189 
01190     public:
01191         SSSegRefineMouseProc(SplineShape* spl, IObjParam *i) { ss=spl; ip=i; }
01192         int proc( 
01193             HWND hwnd, 
01194             int msg, 
01195             int point, 
01196             int flags, 
01197             IPoint2 m );
01198         void SetType(int type) { this->type = type; }
01199     };
01200 
01201 class SSSegRefineCMode : public CommandMode {
01202     private:
01203         ChangeFGObject fgProc;
01204         SSSegRefineMouseProc eproc;
01205         SplineShape* ss;
01206         int type; // See above
01207 
01208     public:
01209         SSSegRefineCMode(SplineShape* spl, IObjParam *i) :
01210             fgProc(spl), eproc(spl,i) {ss=spl;}
01211 
01212         int Class() { return MODIFY_COMMAND; }
01213         int ID() { return CID_SEGREFINE; }
01214         MouseCallBack *MouseProc(int *numPoints) { *numPoints=1; return &eproc; }
01215         ChangeForegroundCallback *ChangeFGProc() { return &fgProc; }
01216         BOOL ChangeFG( CommandMode *oldMode ) { return oldMode->ChangeFGProc() != &fgProc; }
01217         void EnterMode();
01218         void ExitMode();
01219         void SetType(int type) { this->type = type; eproc.SetType(type); }
01220     };
01221 
01222 /*-------------------------------------------------------------------*/
01223 
01224 class SSCrossInsertMouseProc : public MouseCallBack {
01225     private:
01226         SplineShape *ss;
01227         IObjParam *ip;
01228         IPoint2 om;
01229     
01230     protected:
01231         HCURSOR GetTransformCursor();
01232         BOOL HitTest( ViewExp *vpt, IPoint2 *p, int type, int flags );
01233         BOOL AnyHits( ViewExp *vpt ) { return vpt->NumSubObjHits(); }       
01234 
01235     public:
01236         SSCrossInsertMouseProc(SplineShape* spl, IObjParam *i) { ss=spl; ip=i; }
01237         int proc( 
01238             HWND hwnd, 
01239             int msg, 
01240             int point, 
01241             int flags, 
01242             IPoint2 m );
01243     };
01244 
01245 class SSCrossInsertCMode : public CommandMode {
01246     private:
01247         ChangeFGObject fgProc;
01248         SSCrossInsertMouseProc eproc;
01249         SplineShape* ss;
01250 
01251     public:
01252         SSCrossInsertCMode(SplineShape* spl, IObjParam *i) :
01253             fgProc(spl), eproc(spl,i) {ss=spl;}
01254 
01255         int Class() { return MODIFY_COMMAND; }
01256         int ID() { return CID_CROSSINSERT; }
01257         MouseCallBack *MouseProc(int *numPoints) { *numPoints=1; return &eproc; }
01258         ChangeForegroundCallback *ChangeFGProc() { return &fgProc; }
01259         BOOL ChangeFG( CommandMode *oldMode ) { return oldMode->ChangeFGProc() != &fgProc; }
01260         void EnterMode();
01261         void ExitMode();
01262     };
01263 
01264 /*-------------------------------------------------------------------*/
01265 
01266 class SSVertConnectMouseProc : public MouseCallBack {
01267     private:
01268         SplineShape *ss;
01269         IObjParam *ip;
01270         IPoint2 om;
01271 
01272     protected:
01273         HCURSOR GetTransformCursor();
01274         BOOL HitTest( ViewExp *vpt, IPoint2 *p, int type, int flags );
01275         BOOL AnyHits( ViewExp *vpt ) { return vpt->NumSubObjHits(); }       
01276         BOOL HitAnEndpoint(ViewExp *vpt, IPoint2 *p, BezierShape *shape, int poly, int vert,
01277             BezierShape **shapeOut, int *polyOut, int *vertOut);
01278     public:
01279         SSVertConnectMouseProc(SplineShape* spl, IObjParam *i) { ss=spl; ip=i; }
01280         int proc( 
01281             HWND hwnd, 
01282             int msg, 
01283             int point, 
01284             int flags, 
01285             IPoint2 m );
01286     };
01287 
01288 class SSVertConnectCMode : public CommandMode {
01289     private:
01290         ChangeFGObject fgProc;
01291         SSVertConnectMouseProc eproc;
01292         SplineShape* ss;
01293 
01294     public:
01295         SSVertConnectCMode(SplineShape* spl, IObjParam *i) :
01296             fgProc(spl), eproc(spl,i) {ss=spl;}
01297 
01298         int Class() { return MODIFY_COMMAND; }
01299         int ID() { return CID_VERTCONNECT; }
01300         MouseCallBack *MouseProc(int *numPoints) { *numPoints=2; return &eproc; }
01301         ChangeForegroundCallback *ChangeFGProc() { return &fgProc; }
01302         BOOL ChangeFG( CommandMode *oldMode ) { return oldMode->ChangeFGProc() != &fgProc; }
01303         void EnterMode();
01304         void ExitMode();
01305     };
01306 
01307 /*-------------------------------------------------------------------*/
01308 
01309 class SSVertInsertMouseProc : public MouseCallBack {
01310     private:
01311         SplineShape *ss;
01312         IObjParam *ip;
01313         IPoint2 om;
01314 
01315     protected:
01316         HCURSOR GetTransformCursor();
01317         BOOL HitTest( ViewExp *vpt, IPoint2 *p, int type, int flags, int hitType );
01318         BOOL AnyHits( ViewExp *vpt ) { return vpt->NumSubObjHits(); }       
01319         BOOL InsertWhere(ViewExp *vpt, IPoint2 *p, BezierShape **shapeOut, int *polyOut,int *segOut, int *vertOut, INode **nodeOut);
01320     public:
01321         SSVertInsertMouseProc(SplineShape* spl, IObjParam *i) { ss=spl; ip=i; }
01322         int proc( HWND hwnd, int msg, int point, int flags, IPoint2 m );
01323         int override(int mode) { UNUSED_PARAM(mode);  return CLICK_DOWN_POINT; }
01324     };
01325 
01326 class SSVertInsertCMode : public CommandMode {
01327     private:
01328         ChangeFGObject fgProc;
01329         SSVertInsertMouseProc eproc;
01330         SplineShape* ss;
01331         int control;    // ID of the resource button
01332     public:
01333         SSVertInsertCMode(SplineShape* spl, IObjParam *i) :
01334             fgProc(spl), eproc(spl,i) {ss=spl; control= -1;}
01335 
01336         int Class() { return MODIFY_COMMAND; }
01337         int ID() { return CID_VERTINSERT; }
01338         MouseCallBack *MouseProc(int *numPoints) { *numPoints=999999; return &eproc; }
01339         ChangeForegroundCallback *ChangeFGProc() { return &fgProc; }
01340         BOOL ChangeFG( CommandMode *oldMode ) { return oldMode->ChangeFGProc() != &fgProc; }
01341         void EnterMode();
01342         void ExitMode();
01343         void SetControl(int id) { control = id; }
01344     };
01345 
01346 /*-------------------------------------------------------------------*/
01347 
01348 class SSCreateLineMouseProc : public MouseCallBack {
01349     private:
01350         SplineShape *ss;
01351         IObjParam *ip;
01352         IPoint2 om;
01353 
01354     protected:
01355         BOOL HitTest( ViewExp *vpt, IPoint2 *p, int type, int flags, int hitType );
01356         BOOL AnyHits( ViewExp *vpt ) { return vpt->NumSubObjHits(); }       
01357         BOOL InsertWhere(ViewExp *vpt, IPoint2 *p, BezierShape **shapeOut, int *polyOut, int *vertOut, INode **nodeOut);
01358     public:
01359         SSCreateLineMouseProc(SplineShape* spl, IObjParam *i) { ss=spl; ip=i; }
01360         int proc( HWND hwnd, int msg, int point, int flags, IPoint2 m );
01361         int override(int mode) { UNUSED_PARAM(mode); return CLICK_DOWN_POINT; }
01362     };
01363 
01364 class SSCreateLineCMode : public CommandMode {
01365     private:
01366         ChangeFGObject fgProc;
01367         SSCreateLineMouseProc eproc;
01368         SplineShape* ss;
01369 
01370     public:
01371         SSCreateLineCMode(SplineShape* spl, IObjParam *i) :
01372             fgProc(spl), eproc(spl,i) {ss=spl;}
01373 
01374         int Class() { return MODIFY_COMMAND; }
01375         int ID() { return CID_CREATELINE; }
01376         MouseCallBack *MouseProc(int *numPoints) { *numPoints=999999; return &eproc; }
01377         ChangeForegroundCallback *ChangeFGProc() { return &fgProc; }
01378         BOOL ChangeFG( CommandMode *oldMode ) { return oldMode->ChangeFGProc() != &fgProc; }
01379         void EnterMode();
01380         void ExitMode();
01381     };
01382 
01383 /*-------------------------------------------------------------------*/
01384 // CAL-02/24/03: Add Cross Section mode. (FID #827)
01385 
01386 class SSCrossSectionMouseProc : public MouseCallBack {
01387     private:
01388         SplineShape *ss;
01389         IObjParam *ip;
01390         IPoint2 om;
01391         
01392         static bool mCreating;
01393         static bool mCrossingDrawn;
01394         static int mPolys;
01395         static Tab<int> mSelectedSplines;
01396         static Matrix3 mObjToWorldTM;
01397         static IPoint2 mMouse;
01398 
01399     protected:
01400         HCURSOR GetTransformCursor();
01401         HitRecord* HitTest( ViewExp *vpt, IPoint2 *p, int type, int flags );
01402         void DrawCrossing(HWND hWnd);
01403 
01404     public:
01405         SSCrossSectionMouseProc(SplineShape* spl, IObjParam *i) { ss=spl; ip=i; }
01406         int proc( HWND hwnd, int msg, int point, int flags, IPoint2 m );
01407         int override(int mode) { UNUSED_PARAM(mode);  return CLICK_DOWN_POINT; }
01408     };
01409 
01410 class SSCrossSectionCMode : public CommandMode {
01411     private:
01412         ChangeFGObject fgProc;
01413         SSCrossSectionMouseProc eproc;
01414         SplineShape* ss;
01415 
01416     public:
01417         SSCrossSectionCMode(SplineShape* spl, IObjParam *i) :
01418             fgProc(spl), eproc(spl,i) {ss=spl;}
01419 
01420         int Class() { return MODIFY_COMMAND; }
01421         int ID() { return CID_CROSSSECTION; }
01422         MouseCallBack *MouseProc(int *numPoints) { *numPoints=999999; return &eproc; }
01423         ChangeForegroundCallback *ChangeFGProc() { return &fgProc; }
01424         BOOL ChangeFG( CommandMode *oldMode ) { return oldMode->ChangeFGProc() != &fgProc; }
01425         void EnterMode();
01426         void ExitMode();
01427     };
01428 
01429 /*-------------------------------------------------------------------*/
01430 
01431 class SSBooleanMouseProc : public MouseCallBack {
01432     private:
01433         SplineShape *ss;
01434         IObjParam *ip;
01435         IPoint2 om;
01436 
01437     protected:
01438         HCURSOR GetTransformCursor();
01439         BOOL HitTest( ViewExp *vpt, IPoint2 *p, int type, int flags );
01440         BOOL AnyHits( ViewExp *vpt ) { return vpt->NumSubObjHits(); }       
01441     public:
01442         SSBooleanMouseProc(SplineShape* spl, IObjParam *i) { ss=spl; ip=i; }
01443         int proc( 
01444             HWND hwnd, 
01445             int msg, 
01446             int point, 
01447             int flags, 
01448             IPoint2 m );
01449         int override(int mode) { UNUSED_PARAM(mode); return CLICK_DOWN_POINT; }
01450     };
01451 
01452 class SSBooleanCMode : public CommandMode {
01453     private:
01454         ChangeFGObject fgProc;
01455         SSBooleanMouseProc eproc;
01456         SplineShape* ss;
01457 
01458     public:
01459         SSBooleanCMode(SplineShape* spl, IObjParam *i) :
01460             fgProc(spl), eproc(spl,i) {ss=spl;}
01461 
01462         int Class() { return MODIFY_COMMAND; }
01463         int ID() { return CID_BOOLEAN; }
01464         MouseCallBack *MouseProc(int *numPoints) { *numPoints=9999; return &eproc; }
01465         ChangeForegroundCallback *ChangeFGProc() { return &fgProc; }
01466         BOOL ChangeFG( CommandMode *oldMode ) { return oldMode->ChangeFGProc() != &fgProc; }
01467         void EnterMode();
01468         void ExitMode();
01469     };
01470 
01471 /*-------------------------------------------------------------------*/
01472 
01473 class SSTrimMouseProc : public MouseCallBack {
01474     private:
01475         SplineShape *ss;
01476         IObjParam *ip;
01477         IPoint2 om;
01478 
01479     protected:
01480         HCURSOR GetTransformCursor();
01481         BOOL HitTest( ViewExp *vpt, IPoint2 *p, int type, int flags );
01482         BOOL AnyHits( ViewExp *vpt ) { return vpt->NumSubObjHits(); }       
01483     public:
01484         SSTrimMouseProc(SplineShape* spl, IObjParam *i) { ss=spl; ip=i; }
01485         int proc( 
01486             HWND hwnd, 
01487             int msg, 
01488             int point, 
01489             int flags, 
01490             IPoint2 m );
01491         int override(int mode) { UNUSED_PARAM(mode); return CLICK_DOWN_POINT; }
01492     };
01493 
01494 class SSTrimCMode : public CommandMode {
01495     private:
01496         ChangeFGObject fgProc;
01497         SSTrimMouseProc eproc;
01498         SplineShape* ss;
01499 
01500     public:
01501         SSTrimCMode(SplineShape* spl, IObjParam *i) :
01502             fgProc(spl), eproc(spl,i) {ss=spl;}
01503 
01504         int Class() { return MODIFY_COMMAND; }
01505         int ID() { return CID_TRIM; }
01506         MouseCallBack *MouseProc(int *numPoints) { *numPoints=9999; return &eproc; }
01507         ChangeForegroundCallback *ChangeFGProc() { return &fgProc; }
01508         BOOL ChangeFG( CommandMode *oldMode ) { return oldMode->ChangeFGProc() != &fgProc; }
01509         void EnterMode();
01510         void ExitMode();
01511     };
01512 
01513 /*-------------------------------------------------------------------*/
01514 
01515 class SSExtendMouseProc : public MouseCallBack {
01516     private:
01517         SplineShape *ss;
01518         IObjParam *ip;
01519         IPoint2 om;
01520 
01521     protected:
01522         HCURSOR GetTransformCursor();
01523         BOOL HitTest( ViewExp *vpt, IPoint2 *p, int type, int flags );
01524         BOOL AnyHits( ViewExp *vpt ) { return vpt->NumSubObjHits(); }       
01525     public:
01526         SSExtendMouseProc(SplineShape* spl, IObjParam *i) { ss=spl; ip=i; }
01527         int proc( 
01528             HWND hwnd, 
01529             int msg, 
01530             int point, 
01531             int flags, 
01532             IPoint2 m );
01533         int override(int mode) { UNUSED_PARAM(mode); return CLICK_DOWN_POINT; }
01534     };
01535 
01536 class SSExtendCMode : public CommandMode {
01537     private:
01538         ChangeFGObject fgProc;
01539         SSExtendMouseProc eproc;
01540         SplineShape* ss;
01541 
01542     public:
01543         SSExtendCMode(SplineShape* spl, IObjParam *i) :
01544             fgProc(spl), eproc(spl,i) {ss=spl;}
01545 
01546         int Class() { return MODIFY_COMMAND; }
01547         int ID() { return CID_EXTEND; }
01548         MouseCallBack *MouseProc(int *numPoints) { *numPoints=9999; return &eproc; }
01549         ChangeForegroundCallback *ChangeFGProc() { return &fgProc; }
01550         BOOL ChangeFG( CommandMode *oldMode ) { return oldMode->ChangeFGProc() != &fgProc; }
01551         void EnterMode();
01552         void ExitMode();
01553     };
01554 
01555 
01556 //watje
01557 /*-------------------------------------------------------------------*/
01558 
01559 class SSBindMouseProc : public MouseCallBack {
01560     private:
01561         SplineShape *ss;
01562         IObjParam *ip;
01563         IPoint2 om;
01564 
01565     protected:
01566         HCURSOR GetTransformCursor();
01567         BOOL HitTest( ViewExp *vpt, IPoint2 *p, int type, int flags );
01568         BOOL HitTestSeg( ViewExp *vpt, IPoint2 *p, int type, int flags );
01569         BOOL AnyHits( ViewExp *vpt ) { return vpt->NumSubObjHits(); }       
01570         BOOL HitAnEndpoint(ViewExp *vpt, IPoint2 *p, BezierShape *shape, int poly, int vert,
01571             BezierShape **shapeOut, int *polyOut, int *vertOut);
01572         BOOL HitASegment(ViewExp *vpt, IPoint2 *p, BezierShape *shape, int poly, int vert,
01573             BezierShape **shapeOut, int *polyOut, int *vertOut);
01574 
01575     public:
01576         SSBindMouseProc(SplineShape* spl, IObjParam *i) { ss=spl; ip=i; }
01577         int proc( 
01578             HWND hwnd, 
01579             int msg, 
01580             int point, 
01581             int flags, 
01582             IPoint2 m );
01583     };
01584 
01585 class SSBindCMode : public CommandMode {
01586     private:
01587         ChangeFGObject fgProc;
01588         SSBindMouseProc eproc;
01589         SplineShape* ss;
01590 
01591     public:
01592         SSBindCMode(SplineShape* spl, IObjParam *i) :
01593             fgProc(spl), eproc(spl,i) {ss=spl;}
01594 
01595         int Class() { return MODIFY_COMMAND; }
01596         int ID() { return CID_VERTCONNECT; }
01597         MouseCallBack *MouseProc(int *numPoints) { *numPoints=2; return &eproc; }
01598         ChangeForegroundCallback *ChangeFGProc() { return &fgProc; }
01599         BOOL ChangeFG( CommandMode *oldMode ) { return oldMode->ChangeFGProc() != &fgProc; }
01600         void EnterMode();
01601         void ExitMode();
01602     };
01603 
01604 
01605 
01606 class SSRefineConnectMouseProc : public MouseCallBack {
01607     private:
01608         SplineShape *ss;
01609         IObjParam *ip;
01610         IPoint2 om;
01611         int type; // See above
01612     
01613     protected:
01614         HCURSOR GetTransformCursor();
01615         BOOL HitTest( ViewExp *vpt, IPoint2 *p, int type, int flags );
01616         BOOL AnyHits( ViewExp *vpt ) { return vpt->NumSubObjHits(); }       
01617 
01618     public:
01619         SSRefineConnectMouseProc(SplineShape* spl, IObjParam *i) { ss=spl; ip=i; }
01620         int proc( 
01621             HWND hwnd, 
01622             int msg, 
01623             int point, 
01624             int flags, 
01625             IPoint2 m );
01626         void SetType(int type) { this->type = type; }
01627     };
01628 
01629 class SSRefineConnectCMode : public CommandMode {
01630     private:
01631         ChangeFGObject fgProc;
01632         SSRefineConnectMouseProc eproc;
01633         SplineShape* ss;
01634         int type; // See above
01635 
01636     public:
01637         SSRefineConnectCMode(SplineShape* spl, IObjParam *i) :
01638             fgProc(spl), eproc(spl,i) {ss=spl;}
01639 
01640         int Class() { return MODIFY_COMMAND; }
01641         int ID() { return CID_REFINECONNECT; }
01642         MouseCallBack *MouseProc(int *numPoints) { *numPoints=1; return &eproc; }
01643         ChangeForegroundCallback *ChangeFGProc() { return &fgProc; }
01644         BOOL ChangeFG( CommandMode *oldMode ) { return oldMode->ChangeFGProc() != &fgProc; }
01645         void EnterMode();
01646         void ExitMode();
01647         void SetType(int type) { this->type = type; eproc.SetType(type); }
01648     };
01649 
01650 /*-------------------------------------------------------------------*/
01651 // CAL-02/27/03: copy/paste tangent modes. (FID #827)
01652 
01653 class SSCopyTangentMouseProc : public MouseCallBack {
01654     private:
01655         SplineShape *ss;
01656         IObjParam *ip;
01657 
01658     protected:
01659         HCURSOR GetTransformCursor();
01660         HitRecord* HitTest( ViewExp *vpt, IPoint2 *p, int type, int flags );
01661 
01662     public:
01663         SSCopyTangentMouseProc(SplineShape* spl, IObjParam *i) { ss=spl; ip=i; }
01664         int proc(
01665             HWND hwnd, 
01666             int msg, 
01667             int point, 
01668             int flags, 
01669             IPoint2 m );
01670     };
01671 
01672 class SSCopyTangentCMode : public CommandMode {
01673     private:
01674         ChangeFGObject fgProc;
01675         SSCopyTangentMouseProc eproc;
01676         SplineShape* ss;
01677 
01678     public:
01679         SSCopyTangentCMode(SplineShape* spl, IObjParam *i) :
01680             fgProc(spl), eproc(spl,i) {ss=spl;}
01681 
01682         int Class() { return MODIFY_COMMAND; }
01683         int ID() { return CID_COPYTANGENT; }
01684         MouseCallBack *MouseProc(int *numPoints) { *numPoints=1; return &eproc; }
01685         ChangeForegroundCallback *ChangeFGProc() { return &fgProc; }
01686         BOOL ChangeFG( CommandMode *oldMode ) { return oldMode->ChangeFGProc() != &fgProc; }
01687         void EnterMode();
01688         void ExitMode();
01689     };
01690 
01691 class SSPasteTangentMouseProc : public MouseCallBack {
01692     private:
01693         SplineShape *ss;
01694         IObjParam *ip;
01695 
01696     protected:
01697         HCURSOR GetTransformCursor();
01698         HitRecord* HitTest( ViewExp *vpt, IPoint2 *p, int type, int flags );
01699 
01700     public:
01701         SSPasteTangentMouseProc(SplineShape* spl, IObjParam *i) { ss=spl; ip=i; }
01702         int proc(
01703             HWND hwnd, 
01704             int msg, 
01705             int point, 
01706             int flags, 
01707             IPoint2 m );
01708     };
01709 
01710 class SSPasteTangentCMode : public CommandMode {
01711     private:
01712         ChangeFGObject fgProc;
01713         SSPasteTangentMouseProc eproc;
01714         SplineShape* ss;
01715 
01716     public:
01717         SSPasteTangentCMode(SplineShape* spl, IObjParam *i) :
01718             fgProc(spl), eproc(spl,i) {ss=spl;}
01719 
01720         int Class() { return MODIFY_COMMAND; }
01721         int ID() { return CID_PASTETANGENT; }
01722         MouseCallBack *MouseProc(int *numPoints) { *numPoints=1; return &eproc; }
01723         ChangeForegroundCallback *ChangeFGProc() { return &fgProc; }
01724         BOOL ChangeFG( CommandMode *oldMode ) { return oldMode->ChangeFGProc() != &fgProc; }
01725         void EnterMode();
01726         void ExitMode();
01727     };
01728 
01729 /*-------------------------------------------------------------------*/
01730 
01731 
01732 CoreExport ClassDesc* GetSplineShapeDescriptor();
01733 CoreExport int ApplyOffset(Interface *intf, INode *node, float amount);
01734 CoreExport int MeasureOffset(Interface *intf, INode *node, Point3 *point, float *result);
01735 
01736 
01737 class SingleRefMakerSplineNode : public SingleRefMaker{
01738 public:
01739     HWND hwnd;
01740     SplineShape *ss;
01741     SingleRefMakerSplineNode() {hwnd = NULL; ss = NULL;}
01742     ~SingleRefMakerSplineNode() { }
01743     RefResult NotifyRefChanged( Interval changeInt,RefTargetHandle hTarget, 
01744         PartID& partID, RefMessage message );
01745 };
01746 
01747 class SingleRefMakerSplineMtl : public SingleRefMaker{
01748 public: 
01749     HWND hwnd;
01750     SplineShape *ss;
01751     SingleRefMakerSplineMtl() {hwnd = NULL; ss = NULL;}
01752     ~SingleRefMakerSplineMtl() { }
01753     RefResult NotifyRefChanged( Interval changeInt,RefTargetHandle hTarget, 
01754         PartID& partID, RefMessage message );
01755 };
01756 
01757 // Command ID for the dynamic spline quad menu entry
01758 #define ID_SPLINE_MENU 1320
01759 
01760 const DWORD kSplineActions = 0x34fe2c73;
01761 const DWORD kSplineActionsContext = 0x34fe2c73;
01762