surf_api.h
来自「hl2 source code. Do not use it illegal.」· C头文件 代码 · 共 1,866 行 · 第 1/5 页
H
1,866 行
/**********************************************************************
*<
FILE: surf_api.h
DESCRIPTION: Provides the SDK api for NURBS surfaces
CREATED BY: Charlie Thaeler
HISTORY: created 15 April, 1997
*> Copyright (c) 1997, All Rights Reserved.
**********************************************************************/
#ifndef SURF_API_H
#define SURF_API_H
#include "point3.h"
#include "maxtess.h"
#define EDITABLE_SURF_CLASS_ID Class_ID(0x76a11646, 0x12a822fb)
#define FITPOINT_PLANE_CLASS_ID Class_ID(0x76a11646, 0xbadbeff)
#define EDITABLE_CVCURVE_CLASS_ID Class_ID(0x76a11646, 0x12a83145)
#define EDITABLE_FPCURVE_CLASS_ID Class_ID(0x76a11646, 0x12a92143)
#define NURBS_NAME_SIZE 80
typedef unsigned long NURBSId; // NOTE: THESE ARE NOT PERSISTANT ACROSS SESSIONS
// and should NOT be saved to a file.
typedef Tab<NURBSId> NURBSIdTab;
typedef Tab<BOOL> BoolTab;
enum NURBSResult {
kNOk,
kNInvalidObject,
kNInvalidId,
kNInvalidParameter,
kNBad
};
enum NURBSMirrorAxis {
kMirrorX,
kMirrorY,
kMirrorZ,
kMirrorXY,
kMirrorXZ,
kMirrorYZ
};
enum NURBSConstType {
kNConstOnObject,
kNConstOffset,
kNConstNormal,
kNConstTangent
};
enum NURBSKind {
kNURBSPoint,
kNURBSTexturePoint,
kNURBSCV,
kNURBSCurve,
kNURBSSurface
};
enum NURBSParamaterization {
kCentripetal,
kUniform,
};
enum NURBSAutoParam {
kNotAutomatic,
kAutoCentripetal,
kAutoUniform,
};
enum NURBSType {
kNPoint,
kNPointCPoint, // constrained points
kNCurveCPoint,
kNCurveCurveIntersectionPoint,
kNSurfaceCPoint,
kNCurveSurfaceIntersectionPoint,
kNTexturePoint,
kNCV,
kNCVCurve,
kNPointCurve,
kNBlendCurve,
kNOffsetCurve,
kNXFormCurve,
kNMirrorCurve,
kNFilletCurve,
kNChamferCurve,
kNIsoCurve,
kNProjectVectorCurve,
kNProjectNormalCurve,
kNSurfSurfIntersectionCurve,
kNCurveOnSurface,
kNPointCurveOnSurface,
kNSurfaceNormalCurve,
kNSurfaceEdgeCurve,
kNCVSurface,
kNPointSurface,
kNBlendSurface,
kNOffsetSurface,
kNXFormSurface,
kNMirrorSurface,
kNRuledSurface,
kNULoftSurface,
kNExtrudeSurface,
kNLatheSurface,
kNUVLoftSurface,
kNNBlendSurface,
kN1RailSweepSurface,
kN2RailSweepSurface,
kNCapSurface,
kNMultiCurveTrimSurface,
kNFilletSurface
};
enum NURBSTessType {
kNTessSurface,
kNTessDisplacement,
kNTessCurve
};
enum NURBSSubObjectLevel {
kNTopLevel = 0,
kNSurfaceCVLevel,
kNSurfaceLevel,
kNCurveCVLevel,
kNPointLevel,
kNCurveLevel,
kNImportsLevel,
};
class NURBSSet;
typedef Tab<NURBSId> NURBSIdTab;
extern int FindIndex(NURBSIdTab ids, NURBSId id);
class NURBSObject {
friend class NURBSSet;
protected:
TCHAR mName[NURBS_NAME_SIZE];
NURBSType mType;
NURBSKind mKind;
NURBSId mId;
Object *mpObject;
NURBSSet* mpNSet;
BOOL mSelected;
DllExport void Clean(NURBSIdTab ids);
public:
DllExport NURBSObject(void);
DllExport virtual ~NURBSObject(void);
DllExport NURBSObject & operator=(const NURBSObject& pt);
DllExport void SetName(TCHAR *name);
DllExport TCHAR *GetName(void);
DllExport NURBSType GetType();
DllExport NURBSKind GetKind();
DllExport NURBSId GetId();
DllExport void SetId(NURBSId id);
DllExport void SetNSet(NURBSSet *nset);
DllExport void SetObject(Object *object);
DllExport Object* GetMAXObject();
DllExport NURBSSet* GetNSet();
DllExport int GetIndex();
DllExport BOOL IsSelected();
DllExport void SetSelected(BOOL set);
};
class NURBSPoint : public NURBSObject {
protected:
double mX, mY, mZ;
public:
DllExport NURBSPoint();
DllExport virtual Point3 GetPosition(TimeValue t);
DllExport virtual void GetPosition(TimeValue t, float& x, float& y, float& z);
DllExport virtual void GetPosition(TimeValue t, double& x, double& y, double& z);
};
class NURBSTexturePoint : public NURBSObject {
protected:
double mX, mY;
int mUIndex, mVIndex;
public:
DllExport NURBSTexturePoint();
DllExport virtual Point2 GetPosition(TimeValue t);
DllExport virtual void GetPosition(TimeValue t, float& x, float& y);
DllExport virtual void GetPosition(TimeValue t, double& x, double& y);
DllExport void SetPosition(TimeValue t, Point2 pt);
DllExport void SetPosition(TimeValue t, float x, float y);
DllExport void SetPosition(TimeValue t, double x, double y);
DllExport void SetIndices(int uIndex, int vIndex);
};
class NURBSIndependentPoint : public NURBSPoint {
public:
DllExport NURBSIndependentPoint(void);
DllExport virtual ~NURBSIndependentPoint(void);
DllExport NURBSIndependentPoint & operator=(const NURBSIndependentPoint& pt);
DllExport BOOL operator==(const NURBSIndependentPoint& pt);
DllExport BOOL operator!=(const NURBSIndependentPoint& pt);
DllExport void SetPosition(TimeValue t, Point3 pt);
DllExport void SetPosition(TimeValue t, float x, float y, float z);
DllExport void SetPosition(TimeValue t, double x, double y, double z);
};
class NURBSControlVertex : public NURBSObject {
double mX, mY, mZ;
double mW; // weight
public:
DllExport NURBSControlVertex(void);
DllExport virtual ~NURBSControlVertex(void);
DllExport NURBSControlVertex & operator=(const NURBSControlVertex& cv);
DllExport BOOL operator==(const NURBSControlVertex& cv);
DllExport BOOL operator!=(const NURBSControlVertex& cv);
DllExport void SetPosition(TimeValue t, Point3 pt);
DllExport void SetPosition(TimeValue t, float x, float y, float z);
DllExport void SetPosition(TimeValue t, double x, double y, double z);
DllExport Point3 GetPosition(TimeValue t);
DllExport void GetPosition(TimeValue t, float& x, float& y, float& z);
DllExport void GetPosition(TimeValue t, double& x, double& y, double& z);
DllExport void SetWeight(TimeValue t, float wt);
DllExport void SetWeight(TimeValue t, double wt);
DllExport void GetWeight(TimeValue t, float& wt);
DllExport double GetWeight(TimeValue t);
DllExport void GetWeight(TimeValue t, double& wt);
};
class NURBSPointConstPoint : public NURBSPoint {
friend class NURBSSet;
protected:
NURBSId mParentId;
int mParentIndex;
NURBSConstType mCType;
Point3 mOffset;
DllExport void Clean(NURBSIdTab ids);
public:
DllExport NURBSPointConstPoint(void);
DllExport virtual ~NURBSPointConstPoint(void);
DllExport NURBSPointConstPoint & operator=(const NURBSPointConstPoint& pt);
DllExport void SetParent(int index);
DllExport void SetParentId(NURBSId id);
DllExport int GetParent(void);
DllExport NURBSId GetParentId(void);
DllExport void SetPointType(NURBSConstType type);
DllExport NURBSConstType GetPointType(void);
DllExport void SetOffset(TimeValue t, Point3 pt);
DllExport Point3 GetOffset(TimeValue t);
};
class NURBSCurveConstPoint : public NURBSPoint {
friend class NURBSSet;
protected:
NURBSId mParentId;
int mParentIndex;
NURBSConstType mCType;
Point3 mOffset;
float mNormal;
float mUTangent;
double mUParam;
BOOL mTrimCurve;
BOOL mFlipTrim;
DllExport void Clean(NURBSIdTab ids);
public:
DllExport NURBSCurveConstPoint(void);
DllExport virtual ~NURBSCurveConstPoint(void);
DllExport NURBSCurveConstPoint & operator=(const NURBSCurveConstPoint& pt);
DllExport void SetParent(int index);
DllExport void SetParentId(NURBSId id);
DllExport int GetParent(void);
DllExport NURBSId GetParentId(void);
DllExport void SetPointType(NURBSConstType type);
DllExport NURBSConstType GetPointType(void);
DllExport void SetOffset(TimeValue t, Point3 pt);
DllExport Point3 GetOffset(TimeValue t);
DllExport void SetUParam(TimeValue t, double param);
DllExport double GetUParam(TimeValue t);
DllExport void SetNormal(TimeValue t, float dist);
DllExport float GetNormal(TimeValue t);
DllExport void SetUTangent(TimeValue t, float dist);
DllExport float GetUTangent(TimeValue t);
DllExport BOOL GetTrimCurve();
DllExport void SetTrimCurve(BOOL trim);
DllExport BOOL GetFlipTrim();
DllExport void SetFlipTrim(BOOL flip);
};
class NURBSCurveCurveIntersectionPoint : public NURBSPoint {
friend class NURBSSet;
protected:
NURBSId mParentId[2];
int mParentIndex[2];
double mCurveParam[2];
BOOL mTrimCurve[2];
BOOL mFlipTrim[2];
DllExport void Clean(NURBSIdTab ids);
public:
DllExport NURBSCurveCurveIntersectionPoint(void);
DllExport virtual ~NURBSCurveCurveIntersectionPoint(void);
DllExport NURBSCurveCurveIntersectionPoint & operator=(const NURBSCurveCurveIntersectionPoint &pt);
DllExport void SetCurveParam(int curveNum, double param);
DllExport double GetCurveParam(int curveNum);
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(int pnum);
DllExport void SetTrimCurve(int pnum, BOOL trim);
DllExport BOOL GetFlipTrim(int pnum);
DllExport void SetFlipTrim(int pnum, BOOL flip);
};
class NURBSSurfConstPoint : public NURBSPoint {
friend class NURBSSet;
protected:
NURBSId mParentId;
int mParentIndex;
NURBSConstType mCType;
Point3 mOffset;
float mNormal;
float mUTangent;
double mUParam;
float mVTangent;
double mVParam;
DllExport void Clean(NURBSIdTab ids);
public:
DllExport NURBSSurfConstPoint(void);
DllExport virtual ~NURBSSurfConstPoint(void);
DllExport NURBSSurfConstPoint & operator=(const NURBSSurfConstPoint& pt);
DllExport void SetParent(int index);
DllExport void SetParentId(NURBSId id);
DllExport int GetParent(void);
DllExport NURBSId GetParentId(void);
DllExport void SetPointType(NURBSConstType type);
DllExport NURBSConstType GetPointType(void);
DllExport void SetUParam(TimeValue t, double param);
DllExport double GetUParam(TimeValue t);
DllExport void SetVParam(TimeValue t, double param);
DllExport double GetVParam(TimeValue t);
DllExport void SetOffset(TimeValue t, Point3 pt);
DllExport Point3 GetOffset(TimeValue t);
DllExport void SetNormal(TimeValue t, float dist);
DllExport float GetNormal(TimeValue t);
DllExport void SetUTangent(TimeValue t, float dist);
DllExport float GetUTangent(TimeValue t);
DllExport void SetVTangent(TimeValue t, float dist);
DllExport float GetVTangent(TimeValue t);
};
class NURBSCurveSurfaceIntersectionPoint : public NURBSPoint {
friend class NURBSSet;
protected:
// parent 0 should be the surface parent 1 should be the curve
NURBSId mParentId[2];
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?