surf_api.h
来自「hl2 source code. Do not use it illegal.」· C头文件 代码 · 共 1,866 行 · 第 1/5 页
H
1,866 行
int mParentIndex[2];
double mSeed;
BOOL mTrimCurve;
BOOL mFlipTrim;
DllExport void Clean(NURBSIdTab ids);
public:
DllExport NURBSCurveSurfaceIntersectionPoint(void);
DllExport virtual ~NURBSCurveSurfaceIntersectionPoint(void);
DllExport NURBSCurveSurfaceIntersectionPoint & operator=(const NURBSCurveSurfaceIntersectionPoint &pt);
DllExport void SetSeed(double seed);
DllExport double GetSeed();
DllExport void SetParent(int pnum, int index);
DllExport void SetParentId(int pnum, NURBSId id);
DllExport int GetParent(int pnum);
DllExport NURBSId GetParentId(int pnum);
DllExport BOOL GetTrimCurve();
DllExport void SetTrimCurve(BOOL trim);
DllExport BOOL GetFlipTrim();
DllExport void SetFlipTrim(BOOL flip);
};
typedef Tab<NURBSControlVertex> NURBSCVTab;
typedef Tab<double> NURBSKnotTab;
enum NURBSTrimDirection // defines the side to Keep
{
kNone = 0,
kPositive = 1,
kNegative = 2
};
class NURBSTrimPoint {
public:
DllExport NURBSTrimPoint(double parameter, NURBSTrimDirection direction) :
mParameter(parameter), mDirection(direction) {}
DllExport double GetParameter() {return mParameter; }
DllExport NURBSTrimDirection GetDirection() {return mDirection; }
private:
double mParameter;
NURBSTrimDirection mDirection;
};
class NURBSCurve : public NURBSObject {
protected:
friend class NURBSCVCurve;
friend class NURBSPointCurve;
friend class NURBSBlendCurve;
friend class NURBSOffsetCurve;
friend class NURBSXFormCurve;
friend class NURBSMirrorCurve;
friend class NURBSFilletCurve;
friend class NURBSChamferCurve;
friend class NURBSIsoCurve;
friend class NURBSSurfaceEdgeCurve;
friend class NURBSProjectVectorCurve;
friend class NURBSProjectNormalCurve;
friend class NURBSSurfaceNormalCurve;
friend class NURBSNBlendSurface;
friend class NURBSRuledSurface;
friend class NURBSULoftSurface;
friend class NURBSUVLoftSurface;
friend class NURBSExtrudeSurface;
friend class NURBSLatheSurface;
friend class NURBSCapSurface;
friend class NURBS1RailSweepSurface;
friend class NURBS2RailSweepSurface;
friend class NURBSMultiCurveTrimSurface;
int mMatID;
public:
DllExport NURBSCurve(void);
DllExport virtual ~NURBSCurve(void);
DllExport NURBSCurve & operator=(const NURBSCurve& curve);
DllExport BOOL IsClosed(void);
DllExport int NumTrimPoints();
DllExport NURBSTrimPoint GetTrimPoint(TimeValue t, int i);
DllExport BOOL Evaluate(TimeValue t, double u, Point3& pt, Point3& tangent);
DllExport void GetParameterRange(TimeValue t, double& uMin, double& uMax);
DllExport BOOL GetNURBSData(TimeValue t,
int& degree,
int& numCVs,
NURBSCVTab& cvs,
int& numKnots,
NURBSKnotTab& knots);
DllExport int MatID();
DllExport void MatID(int id);
};
class NURBSCVCurve : public NURBSCurve {
friend class NURBSSet;
protected:
NURBSControlVertex *mpCVs;
double *mpKnots;
BOOL mClosed;
int mOrder;
int mNumKnots;
int mNumCVs;
NURBSAutoParam mAutoParam;
public:
DllExport NURBSCVCurve(void);
DllExport virtual ~NURBSCVCurve(void);
DllExport NURBSCVCurve & operator=(const NURBSCVCurve& curve);
DllExport void Close(void);
DllExport BOOL IsClosed(void);
DllExport void SetOrder(int order);
DllExport int GetOrder(void);
DllExport void SetNumKnots(int num); // data is NOT maintained
DllExport int GetNumKnots(void);
DllExport void SetNumCVs(int num); // data is NOT maintained
DllExport void GetNumCVs(int& num);
DllExport int GetNumCVs(void);
DllExport double GetKnot(int index);
DllExport void SetKnot(int index, double value);
DllExport NURBSControlVertex* GetCV(int index);
DllExport void SetCV(int index, NURBSControlVertex &cv);
DllExport void SetTransformMatrix(TimeValue t, SetXFormPacket& xPack);
DllExport Matrix3 GetTransformMatrix(TimeValue t);
DllExport NURBSAutoParam AutoParam();
DllExport void AutoParam(TimeValue t, NURBSAutoParam param);
DllExport void Reparameterize(TimeValue t, NURBSParamaterization param);
DllExport void EndsOverlap(BOOL& overlap);
DllExport void Refine(TimeValue t, double u); // looses animation
DllExport void Insert(TimeValue t, double u);
};
class NURBSPointCurve : public NURBSCurve {
friend class NURBSSet;
protected:
NURBSIndependentPoint *mpPts;
BOOL mClosed;
int mNumPts;
public:
DllExport NURBSPointCurve(void);
DllExport virtual ~NURBSPointCurve(void);
DllExport NURBSPointCurve & operator=(const NURBSPointCurve& curve);
DllExport void Close(void);
DllExport BOOL IsClosed(void);
DllExport void SetNumPts(int num); // data is NOT maintained
DllExport int GetNumPts(void);
DllExport void GetNumPts(int &num);
DllExport NURBSIndependentPoint* GetPoint(int index);
DllExport void SetPoint(int index, NURBSIndependentPoint &pt);
DllExport void SetTransformMatrix(TimeValue t, SetXFormPacket& xPack);
DllExport Matrix3 GetTransformMatrix(TimeValue t);
DllExport void Refine(TimeValue t, double u); // looses animation
};
class NURBSBlendCurve : public NURBSCurve {
friend class NURBSSet;
NURBSId mParentId[2];
int mParentIndex[2];
BOOL mParentEnd[2];
double mTension[2];
DllExport void Clean(NURBSIdTab ids);
public:
DllExport NURBSBlendCurve(void);
DllExport virtual ~NURBSBlendCurve(void);
DllExport NURBSBlendCurve & operator=(const NURBSBlendCurve& curve);
DllExport void SetParent(int pnum, int index);
DllExport void SetParentId(int pnum, NURBSId id);
DllExport int GetParent(int pnum);
DllExport NURBSId GetParentId(int pnum);
DllExport void SetEnd(int pnum, BOOL end);
DllExport BOOL GetEnd(int pnum);
DllExport void SetTension(TimeValue t, int pnum, double ten);
DllExport double GetTension(TimeValue t, int pnum);
};
class NURBSOffsetCurve : public NURBSCurve {
friend class NURBSSet;
NURBSId mParentId;
int mParentIndex;
double mDistance;
DllExport void Clean(NURBSIdTab ids);
public:
DllExport NURBSOffsetCurve(void);
DllExport virtual ~NURBSOffsetCurve(void);
DllExport NURBSOffsetCurve & operator=(const NURBSOffsetCurve& curve);
DllExport void SetParent(int index);
DllExport void SetParentId(NURBSId id);
DllExport int GetParent(void);
DllExport NURBSId GetParentId(void);
DllExport void SetDistance(TimeValue t, double d);
DllExport double GetDistance(TimeValue t);
};
class NURBSXFormCurve : public NURBSCurve {
friend class NURBSSet;
NURBSId mParentId;
int mParentIndex;
Matrix3 mXForm;
DllExport void Clean(NURBSIdTab ids);
public:
DllExport NURBSXFormCurve(void);
DllExport virtual ~NURBSXFormCurve(void);
DllExport NURBSXFormCurve & operator=(const NURBSXFormCurve& curve);
DllExport void SetParent(int index);
DllExport void SetParentId(NURBSId id);
DllExport int GetParent(void);
DllExport NURBSId GetParentId(void);
DllExport void SetXForm(TimeValue t, Matrix3& mat);
DllExport Matrix3& GetXForm(TimeValue t);
};
class NURBSMirrorCurve : public NURBSCurve {
friend class NURBSSet;
NURBSId mParentId;
int mParentIndex;
NURBSMirrorAxis mAxis;
Matrix3 mXForm;
double mDistance;
DllExport void Clean(NURBSIdTab ids);
public:
DllExport NURBSMirrorCurve(void);
DllExport virtual ~NURBSMirrorCurve(void);
DllExport NURBSMirrorCurve & operator=(const NURBSMirrorCurve& curve);
DllExport void SetParent(int index);
DllExport void SetParentId(NURBSId id);
DllExport int GetParent(void);
DllExport NURBSId GetParentId(void);
DllExport void SetAxis(NURBSMirrorAxis axis);
DllExport NURBSMirrorAxis GetAxis(void);
DllExport void SetXForm(TimeValue t, Matrix3& mat);
DllExport Matrix3& GetXForm(TimeValue t);
DllExport void SetDistance(TimeValue t, double d);
DllExport double GetDistance(TimeValue t);
};
class NURBSFilletCurve : public NURBSCurve {
friend class NURBSSet;
NURBSId mParentId[2];
int mParentIndex[2];
BOOL mParentEnd[2];
double mRadius;
BOOL mTrimCurve[2];
BOOL mFlipTrim[2];
DllExport void Clean(NURBSIdTab ids);
public:
DllExport NURBSFilletCurve(void);
DllExport virtual ~NURBSFilletCurve(void);
DllExport NURBSFilletCurve & operator=(const NURBSFilletCurve& curve);
DllExport void SetParent(int pnum, int index);
DllExport void SetParentId(int pnum, NURBSId id);
DllExport int GetParent(int pnum);
DllExport NURBSId GetParentId(int pnum);
DllExport void SetEnd(int pnum, BOOL end);
DllExport BOOL GetEnd(int pnum);
DllExport void SetRadius(TimeValue t, double radius);
DllExport double GetRadius(TimeValue t);
DllExport BOOL GetTrimCurve(int pnum);
DllExport void SetTrimCurve(int pnum, BOOL trim);
DllExport BOOL GetFlipTrim(int pnum);
DllExport void SetFlipTrim(int pnum, BOOL flip);
};
class NURBSChamferCurve : public NURBSCurve {
friend class NURBSSet;
NURBSId mParentId[2];
int mParentIndex[2];
BOOL mParentEnd[2];
double mLength[2];
BOOL mTrimCurve[2];
BOOL mFlipTrim[2];
DllExport void Clean(NURBSIdTab ids);
public:
DllExport NURBSChamferCurve(void);
DllExport virtual ~NURBSChamferCurve(void);
DllExport NURBSChamferCurve & operator=(const NURBSChamferCurve& curve);
DllExport void SetParent(int pnum, int index);
DllExport void SetParentId(int pnum, NURBSId id);
DllExport int GetParent(int pnum);
DllExport NURBSId GetParentId(int pnum);
DllExport void SetEnd(int pnum, BOOL end);
DllExport BOOL GetEnd(int pnum);
DllExport void SetLength(TimeValue t, int pnum, double length);
DllExport double GetLength(TimeValue t, int pnum);
DllExport BOOL GetTrimCurve(int pnum);
DllExport void SetTrimCurve(int pnum, BOOL trim);
DllExport BOOL GetFlipTrim(int pnum);
DllExport void SetFlipTrim(int pnum, BOOL flip);
};
class NURBSIsoCurve : public NURBSCurve {
friend class NURBSSet;
NURBSId mParentId;
int mParentIndex;
BOOL mIsU; // false for V...
double mParam;
BOOL mTrim;
BOOL mFlipTrim;
Point2 mSeed;
DllExport void Clean(NURBSIdTab ids);
public:
DllExport NURBSIsoCurve(void);
DllExport virtual ~NURBSIsoCurve(void);
DllExport NURBSIsoCurve & operator=(const NURBSIsoCurve& curve);
DllExport void SetParent(int index);
DllExport void SetParentId(NURBSId id);
DllExport int GetParent(void);
DllExport NURBSId GetParentId(void);
DllExport void SetDirection(BOOL isU);
DllExport BOOL GetDirection(void);
DllExport void SetParam(TimeValue t, double p);
DllExport double GetParam(TimeValue t);
DllExport BOOL GetTrim();
DllExport void SetTrim(BOOL trim);
DllExport BOOL GetFlipTrim();
DllExport void SetFlipTrim(BOOL flip);
DllExport Point2 GetSeed();
DllExport void SetSeed(Point2& seed);
};
class NURBSSurfaceEdgeCurve : public NURBSCurve {
friend class NURBSSet;
NURBSId mParentId;
int mParentIndex;
Point2 mSeed;
DllExport void Clean(NURBSIdTab ids);
public:
DllExport NURBSSurfaceEdgeCurve(void);
DllExport virtual ~NURBSSurfaceEdgeCurve(void);
DllExport NURBSSurfaceEdgeCurve & operator=(const NURBSSurfaceEdgeCurve& curve);
DllExport void SetParent(int index);
DllExport void SetParentId(NURBSId id);
DllExport int GetParent(void);
DllExport NURBSId GetParentId(void);
DllExport Point2 GetSeed();
DllExport void SetSeed(Point2& seed);
};
class NURBSProjectVectorCurve : public NURBSCurve {
friend class NURBSSet;
// parent 0 should be the surface parent 1 should be the curve
NURBSId mParentId[2];
int mParentIndex[2];
BOOL mTrim;
BOOL mFlipTrim;
Point2 mSeed;
Point3 mPVec;
DllExport void Clean(NURBSIdTab ids);
public:
DllExport NURBSProjectVectorCurve(void);
DllExport virtual ~NURBSProjectVectorCurve(void);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?