1 | /**********************************************************************
|
---|
2 | *<
|
---|
3 | FILE: linshape.h
|
---|
4 |
|
---|
5 | DESCRIPTION: Defines a Linear Shape Object Class
|
---|
6 |
|
---|
7 | CREATED BY: Tom Hudson
|
---|
8 |
|
---|
9 | HISTORY: created 31 October 1995
|
---|
10 |
|
---|
11 | *> Copyright (c) 1995, All Rights Reserved.
|
---|
12 | **********************************************************************/
|
---|
13 |
|
---|
14 | #ifndef __LINSHAPE_H__
|
---|
15 |
|
---|
16 | #define __LINSHAPE_H__
|
---|
17 |
|
---|
18 | #include "polyshp.h"
|
---|
19 | extern CoreExport Class_ID linearShapeClassID;
|
---|
20 |
|
---|
21 | class LinearShape : public ShapeObject {
|
---|
22 | private:
|
---|
23 | Interval geomValid;
|
---|
24 | Interval topoValid;
|
---|
25 | Interval selectValid;
|
---|
26 | DWORD validBits; // for the remaining constant channels
|
---|
27 | void CopyValidity(LinearShape *fromOb, ChannelMask channels);
|
---|
28 |
|
---|
29 | protected:
|
---|
30 | // inherited virtual methods for Reference-management
|
---|
31 | RefResult NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message );
|
---|
32 |
|
---|
33 | public:
|
---|
34 | PolyShape shape;
|
---|
35 |
|
---|
36 | CoreExport LinearShape();
|
---|
37 | CoreExport ~LinearShape();
|
---|
38 |
|
---|
39 | // inherited virtual methods:
|
---|
40 |
|
---|
41 | // From BaseObject
|
---|
42 | CoreExport int HitTest(TimeValue t, INode* inode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt);
|
---|
43 | CoreExport void Snap(TimeValue t, INode* inode, SnapInfo *snap, IPoint2 *p, ViewExp *vpt);
|
---|
44 | CoreExport int Display(TimeValue t, INode* inode, ViewExp *vpt, int flags);
|
---|
45 | CoreExport CreateMouseCallBack* GetCreateMouseCallBack();
|
---|
46 | CoreExport RefTargetHandle Clone(RemapDir& remap = NoRemap());
|
---|
47 |
|
---|
48 | // From Object
|
---|
49 | CoreExport ObjectState Eval(TimeValue time);
|
---|
50 | CoreExport Interval ObjectValidity(TimeValue t);
|
---|
51 |
|
---|
52 | // The validity interval of channels necessary to do a convert to type
|
---|
53 | CoreExport Interval ConvertValidity(TimeValue t);
|
---|
54 |
|
---|
55 | // get and set the validity interval for the nth channel
|
---|
56 | CoreExport Interval ChannelValidity(TimeValue t, int nchan);
|
---|
57 | CoreExport void SetChannelValidity(int i, Interval v);
|
---|
58 | CoreExport void InvalidateChannels(ChannelMask channels);
|
---|
59 |
|
---|
60 | // Deformable object procs
|
---|
61 | int IsDeformable() { return 1; }
|
---|
62 | CoreExport int NumPoints();
|
---|
63 | CoreExport Point3 GetPoint(int i);
|
---|
64 | CoreExport void SetPoint(int i, const Point3& p);
|
---|
65 |
|
---|
66 | CoreExport void PointsWereChanged();
|
---|
67 | CoreExport void GetDeformBBox(TimeValue t, Box3& box, Matrix3 *tm=NULL,BOOL useSel=FALSE );
|
---|
68 | CoreExport void Deform(Deformer *defProc, int useSel);
|
---|
69 |
|
---|
70 | CoreExport int CanConvertToType(Class_ID obtype);
|
---|
71 | CoreExport Object* ConvertToType(TimeValue t, Class_ID obtype);
|
---|
72 | CoreExport void FreeChannels(ChannelMask chan);
|
---|
73 | CoreExport Object *MakeShallowCopy(ChannelMask channels);
|
---|
74 | CoreExport void ShallowCopy(Object* fromOb, ChannelMask channels);
|
---|
75 | CoreExport void NewAndCopyChannels(ChannelMask channels);
|
---|
76 |
|
---|
77 | CoreExport DWORD GetSubselState();
|
---|
78 |
|
---|
79 | // From ShapeObject
|
---|
80 | CoreExport int IntersectRay(TimeValue t, Ray& r, float& at);
|
---|
81 | CoreExport ObjectHandle CreateTriObjRep(TimeValue t); // for rendering, also for deformation
|
---|
82 | CoreExport void GetWorldBoundBox(TimeValue t, INode *inode, ViewExp* vpt, Box3& box );
|
---|
83 | CoreExport void GetLocalBoundBox(TimeValue t, INode *inode, ViewExp* vpt, Box3& box );
|
---|
84 | CoreExport int NumberOfCurves();
|
---|
85 | CoreExport BOOL CurveClosed(TimeValue t, int curve);
|
---|
86 | CoreExport Point3 InterpCurve3D(TimeValue t, int curve, float param);
|
---|
87 | CoreExport Point3 TangentCurve3D(TimeValue t, int curve, float param);
|
---|
88 | CoreExport float LengthOfCurve(TimeValue t, int curve);
|
---|
89 | CoreExport int NumberOfPieces(TimeValue t, int curve);
|
---|
90 | CoreExport Point3 InterpPiece3D(TimeValue t, int curve, int piece, float param);
|
---|
91 | CoreExport Point3 TangentPiece3D(TimeValue t, int curve, int piece, float param);
|
---|
92 | BOOL CanMakeBezier() { return TRUE; }
|
---|
93 | CoreExport void MakeBezier(TimeValue t, BezierShape &shape);
|
---|
94 | CoreExport ShapeHierarchy &OrganizeCurves(TimeValue t, ShapeHierarchy *hier = NULL);
|
---|
95 | CoreExport void MakePolyShape(TimeValue t, PolyShape &shape, int steps = PSHAPE_BUILTIN_STEPS, BOOL optimize = FALSE);
|
---|
96 | CoreExport int MakeCap(TimeValue t, MeshCapInfo &capInfo, int capType);
|
---|
97 | CoreExport int MakeCap(TimeValue t, PatchCapInfo &capInfo);
|
---|
98 |
|
---|
99 | PolyShape& GetShape() { return shape; }
|
---|
100 |
|
---|
101 | // This does the job of setting all points in the PolyShape to "POLYPT_KNOT"
|
---|
102 | // types, and removing the "POLYPT_INTERPOLATED" flag. This is because the
|
---|
103 | // LinearShape knows nothing about its origin
|
---|
104 | CoreExport void SetPointFlags();
|
---|
105 |
|
---|
106 | // Animatable methods
|
---|
107 |
|
---|
108 | void DeleteThis() { delete this; }
|
---|
109 | void FreeCaches() { shape.InvalidateGeomCache(FALSE); }
|
---|
110 | Class_ID ClassID() { return linearShapeClassID; }
|
---|
111 | void GetClassName(TSTR& s) { s = TSTR(_T("LinearShape")); }
|
---|
112 | void NotifyMe(Animatable *subAnim, int message) {}
|
---|
113 | int IsKeyable() { return 0;}
|
---|
114 | int Update(TimeValue t) { return 0; }
|
---|
115 | BOOL BypassTreeView() { return TRUE; }
|
---|
116 | // This is the name that will appear in the history browser.
|
---|
117 | TCHAR *GetObjectName() { return _T("Linear Shape"); }
|
---|
118 |
|
---|
119 | // IO
|
---|
120 | CoreExport IOResult Save(ISave *isave);
|
---|
121 | CoreExport IOResult Load(ILoad *iload);
|
---|
122 |
|
---|
123 | };
|
---|
124 |
|
---|
125 | CoreExport ClassDesc* GetLinearShapeDescriptor();
|
---|
126 |
|
---|
127 | #endif // __LINSHAPE_H__
|
---|