surf_api.h

Go to the documentation of this file.
00001 /**********************************************************************
00002  *<
00003     FILE: surf_api.h
00004 
00005     DESCRIPTION:  Provides the SDK api for NURBS surfaces
00006 
00007     CREATED BY: Charlie Thaeler
00008 
00009     HISTORY: created 15 April, 1997
00010 
00011  *> Copyright (c) 1997, All Rights Reserved.
00012  **********************************************************************/
00013 
00014 #pragma once
00015 #include "export.h"
00016 #include "maxheap.h"
00017 #include "point3.h"
00018 #include "maxtess.h"
00019 #include "tab.h"
00020 #include "strbasic.h"
00021 #include "point2.h"
00022 #include "matrix3.h"
00023 // forward declarations
00024 class Object;
00025 class SetXFormPacket;
00026 class IObjParam;
00027 class ShapeObject;
00028 class BitArray;
00029 class Modifier;
00030 
00031 #define EDITABLE_SURF_CLASS_ID Class_ID(0x76a11646, 0x12a822fb)
00032 #define FITPOINT_PLANE_CLASS_ID Class_ID(0x76a11646, 0xbadbeff)
00033 #define EDITABLE_CVCURVE_CLASS_ID Class_ID(0x76a11646, 0x12a83145)
00034 #define EDITABLE_FPCURVE_CLASS_ID Class_ID(0x76a11646, 0x12a92143)
00035 
00036 #define NURBS_NAME_SIZE 80
00037 
00038 // NOTE: THESE ARE NOT PERSISTANT ACROSS SESSIONS and should NOT be saved to a file.
00039 typedef ULONG_PTR NURBSId;  
00040 typedef Tab<NURBSId> NURBSIdTab;
00041 typedef Tab<BOOL> BoolTab;
00042 
00047 enum NURBSResult {
00049     kNOk,
00052     kNInvalidObject,
00055     kNInvalidId,
00058     kNInvalidParameter, 
00059 
00060     kNBad
00061 };
00063 
00068 enum NURBSMirrorAxis {
00069     kMirrorX,
00070     kMirrorY,
00071     kMirrorZ,
00072     kMirrorXY,
00073     kMirrorXZ,
00074     kMirrorYZ
00075 };
00077 
00084 enum NURBSConstType {
00086     kNConstOnObject,
00089     kNConstOffset,
00092     kNConstNormal,
00097     kNConstTangent
00098 };
00100 
00107 enum NURBSKind {
00109     kNURBSPoint,
00111     kNURBSTexturePoint,
00113     kNURBSCV,
00115     kNURBSCurve,
00117     kNURBSSurface
00118 };
00120 
00125 enum NURBSParamaterization {
00129     kCentripetalKnots,
00133     kUniformKnots,
00134 };
00136 
00141 enum NURBSAutoParam {
00144     kNotAutomatic,
00148     kAutoCentripetal,
00152     kAutoUniform,
00153 };
00155 
00162 enum NURBSType {
00164     kNPoint,
00166     kNPointCPoint,
00168     kNCurveCPoint,
00170     kNCurveCurveIntersectionPoint,
00172     kNSurfaceCPoint,
00174     kNCurveSurfaceIntersectionPoint,
00176     kNTexturePoint,
00178     kNCV,
00180     kNCVCurve,
00182     kNPointCurve,
00184     kNBlendCurve,
00186     kNOffsetCurve,
00188     kNXFormCurve,
00190     kNMirrorCurve,
00192     kNFilletCurve,
00194     kNChamferCurve,
00196     kNIsoCurve,
00198     kNProjectVectorCurve,
00200     kNProjectNormalCurve,
00202     kNSurfSurfIntersectionCurve,
00204     kNCurveOnSurface,
00206     kNPointCurveOnSurface,
00208     kNSurfaceNormalCurve,
00210     kNSurfaceEdgeCurve,
00212     kNCVSurface,
00214     kNPointSurface,
00216     kNBlendSurface,
00218     kNOffsetSurface,
00220     kNXFormSurface,
00222     kNMirrorSurface,
00224     kNRuledSurface,
00226     kNULoftSurface,
00228     kNExtrudeSurface,
00230     kNLatheSurface,
00232     kNUVLoftSurface,
00234     kNNBlendSurface,
00236     kN1RailSweepSurface,
00238     kN2RailSweepSurface,
00240     kNCapSurface,
00242     kNMultiCurveTrimSurface,
00244     kNFilletSurface
00245 };
00247 
00252 enum NURBSTessType {
00254     kNTessSurface,
00256     kNTessDisplacement,
00258     kNTessCurve
00259 };
00261 
00266 enum NURBSSubObjectLevel {
00268     kNTopLevel = 0,
00270     kNSurfaceCVLevel,
00272     kNSurfaceLevel,
00274     kNCurveCVLevel,
00276     kNPointLevel,
00278     kNCurveLevel,
00280     kNImportsLevel,
00281 };
00283 
00284 
00285 class NURBSSet;
00286 
00287 typedef Tab<NURBSId> NURBSIdTab;
00288 
00289 extern int FindIndex(NURBSIdTab ids, NURBSId id);
00290 
00325 class NURBSObject: public MaxHeapOperators {
00326     friend class NURBSSet;
00327 protected:
00328     MCHAR mName[NURBS_NAME_SIZE];
00329     NURBSType mType;
00330     NURBSKind mKind;
00331     NURBSId mId;
00332     Object* mpObject;
00333     NURBSSet* mpNSet;
00334     BOOL mSelected;
00342     DllExport void Clean(NURBSIdTab ids);
00343 public:
00350     DllExport NURBSObject(void);
00352     DllExport virtual ~NURBSObject(void);
00357     DllExport NURBSObject & operator=(const NURBSObject& pt);
00362     DllExport void SetName(MCHAR *name);
00364     DllExport MCHAR *GetName(void);
00366     DllExport NURBSType GetType();
00368     DllExport NURBSKind GetKind();
00371     DllExport NURBSId GetId();
00376     DllExport void SetId(NURBSId id);
00382     DllExport void SetNSet(NURBSSet *nset);
00388     DllExport void SetObject(Object *object);
00391     DllExport Object* GetMAXObject();
00394     DllExport NURBSSet* GetNSet();
00397     DllExport int GetIndex();
00399     DllExport BOOL IsSelected();
00406     DllExport void SetSelected(BOOL set);
00407 };
00408 
00409 
00421 class NURBSPoint : public NURBSObject {
00422 protected:
00423     double mX, mY, mZ;
00424 public:
00425     DllExport NURBSPoint();
00427     DllExport virtual Point3 GetPosition(TimeValue t);
00436     DllExport virtual void GetPosition(TimeValue t, float& x, float& y, float& z);
00445     DllExport virtual void GetPosition(TimeValue t, double& x, double& y, double& z);
00446 };
00447 
00457 class NURBSTexturePoint : public NURBSObject {
00458 protected:
00459     double mX, mY;
00460     int    mUIndex, mVIndex;
00461 public:
00466     DllExport NURBSTexturePoint();
00472     DllExport virtual Point2 GetPosition(TimeValue t);
00482     DllExport virtual void GetPosition(TimeValue t, float& x, float& y);
00492     DllExport virtual void GetPosition(TimeValue t, double& x, double& y);
00500     DllExport void SetPosition(TimeValue t, Point2 pt);
00510     DllExport void SetPosition(TimeValue t, float x, float y);
00520     DllExport void SetPosition(TimeValue t, double x, double y);
00521 
00522     DllExport void SetIndices(int uIndex, int vIndex);
00523 };
00524 
00525 
00533 class NURBSIndependentPoint : public NURBSPoint {
00534 public:
00538     DllExport NURBSIndependentPoint(void);
00540     DllExport virtual ~NURBSIndependentPoint(void);
00545     DllExport NURBSIndependentPoint & operator=(const NURBSIndependentPoint& pt);
00552     DllExport BOOL operator==(const NURBSIndependentPoint& pt);
00560     DllExport BOOL operator!=(const NURBSIndependentPoint& pt);
00568     DllExport void SetPosition(TimeValue t, Point3 pt);
00580     DllExport void SetPosition(TimeValue t, float x, float y, float z);
00594     DllExport void SetPosition(TimeValue t, double x, double y, double z);
00595 
00596 };
00597 
00598 
00605 class NURBSControlVertex : public NURBSObject {
00606     double mX, mY, mZ;
00607     double mW;  // weight
00608 public:
00611     DllExport NURBSControlVertex(void);
00613     DllExport virtual ~NURBSControlVertex(void);
00618     DllExport NURBSControlVertex & operator=(const NURBSControlVertex& cv);
00625     DllExport BOOL operator==(const NURBSControlVertex& cv);
00632     DllExport BOOL operator!=(const NURBSControlVertex& cv);
00639     DllExport void SetPosition(TimeValue t, Point3 pt);
00646     DllExport void SetPosition(TimeValue t, float x, float y, float z);
00653     DllExport void SetPosition(TimeValue t, double x, double y, double z);
00658     DllExport Point3 GetPosition(TimeValue t);
00669     DllExport void GetPosition(TimeValue t, float& x, float& y, float& z);
00680     DllExport void GetPosition(TimeValue t, double& x, double& y, double& z);
00689     DllExport void SetWeight(TimeValue t, float wt);
00698     DllExport void SetWeight(TimeValue t, double wt);
00705     DllExport void GetWeight(TimeValue t, float& wt);
00710     DllExport double GetWeight(TimeValue t);
00719     DllExport void GetWeight(TimeValue t, double& wt);
00720 };
00721 
00722 
00739 class NURBSPointConstPoint : public NURBSPoint {
00740     friend class NURBSSet;
00741 protected:
00742     NURBSId mParentId;
00743     int mParentIndex;
00744     NURBSConstType mCType;
00745     Point3 mOffset;
00752     DllExport void Clean(NURBSIdTab ids);
00753 
00754 public:
00763     DllExport NURBSPointConstPoint(void);
00765     DllExport virtual ~NURBSPointConstPoint(void);
00770     DllExport NURBSPointConstPoint & operator=(const NURBSPointConstPoint& pt);
00775     DllExport void SetParent(int index);
00780     DllExport void SetParentId(NURBSId id);
00782     DllExport int GetParent(void);
00786     DllExport NURBSId GetParentId(void);
00791     DllExport void SetPointType(NURBSConstType type);
00793     DllExport NURBSConstType GetPointType(void);
00800     DllExport void SetOffset(TimeValue t, Point3 pt);
00808     DllExport Point3 GetOffset(TimeValue t);
00809 };
00810 
00849 class NURBSCurveConstPoint : public NURBSPoint {
00850     friend class NURBSSet;
00851 protected:
00852     NURBSId mParentId;
00853     int mParentIndex;
00854     NURBSConstType mCType;
00855     Point3 mOffset;
00856     float mNormal;
00857     float mUTangent;
00858     double mUParam;
00859     BOOL mTrimCurve;
00860     BOOL mFlipTrim;
00861 
00868     DllExport void Clean(NURBSIdTab ids);
00869 public:
00883     DllExport NURBSCurveConstPoint(void);
00885     DllExport virtual ~NURBSCurveConstPoint(void);
00890     DllExport NURBSCurveConstPoint & operator=(const NURBSCurveConstPoint& pt);
00895     DllExport void SetParent(int index);
00900     DllExport void SetParentId(NURBSId id);
00902     DllExport int GetParent(void);
00906     DllExport NURBSId GetParentId(void);
00911     DllExport void SetPointType(NURBSConstType type);
00913     DllExport NURBSConstType GetPointType(void);
00920     DllExport void SetOffset(TimeValue t, Point3 pt);
00926     DllExport Point3 GetOffset(TimeValue t);
00933     DllExport void SetUParam(TimeValue t, double param);
00938     DllExport double GetUParam(TimeValue t);
00945     DllExport void SetNormal(TimeValue t, float dist);
00950     DllExport float GetNormal(TimeValue t);
00957     DllExport void SetUTangent(TimeValue t, float dist);
00962     DllExport float GetUTangent(TimeValue t);
00965     DllExport BOOL GetTrimCurve();
00971     DllExport void SetTrimCurve(BOOL trim);
00973     DllExport BOOL GetFlipTrim();
00982     DllExport void SetFlipTrim(BOOL flip);
00983 };
00984 
01003 class NURBSCurveCurveIntersectionPoint : public NURBSPoint {
01004     friend class NURBSSet;
01005 protected:
01006     NURBSId mParentId[2];
01007     int mParentIndex[2];
01008     double mCurveParam[2];
01009     BOOL mTrimCurve[2];
01010     BOOL mFlipTrim[2];
01011 
01018     DllExport void Clean(NURBSIdTab ids);
01019 public:
01029     DllExport NURBSCurveCurveIntersectionPoint(void);
01031     DllExport virtual ~NURBSCurveCurveIntersectionPoint(void);
01036     DllExport NURBSCurveCurveIntersectionPoint & operator=(const NURBSCurveCurveIntersectionPoint &pt);
01037     DllExport void SetCurveParam(int curveNum, double param);
01043     DllExport double GetCurveParam(int curveNum);
01051     DllExport void SetParent(int pnum, int index);
01058     DllExport void SetParentId(int pnum, NURBSId id);
01064     DllExport int GetParent(int pnum);
01071     DllExport NURBSId GetParentId(int pnum);
01072 
01078     DllExport BOOL GetTrimCurve(int pnum);
01086     DllExport void SetTrimCurve(int pnum, BOOL trim);
01094     DllExport BOOL GetFlipTrim(int pnum);
01106     DllExport void SetFlipTrim(int pnum, BOOL flip);
01107 };
01108 
01140 class NURBSSurfConstPoint : public NURBSPoint {
01141     friend class NURBSSet;
01142 protected:
01143     NURBSId mParentId;
01144     int mParentIndex;
01145     NURBSConstType mCType;
01146     Point3 mOffset;
01147     float mNormal;
01148     float mUTangent;
01149     double mUParam;
01150     float mVTangent;
01151     double mVParam;
01158     DllExport void Clean(NURBSIdTab ids);
01159 public:
01173     DllExport NURBSSurfConstPoint(void);
01175     DllExport virtual ~NURBSSurfConstPoint(void);
01180     DllExport NURBSSurfConstPoint & operator=(const NURBSSurfConstPoint& pt);
01185     DllExport void SetParent(int index);
01190     DllExport void SetParentId(NURBSId id);
01193     DllExport int GetParent(void);
01197     DllExport NURBSId GetParentId(void);
01202     DllExport void SetPointType(NURBSConstType type);
01204     DllExport NURBSConstType GetPointType(void);
01211     DllExport void SetUParam(TimeValue t, double param);
01217     DllExport double GetUParam(TimeValue t);
01225     DllExport void SetVParam(TimeValue t, double param);
01231     DllExport double GetVParam(TimeValue t);
01238     DllExport void SetOffset(TimeValue t, Point3 pt);
01244     DllExport Point3 GetOffset(TimeValue t);
01252     DllExport void SetNormal(TimeValue t, float dist);
01258     DllExport float GetNormal(TimeValue t);
01265     DllExport void SetUTangent(TimeValue t, float dist);
01270     DllExport float GetUTangent(TimeValue t);
01277     DllExport void SetVTangent(TimeValue t, float dist);
01284     DllExport float GetVTangent(TimeValue t);
01285 };
01286 
01306 class NURBSCurveSurfaceIntersectionPoint : public NURBSPoint {
01307     friend class NURBSSet;
01308 protected:
01309     // parent 0 should be the surface parent 1 should be the curve
01310     NURBSId mParentId[2];
01311     int mParentIndex[2];
01312     double mSeed;
01313     BOOL mTrimCurve;
01314     BOOL mFlipTrim;
01315 
01322     DllExport void Clean(NURBSIdTab ids);
01323 public:
01333     DllExport NURBSCurveSurfaceIntersectionPoint(void);
01335     DllExport virtual ~NURBSCurveSurfaceIntersectionPoint(void);
01340     DllExport NURBSCurveSurfaceIntersectionPoint & operator=(const NURBSCurveSurfaceIntersectionPoint &pt);
01345     DllExport void SetSeed(double seed);
01347     DllExport double GetSeed();
01355     DllExport void SetParent(int pnum, int index);
01363     DllExport void SetParentId(int pnum, NURBSId id);
01369     DllExport int GetParent(int pnum);
01374     DllExport NURBSId GetParentId(int pnum);
01375 
01378     DllExport BOOL GetTrimCurve();
01383     DllExport void SetTrimCurve(BOOL trim);
01386     DllExport BOOL GetFlipTrim();
01391     DllExport void SetFlipTrim(BOOL flip);
01392 };
01393 
01394 
01395 
01396 
01397 
01398 typedef Tab<NURBSControlVertex> NURBSCVTab;
01399 typedef Tab<double> NURBSKnotTab;
01400 
01401 
01406 enum NURBSTrimDirection // 
01407 {
01410     kNone = 0,
01414     kPositive = 1,
01418     kNegative = 2
01419 };
01421 
01432 class NURBSTrimPoint: public MaxHeapOperators {
01433 public:
01442     DllExport NURBSTrimPoint(double parameter, NURBSTrimDirection direction) :
01443         mParameter(parameter), mDirection(direction) {}
01446     DllExport double GetParameter() {return mParameter; }
01449     DllExport NURBSTrimDirection GetDirection() {return mDirection; }
01450 
01451 private:
01452     double mParameter;
01453     NURBSTrimDirection mDirection;
01454 };
01455 
01456 
01457 
01470 class NURBSCurve : public NURBSObject {
01471 protected:
01472     friend class NURBSCVCurve;
01473     friend class NURBSPointCurve;
01474     friend class NURBSBlendCurve;
01475     friend class NURBSOffsetCurve;
01476     friend class NURBSXFormCurve;
01477     friend class NURBSMirrorCurve;
01478     friend class NURBSFilletCurve;
01479     friend class NURBSChamferCurve;
01480     friend class NURBSIsoCurve;
01481     friend class NURBSSurfaceEdgeCurve;
01482     friend class NURBSProjectVectorCurve;
01483     friend class NURBSProjectNormalCurve;
01484     friend class NURBSSurfaceNormalCurve;
01485     friend class NURBSNBlendSurface;
01486     friend class NURBSRuledSurface;
01487     friend class NURBSULoftSurface;
01488     friend class NURBSUVLoftSurface;
01489     friend class NURBSExtrudeSurface;
01490     friend class NURBSLatheSurface;
01491     friend class NURBSCapSurface;
01492     friend class NURBS1RailSweepSurface;
01493     friend class NURBS2RailSweepSurface;
01494     friend class NURBSMultiCurveTrimSurface;
01495 
01496     int mMatID;
01497 
01498 public:
01502     DllExport NURBSCurve(void);
01504     DllExport virtual ~NURBSCurve(void);
01509     DllExport NURBSCurve & operator=(const NURBSCurve& curve);
01511     DllExport BOOL IsClosed(void);
01512 
01514     DllExport int NumTrimPoints();
01521     DllExport NURBSTrimPoint GetTrimPoint(TimeValue t, int i);
01522     
01538     DllExport BOOL Evaluate(TimeValue t, double u, Point3& pt, Point3& tangent);
01548     DllExport void GetParameterRange(TimeValue t, double& uMin, double& uMax);
01565     DllExport BOOL GetNURBSData(TimeValue t,
01566                                 int& degree,
01567                                 int& numCVs,
01568                                 NURBSCVTab& cvs,
01569                                 int& numKnots,
01570                                 NURBSKnotTab& knots);
01572     DllExport int MatID();
01579     DllExport void MatID(int id);
01580 };
01581 
01582 
01608 class NURBSCVCurve : public NURBSCurve {
01609     friend class NURBSSet;
01610 protected:
01611     NURBSControlVertex *mpCVs;
01612     double *mpKnots;
01613     BOOL mClosed;
01614     int mOrder;
01615     int mNumKnots;
01616     int mNumCVs;
01617     NURBSAutoParam mAutoParam;
01618 public:
01624     DllExport NURBSCVCurve(void);
01627     DllExport virtual ~NURBSCVCurve(void);
01632     DllExport NURBSCVCurve & operator=(const NURBSCVCurve& curve);
01634     DllExport void Close(void);
01635     DllExport BOOL IsClosed(void);
01636 
01645     DllExport void SetOrder(int order);
01647     DllExport int GetOrder(void);
01657     DllExport void SetNumKnots(int num);         // data is NOT maintained
01659     DllExport int GetNumKnots(void);
01665     DllExport void SetNumCVs(int num);           // data is NOT maintained
01670     DllExport void GetNumCVs(int& num);
01672     DllExport int GetNumCVs(void);
01677     DllExport double GetKnot(int index);
01684     DllExport void SetKnot(int index, double value);
01690     DllExport NURBSControlVertex* GetCV(int index);
01697     DllExport void SetCV(int index, NURBSControlVertex &cv);
01706     DllExport void SetTransformMatrix(TimeValue t, SetXFormPacket& xPack);
01712     DllExport Matrix3 GetTransformMatrix(TimeValue t);
01715     DllExport NURBSAutoParam AutoParam();
01722     DllExport void AutoParam(TimeValue t, NURBSAutoParam param);
01731     DllExport void Reparameterize(TimeValue t, NURBSParamaterization param);
01732 
01739     DllExport void EndsOverlap(BOOL& overlap);
01752     DllExport void Refine(TimeValue t, double u); // looses animation
01766     DllExport void Insert(TimeValue t, double u);
01767 };
01768 
01769 
01788 class NURBSPointCurve : public NURBSCurve {
01789     friend class NURBSSet;
01790 protected:
01791     NURBSIndependentPoint *mpPts;
01792     BOOL mClosed;
01793     int mNumPts;
01794 public:
01799     DllExport NURBSPointCurve(void);
01802     DllExport virtual ~NURBSPointCurve(void);
01807     DllExport NURBSPointCurve & operator=(const NURBSPointCurve& curve);
01809     DllExport void Close(void);
01811     DllExport BOOL IsClosed(void);
01812 
01818     DllExport void SetNumPts(int num);       // data is NOT maintained
01820     DllExport int GetNumPts(void);
01825     DllExport void GetNumPts(int &num);
01830     DllExport NURBSIndependentPoint* GetPoint(int index);
01837     DllExport void SetPoint(int index, NURBSIndependentPoint &pt);
01847     DllExport void SetTransformMatrix(TimeValue t, SetXFormPacket& xPack);
01853     DllExport Matrix3 GetTransformMatrix(TimeValue t);
01869     DllExport void Refine(TimeValue t, double u); // looses animation
01870 };
01871 
01872 
01882 class NURBSBlendCurve : public NURBSCurve {
01883     friend class NURBSSet;
01884     NURBSId mParentId[2];
01885     int mParentIndex[2];
01886     BOOL mParentEnd[2];
01887     double mTension[2];
01894     DllExport void Clean(NURBSIdTab ids);
01895 public:
01909     DllExport NURBSBlendCurve(void);
01911     DllExport virtual ~NURBSBlendCurve(void);
01916     DllExport NURBSBlendCurve & operator=(const NURBSBlendCurve& curve);
01924     DllExport void SetParent(int pnum, int index);
01931     DllExport void SetParentId(int pnum, NURBSId id);
01937     DllExport int GetParent(int pnum);
01944     DllExport NURBSId GetParentId(int pnum);
01953     DllExport void SetEnd(int pnum, BOOL end);
01961     DllExport BOOL GetEnd(int pnum);
01970     DllExport void SetTension(TimeValue t, int pnum, double ten);
01979     DllExport double GetTension(TimeValue t, int pnum);
01980 };
01981 
01982 
01991 class NURBSOffsetCurve : public NURBSCurve {
01992     friend class NURBSSet;
01993     NURBSId mParentId;
01994     int mParentIndex;
01995     double mDistance;
02002     DllExport void Clean(NURBSIdTab ids);
02003 public:
02011     DllExport NURBSOffsetCurve(void);
02013     DllExport virtual ~NURBSOffsetCurve(void);
02018     DllExport NURBSOffsetCurve & operator=(const NURBSOffsetCurve& curve);
02023     DllExport void SetParent(int index);
02028     DllExport void SetParentId(NURBSId id);
02031     DllExport int GetParent(void);
02035     DllExport NURBSId GetParentId(void);
02043     DllExport void SetDistance(TimeValue t, double d);
02051     DllExport double GetDistance(TimeValue t);
02052 };
02053 
02060 class NURBSXFormCurve : public NURBSCurve {
02061     friend class NURBSSet;
02062     NURBSId mParentId;
02063     int mParentIndex;
02064     Matrix3 mXForm;
02071     DllExport void Clean(NURBSIdTab ids);
02072 public:
02080     DllExport NURBSXFormCurve(void);
02082     DllExport virtual ~NURBSXFormCurve(void);
02087     DllExport NURBSXFormCurve & operator=(const NURBSXFormCurve& curve);
02093     DllExport void SetParent(int index);
02098     DllExport void SetParentId(NURBSId id);
02101     DllExport int GetParent(void);
02105     DllExport NURBSId GetParentId(void);
02113     DllExport void SetXForm(TimeValue t, Matrix3& mat);
02121     DllExport Matrix3& GetXForm(TimeValue t);
02122 };
02123 
02133 class NURBSMirrorCurve : public NURBSCurve {
02134     friend class NURBSSet;
02135     NURBSId mParentId;
02136     int mParentIndex;
02137     NURBSMirrorAxis mAxis;
02138     Matrix3 mXForm;
02139     double mDistance;
02146     DllExport void Clean(NURBSIdTab ids);
02147 public:
02157     DllExport NURBSMirrorCurve(void);
02159     DllExport virtual ~NURBSMirrorCurve(void);
02164     DllExport NURBSMirrorCurve & operator=(const NURBSMirrorCurve& curve);
02169     DllExport void SetParent(int index);
02174     DllExport void SetParentId(NURBSId id);
02177     DllExport int GetParent(void);
02181     DllExport NURBSId GetParentId(void);
02186     DllExport void SetAxis(NURBSMirrorAxis axis);
02188     DllExport NURBSMirrorAxis GetAxis(void);
02198     DllExport void SetXForm(TimeValue t, Matrix3& mat);
02204     DllExport Matrix3& GetXForm(TimeValue t);
02211     DllExport void SetDistance(TimeValue t, double d);
02218     DllExport double GetDistance(TimeValue t);
02219 };
02220 
02221 
02230 class NURBSFilletCurve : public NURBSCurve {
02231     friend class NURBSSet;
02232     NURBSId mParentId[2];
02233     int mParentIndex[2];
02234     BOOL mParentEnd[2];
02235     double mRadius;
02236     BOOL mTrimCurve[2];
02237     BOOL mFlipTrim[2];
02238 
02245     DllExport void Clean(NURBSIdTab ids);
02246 public:
02262     DllExport NURBSFilletCurve(void);
02264     DllExport virtual ~NURBSFilletCurve(void);
02269     DllExport NURBSFilletCurve & operator=(const NURBSFilletCurve& curve);
02277     DllExport void SetParent(int pnum, int index);
02284     DllExport void SetParentId(int pnum, NURBSId id);
02290     DllExport int GetParent(int pnum);
02297     DllExport NURBSId GetParentId(int pnum);
02304     DllExport void SetEnd(int pnum, BOOL end);
02311     DllExport BOOL GetEnd(int pnum);
02318     DllExport void SetRadius(TimeValue t, double radius);
02323     DllExport double GetRadius(TimeValue t);
02324 
02330     DllExport BOOL GetTrimCurve(int pnum);
02337     DllExport void SetTrimCurve(int pnum, BOOL trim);
02343     DllExport BOOL GetFlipTrim(int pnum);
02352     DllExport void SetFlipTrim(int pnum, BOOL flip);
02353 };
02354 
02355 
02366 class NURBSChamferCurve : public NURBSCurve {
02367     friend class NURBSSet;
02368     NURBSId mParentId[2];
02369     int mParentIndex[2];
02370     BOOL mParentEnd[2];
02371     double mLength[2];
02372     BOOL mTrimCurve[2];
02373     BOOL mFlipTrim[2];
02374 
02381     DllExport void Clean(NURBSIdTab ids);
02382 public:
02398     DllExport NURBSChamferCurve(void);
02400     DllExport virtual ~NURBSChamferCurve(void);
02405     DllExport NURBSChamferCurve & operator=(const NURBSChamferCurve& curve);
02413     DllExport void SetParent(int pnum, int index);
02420     DllExport void SetParentId(int pnum, NURBSId id);
02426     DllExport int GetParent(int pnum);
02433     DllExport NURBSId GetParentId(int pnum);
02441     DllExport void SetEnd(int pnum, BOOL end);
02448     DllExport BOOL GetEnd(int pnum);
02458     DllExport void SetLength(TimeValue t, int pnum, double length);
02465     DllExport double GetLength(TimeValue t, int pnum);
02466 
02472     DllExport BOOL GetTrimCurve(int pnum);
02479     DllExport void SetTrimCurve(int pnum, BOOL trim);
02485     DllExport BOOL GetFlipTrim(int pnum);
02494     DllExport void SetFlipTrim(int pnum, BOOL flip);
02495 };
02496 
02497 
02509 class NURBSIsoCurve : public NURBSCurve {
02510     friend class NURBSSet;
02511     NURBSId mParentId;
02512     int mParentIndex;
02513     BOOL mIsU;  // false for V...
02514     double mParam;
02515     BOOL mTrim;
02516     BOOL mFlipTrim;
02517     Point2 mSeed;
02524     DllExport void Clean(NURBSIdTab ids);
02525 public:
02537     DllExport NURBSIsoCurve(void);
02539     DllExport virtual ~NURBSIsoCurve(void);
02544     DllExport NURBSIsoCurve & operator=(const NURBSIsoCurve& curve);
02550     DllExport void SetParent(int index);
02555     DllExport void SetParentId(NURBSId id);
02558     DllExport int GetParent(void);
02562     DllExport NURBSId GetParentId(void);
02567     DllExport void SetDirection(BOOL isU);
02570     DllExport BOOL GetDirection(void);
02578     DllExport void SetParam(TimeValue t, double p);
02584     DllExport double GetParam(TimeValue t);
02587     DllExport BOOL GetTrim();
02593     DllExport void SetTrim(BOOL trim);
02596     DllExport BOOL GetFlipTrim();
02602     DllExport void SetFlipTrim(BOOL flip);
02604     DllExport Point2 GetSeed();
02611     DllExport void SetSeed(Point2& seed);
02612 };
02613 
02614 
02622 class NURBSSurfaceEdgeCurve : public NURBSCurve {
02623     friend class NURBSSet;
02624     NURBSId mParentId;
02625     int mParentIndex;
02626     Point2 mSeed;
02633     DllExport void Clean(NURBSIdTab ids);
02634 public:
02642     DllExport NURBSSurfaceEdgeCurve(void);
02644     DllExport virtual ~NURBSSurfaceEdgeCurve(void);
02649     DllExport NURBSSurfaceEdgeCurve & operator=(const NURBSSurfaceEdgeCurve& curve);
02654     DllExport void SetParent(int index);
02659     DllExport void SetParentId(NURBSId id);
02662     DllExport int GetParent(void);
02666     DllExport NURBSId GetParentId(void);
02668     DllExport Point2 GetSeed();
02675     DllExport void SetSeed(Point2& seed);
02676 };
02677 
02678 
02687 class NURBSProjectVectorCurve : public NURBSCurve {
02688     friend class NURBSSet;
02689     // parent 0 should be the surface parent 1 should be the curve
02690     NURBSId mParentId[2];
02691     int mParentIndex[2];
02692     BOOL mTrim;
02693     BOOL mFlipTrim;
02694     Point2 mSeed;
02695     Point3 mPVec;
02702     DllExport void Clean(NURBSIdTab ids);
02703 public:
02714     DllExport NURBSProjectVectorCurve(void);
02716     DllExport virtual ~NURBSProjectVectorCurve(void);
02721     DllExport NURBSProjectVectorCurve & operator=(const NURBSProjectVectorCurve& curve);
02728     DllExport void SetParent(int pnum, int index);
02736     DllExport void SetParentId(int pnum, NURBSId id);
02742     DllExport int GetParent(int pnum);
02747     DllExport NURBSId GetParentId(int pnum);
02750     DllExport BOOL GetTrim();
02756     DllExport void SetTrim(BOOL trim);
02759     DllExport BOOL GetFlipTrim();
02765     DllExport void SetFlipTrim(BOOL flip);
02767     DllExport Point2 GetSeed();
02774     DllExport void SetSeed(Point2& seed);
02781     DllExport void SetPVec(TimeValue t, Point3& pvec); // projection vector
02786     DllExport Point3& GetPVec(TimeValue t);
02787 };
02788 
02789 
02790 
02797 class NURBSProjectNormalCurve : public NURBSCurve {
02798     friend class NURBSSet;
02799     // parent 0 should be the surface parent 1 should be the curve
02800     NURBSId mParentId[2];
02801     int mParentIndex[2];
02802     BOOL mTrim;
02803     BOOL mFlipTrim;
02804     Point2 mSeed;
02811     DllExport void Clean(NURBSIdTab ids);
02812 public:
02814     DllExport NURBSProjectNormalCurve(void);
02816     DllExport virtual ~NURBSProjectNormalCurve(void);
02821     DllExport NURBSProjectNormalCurve & operator=(const NURBSProjectNormalCurve& curve);
02829     DllExport void SetParent(int pnum, int index);
02836     DllExport void SetParentId(int pnum, NURBSId id);
02842     DllExport int GetParent(int pnum);
02847     DllExport NURBSId GetParentId(int pnum);
02850     DllExport BOOL GetTrim();
02856     DllExport void SetTrim(BOOL trim);
02859     DllExport BOOL GetFlipTrim();
02865     DllExport void SetFlipTrim(BOOL flip);
02867     DllExport Point2 GetSeed();
02874     DllExport void SetSeed(Point2& seed);
02875 };
02876 
02877 
02884 class NURBSSurfSurfIntersectionCurve : public NURBSCurve {
02885     friend class NURBSSet;
02886     // parent 0 should be the surface parent 1 should be the curve
02887     NURBSId mParentId[2];
02888     int mParentIndex[2];
02889     BOOL mTrim[2];
02890     BOOL mFlipTrim[2];
02891     Point2 mSeed;
02898     DllExport void Clean(NURBSIdTab ids);
02899 public:
02909     DllExport NURBSSurfSurfIntersectionCurve(void);
02911     DllExport virtual ~NURBSSurfSurfIntersectionCurve(void);
02916     DllExport NURBSSurfSurfIntersectionCurve & operator=(const NURBSSurfSurfIntersectionCurve& curve);
02924     DllExport void SetParent(int pnum, int index);
02932     DllExport void SetParentId(int pnum, NURBSId id);
02937     DllExport int GetParent(int pnum);
02942     DllExport NURBSId GetParentId(int pnum);
02950     DllExport BOOL GetTrim(int tnum);
02960     DllExport void SetTrim(int tnum, BOOL trim);
02966     DllExport BOOL GetFlipTrim(int tnum);
02974     DllExport void SetFlipTrim(int tnum, BOOL flip);
02978     DllExport Point2 GetSeed();
02985     DllExport void SetSeed(Point2& seed);
02986 };
02987 
02988 
02989 
02995 class NURBSCurveOnSurface : public NURBSCVCurve {
02996     friend class NURBSSet;
02997     NURBSId mParentId;
02998     int mParentIndex;
02999     BOOL mTrim;
03000     BOOL mFlipTrim;
03001     DllExport void Clean(NURBSIdTab ids);
03002 public:
03011     DllExport NURBSCurveOnSurface(void);
03013     DllExport virtual ~NURBSCurveOnSurface(void);
03018     DllExport NURBSCurveOnSurface & operator=(const NURBSCurveOnSurface& curve);
03023     DllExport void SetParent(int index);
03028     DllExport void SetParentId(NURBSId id);
03031     DllExport int GetParent();
03035     DllExport NURBSId GetParentId();
03037     DllExport BOOL GetTrim();
03042     DllExport void SetTrim(BOOL trim);
03044     DllExport BOOL GetFlipTrim();
03050     DllExport void SetFlipTrim(BOOL flip);
03051 };
03052 
03058 class NURBSPointCurveOnSurface : public NURBSPointCurve {
03059     friend class NURBSSet;
03060     NURBSId mParentId;
03061     int mParentIndex;
03062     BOOL mTrim;
03063     BOOL mFlipTrim;
03070     DllExport void Clean(NURBSIdTab ids);
03071 public:
03080     DllExport NURBSPointCurveOnSurface(void);
03082     DllExport virtual ~NURBSPointCurveOnSurface(void);
03087     DllExport NURBSPointCurveOnSurface & operator=(const NURBSPointCurveOnSurface& curve);
03092     DllExport void SetParent(int index);
03097     DllExport void SetParentId(NURBSId id);
03100     DllExport int GetParent();
03104     DllExport NURBSId GetParentId();
03106     DllExport BOOL GetTrim();
03107     DllExport void SetTrim(BOOL trim);
03109     DllExport BOOL GetFlipTrim();
03115     DllExport void SetFlipTrim(BOOL flip);
03116 };
03117 
03118 
03127 class NURBSSurfaceNormalCurve : public NURBSCurve {
03128     friend class NURBSSet;
03129     NURBSId mParentId;
03130     int mParentIndex;
03131     double mDistance;
03138     DllExport void Clean(NURBSIdTab ids);
03139 public:
03146     DllExport NURBSSurfaceNormalCurve(void);
03148     DllExport virtual ~NURBSSurfaceNormalCurve(void);
03153     DllExport NURBSSurfaceNormalCurve & operator=(const NURBSSurfaceNormalCurve& curve);
03159     DllExport void SetParent(int index);
03165     DllExport void SetParentId(NURBSId id);
03168     DllExport int GetParent();
03170     DllExport NURBSId GetParentId();
03178     DllExport void SetDistance(TimeValue t, double dist);
03184     DllExport double GetDistance(TimeValue t);
03185 };
03186 
03191 enum NURBSTexSurfType {
03194     kNMapDefault,
03197     kNMapUserDefined, 
03200     kNMapSufaceMapper  
03201 };
03203 
03215 class NURBSTextureSurface: public MaxHeapOperators {
03216     NURBSTexSurfType mMapperType;
03217     NURBSTexturePoint *mpPoints;
03218     int mNumUPoints;
03219     int mNumVPoints;
03220 
03221     NURBSId mParentId;
03222     int mParentIndex;
03223 public:
03227     DllExport NURBSTextureSurface(void);
03229     DllExport ~NURBSTextureSurface(void);
03230     DllExport NURBSTextureSurface(NURBSTextureSurface& tsurf);
03235     DllExport NURBSTextureSurface & operator=(const NURBSTextureSurface& surf);
03237     DllExport NURBSTexSurfType MapperType();
03242     DllExport void SetMapperType(NURBSTexSurfType type);
03243 
03254     DllExport void SetParent(int index);
03265     DllExport void SetParentId(NURBSId id);
03267     DllExport int GetParent();
03269     DllExport NURBSId GetParentId();
03270 
03277     DllExport void SetNumPoints(int u, int v);
03279     DllExport int GetNumUPoints(void);
03281     DllExport int GetNumVPoints(void);
03288     DllExport void GetNumPoints(int &u, int &v);
03295     DllExport NURBSTexturePoint* GetPoint(int u, int v);
03304     DllExport void SetPoint(int u, int v, NURBSTexturePoint& pnt);
03305 };
03306 
03307 
03308 
03309 class NURBSTextureChannel;
03310 
03321 class NURBSTextureChannelSet: public MaxHeapOperators {
03322     friend class NURBSSurface;
03323     ~NURBSTextureChannelSet();
03324 
03325 private:
03331     NURBSTextureChannel* GetChannelByIndex(int index) { return mTextureChannels[index]; }
03338     NURBSTextureChannel* GetChannel(int channel);
03345     NURBSTextureChannel* AddChannel(int channel);
03347     int NumChannels() { return mTextureChannels.Count(); }
03348 
03349     Tab<NURBSTextureChannel*> mTextureChannels;
03350 };
03351 
03381 class NURBSTextureChannel: public MaxHeapOperators {
03382     friend class NURBSSurface;
03383     friend class NURBSTextureChannelSet;
03384 private:
03397     DllExport NURBSTextureChannel(int channel);
03398 
03400     DllExport int GetChannel() { return mChannel; }
03401 
03404     DllExport BOOL GenerateUVs();
03409     DllExport void SetGenerateUVs(BOOL state);
03416     DllExport Point2 GetTextureUVs(TimeValue t, int i);
03425     DllExport void SetTextureUVs(TimeValue t, int i, Point2 pt);
03441     DllExport void GetTileOffset(TimeValue t, float &ut, float &vt, float &uo, float &vo, float &a);
03457     DllExport void SetTileOffset(TimeValue t, float ut, float vt, float uo, float vo, float a);
03458 
03461     DllExport NURBSTextureSurface& GetTextureSurface() {return mTexSurface; }
03466     DllExport void SetTextureSurface(NURBSTextureSurface& texSurf);
03467 
03468     int mChannel;
03469 
03470     BOOL mGenUVs;
03471     Point2 mTexUVs[4];
03472 
03473     float mUTile;
03474     float mVTile;
03475     float mUOffset;
03476     float mVOffset;
03477     float mAngle;
03478 
03479     NURBSTextureSurface mTexSurface;
03480 };
03481 
03532 class NURBSSurface : public NURBSObject {
03533     friend class NURBSCVSurface;
03534     friend class NURBSPointSurface;
03535     friend class NURBSBlendSurface;
03536     friend class NURBSNBlendSurface;
03537     friend class NURBSOffsetSurface;
03538     friend class NURBSXFormSurface;
03539     friend class NURBSMirrorSurface;
03540     friend class NURBSCapSurface;
03541     friend class NURBSIsoCurve;
03542     friend class NURBSProjectVectorCurve;
03543     friend class NURBSProjectNormalCurve;
03544     friend class NURBSSurfSurfIntersectionCurve;
03545     friend class NURBSCurveOnSurface;
03546     friend class NURBSPointCurveOnSurface;
03547     friend class NURBSMultiCurveTrimSurface;
03548     friend class NURBSTextureChannel;
03549     friend class NURBSTextureChannelSet;
03550 
03551 private:
03552     DllExport NURBSTextureChannel* GetChannel(int index);
03553 
03554 protected:
03555     NURBSTextureChannelSet mTextureChannelSet;
03556 
03557     BOOL mFlipNormals;
03558     BOOL mRenderable;
03559     int mMatID;
03560     BOOL mClosedInU, mClosedInV;
03561 
03562     // new for R3 -- optional
03563     TessApprox *mpVTess;
03564     TessApprox *mpRTess;
03565     TessApprox *mpRTessDisp;
03566     TessApprox *mpVTessCurve;
03567     TessApprox *mpRTessCurve;
03568 
03569     // Internal surface cache
03570     // 
03571     void* mpSurfCache;
03572 
03573 public:
03574 
03575     // Internal use only cache
03576     void* GetSurfCache() { return mpSurfCache; }
03577     void SetSurfCache(void* pCache) { mpSurfCache = pCache; }
03578 
03589     DllExport NURBSSurface(void);
03591     DllExport virtual ~NURBSSurface(void);
03596     DllExport NURBSSurface & operator=(const NURBSSurface& surf);
03599     DllExport BOOL Renderable();
03604     DllExport void Renderable(BOOL state);
03606     DllExport BOOL FlipNormals();
03611     DllExport void FlipNormals(BOOL state);
03618     DllExport BOOL GenerateUVs(int channel = 0);
03626     DllExport void SetGenerateUVs(BOOL state, int channel = 0);
03628     DllExport int MatID();
03633     DllExport void MatID(int id);
03644     DllExport Point2 GetTextureUVs(TimeValue t, int i, int channel = 0);
03657     DllExport void SetTextureUVs(TimeValue t, int i, Point2 pt, int channel = 0);
03673     DllExport void GetTileOffset(TimeValue t, float &ut, float &vt, float &uo, float &vo, float &a, int channel = 0);
03689     DllExport void SetTileOffset(TimeValue t, float ut, float vt, float uo, float vo, float a, int channel = 0);
03690 
03697     DllExport NURBSTextureSurface& GetTextureSurface(int channel);
03705     DllExport void SetTextureSurface(int channel, NURBSTextureSurface& texSurf);
03706 
03708     DllExport int NumChannels();
03714     DllExport int GetChannelFromIndex(int index);
03715 
03716 
03717 
03720     DllExport BOOL IsClosedInU(void);
03723     DllExport BOOL IsClosedInV(void);
03724 
03746     DllExport BOOL Evaluate(TimeValue t, double u, double v, Point3& pt,
03747             Point3& dPdU, Point3& dPdV);
03774     DllExport BOOL Evaluate(TimeValue t, double u, double v, Point3& pt,
03775             Point3& dPdU, Point3& dPdV, Point3& d2PdU2, Point3& d2PdV2, Point3& d2PdUdV);
03789     DllExport void GetParameterRange(TimeValue t, double& uMin, double& uMax, double& vMin, double& vMax);
03814     DllExport BOOL GetNURBSData(TimeValue t,
03815                                 int& degreeInU,
03816                                 int& degreeInV,
03817                                 int& numInU,
03818                                 int& numInV,
03819                                 NURBSCVTab& cvs,
03820                                 int& numKnotsInU,
03821                                 int& numKnotsInV,
03822                                 NURBSKnotTab& uKnots, 
03823                                 NURBSKnotTab& vKnots);
03851     DllExport BOOL GetCLPTextureSurfaceData(TimeValue t, int channel,
03852                                 int& degreeInU,
03853                                 int& degreeInV,
03854                                 int& numInU,
03855                                 int& numInV,
03856                                 NURBSCVTab& cvs,
03857                                 int& numKnotsInU,
03858                                 int& numKnotsInV,
03859                                 NURBSKnotTab& uKnots, 
03860                                 NURBSKnotTab& vKnots);
03866     DllExport int NumTrimLoops(TimeValue t);
03873     DllExport int NumCurvesInLoop(TimeValue t, int loop);
03894     DllExport BOOL Get2dTrimCurveData(TimeValue t, int loop, int curve,
03895                                         int& degree,
03896                                         int& numCVs,
03897                                         NURBSCVTab& cvs,
03898                                         int& numKnots,
03899                                         NURBSKnotTab& knots);
03920     DllExport BOOL Get3dTrimCurveData(TimeValue t, int loop, int curve,
03921                                         int& degree,
03922                                         int& numCVs,
03923                                         NURBSCVTab& cvs,
03924                                         int& numKnots,
03925                                         NURBSKnotTab& knots);
03931     DllExport TessApprox* GetProdTess(NURBSTessType type=kNTessSurface);
03937     DllExport TessApprox* GetViewTess(NURBSTessType type=kNTessSurface);
03945     DllExport void SetProdTess(TessApprox& tess, NURBSTessType type=kNTessSurface);
03953     DllExport void SetViewTess(TessApprox& tess, NURBSTessType type=kNTessSurface);
03959     DllExport void ClearViewTess(NURBSTessType type=kNTessSurface);
03967     DllExport void ClearProdTess(NURBSTessType type=kNTessSurface);
03968 };
03969 
03970 
03981 class NURBSCVSurface : public NURBSSurface {
03982     friend class NURBSSet;
03983     NURBSControlVertex *mpCVs;
03984     double *mpUKnots;
03985     double *mpVKnots;
03986     int mUOrder;
03987     int mVOrder;
03988     int mNumUCVs;
03989     int mNumVCVs;
03990     int mNumUKnots;
03991     int mNumVKnots;
03992     BOOL mRigid;
03993     NURBSAutoParam mAutoParam;
03994 public:
04010     DllExport NURBSCVSurface(void);
04012     DllExport virtual ~NURBSCVSurface(void);
04017     DllExport NURBSCVSurface & operator=(const NURBSCVSurface& surf);
04019     DllExport BOOL IsRigid();
04024     DllExport void SetRigid(BOOL isRigid);
04026     DllExport NURBSAutoParam AutoParam();
04033     DllExport void AutoParam(TimeValue t, NURBSAutoParam param);
04040     DllExport void Reparameterize(TimeValue t, NURBSParamaterization param);
04043     DllExport void CloseInU(void);
04046     DllExport void CloseInV(void);
04051     DllExport void SetUOrder(int order);
04053     DllExport int GetUOrder(void);
04055     DllExport int GetVOrder(void);
04060     DllExport void SetVOrder(int order);
04066     DllExport void SetNumUKnots(int num);         // data is NOT maintained
04072     DllExport void SetNumVKnots(int num);         // data is NOT maintained
04074     DllExport int GetNumUKnots(void);
04076     DllExport int GetNumVKnots(void);
04084     DllExport void SetNumCVs(int u, int v);       // data is NOT maintained
04086     DllExport int GetNumUCVs(void);
04088     DllExport int GetNumVCVs(void);
04096     DllExport void GetNumCVs(int &u, int &v);
04101     DllExport double GetUKnot(int index);
04106     DllExport double GetVKnot(int index);
04114     DllExport void SetUKnot(int index, double value);
04122     DllExport void SetVKnot(int index, double value);
04129     DllExport NURBSControlVertex* GetCV(int u, int v);
04138     DllExport void SetCV(int u, int v, NURBSControlVertex& cv);
04139 
04150     DllExport void SetTransformMatrix(TimeValue t, SetXFormPacket& mat);
04156     DllExport Matrix3 GetTransformMatrix(TimeValue t);
04157 
04168     DllExport void EdgesOverlap(BOOL& uOverlap, BOOL& vOverlap);
04169     // If you refine in U (U_V_Both = 0) you must specify v
04170     // If you refine in V (U_V_Both = 1) you must specify u
04171     // If you refine in U and (U_V_Both = -1) you must specify u and v
04192     DllExport void Refine(TimeValue t, double u, double v, int U_V_Both);
04211     DllExport void Insert(TimeValue t, double u, double v, int U_V_Both);
04212 };
04213 
04214 
04224 class NURBSPointSurface : public NURBSSurface {
04225     friend class NURBSSet;
04226     NURBSIndependentPoint *mpPts;
04227     int mNumUPts;
04228     int mNumVPts;
04229 public:
04235     DllExport NURBSPointSurface(void);
04237     DllExport virtual ~NURBSPointSurface(void);
04242     DllExport NURBSPointSurface & operator=(const NURBSPointSurface& surf);
04244     DllExport void CloseInU(void);
04246     DllExport void CloseInV(void);
04253     DllExport void SetNumPts(int u, int v);       // data is NOT maintained
04255     DllExport int GetNumUPts(void);
04257     DllExport int GetNumVPts(void);
04265     DllExport void GetNumPts(int &u, int &v);
04272     DllExport NURBSIndependentPoint* GetPoint(int u, int v);
04281     DllExport void SetPoint(int u, int v, NURBSIndependentPoint& pt);
04282 
04292     DllExport void SetTransformMatrix(TimeValue t, SetXFormPacket& mat);
04298     DllExport Matrix3 GetTransformMatrix(TimeValue t);
04299 
04300     // If you refine in U (U_V_Both = 0) you must specify v
04301     // If you refine in V (U_V_Both = 1) you must specify u
04302     // If you refine in U and (U_V_Both = -1) you must specify u and v
04324     DllExport void Refine(TimeValue t, double u, double v, int U_V_Both);
04325 };
04326 
04335 class NURBSBlendSurface : public NURBSSurface {
04336     friend class NURBSSet;
04337     NURBSId mParentId[2];
04338     int mParentIndex[2];
04339     int mParentEdge[2];
04340     BOOL mFlip[2];
04341     double mTension[2];
04342     double mCurveStartParam[2];
04349     DllExport void Clean(NURBSIdTab ids);
04350 public:
04366     DllExport NURBSBlendSurface(void);
04368     DllExport virtual ~NURBSBlendSurface(void);
04373     DllExport NURBSBlendSurface & operator=(const NURBSBlendSurface& surf);
04381     DllExport void SetParent(int pnum, int index);
04388     DllExport void SetParentId(int pnum, NURBSId id);
04394     DllExport int GetParent(int pnum);
04401     DllExport NURBSId GetParentId(int pnum);
04413     DllExport void SetEdge(int pnum, int edge);
04424     DllExport int GetEdge(int pnum);
04433     DllExport void SetTension(TimeValue t, int pnum, double ten);
04440     DllExport double GetTension(TimeValue t, int pnum);
04454     DllExport void SetFlip(int pnum, BOOL flip);
04459     DllExport BOOL GetFlip(int pnum);
04460 
04461     // only if the parent is a closed curve
04471     DllExport void SetCurveStartPoint(TimeValue t, int pnum, double startpoint);
04481     DllExport double GetCurveStartPoint(TimeValue t, int pnum);
04482 };
04483 
04484 
04495 class NURBSNBlendSurface : public NURBSSurface {
04496     friend class NURBSSet;
04497     // The parents can be either curves or surfaces (with edge IDs)
04498     NURBSId mParentId[4];
04499     int mParentIndex[4];
04500     int mParentEdge[4];  // used only if the parent is a surface
04507     DllExport void Clean(NURBSIdTab ids);
04508 public:
04521     DllExport NURBSNBlendSurface(void);
04523     DllExport virtual ~NURBSNBlendSurface(void);
04528     DllExport NURBSNBlendSurface & operator=(const NURBSNBlendSurface& surf);
04536     DllExport void SetParent(int pnum, int index);
04544     DllExport void SetParentId(int pnum, NURBSId id);
04550     DllExport int GetParent(int pnum);
04555     DllExport NURBSId GetParentId(int pnum);
04567     DllExport void SetEdge(int pnum, int edge);
04578     DllExport int GetEdge(int pnum);
04579 };
04580 
04589 class NURBSOffsetSurface : public NURBSSurface {
04590     friend class NURBSSet;
04591     NURBSId mParentId;
04592     int mParentIndex;
04593     double mDistance;
04600     DllExport void Clean(NURBSIdTab ids);
04601 public:
04609     DllExport NURBSOffsetSurface(void);
04611     DllExport virtual ~NURBSOffsetSurface(void);
04616     DllExport NURBSOffsetSurface & operator=(const NURBSOffsetSurface& surf);
04622     DllExport void SetParent(int index);
04627     DllExport void SetParentId(NURBSId id);
04630     DllExport int GetParent(void);
04634     DllExport NURBSId GetParentId(void);
04642     DllExport void SetDistance(TimeValue t, double d);
04649     DllExport double GetDistance(TimeValue t);
04650 };
04651 
04661 class NURBSXFormSurface : public NURBSSurface {
04662     friend class NURBSSet;
04663     NURBSId mParentId;
04664     int mParentIndex;
04665     Matrix3 mXForm;
04672     DllExport void Clean(NURBSIdTab ids);
04673 public:
04681     DllExport NURBSXFormSurface(void);
04683     DllExport virtual ~NURBSXFormSurface(void);
04688     DllExport NURBSXFormSurface & operator=(const NURBSXFormSurface& surf);
04693     DllExport void SetParent(int index);
04698     DllExport void SetParentId(NURBSId id);
04700     DllExport int GetParent(void);
04702     DllExport NURBSId GetParentId(void);
04709     DllExport void SetXForm(TimeValue t, Matrix3& mat);
04716     DllExport Matrix3& GetXForm(TimeValue t);
04717 };
04718 
04730 class NURBSMirrorSurface : public NURBSSurface {
04731     friend class NURBSSet;
04732     NURBSId mParentId;
04733     int mParentIndex;
04734     NURBSMirrorAxis mAxis;
04735     Matrix3 mXForm;
04736     double mDistance;
04743     DllExport void Clean(NURBSIdTab ids);
04744 public:
04754     DllExport NURBSMirrorSurface(void);
04756     DllExport virtual ~NURBSMirrorSurface(void);
04761     DllExport NURBSMirrorSurface & operator=(const NURBSMirrorSurface& surf);
04766     DllExport void SetParent(int index);
04771     DllExport void SetParentId(NURBSId id);
04774     DllExport int GetParent(void);
04778     DllExport NURBSId GetParentId(void);
04783     DllExport void SetAxis(NURBSMirrorAxis axis);
04785     DllExport NURBSMirrorAxis GetAxis(void);
04795     DllExport void SetXForm(TimeValue t, Matrix3& mat);
04801     DllExport Matrix3& GetXForm(TimeValue t);
04811     DllExport void SetDistance(TimeValue t, double d);
04819     DllExport double GetDistance(TimeValue t);
04820 };
04821 
04831 class NURBSRuledSurface : public NURBSSurface {
04832     friend class NURBSSet;
04833     NURBSId mParentId[2];
04834     int mParentIndex[2];
04835     BOOL mFlip[2];
04836     double mCurveStartParam[2];
04843     DllExport void Clean(NURBSIdTab ids);
04844 public:
04858     DllExport NURBSRuledSurface(void);
04860     DllExport virtual ~NURBSRuledSurface(void);
04865     DllExport NURBSRuledSurface & operator=(const NURBSRuledSurface& surf);
04873     DllExport void SetParent(int pnum, int index);
04880     DllExport void SetParentId(int pnum, NURBSId id);
04886     DllExport int GetParent(int pnum);
04893     DllExport NURBSId GetParentId(int pnum);
04907     DllExport void SetFlip(int pnum, BOOL flip);
04912     DllExport BOOL GetFlip(int pnum);
04922     DllExport void SetCurveStartPoint(TimeValue t, int pnum, double startpoint);
04932     DllExport double GetCurveStartPoint(TimeValue t, int pnum);
04933 };
04934 
04935 
04945 class NURBSULoftSurface : public NURBSSurface {
04946     friend class NURBSSet;
04947     Tab<NURBSId> mParentId;
04948     Tab<int> mParentIndex;
04949     Tab<BOOL> mFlip;
04950     Tab<double>mCurveStartParam;
04951     Tab<double>mTension;
04952     Tab<BOOL> mUseTangents;
04953     Tab<BOOL> mFlipTangents;
04954     BOOL mAutoAlign;
04955     BOOL mCloseLoft;
04962     DllExport void Clean(NURBSIdTab ids);
04963 public:
04977     DllExport NURBSULoftSurface(void);
04979     DllExport virtual ~NURBSULoftSurface(void);
04984     DllExport NURBSULoftSurface & operator=(const NURBSULoftSurface& surf);
04989     DllExport void SetNumCurves(int num);
04991     DllExport int GetNumCurves(void);
05001     DllExport int AppendCurve(int index, BOOL flip, double startpoint=0.0,
05002                                 double tension=0.0, BOOL useTangent=FALSE, BOOL flipTangent=FALSE);
05011     DllExport int AppendCurve(NURBSId id, BOOL flip, double startpoint=0.0,
05012                                 double tension=0.0, BOOL useTangent=FALSE, BOOL flipTangent=FALSE);
05020     DllExport void SetParent(int pnum, int index);
05027     DllExport void SetParentId(int pnum, NURBSId id);
05033     DllExport int GetParent(int pnum);
05040     DllExport NURBSId GetParentId(int pnum);
05049     DllExport void SetFlip(int pnum, BOOL flip);
05054     DllExport BOOL GetFlip(int pnum);
05064     DllExport void SetCurveStartPoint(TimeValue t, int pnum, double startpoint);
05072     DllExport double GetCurveStartPoint(TimeValue t, int pnum);
05073 
05082     DllExport void SetCurveTension(TimeValue t, int pnum, double tension);
05090     DllExport double GetCurveTension(TimeValue t, int pnum);
05099     DllExport void SetCurveUseSurfaceTangent(int pnum, BOOL useTangent);
05104     DllExport BOOL GetCurveUseSurfaceTangent(int pnum);
05111     DllExport void SetFlipTangent(int pnum, BOOL flipTangent);
05117     DllExport BOOL GetFlipTangent(int pnum);
05122     DllExport void SetAutoAlign(BOOL autoalign);
05124     DllExport BOOL GetAutoAlign();
05129     DllExport void SetCloseLoft(BOOL closeLoft);
05133     DllExport BOOL GetCloseLoft();
05134 };
05135 
05136 
05143 class NURBSUVLoftSurface : public NURBSSurface {
05144     friend class NURBSSet;
05145     Tab<NURBSId> mUParentId;
05146     Tab<int> mUParentIndex;
05147     Tab<NURBSId> mVParentId;
05148     Tab<int> mVParentIndex;
05155     DllExport void Clean(NURBSIdTab ids);
05156 public:
05165     DllExport NURBSUVLoftSurface(void);
05167     DllExport virtual ~NURBSUVLoftSurface(void);
05172     DllExport NURBSUVLoftSurface & operator=(const NURBSUVLoftSurface& surf);
05173 
05178     DllExport void SetNumUCurves(int num);
05180     DllExport int GetNumUCurves(void);
05186     DllExport int AppendUCurve(int index);
05193     DllExport int AppendUCurve(NURBSId id);
05201     DllExport void SetUParent(int pnum, int index);
05209     DllExport void SetUParentId(int pnum, NURBSId id);
05215     DllExport int GetUParent(int pnum);
05222     DllExport NURBSId GetUParentId(int pnum);
05223 
05228     DllExport void SetNumVCurves(int num);
05230     DllExport int GetNumVCurves(void);
05237     DllExport int AppendVCurve(int index);
05244     DllExport int AppendVCurve(NURBSId id);
05252     DllExport void SetVParent(int pnum, int index);
05260     DllExport void SetVParentId(int pnum, NURBSId id);
05266     DllExport int GetVParent(int pnum);
05273     DllExport NURBSId GetVParentId(int pnum);
05274 };
05275 
05276 
05277 
05288 class NURBSExtrudeSurface : public NURBSSurface {
05289     friend class NURBSSet;
05290     NURBSId mParentId;
05291     int mParentIndex;
05292     Matrix3 mXForm;
05293     double mDistance;
05294     double mCurveStartParam;
05301     DllExport void Clean(NURBSIdTab ids);
05302 public:
05312     DllExport NURBSExtrudeSurface(void);
05314     DllExport virtual ~NURBSExtrudeSurface(void);
05319     DllExport NURBSExtrudeSurface & operator=(const NURBSExtrudeSurface& surf);
05324     DllExport void SetParent(int index);
05329     DllExport void SetParentId(NURBSId id);
05332     DllExport int GetParent(void);
05336     DllExport NURBSId GetParentId(void);
05343     DllExport void SetAxis(TimeValue t, Matrix3& ray);
05348     DllExport Matrix3& GetAxis(TimeValue t);
05355     DllExport void SetDistance(TimeValue t, double d);
05360     DllExport double GetDistance(TimeValue t);
05367     DllExport void SetCurveStartPoint(TimeValue t, double startpoint);
05374     DllExport double GetCurveStartPoint(TimeValue t);
05375 };
05376 
05377 
05388 class NURBSLatheSurface : public NURBSSurface {
05389     friend class NURBSSet;
05390     NURBSId mParentId;
05391     int mParentIndex;
05392     Matrix3 mXForm;
05393     double mRotation;
05394     double mCurveStartParam;
05401     DllExport void Clean(NURBSIdTab ids);
05402 public:
05412     DllExport NURBSLatheSurface(void);
05414     DllExport virtual ~NURBSLatheSurface(void);
05419     DllExport NURBSLatheSurface & operator=(const NURBSLatheSurface& surf);
05424     DllExport void SetParent(int index);
05429     DllExport void SetParentId(NURBSId id);
05432     DllExport int GetParent(void);
05436     DllExport NURBSId GetParentId(void);
05444     DllExport void SetAxis(TimeValue t, Matrix3& ray);
05449     DllExport Matrix3& GetAxis(TimeValue t);
05456     DllExport void SetRotation(TimeValue t, double degrees);
05461     DllExport double GetRotation(TimeValue t);
05468     DllExport void SetCurveStartPoint(TimeValue t, double startpoint);
05475     DllExport double GetCurveStartPoint(TimeValue t);
05476 };
05477 
05478 
05485 class NURBSCapSurface : public NURBSSurface {
05486     friend class NURBSSet;
05487     NURBSId mParentId;
05488     int mParentIndex;
05489     int mParentEdge;
05490     double mCurveStartParam;
05497     DllExport void Clean(NURBSIdTab ids);
05498 public:
05507     DllExport NURBSCapSurface(void);
05509     DllExport virtual ~NURBSCapSurface(void);
05514     DllExport NURBSCapSurface & operator=(const NURBSCapSurface& surf);
05520     DllExport void SetParent(int index);
05526     DllExport void SetParentId(NURBSId id);
05529     DllExport int GetParent(void);
05532     DllExport NURBSId GetParentId(void);
05542     DllExport void SetEdge(int edge);
05549     DllExport int GetEdge();
05550 
05551     // only if the parent is a closed curve
05559     DllExport void SetCurveStartPoint(TimeValue t, double startpoint);
05565     DllExport double GetCurveStartPoint(TimeValue t);
05566 };
05567 
05568 
05577 class NURBS1RailSweepSurface : public NURBSSurface {
05578     friend class NURBSSet;
05579     NURBSId mRailId;
05580     int mRailIndex;
05581     Tab<NURBSId> mParentId;
05582     Tab<int> mParentIndex;
05583     Tab<BOOL> mFlip;
05584     Tab<double> mCurveStartParam;
05585     BOOL mParallel;
05586     BOOL mSnapCrossSections;
05587     BOOL mRoadlike;
05588     Matrix3 mXForm;
05595     DllExport void Clean(NURBSIdTab ids);
05596 public:
05610     DllExport NURBS1RailSweepSurface(void);
05612     DllExport virtual ~NURBS1RailSweepSurface(void);
05617     DllExport NURBS1RailSweepSurface & operator=(const NURBS1RailSweepSurface& surf);
05623     DllExport void SetParentRail(int index);
05629     DllExport void SetParentRailId(NURBSId id);
05631     DllExport int GetParentRail();
05633     DllExport NURBSId GetParentRailId();
05638     DllExport void SetNumCurves(int num);
05640     DllExport int GetNumCurves(void);
05650     DllExport int AppendCurve(int index, BOOL flip, double startpoint=0.0);
05660     DllExport int AppendCurve(NURBSId id, BOOL flip, double startpoint=0.0);
05668     DllExport void SetParent(int pnum, int index);
05676     DllExport void SetParentId(int pnum, NURBSId id);
05682     DllExport int GetParent(int pnum);
05688     DllExport NURBSId GetParentId(int pnum);
05696     DllExport void SetFlip(int pnum, BOOL flip);
05702     DllExport BOOL GetFlip(int pnum);
05708     DllExport void SetParallel(BOOL para);
05711     DllExport BOOL GetParallel();
05721     DllExport void SetCurveStartPoint(TimeValue t, int pnum, double startpoint);
05729     DllExport double GetCurveStartPoint(TimeValue t, int pnum);
05735     DllExport void SetSnapCS(BOOL snapCS);
05737     DllExport BOOL GetSnapCS();
05745     DllExport void SetRoadlike(BOOL roadlike);
05747     DllExport BOOL GetRoadlike();
05754     DllExport void SetAxis(TimeValue t, Matrix3& ray);
05761     DllExport Matrix3& GetAxis(TimeValue t);
05762 };
05763 
05764 
05773 class NURBS2RailSweepSurface : public NURBSSurface {
05774     friend class NURBSSet;
05775     Tab<NURBSId> mParentId;
05776     Tab<int> mParentIndex;
05777     Tab<BOOL> mFlip;
05778     NURBSId mRailParentId[2];
05779     int mRailParentIndex[2];
05780     BOOL mParallel;
05781     BOOL mScale;
05782     BOOL mSnapCrossSections;
05783     Tab<double> mCurveStartParam;
05790     DllExport void Clean(NURBSIdTab ids);
05791 public:
05802     DllExport NURBS2RailSweepSurface(void);
05804     DllExport virtual ~NURBS2RailSweepSurface(void);
05809     DllExport NURBS2RailSweepSurface & operator=(const NURBS2RailSweepSurface& surf);
05810 
05815     DllExport void SetNumCurves(int num);
05817     DllExport int GetNumCurves(void);
05827     DllExport int AppendCurve(int index, BOOL flip, double startpoint=0.0);
05837     DllExport int AppendCurve(NURBSId id, BOOL flip, double startpoint=0.0);
05845     DllExport void SetParent(int pnum, int index);
05853     DllExport void SetParentId(int pnum, NURBSId id);
05859     DllExport int GetParent(int pnum);
05865     DllExport NURBSId GetParentId(int pnum);
05873     DllExport void SetFlip(int pnum, BOOL flip);
05879     DllExport BOOL GetFlip(int pnum);
05886     DllExport void SetParallel(BOOL para);
05888     DllExport BOOL GetParallel();
05895     DllExport void SetScale(BOOL scale);
05898     DllExport BOOL GetScale();
05904     DllExport void SetSnapCS(BOOL snapCS);
05906     DllExport BOOL GetSnapCS();
05907 
05915     DllExport void SetRailParent(int pnum, int index);
05923     DllExport void SetRailParentId(int pnum, NURBSId id);
05929     DllExport int GetRailParent(int pnum);
05935     DllExport NURBSId GetRailParentId(int pnum);
05936 
05945     DllExport void SetCurveStartPoint(TimeValue t, int pnum, double startpoint);
05954     DllExport double GetCurveStartPoint(TimeValue t, int pnum);
05955 };
05956 
05957 
05958 
05964 class NURBSMultiCurveTrimSurface : public NURBSSurface {
05965     friend class NURBSSet;
05966     Tab<NURBSId> mParentId;
05967     Tab<int> mParentIndex;
05968     NURBSId mSurfaceId;
05969     int mSurfaceIndex;
05970     BOOL mFlipTrim;
05977     DllExport void Clean(NURBSIdTab ids);
05978 public:
05989     DllExport NURBSMultiCurveTrimSurface(void);
05991     DllExport virtual ~NURBSMultiCurveTrimSurface(void);
05996     DllExport NURBSMultiCurveTrimSurface & operator=(const NURBSMultiCurveTrimSurface& surf);
05997 
06003     DllExport void SetNumCurves(int num);
06005     DllExport int GetNumCurves(void);
06012     DllExport int AppendCurve(int index);
06019     DllExport int AppendCurve(NURBSId id);
06027     DllExport void SetParent(int pnum, int index);
06035     DllExport void SetParentId(int pnum, NURBSId id);
06041     DllExport int GetParent(int pnum);
06047     DllExport NURBSId GetParentId(int pnum);
06048 
06054     DllExport void SetSurfaceParent(int index);
06060     DllExport void SetSurfaceParentId(NURBSId id);
06063     DllExport int GetSurfaceParent();
06065     DllExport NURBSId GetSurfaceParentId();
06066 
06069     DllExport BOOL GetFlipTrim();
06076     DllExport void SetFlipTrim(BOOL flip);
06077 };
06078 
06079 
06080 
06087 class NURBSFilletSurface : public NURBSSurface {
06088     friend class NURBSSet;
06089     // parent 0 should be the surface parent 1 should be the curve
06090     NURBSId mParentId[2];
06091     int mParentIndex[2];
06092     BOOL mCubic;
06093     float mRadius[2];
06094     Point2 mSeed[2];
06095     BOOL mTrimSurface[2];
06096     BOOL mFlipTrim[2];
06103     DllExport void Clean(NURBSIdTab ids);
06104 public:
06114     DllExport NURBSFilletSurface(void);
06116     DllExport virtual ~NURBSFilletSurface(void);
06121     DllExport NURBSFilletSurface & operator=(const NURBSFilletSurface& curve);
06129     DllExport void SetParent(int pnum, int index);
06137     DllExport void SetParentId(int pnum, NURBSId id);
06143     DllExport int GetParent(int pnum);
06148     DllExport NURBSId GetParentId(int pnum);
06154     DllExport Point2 GetSeed(int pnum);
06162     DllExport void SetSeed(int pnum, Point2& seed);
06166     DllExport BOOL IsCubic();
06171     DllExport void SetCubic(BOOL cubic);
06178     DllExport float GetRadius(TimeValue t, int rnum);
06187     DllExport void SetRadius(TimeValue t, int rnum, float radius);
06188 
06195     DllExport BOOL GetTrimSurface(int pnum);
06204     DllExport void SetTrimSurface(int pnum, BOOL trim);
06210     DllExport BOOL GetFlipTrim(int pnum);
06218     DllExport void SetFlipTrim(int pnum, BOOL flip);
06219 };
06220 
06221 
06222 
06245 class NURBSDisplay: public MaxHeapOperators {
06246 public:
06256     DllExport NURBSDisplay();
06261     DllExport NURBSDisplay & operator=(const NURBSDisplay& disp);
06262 
06263     BOOL mDisplayCurves;
06264     BOOL mDisplaySurfaces;
06265     BOOL mDisplayLattices;
06266     BOOL mDisplaySurfCVLattices;
06267     BOOL mDisplayCurveCVLattices;
06268     BOOL mDisplayDependents;
06269     BOOL mDisplayTrimming;
06270     BOOL mDegradeOnMove;
06271     BOOL mDisplayShadedLattice;
06272 };
06273 
06274 
06275 
06294 class NURBSFuseSurfaceCV: public MaxHeapOperators {
06295 public:
06299     DllExport NURBSFuseSurfaceCV();
06300     int mSurf1, mSurf2;
06301     int mRow1, mCol1, mRow2, mCol2;
06302 };
06303 
06304 
06321 class NURBSFuseCurveCV: public MaxHeapOperators {
06322 public:
06327     DllExport NURBSFuseCurveCV();
06328     int mCurve1, mCurve2;
06329     int mCV1, mCV2;
06330 };
06331 
06382 class NURBSSet: public MaxHeapOperators {
06383 protected:
06384     friend DllExport Object* CreateNURBSObject(IObjParam* ip, NURBSSet *nset, Matrix3& mat);
06385     friend DllExport int AddNURBSObjects(Object* MAXobj, IObjParam* ip, NURBSSet *nset);
06386     friend DllExport BOOL GetNURBSSet(Object *object, TimeValue t, NURBSSet &nset, BOOL Relational);
06387     TessApprox *mpVTess;
06388     TessApprox *mpRTess;
06389     // new for R3 -- optional
06390     TessApprox *mpRTessDisp;
06391     TessApprox *mpVTessCurve;
06392     TessApprox *mpRTessCurve;
06393 
06394     float mTessMerge;
06395     Tab<NURBSObject*> mObjects;
06396     Object *mpObject;
06397     NURBSDisplay mDisplay;
06398 
06399 public:
06417     DllExport NURBSSet(void);
06419     DllExport virtual ~NURBSSet(void);
06426     DllExport void Clean(); // this method removes any relation to a live NURBS object
06428     DllExport int GetNumObjects();
06449     DllExport void SetObject(int index, NURBSObject* obj);
06459     DllExport int AppendObject(NURBSObject* obj);
06464     DllExport void RemoveObject(int index);
06469     DllExport void DeleteObjects();
06474     DllExport NURBSObject* GetNURBSObject(int index);
06479     DllExport NURBSObject* GetNURBSObject(NURBSId id);
06485     DllExport TessApprox* GetProdTess(NURBSTessType type=kNTessSurface);
06491     DllExport TessApprox* GetViewTess(NURBSTessType type=kNTessSurface);
06500     DllExport void SetProdTess(TessApprox& tess, NURBSTessType type=kNTessSurface);
06509     DllExport void SetViewTess(TessApprox& tess, NURBSTessType type=kNTessSurface);
06515     DllExport void ClearViewTess(NURBSTessType type=kNTessSurface);
06521     DllExport void ClearProdTess(NURBSTessType type=kNTessSurface);
06523     DllExport float GetTessMerge();
06536     DllExport void SetTessMerge(float merge);
06539     DllExport Object* GetMAXObject();
06541     DllExport NURBSDisplay GetDisplaySettings();
06546     DllExport void SetDisplaySettings(NURBSDisplay& disp);
06547 
06548 
06549     Tab<NURBSFuseSurfaceCV> mSurfFuse;
06550     Tab<NURBSFuseCurveCV> mCurveFuse;
06551 };
06552 
06553 
06554 
06567 typedef NURBSResult (*SurfParamRangeProc)(double& uMin, double& uMax, double& vMin, double& vMax);
06582 typedef NURBSResult (*SurfEvalProc)(double u, double v, Point3& pt);
06602 typedef NURBSResult (*SurfEvalTan)(double u, double v, Point3& uTan, Point3& vTan);
06628 typedef NURBSResult (*SurfEvalMixedProc)(double u, double v, Point3& mixed);
06629 
06630 // base class for a proceedurally defined surfaces
06631 // NOTE THIS IS NOT SUBCLASSED FROM NURBSObject
06632 // You must use the GenNURBSCVSurfaceProcedurally
06641 class NURBSProceeduralSurface: public MaxHeapOperators {
06642 public:
06643     SurfParamRangeProc  mParamProc;     // this one MUST be implemented
06644     SurfEvalProc        mEvalProc;      // this one MUST be implemented
06645     SurfEvalTan         mEvalTanProc;   // this one is optional
06646     SurfEvalMixedProc   mEvalMixedProc; // this one is optional
06654     DllExport NURBSProceeduralSurface(SurfParamRangeProc param, SurfEvalProc eval,
06655                             SurfEvalTan tan, SurfEvalMixedProc mixed);
06656 };
06673 DllExport NURBSResult GenNURBSCVSurfaceProceedurally(NURBSProceeduralSurface *pSurf, double tolerence, NURBSCVSurface& surf);
06674 
06675 
06684 typedef NURBSResult (*CurveParamRangeProc)(double& tMin, double& tMax);
06693 typedef NURBSResult (*CurveEvalProc)(double u, Point3& pt);
06704 typedef NURBSResult (*CurveEvalTan)(double u, Point3& pt, Point3& tan);
06720 typedef NURBSResult (*CurveArcLengthProc)(double& arcLength);
06721 // base class for a proceedurally defined curves
06722 // NOTE THIS IS NOT SUBCLASSED FROM NURBSObject
06723 // You must use the GenNURBSCVCurveProcedurally
06732 class NURBSProceeduralCurve: public MaxHeapOperators {
06733 public:
06734     CurveParamRangeProc mParamProc;     // this one MUST be implemented
06735     CurveEvalProc       mEvalProc;      // this one MUST be implemented
06736     CurveEvalTan        mEvalTanProc;   // this one is optional
06737     CurveArcLengthProc  mArcLengthProc; // this one is optional
06740     DllExport NURBSProceeduralCurve(CurveParamRangeProc param, CurveEvalProc eval,
06741                             CurveEvalTan tan, CurveArcLengthProc arclen);
06742 };
06743 
06761 DllExport NURBSResult GenNURBSCVCurveProceedurally(NURBSProceeduralCurve *pCrv, double tolerence, NURBSCVCurve& crv);
06762 
06763 
06764 
06765 
06766 
06767 
06768 DllExport NURBSResult GenNURBSLatheSurface(NURBSCVCurve& curve, Point3& origin, Point3& north,
06769                                     float start, float end, NURBSCVSurface& surf);
06770 DllExport NURBSResult GenNURBSSphereSurface(float radius, Point3& center, Point3& northAxis, Point3& refAxis,
06771                     float startAngleU, float endAngleU, float startAngleV, float endAngleV, BOOL open, NURBSCVSurface& surf);
06772 DllExport NURBSResult GenNURBSCylinderSurface(float radius, float height, Point3& origin, Point3& symAxis, Point3& refAxis,
06773                     float startAngle, float endAngle, BOOL open, NURBSCVSurface& surf);
06774 DllExport NURBSResult GenNURBSConeSurface(float radius1, float radius2, float height, Point3& origin, Point3& symAxis, Point3& refAxis,
06775                     float startAngle, float endAngle, BOOL open, NURBSCVSurface& surf);
06776 DllExport NURBSResult GenNURBSTorusSurface(float majorRadius, float minorRadius, Point3& origin,
06777                     Point3& symAxis, Point3& refAxis, float startAngleU, float endAngleU,
06778                     float startAngleV, float endAngleV, BOOL open, NURBSCVSurface& surf);
06779 
06780 DllExport Object *CreateNURBSObject(IObjParam* ip, NURBSSet *nset, Matrix3& mat);
06781 DllExport int AddNURBSObjects(Object* obj, IObjParam* ip, NURBSSet *nset);
06782 
06783 DllExport Object *CreateNURBSLatheShape(IObjParam* ip, MSTR name, TimeValue t, ShapeObject *shape,
06784                      Matrix3& axis, float degrees, int capStart, int capEnd,
06785                      int capType, BOOL weldCore, BOOL flipNormals, BOOL texturing,
06786                      int segs, BOOL matIds, BOOL shapeIDs);
06787 DllExport Object *CreateNURBSExtrudeShape(IObjParam* ip, MSTR name, TimeValue t, ShapeObject *shape, float amount,
06788                        int capStart, int capEnd, int capType, BOOL texturing,
06789                        BOOL matIds, BOOL shapeIDs);
06790 
06791 DllExport BOOL GetNURBSSet(Object *object, TimeValue t, NURBSSet &nset, BOOL Relational);
06792 
06793 
06794 
06795 // modify extant objects
06796 DllExport NURBSResult SetSurfaceApprox(Object* obj, BOOL viewport, TessApprox *tess, BOOL clearSurfs=FALSE);
06797 DllExport NURBSResult SetCurveApprox(Object* obj, BOOL viewport, TessApprox *tess, BOOL clearSurfs);
06798 DllExport NURBSResult SetDispApprox(Object* obj, TessApprox *tess, BOOL clearSurfs);
06799 DllExport NURBSResult SetSurfaceDisplaySettings(Object* obj, NURBSDisplay& disp);
06800 DllExport NURBSResult GetSurfaceDisplaySettings(Object* obj, NURBSDisplay& disp);
06801 
06802 DllExport NURBSResult Transform(Object* obj, NURBSIdTab& ids, SetXFormPacket& xPack, Matrix3& mat, TimeValue t);
06803 
06804 DllExport NURBSResult BreakCurve(Object* obj, NURBSId id, double u, TimeValue t);
06805 DllExport NURBSResult BreakSurface(Object* obj, NURBSId id, BOOL breakU, double param, TimeValue t);
06806 
06807 DllExport NURBSResult JoinCurves(Object* obj, NURBSId id1, NURBSId id2, BOOL begin1, BOOL begin2,
06808                                  double tolerance, double ten1, double ten2, TimeValue t);
06809 DllExport NURBSResult JoinSurfaces(Object* obj, NURBSId id1, NURBSId id2, int edge1, int edge2,
06810                                    double tolerance, double ten1, double ten2, TimeValue t);
06811 
06812 DllExport NURBSResult ZipCurves(Object* obj, NURBSId id1, NURBSId id2, BOOL begin1, BOOL begin2,
06813                                  double tolerance, TimeValue t);
06814 DllExport NURBSResult ZipSurfaces(Object* obj, NURBSId id1, NURBSId id2, int edge1, int edge2,
06815                                    double tolerance, TimeValue t);
06816 
06817 DllExport NURBSId MakeIndependent(Object* obj, NURBSId id, TimeValue t);
06818 DllExport NURBSId MakeRigid(Object* obj, NURBSId id, TimeValue t);
06819 DllExport void SetApproxPreset(Object* pObj, int i);
06820 DllExport void ToggleShadedLattice(Object* pObj);
06821 DllExport TessApprox* GetTessPreset(int which, int preset);
06822 DllExport void SetTessPreset(int which, int preset, TessApprox& tess);
06823 
06824 DllExport Object *BuildEMObjectFromLofterObject(Object *loftObject, double tolerance);
06825 DllExport Object *BuildEMObjectFromPatchObject(Object *patchObject);
06826 
06827 typedef Tab<NURBSId> NURBSIdList;
06828 
06829 DllExport Object *DetachObjects(TimeValue t, INode *pNode, Object* pobj, NURBSIdList list, char *newObjName, BOOL copy, BOOL relational);
06830 
06831 
06832 DllExport NURBSSubObjectLevel GetSelectionLevel(Object* pObj);
06833 DllExport NURBSResult SetSelectionLLevel(Object* pObj, NURBSSubObjectLevel level);
06834 
06835 DllExport NURBSResult GetSelection(Object* pObj, NURBSSubObjectLevel level,
06836                                    BitArray& selset);
06837 
06838 DllExport NURBSResult SetSelection(Object* pObj, NURBSSubObjectLevel level,
06839                                    BitArray& selset);
06840 
06841 DllExport NURBSResult
06842 MoveCurrentSelection(Object* pObj, NURBSSubObjectLevel level,
06843                      TimeValue t, Matrix3& partm, Matrix3& tmAxis,
06844                      Point3& val, BOOL localOrigin);
06845 
06846 DllExport NURBSResult
06847 RotateCurrentSelection(Object* pObj, NURBSSubObjectLevel level,
06848                        TimeValue t, Matrix3& partm, Matrix3& tmAxis,
06849                        Quat& val, BOOL localOrigin);
06850 
06851 DllExport NURBSResult 
06852 ScaleCurrentSelection(Object* pObj, NURBSSubObjectLevel level,
06853                       TimeValue t, Matrix3& partm, Matrix3& tmAxis,
06854                       Point3& val, BOOL localOrigin);
06855 
06856 
06857 // Get the number of sub-objects at a particular level
06858 DllExport int
06859 SubObjectCount(Object* pObj, NURBSSubObjectLevel level);
06860 
06861 // number of named sets at a particular level
06862 DllExport int 
06863 NamedSelSetCount(Object* pObj, NURBSSubObjectLevel level);
06864 
06865 // Get ith named sel set name
06866 DllExport MCHAR* 
06867 GetNamedSelSetName(Object* pObj, NURBSSubObjectLevel level, int i);  
06868 
06869 // Set the bit array to the named selection set
06870 DllExport NURBSResult 
06871 GetNamedSelSet(Object* pObj, NURBSSubObjectLevel level, MCHAR* name, BitArray& selSet);
06872 
06873 // Set the named selection set the selection in BitArray
06874 DllExport NURBSResult 
06875 SetNamedSelSet(Object* pObj, NURBSSubObjectLevel level, MCHAR* name, BitArray& sel); 
06876 
06877 // Add a new named selection set
06878 DllExport NURBSResult
06879 AppendNamedSelSet(Object* pObj, NURBSSubObjectLevel level, MCHAR* name, BitArray& sel); 
06880 
06881 DllExport NURBSResult
06882 DeleteCurrentSelection(Object* pObj, NURBSSubObjectLevel level);
06883 
06884 DllExport NURBSResult
06885 MapNURBSIdToSelSetIndex(Object* pObj, NURBSId id, int& index, NURBSSubObjectLevel& level);
06886 
06887 DllExport NURBSResult
06888 MapSelSetIndexToNURBSId(Object* pObj, int index, NURBSSubObjectLevel level, NURBSId& id);
06889 
06890 DllExport void 
06891 ApplyUVWMapAsTextureSurface(Object* pObj, int type, float utile, float vtile,
06892                             float wtile, int uflip, int vflip, int wflip, int cap,
06893                             const Matrix3 &tm,int channel);
06894 
06895 // Has the same affect as the "Update" button on the "Surface Mapper" WSM.
06896 DllExport void UpdateSurfaceMapper(Modifier* pMod);