added everything
This commit is contained in:
150
lib/maxsdk31/CompBase.h
Executable file
150
lib/maxsdk31/CompBase.h
Executable file
@ -0,0 +1,150 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: compbase.h
|
||||
|
||||
DESCRIPTION: A base class for components implemented as RefArrays
|
||||
|
||||
CREATED BY: John Hutchinson
|
||||
|
||||
HISTORY: created 9/1/98
|
||||
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
#ifndef _COMPBASE
|
||||
#define _COMPBASE
|
||||
|
||||
#include "RefArrayBase.h"
|
||||
#include "Icomponent.h"
|
||||
|
||||
class CompositeBase : public RefArrayBase, public IComponent
|
||||
{
|
||||
protected:
|
||||
int iSelLevel;
|
||||
enum authority_context {eOpColor};
|
||||
|
||||
public:
|
||||
CompositeBase():iSelLevel(0){};
|
||||
// From Animatable
|
||||
CoreExport void DeleteThis();
|
||||
// CompositeBase now returns SHAPE_CLASS_ID for its SuperClassID when
|
||||
// it only contains shapes. This allows an instance to behave more
|
||||
// like a true shape if it only contains shapes. If you want to support
|
||||
// this behavior, you'll need two ClassDesc's, one returning GEOM and
|
||||
// one returning SHAPE for the super class id. They should both return
|
||||
// the same class id. If you want to disable this behavior, override
|
||||
// this method.
|
||||
CoreExport SClass_ID SuperClassID();
|
||||
|
||||
// This is a flag that *should* be exported elsewhere in the SDK.
|
||||
#define DISP_NODEFAULTCOLOR (1<<12)
|
||||
// This is an additional flag that can be used by Display() and HitTest().
|
||||
#define EDITOBJ_THIS (1 << (HITFLAG_STARTUSERBIT+1))
|
||||
|
||||
//This flag is used by hostcomposite when using special materilas in the viewport
|
||||
//It needs to indicate that the material has been usurped and that the mesh
|
||||
//should not be passed inode::NumMtls(), rather it should be passed 1.
|
||||
#define DISP_NUMMATS_INVALID (1 << (HITFLAG_STARTUSERBIT+2))
|
||||
|
||||
// From BaseObject
|
||||
CoreExport int Display(TimeValue t, INode* inode, ViewExp *vpt, int flags);
|
||||
CoreExport int HitTest(TimeValue t, INode* inode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt);
|
||||
CoreExport void Snap(TimeValue t, INode* inode, SnapInfo *snap, IPoint2 *p, ViewExp *vpt);
|
||||
CoreExport void GetWorldBoundBox(TimeValue t, INode *mat, ViewExp *vpt, Box3& box );
|
||||
CoreExport void GetLocalBoundBox(TimeValue t, INode *mat, ViewExp *vpt, Box3& box );
|
||||
// For sub-object selection
|
||||
CoreExport void Move( TimeValue t, Matrix3& partm, Matrix3& tmAxis, Point3& val, BOOL localOrigin=FALSE);
|
||||
CoreExport void Rotate( TimeValue t, Matrix3& partm, Matrix3& tmAxis, Quat& val, BOOL localOrigin=FALSE);
|
||||
CoreExport void Scale( TimeValue t, Matrix3& partm, Matrix3& tmAxis, Point3& val, BOOL localOrigin=FALSE);
|
||||
CoreExport int HitTest(TimeValue t, INode* inode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt, ModContext* mc);
|
||||
CoreExport int Display(TimeValue t, INode* inode, ViewExp *vpt, int flags, ModContext* mc);
|
||||
CoreExport int SubObjectIndex(HitRecord *hitRec);
|
||||
CoreExport void GetSubObjectCenters(SubObjAxisCallback *cb,TimeValue t,INode *node,ModContext *mc);
|
||||
CoreExport void GetSubObjectTMs(SubObjAxisCallback *cb,TimeValue t,INode *node,ModContext *mc);
|
||||
|
||||
// From Object
|
||||
CoreExport void GetDeformBBox(TimeValue t, Box3& box, Matrix3 *tm = NULL, BOOL useSel = FALSE );
|
||||
CoreExport BOOL HasUVW();
|
||||
CoreExport void SetGenUVW(BOOL sw);
|
||||
CoreExport int CanConvertToType(Class_ID obtype);
|
||||
CoreExport Object* ConvertToType(TimeValue t, Class_ID obtype);
|
||||
CoreExport void GetCollapseTypes(Tab<Class_ID> &clist,Tab<TSTR*> &nlist);
|
||||
CoreExport Class_ID PreferredCollapseType();
|
||||
CoreExport int IntersectRay(TimeValue t, Ray& ray, float& at, Point3& norm);
|
||||
CoreExport ObjectState Eval(TimeValue t);
|
||||
|
||||
// From GeomObject
|
||||
CoreExport Mesh* GetRenderMesh(TimeValue t, INode *inode, View& view, BOOL& needDelete);
|
||||
|
||||
// From ShapeObject
|
||||
CoreExport void SetRenderable(BOOL sw);
|
||||
CoreExport void SetThickness(float t);
|
||||
CoreExport void SetGenUVs(BOOL sw);
|
||||
CoreExport int NumberOfVertices(TimeValue t, int curve = -1);
|
||||
CoreExport int NumberOfCurves();
|
||||
CoreExport BOOL CurveClosed(TimeValue t, int curve);
|
||||
CoreExport Point3 InterpCurve3D(TimeValue t, int curve, float param, int ptype=PARAM_SIMPLE);
|
||||
CoreExport Point3 TangentCurve3D(TimeValue t, int curve, float param, int ptype=PARAM_SIMPLE);
|
||||
CoreExport float LengthOfCurve(TimeValue t, int curve);
|
||||
CoreExport int NumberOfPieces(TimeValue t, int curve);
|
||||
CoreExport Point3 InterpPiece3D(TimeValue t, int curve, int piece, float param, int ptype=PARAM_SIMPLE);
|
||||
CoreExport Point3 TangentPiece3D(TimeValue t, int curve, int piece, float param, int ptype=PARAM_SIMPLE);
|
||||
CoreExport MtlID GetMatID(TimeValue t, int curve, int piece);
|
||||
CoreExport BOOL CanMakeBezier();
|
||||
CoreExport void MakeBezier(TimeValue t, BezierShape &shape);
|
||||
CoreExport void MakePolyShape(TimeValue t, PolyShape &shape, int steps = PSHAPE_BUILTIN_STEPS, BOOL optimize = FALSE);
|
||||
CoreExport ShapeHierarchy &OrganizeCurves(TimeValue t, ShapeHierarchy *hier=NULL);
|
||||
CoreExport int MakeCap(TimeValue t, MeshCapInfo &capInfo, int capType);
|
||||
CoreExport int MakeCap(TimeValue t, PatchCapInfo &capInfo);
|
||||
CoreExport BOOL AttachShape(TimeValue t, INode *thisNode, INode *attachNode, BOOL weldEnds=FALSE, float weldThreshold=0.0f);
|
||||
|
||||
// From RefArrayBase
|
||||
CoreExport class IRefArray *Containee(void){return NULL;}
|
||||
|
||||
// Local methods
|
||||
CoreExport virtual ObjectState EvalPipeObj(TimeValue t, Object* obj) = 0;
|
||||
CoreExport virtual void CombineComponentMeshes(TimeValue t, Mesh& m) = 0;
|
||||
CoreExport virtual void CombineComponentShapes(TimeValue t, BezierShape& Dest) = 0;
|
||||
CoreExport virtual void CombineRenderMeshes(TimeValue t, INode *inode, View& view, Mesh& m) = 0;
|
||||
CoreExport virtual bool HasOnlyShapeOperands(TimeValue t) = 0;
|
||||
CoreExport virtual bool isCompositeAuthority(authority_context context, int contextflags);
|
||||
|
||||
CoreExport virtual bool IsAShape(Object *obj);
|
||||
CoreExport void LockComponent();
|
||||
CoreExport void UnlockComponent();
|
||||
|
||||
protected:
|
||||
// Used by most ShapeObject methods.
|
||||
CoreExport bool GetNextShape(ComponentIterator* iter, ShapeObject*& shape);
|
||||
CoreExport bool CurveFound(int& curve, ComponentIterator* iter, ShapeObject*& shape);
|
||||
};
|
||||
|
||||
//If you implement a component using the compbase class, then you can implement
|
||||
//the iterator for it by deriving from the following class. The assumptions include:
|
||||
// 1) The composite isa IRefArray
|
||||
|
||||
class CompositeIteratorBase: public ComponentIterator
|
||||
{
|
||||
protected:
|
||||
long m_current;
|
||||
public:
|
||||
CoreExport CompositeIteratorBase() : m_current(0) {}
|
||||
CoreExport virtual ~CompositeIteratorBase();
|
||||
CoreExport virtual void First();
|
||||
CoreExport virtual void Next();
|
||||
CoreExport virtual bool IsDone() /*const*/;
|
||||
CoreExport virtual int SubObjIndex() { return m_current; }
|
||||
CoreExport virtual IComponent* GetComponent(void** ipp = NULL, ULONG iid = I_BASEOBJECT) const;
|
||||
//Note: this object may be dynamically allocated. Calls must
|
||||
//be matched with calls to DisposeTemporary()
|
||||
|
||||
CoreExport virtual void DeleteThis();
|
||||
|
||||
CoreExport virtual bool WantsDisplay(DWORD flags){return !Hidden();}
|
||||
CoreExport virtual Point3 DisplayColor(DWORD flags, INode* n = NULL, GraphicsWindow* gw = NULL);
|
||||
protected:
|
||||
CoreExport virtual Object* GetCompositeObject() = 0;
|
||||
CoreExport virtual const Object* GetCompositeObject() const = 0;
|
||||
};
|
||||
|
||||
|
||||
#endif //_COMPBASE
|
BIN
lib/maxsdk31/FLILIBD.LIB
Executable file
BIN
lib/maxsdk31/FLILIBD.LIB
Executable file
Binary file not shown.
BIN
lib/maxsdk31/FLILIBH.LIB
Executable file
BIN
lib/maxsdk31/FLILIBH.LIB
Executable file
Binary file not shown.
BIN
lib/maxsdk31/FLILIBR.LIB
Executable file
BIN
lib/maxsdk31/FLILIBR.LIB
Executable file
Binary file not shown.
147
lib/maxsdk31/FileLinkApi.h
Executable file
147
lib/maxsdk31/FileLinkApi.h
Executable file
@ -0,0 +1,147 @@
|
||||
/*********************************************************************
|
||||
*<
|
||||
FILE: FileLinkApi.h
|
||||
|
||||
DESCRIPTION: File Link interface class
|
||||
|
||||
CREATED BY: Nikolai Sander
|
||||
|
||||
HISTORY: Created 29 January 1998
|
||||
|
||||
*> Copyright (c) 1997-1999, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef FILELINKAPI_H
|
||||
#define FILELINKAPI_H
|
||||
|
||||
#include <maxtypes.h>
|
||||
|
||||
|
||||
/******
|
||||
Accessing the Link Table:
|
||||
If you want your plugin to be able to access the IVizLinkTable interface
|
||||
without incurring a load-time dependency, add the following function to
|
||||
your plugin. With this, your plugin will load whether or not the
|
||||
VizLink plugin is available.
|
||||
|
||||
// Returns NULL if the LinkTable plugin is not present on this system.
|
||||
IVizLinkTable* GetLinkTable()
|
||||
{
|
||||
// Look for the LinkTable node in track view.
|
||||
ITrackViewNode* tvRoot = GetCOREInterface()->GetTrackViewRootNode();
|
||||
int i = tvRoot->FindItem(VIZLINKTABLE_CLASS_ID);
|
||||
if (i < 0)
|
||||
return NULL;
|
||||
|
||||
// Get the node's controller.
|
||||
ITrackViewNode* tvNode = tvRoot->GetNode(i);
|
||||
Control* pc = tvNode->GetController(VIZLINKTABLE_CLASS_ID);
|
||||
if (pc == NULL)
|
||||
return NULL;
|
||||
|
||||
// Call GetInterface to confirm that this is the proper instance.
|
||||
return GetVizLinkTable(pc);
|
||||
}
|
||||
******/
|
||||
|
||||
#define VIZLINKTABLE_CLASS_ID Class_ID(0xa20bbe82, 0x70c763d)
|
||||
|
||||
#define I_VIZLINKCONTROLLER (I_USERINTERFACE+0x1739)
|
||||
#define GetVizLinkTable(anim) ((IVizLinkTable*)anim->GetInterface(I_VIZLINKCONTROLLER))
|
||||
|
||||
#define kFILES_FORMAT -1
|
||||
|
||||
|
||||
class VizLinkList;
|
||||
class FormatRegistry;
|
||||
class FormatFactory;
|
||||
class LinkTableRecord;
|
||||
class LinkedObjectsEnum;
|
||||
class IFileLinkManager;
|
||||
|
||||
|
||||
// Interface to the underlying implementation. Also designed as
|
||||
// a Facade to the more complicated linking process.
|
||||
//
|
||||
class IVizLinkTable : public StdControl
|
||||
{
|
||||
public :
|
||||
typedef int Iterator;
|
||||
|
||||
// Access to the UI driver.
|
||||
virtual IFileLinkManager* GetFileLinkManager() = 0;
|
||||
|
||||
// If you pass in kFILES_FORMAT for the format argument, the format type will be
|
||||
// determined from the filename.
|
||||
virtual BOOL DoAttach(const TCHAR* filename,
|
||||
int format = 0,
|
||||
BOOL suppressPrompts = FALSE,
|
||||
BOOL readOnly = TRUE) = 0;
|
||||
virtual int NumLinkedFiles() const = 0;
|
||||
virtual bool GetLinkID(int i, Iterator& iter) const = 0;
|
||||
virtual bool DoReload(Iterator iter, BOOL suppressPrompts = FALSE) = 0;
|
||||
virtual bool DoDetach(Iterator iter) = 0;
|
||||
virtual bool DoBind(Iterator iter) = 0;
|
||||
virtual LinkTableRecord* RecordAt(IVizLinkTable::Iterator id) = 0;
|
||||
virtual bool ChangeLinkFile(Iterator iter, const TSTR& str) = 0;
|
||||
|
||||
// Auto-reload event handling.
|
||||
protected:
|
||||
friend class DBManUI;
|
||||
// Only DBManUI can turn this on and off.
|
||||
virtual void EnableAutoReload(bool enable) = 0;
|
||||
public:
|
||||
virtual void WaitForReloadThread() const = 0;
|
||||
|
||||
public:
|
||||
// List updating notification.
|
||||
virtual void RegisterForListUpdates(VizLinkList*) = 0;
|
||||
virtual void UnregisterForListUpdates(VizLinkList*) = 0;
|
||||
virtual void UpdateList() = 0;
|
||||
|
||||
// For iterating over all linked nodes.
|
||||
virtual void EnumerateLinkedObjects(LinkedObjectsEnum* EnumProc) = 0;
|
||||
|
||||
// Linked splines can be rendered.
|
||||
virtual void SetRenderSplines(BOOL b) = 0;
|
||||
virtual BOOL GetRenderSplines() const = 0;
|
||||
virtual BOOL SetSplineRenderThickness(float f) = 0;
|
||||
virtual float GetSplineRenderThickness() const = 0;
|
||||
virtual void SetGenUVs(BOOL b) = 0;
|
||||
virtual BOOL GetGenUVs() const = 0;
|
||||
virtual void SetShapeRenderFlags(Object *pObj) const = 0;
|
||||
|
||||
// If you are supporting a new format, register your factory class
|
||||
// here.
|
||||
virtual BOOL RegisterFactory(Class_ID& cid) = 0;
|
||||
virtual FormatRegistry* Registry() = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
// This interface provides access to some of the link manager's functions.
|
||||
class IFileLinkManager
|
||||
{
|
||||
public:
|
||||
// Select a file, prompt for settings, and link the file.
|
||||
virtual BOOL DoAttach(BOOL suppressPrompts = FALSE) = 0;
|
||||
|
||||
// Display the manager.
|
||||
virtual void OpenFileLinkManager(Interface* ip) = 0;
|
||||
// Enable/Disable the manager
|
||||
virtual void EnableFileLinkManager(BOOL enable) = 0;
|
||||
};
|
||||
|
||||
|
||||
// If you have a list that you want dynamically updated whenever a
|
||||
// linked file's status changes, derive your class from this, and
|
||||
// implement the inherited method(s). For example, a utility plugin
|
||||
// would derive from both UtilityObj and from VizLinkList.
|
||||
class VizLinkList
|
||||
{
|
||||
public:
|
||||
virtual void RefreshLinkedFileList() = 0;
|
||||
};
|
||||
|
||||
|
||||
#endif //FILELINKAPI_H
|
68
lib/maxsdk31/IAggregation.h
Executable file
68
lib/maxsdk31/IAggregation.h
Executable file
@ -0,0 +1,68 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: IAggregation.h
|
||||
|
||||
DESCRIPTION: Interface to object aggregation manager
|
||||
|
||||
CREATED BY: John Hutchinson
|
||||
|
||||
HISTORY: Created January 9, 1999
|
||||
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
#pragma once
|
||||
|
||||
// DESCRIPTION:
|
||||
// The IAggregation class is the interface class for representing
|
||||
// the process of object aggregation
|
||||
|
||||
//some constants passed to association class descriptors when editing parameters
|
||||
#define BEGIN_EDIT 1
|
||||
#define END_EDIT 2
|
||||
#define IMAGE_LOAD 3
|
||||
|
||||
typedef enum {eUncommitted,
|
||||
ePending,
|
||||
ePartial,
|
||||
eFully,
|
||||
eRejecting,
|
||||
eAborting}
|
||||
commitlevels;
|
||||
|
||||
typedef enum {eNoAffinity,
|
||||
eSuperClassAffinity,
|
||||
ePseudoSuperClassAffinity,
|
||||
eClassAffinity,
|
||||
eInterfaceAffinity,
|
||||
eInstanceAffinity}
|
||||
aggregationaffinity;
|
||||
|
||||
class IAggregation
|
||||
{
|
||||
public:
|
||||
virtual void SetActiveComplex(INode* node) = 0;
|
||||
virtual INode* GetActiveComplex() = 0;
|
||||
virtual void Reset() = 0;
|
||||
virtual bool SetProductFactory(SClass_ID superID, Class_ID classID) = 0;
|
||||
virtual bool RegisterIntermediateFactory(ClassDesc* cd, int affinity) = 0;
|
||||
virtual void ResetFactories() = 0;
|
||||
virtual IRollupWindow* GetParamRollup() = 0;
|
||||
virtual ClassDesc* GetSelClassDesc() const = 0;
|
||||
virtual Animatable* GetSelClassTemplate() = 0;
|
||||
virtual int ToolbarIndex(ClassDesc* cd) = 0;
|
||||
virtual HIMAGELIST ToolbarImagelist(int which) = 0;
|
||||
virtual bool RegisterAssocClass(ClassDesc* cd, int whichbar, int ioe_idx, int iod_idx, int iie_idx, int iid_idx) = 0;
|
||||
virtual int CommitAggregation(int action, int flag) = 0;
|
||||
virtual void Suspend() = 0;
|
||||
virtual void Resume() = 0;
|
||||
virtual bool isSuspended() = 0;
|
||||
virtual INode* ReactToNode(INode* newnode) = 0;
|
||||
virtual commitlevels Status() = 0;
|
||||
};
|
||||
|
||||
class ValenceData
|
||||
{
|
||||
public:
|
||||
ValenceData():m_type(0){};
|
||||
int m_type;
|
||||
};
|
79
lib/maxsdk31/IComponent.h
Executable file
79
lib/maxsdk31/IComponent.h
Executable file
@ -0,0 +1,79 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: IComponent.h
|
||||
|
||||
DESCRIPTION: An interface representing the composite pattern.
|
||||
|
||||
CREATED BY: John Hutchinson
|
||||
|
||||
HISTORY: created 9/1/98
|
||||
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
#ifndef _ICOMP
|
||||
#define _ICOMP
|
||||
|
||||
/*
|
||||
The composite pattern relies on a common interface for leaves and composites.
|
||||
This class embodies that commonality. Classes which realize this interface
|
||||
will generally be of two forms: composites and leaves. A composite will
|
||||
implement its methods by iterating over its components and making a recursive
|
||||
call. A leaf will actually do something.
|
||||
|
||||
*/
|
||||
class ComponentIterator;
|
||||
class INode;
|
||||
class Object;
|
||||
|
||||
class IComponent {
|
||||
public:
|
||||
virtual void DisposeTemporary() = 0;
|
||||
virtual void Remove(ComponentIterator& c) = 0;
|
||||
virtual void Add(TimeValue t, Object* obj, TSTR objname, Matrix3& oppTm, Matrix3& boolTm, Matrix3& parTM, Control* opCont = NULL) = 0;
|
||||
virtual void Add(TimeValue t, INode *node, Matrix3& boolTm, bool delnode = true) = 0;
|
||||
|
||||
virtual ComponentIterator * MakeIterator() /*const*/ = 0;
|
||||
virtual ComponentIterator * MakeReverseIterator() /*const*/ = 0;
|
||||
|
||||
virtual Object* MakeLeaf(Object* o) = 0;
|
||||
virtual bool IsLeaf() const = 0;
|
||||
|
||||
virtual void SelectOp(int which, BOOL selected) = 0;
|
||||
virtual void ClearSelection() = 0;
|
||||
virtual int GetSubSelectionCount() = 0;
|
||||
};
|
||||
|
||||
|
||||
class ComponentIterator {
|
||||
public:
|
||||
virtual void First() = 0;
|
||||
virtual void Next() = 0;
|
||||
virtual bool IsDone() /*const*/ = 0; //Should be const but we want to call nonconst methods from within
|
||||
virtual int SubObjIndex() = 0;
|
||||
virtual IComponent* GetComponent(void** ipp = NULL, ULONG iid = I_BASEOBJECT) const = 0;
|
||||
//Note: this object may be dynamically allocated. Calls must
|
||||
//be matched with calls to DisposeTemporary()
|
||||
|
||||
virtual Object* GetComponentObject() const = 0;
|
||||
virtual INode* GetComponentINode(INode *node) const = 0;
|
||||
virtual void DisposeComponentINode(INode *node) const = 0;
|
||||
virtual Control* GetComponentControl() const = 0;//This need not be released
|
||||
virtual bool Selected() const = 0;//is the corresponding component selected?
|
||||
virtual bool Hidden() const = 0;//is the corresponding component hidden?
|
||||
virtual void DeleteThis() = 0;
|
||||
|
||||
//JH 4/12/99 Adding some methods for better display control
|
||||
virtual bool WantsDisplay(DWORD flags) = 0;
|
||||
virtual Point3 DisplayColor(DWORD flags, INode* n = NULL, GraphicsWindow* gw = NULL) = 0;
|
||||
protected:
|
||||
virtual bool ValidIndex(int which) const = 0;
|
||||
};
|
||||
|
||||
class CompositeClassDesc: public ClassDesc
|
||||
{
|
||||
public:
|
||||
virtual int NumValenceTypes(){return 0;}
|
||||
virtual Class_ID GetValenceClassID(int which) {return Class_ID(0,0);}
|
||||
};
|
||||
|
||||
#endif //_ICOMP
|
341
lib/maxsdk31/IGeomImp.h
Executable file
341
lib/maxsdk31/IGeomImp.h
Executable file
@ -0,0 +1,341 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: IGeomImp.h
|
||||
|
||||
DESCRIPTION: Declaration of the interface which a puppet must implement.
|
||||
A puppet is essentially a geometry machine with a series of
|
||||
set poses and operations.
|
||||
CREATED BY: John Hutchinson
|
||||
|
||||
HISTORY: Dec 9, 1997
|
||||
|
||||
*> Copyright (c) 1997, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
#ifndef __IGEOMPUPPET_H
|
||||
#define __IGEOMPUPPET_H
|
||||
#include "export.h"
|
||||
#include <windows.h>
|
||||
#include "maxtypes.h"
|
||||
|
||||
//FIX ME
|
||||
//THis should not depend on GE
|
||||
//but for now we use some of its classes
|
||||
class AcGePoint3d;
|
||||
class AcGeVector3d;
|
||||
class AcGePlane;
|
||||
class AcGePoint2d;
|
||||
class AcGeVector2d;
|
||||
|
||||
|
||||
#define OP_TIMING
|
||||
|
||||
//FIX ME
|
||||
//This shouldn't depend on amodeler
|
||||
//but for now we use some of its classes
|
||||
//JH 3/9/99 Removing references to vertexdata
|
||||
//#include "../msdkamodeler/inc/vertdata.h"
|
||||
|
||||
//need the mesh class for TriangulateMesh
|
||||
#include "max.h"
|
||||
class INode;
|
||||
class ViewExp;
|
||||
|
||||
extern inline AcGePoint3d* MaxArToGeAr(const Point3* maxPt, int numverts);
|
||||
|
||||
#define MAX_MESH_ID 0x00000001
|
||||
#define AMODELER_BODY_ID 0x00000002
|
||||
class OpTimer;
|
||||
class IGeomImp {
|
||||
protected:
|
||||
|
||||
public:
|
||||
static DllExport OpTimer opstatistics; //exported from core, initialized in hostcomp.cpp
|
||||
//access to the actual internal geometry representation
|
||||
// virtual void SetInternalRepresentation(LONG RepID, void *rep);
|
||||
virtual void Init(void *prep = NULL, LONG RepID = -1) = 0;
|
||||
virtual void *GetInternalRepresentation(LONG RepID, bool* needsdelete)= 0;// access to the wrapped cache
|
||||
virtual LONG NativeRepresentationID() = 0;
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// pseudoconstructors
|
||||
//
|
||||
//JH In the process of overloading these for ease of use in MAX 03/26/99
|
||||
|
||||
virtual bool createBox(const Point3& p) = 0;
|
||||
virtual bool createBox(const AcGePoint3d& p, const AcGeVector3d& vec) = 0;
|
||||
|
||||
virtual bool createSphere(float radius, int sides, BOOL smooth = TRUE) = 0;
|
||||
virtual bool createSphere(const AcGePoint3d& p, double radius, int approx) = 0;
|
||||
|
||||
virtual bool createCylinder(float height, float radius, int sides , BOOL smooth = TRUE) = 0;
|
||||
virtual bool createCylinder(const AcGePoint3d& axisStart, const AcGePoint3d& axisEnd,
|
||||
double radius, int approx) = 0;
|
||||
|
||||
virtual bool createCone(float height, float radius1, float radius2, int sides , BOOL smooth = TRUE) = 0;
|
||||
virtual bool createCone(const AcGePoint3d& axisStart, const AcGePoint3d& axisEnd,
|
||||
const AcGeVector3d& baseNormal, double radius1, double radius2, int approx) = 0;
|
||||
|
||||
virtual bool createPipe(float height, float radius1, float radius2, int sides , BOOL smooth = TRUE) = 0;
|
||||
virtual bool createPipe(const AcGePoint3d& axisStart, const AcGePoint3d& axisEnd,
|
||||
const AcGeVector3d& baseNormal,
|
||||
double dblOuterRadius, double dblInnerRadius,
|
||||
int approx) = 0;
|
||||
|
||||
virtual void createPipeConic(const AcGePoint3d& axisStart, const AcGePoint3d& axisEnd,
|
||||
const AcGeVector3d& baseNormal,
|
||||
double outterRadius1, double innerRadius1,
|
||||
double outterRadius2, double innerRadius2,
|
||||
int approx) = 0;
|
||||
|
||||
virtual void createTetrahedron(const AcGePoint3d& p1, const AcGePoint3d& p2,
|
||||
const AcGePoint3d& p3, const AcGePoint3d& p4) = 0;
|
||||
|
||||
virtual bool createTorus(float majorRadius, float minorRadius, int sidesa, int segs, BOOL smooth = TRUE) = 0;
|
||||
virtual bool createTorus(const AcGePoint3d& axisStart, const AcGePoint3d& axisEnd,
|
||||
double majorRadius, double minorRadius, int majorApprox, int minorApprox) = 0;
|
||||
/*
|
||||
virtual void createReducingElbow(const AcGePoint3d& elbowCenter, const AcGePoint3d& endCenter1,
|
||||
const AcGePoint3d& endCenter2, double endRadius1, double endRadius2,
|
||||
int majorApprox, int minorApprox) = 0;
|
||||
virtual void createRectToCircleReducer(
|
||||
const AcGePoint3d& baseCorner,
|
||||
const AcGeVector2d& baseSizes,
|
||||
const AcGePoint3d& circleCenter,
|
||||
const AcGeVector3d& circleNormal,
|
||||
double circleRadius,
|
||||
int approx) = 0;
|
||||
*/
|
||||
virtual bool createConvexHull(const AcGePoint3d vertices[], int numVertices) = 0;
|
||||
virtual bool createConvexHull(const Point3 vertices[], int numVertices) = 0;
|
||||
|
||||
// Create a body consisting of one face
|
||||
//
|
||||
/*
|
||||
virtual void createFace(const AcGePoint3d vertices[], AModeler::PolygonVertexData* vertexData[],
|
||||
int numVertices, const AcGeVector3d &normal) = 0;
|
||||
*/
|
||||
virtual void createFace(const AcGePoint3d vertices[], int numVertices, BOOL smooth = TRUE) = 0;
|
||||
|
||||
//The boolean operators
|
||||
virtual void prepBoolean() = 0;
|
||||
virtual void operator +=(IGeomImp& b) = 0;
|
||||
virtual void operator -=(IGeomImp& b) = 0;
|
||||
virtual void operator *=(IGeomImp& b) = 0;
|
||||
virtual int interfere (IGeomImp& b) = 0;
|
||||
|
||||
//combination
|
||||
virtual bool Combine(IGeomImp& b) = 0;
|
||||
|
||||
//assignment
|
||||
virtual IGeomImp& operator =(IGeomImp& b) = 0;
|
||||
|
||||
|
||||
// The section method removes part of the body in the positive halfplane
|
||||
//
|
||||
virtual void section(const Matrix3& tm) = 0;
|
||||
virtual void section(const AcGePlane& p) = 0;
|
||||
|
||||
// Sweeps
|
||||
//
|
||||
virtual bool createPyramid(float width, float depth, float height)=0;
|
||||
virtual bool createPyramid(
|
||||
const AcGePoint3d vertices[],
|
||||
// AModeler::PolygonVertexData* vertexData[],
|
||||
int numVertices,
|
||||
const AcGeVector3d &plgNormal,
|
||||
const AcGePoint3d &apex) = 0;
|
||||
|
||||
// virtual bool createExtrusion(const Point3 vertices[], int numVertices, const float height )=0;
|
||||
virtual bool createExtrusion(
|
||||
PolyPt vertices[],
|
||||
int numVertices,
|
||||
const float height,
|
||||
const BOOL smooth,
|
||||
const BOOL genMatIDs,
|
||||
const BOOL useShapeIDs)=0;
|
||||
|
||||
virtual bool createExtrusion(
|
||||
const AcGePoint3d vertices[],
|
||||
// AModeler::PolygonVertexData* vertexData[],
|
||||
int numVertices,
|
||||
const AcGeVector3d &plgNormal,
|
||||
const AcGeVector3d &extusionVector,
|
||||
const AcGePoint3d &fixedPt,
|
||||
double scaleFactor,
|
||||
double twistAngle) = 0;
|
||||
|
||||
virtual void createAxisRevolution(
|
||||
const AcGePoint3d vertices[],
|
||||
// AModeler::PolygonVertexData* vertexData[],
|
||||
int numVertices,
|
||||
const AcGeVector3d &normal,
|
||||
const AcGePoint3d &axisStart,
|
||||
const AcGePoint3d &axisEnd,
|
||||
double revolutionAngle,
|
||||
int approx,
|
||||
const AcGePoint3d &fixedPt,
|
||||
double scaleFactor,
|
||||
double twistAngle) = 0;
|
||||
|
||||
virtual void createEndpointRevolution(
|
||||
const AcGePoint3d vertices[],
|
||||
// AModeler::PolygonVertexData* vertexData[],
|
||||
int numVertices,
|
||||
const AcGeVector3d &normal,
|
||||
double revolutionAngle,
|
||||
int approx)=0;
|
||||
/*
|
||||
void createSkin(
|
||||
AsdkBody* profiles[],
|
||||
int numProfiles,
|
||||
bool isClosed,
|
||||
MorphingMap* morphingMaps[]);
|
||||
*/
|
||||
|
||||
virtual void createExtrusionAlongPath(
|
||||
const AcGePoint3d vertices[],
|
||||
// AModeler::PolygonVertexData* vertexData[],
|
||||
int numVerticesm,
|
||||
bool pathIsClosed,
|
||||
bool bCheckValidity,
|
||||
const AcGePoint3d &scaleTwistFixedPt,
|
||||
double scaleFactor,
|
||||
double twistAngle,
|
||||
const AcGeVector3d &extusionVector) = 0;
|
||||
|
||||
virtual void createWallCorner(
|
||||
const AcGePoint2d& pt1, // Start of wall 1
|
||||
const AcGePoint2d& pt2, // End of wall 1, start of wall 2
|
||||
const AcGePoint2d& pt3, // End of wall 2
|
||||
bool materialToTheLeft,
|
||||
double width1, // Wall 1 width
|
||||
double width2, // Wall 2 width
|
||||
double height, // Wall height
|
||||
AcGePlane& matingPlane1,
|
||||
AcGePlane& matingPlane2,
|
||||
bool& wall1NeedsToBeSectioned,
|
||||
bool& wall2NeedsToBeSectioned) = 0;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// transforms
|
||||
//
|
||||
|
||||
virtual void transform(Matrix3 & mat, bool override_locks = true) = 0;
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// triangulation
|
||||
//
|
||||
|
||||
|
||||
// Saves the triangles directly to a Mesh //
|
||||
virtual void triangulateMesh(TimeValue t, Mesh& m,
|
||||
TesselationType type = kTriangles, bool cacheTriangles = true) = 0;
|
||||
|
||||
/* TO DO
|
||||
// saves the triangle back to the callback object
|
||||
virtual void triangulate (TimeValue t, OutputTriangleCallback*,
|
||||
TriangulationType type = kGenerateTriangles, bool cacheTriangles = true) = 0;
|
||||
*/
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// display
|
||||
//
|
||||
virtual void Display(TimeValue t, INode* inode, ViewExp *vpt, int flags) = 0;
|
||||
virtual void Invalidate() = 0;
|
||||
|
||||
//Validity
|
||||
virtual bool isNull() = 0;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copy
|
||||
//
|
||||
virtual IGeomImp * Copy(void) = 0;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// BondingBox methods
|
||||
//
|
||||
virtual void GetDeformBBox(TimeValue t, Box3& box, Matrix3 *tm=NULL, BOOL useSel=FALSE ) = 0;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Constraining transform
|
||||
//
|
||||
virtual bool GetTransformLock(int type, int axis) = 0;
|
||||
virtual void SetTransformLock(int type, int axis, BOOL onOff) = 0;
|
||||
};
|
||||
|
||||
//#ifdef IMPORTING
|
||||
//#error
|
||||
//#endif
|
||||
|
||||
#define HIRES
|
||||
|
||||
class OpTimer: public MeshOpProgress
|
||||
{
|
||||
private:
|
||||
#ifdef HIRES
|
||||
LARGE_INTEGER opstart;
|
||||
LARGE_INTEGER optime;
|
||||
LARGE_INTEGER cumtime;
|
||||
LARGE_INTEGER res;
|
||||
#else
|
||||
int opstart, optime, cumtime;
|
||||
#endif
|
||||
int m_errorcode;
|
||||
int m_errcount;
|
||||
int m_opcount;
|
||||
TSTR curopname;
|
||||
public:
|
||||
//From MeshOpProgress
|
||||
OpTimer():m_errorcode(0), m_opcount(0){curopname = "??";}
|
||||
void Init(int total)
|
||||
{
|
||||
++m_opcount;
|
||||
m_errorcode = 0;
|
||||
|
||||
#ifdef HIRES
|
||||
QueryPerformanceFrequency(&res);
|
||||
optime.QuadPart = 0;
|
||||
QueryPerformanceCounter(&opstart);
|
||||
#else
|
||||
opstart = GetTickCount();
|
||||
#endif
|
||||
}
|
||||
BOOL Progress(int p)
|
||||
{
|
||||
#ifdef HIRES
|
||||
LARGE_INTEGER opnow;
|
||||
QueryPerformanceCounter(&opnow);
|
||||
cumtime.QuadPart += (opnow.QuadPart - (opstart.QuadPart + optime.QuadPart));
|
||||
optime.QuadPart = opnow.QuadPart - opstart.QuadPart;
|
||||
#else
|
||||
integer opnow = GetTickCount();
|
||||
cumtime += (opnow - (opstart + optime));
|
||||
optime = opnow - opstart;
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
void OutputMetrics(HWND hDlg);
|
||||
void InitName(char *opname){curopname = opname;}
|
||||
void ExtendName(char *opname){curopname += opname;}
|
||||
void FlagError(int errcode = 999){m_errorcode = errcode;++m_errcount;}
|
||||
void Reset(){
|
||||
m_errcount = 0; m_opcount=0;
|
||||
#ifdef HIRES
|
||||
cumtime.QuadPart = 0;
|
||||
#else
|
||||
optime = 0;
|
||||
#endif
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
extern "C" __declspec(dllexport) IGeomImp* CreateAmodelerBody();
|
||||
extern "C" __declspec(dllexport) IGeomImp* CreateMeshAdapter();
|
||||
#endif //__IGEOMPUPPET_H
|
30
lib/maxsdk31/IGuest.h
Executable file
30
lib/maxsdk31/IGuest.h
Executable file
@ -0,0 +1,30 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: IGuest.h
|
||||
|
||||
DESCRIPTION: Declares Host/Guest protocol
|
||||
|
||||
CREATED BY: John Hutchinson
|
||||
|
||||
HISTORY: Created April 24, 1999
|
||||
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
#pragma once
|
||||
|
||||
class IGeomImp;
|
||||
class IHost;
|
||||
|
||||
class IGuest
|
||||
{
|
||||
public:
|
||||
virtual void rsvp(IHost* host, IGeomImp* return_envelope, Matrix3& tm) = 0;
|
||||
};
|
||||
|
||||
|
||||
class IHost
|
||||
{
|
||||
public:
|
||||
virtual void accomodate(IGeomImp* guestrep, Matrix3 &tm, HitRecord *rec = NULL) = 0;
|
||||
virtual bool locate(INode *host, Control *c, Matrix3 &oldP, Matrix3 &newP) = 0;
|
||||
};
|
123
lib/maxsdk31/ILayer.h
Executable file
123
lib/maxsdk31/ILayer.h
Executable file
@ -0,0 +1,123 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: ILayer.h
|
||||
|
||||
DESCRIPTION: Declaration of the ILayer interface
|
||||
|
||||
CREATED BY: Peter Sauerbrei
|
||||
|
||||
HISTORY: Created 19 October 1998
|
||||
|
||||
*> Copyright (c) 1998-99, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#pragma once
|
||||
#ifndef __ILAYER_H__
|
||||
#define __ILAYER_H__
|
||||
#include <maxtypes.h>
|
||||
|
||||
class LayerProperty : public ReferenceTarget
|
||||
{
|
||||
private:
|
||||
int m_id;
|
||||
TSTR m_name;
|
||||
|
||||
public:
|
||||
LayerProperty() : m_id(-1), m_name("") {}
|
||||
LayerProperty(const TSTR & name, int id) : m_id(id), m_name(name) {}
|
||||
virtual ~LayerProperty() {}
|
||||
|
||||
// child methods
|
||||
virtual void SetProperty(const int d) = 0;
|
||||
virtual void SetProperty(const float d) = 0;
|
||||
virtual void SetProperty(const Point3 & d) = 0;
|
||||
virtual void SetProperty(const TSTR & d) = 0;
|
||||
virtual void SetProperty(void * d) = 0;
|
||||
virtual bool GetProperty(int & i) const = 0;
|
||||
virtual bool GetProperty(float & f) const = 0;
|
||||
virtual bool GetProperty(Point3 & p) const = 0;
|
||||
virtual bool GetProperty(TSTR & n) const = 0;
|
||||
virtual bool GetProperty(void * v) const = 0;
|
||||
|
||||
// local methods
|
||||
int GetID() const { return m_id; }
|
||||
void SetID(int id) { m_id = id; }
|
||||
TSTR GetName() const { return m_name; }
|
||||
void SetName(const TSTR & name) { m_name = name; }
|
||||
};
|
||||
|
||||
class ILayer : public ReferenceTarget
|
||||
{
|
||||
public:
|
||||
static const SClass_ID kLayerSuperClassID;
|
||||
|
||||
// from Animatable
|
||||
SClass_ID SuperClassID() { return kLayerSuperClassID; }
|
||||
|
||||
// from ILayerRecord
|
||||
virtual bool AddToLayer(INode * rtarg) = 0;
|
||||
virtual bool DeleteFromLayer(INode * rtarg) = 0;
|
||||
virtual void SetName(const TSTR & name) = 0;
|
||||
virtual TSTR GetName() const = 0; // user must delete the string
|
||||
virtual void SetWireColor(DWORD newcol) = 0;
|
||||
virtual DWORD GetWireColor() const = 0;
|
||||
virtual void Hide(bool onOff) = 0;
|
||||
virtual bool IsHidden() const = 0;
|
||||
virtual void Freeze(bool onOff) = 0;
|
||||
virtual bool IsFrozen() const = 0;
|
||||
virtual void SetRenderable(bool onOff) = 0;
|
||||
virtual bool Renderable() const = 0;
|
||||
virtual void XRayMtl(bool onOff) = 0;
|
||||
virtual bool HasXRayMtl() const = 0;
|
||||
virtual void IgnoreExtents(bool onOff) = 0;
|
||||
virtual bool GetIgnoreExtents() const = 0;
|
||||
virtual void BoxMode(bool onOff) = 0;
|
||||
virtual bool GetBoxMode() const = 0;
|
||||
virtual void AllEdges(bool onOff) = 0;
|
||||
virtual bool GetAllEdges() const = 0;
|
||||
virtual void VertTicks(bool onOff) = 0;
|
||||
virtual bool GetVertTicks() const = 0;
|
||||
virtual void BackCull(bool onOff) = 0;
|
||||
virtual bool GetBackCull() const = 0;
|
||||
virtual void SetCVertMode(bool onOff) = 0;
|
||||
virtual bool GetCVertMode() const = 0;
|
||||
virtual void SetShadeCVerts(bool onOff) = 0;
|
||||
virtual bool GetShadeCVerts() const = 0;
|
||||
virtual void SetCastShadows(bool onOff) = 0;
|
||||
virtual bool CastShadows() const = 0;
|
||||
virtual void SetRcvShadows(bool onOff) = 0;
|
||||
virtual bool RcvShadows() const = 0;
|
||||
virtual void SetMotBlur(int kind) = 0;
|
||||
virtual int MotBlur() const = 0;
|
||||
virtual int GetRenderFlags() const = 0;
|
||||
virtual void SetRenderFlags(int flags) = 0;
|
||||
virtual int GetDisplayFlags() const = 0;
|
||||
virtual int AddProperty(LayerProperty & lprop) = 0;
|
||||
virtual int SetProperty(LayerProperty & lprop) = 0;
|
||||
virtual int GetProperty(LayerProperty & lprop) const = 0;
|
||||
virtual bool Used(void) const = 0;
|
||||
virtual bool GetFlag(int mask) const = 0;
|
||||
virtual bool GetFlag2(int mask) const = 0;
|
||||
virtual void UpdateSelectionSet(void) = 0;
|
||||
#ifdef DESIGN_VER
|
||||
virtual void SetInheritVisibility(bool onOff) = 0;
|
||||
virtual bool GetInheritVisibility() const = 0;
|
||||
virtual void Trajectory(bool onOff, bool temp = false) = 0;
|
||||
virtual bool GetTrajectory() const = 0;
|
||||
virtual void SetDisplayByLayer(BOOL onOff, INode *) = 0;
|
||||
virtual void SetRenderByLayer(BOOL onOff, INode *) = 0;
|
||||
virtual void SetMotionByLayer(BOOL onOff, INode *) = 0;
|
||||
virtual void SelectObjects(void) = 0;
|
||||
virtual void SetVisibility(TimeValue t, float vis) = 0;
|
||||
virtual float GetVisibility(TimeValue t,Interval *valid=NULL) = 0;
|
||||
virtual float GetVisibility(TimeValue t,View & view, Interval *valid=NULL) = 0;
|
||||
virtual float GetImageBlurMultiplier(TimeValue t) = 0;
|
||||
virtual void SetImageBlurMultiplier(TimeValue t, float m) = 0;
|
||||
virtual bool GetMotBlurOnOff(TimeValue t) = 0;
|
||||
virtual void SetMotBlurOnOff(TimeValue t, bool m) = 0;
|
||||
virtual bool IsHiddenByVisControl() = 0;
|
||||
virtual float GetLocalVisibility(TimeValue t,Interval *valid) = 0;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
55
lib/maxsdk31/ILayerManager.h
Executable file
55
lib/maxsdk31/ILayerManager.h
Executable file
@ -0,0 +1,55 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: ILayerManager.h
|
||||
|
||||
DESCRIPTION: Declaration of the ILayerManager interface
|
||||
|
||||
CREATED BY: Peter Sauerbrei
|
||||
|
||||
HISTORY: Created 19 October 1998
|
||||
|
||||
*> Copyright (c) 1998-99, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#pragma once
|
||||
#ifndef __ILAYERMANAGER_H__
|
||||
#define __ILAYERMANAGER_H__
|
||||
#include <ILayer.h>
|
||||
|
||||
class LayerIterator;
|
||||
class ConstLayerIterator;
|
||||
|
||||
class ILayerManager : public ReferenceTarget
|
||||
{
|
||||
public:
|
||||
static const SClass_ID kLayerManagerSuperClassID;
|
||||
|
||||
// from Animatable
|
||||
SClass_ID SuperClassID() { return kLayerManagerSuperClassID; }
|
||||
|
||||
// local methods
|
||||
virtual bool AddLayer(ILayer * layer) = 0;
|
||||
virtual void CreateLayer(void) = 0; // creates a new layer
|
||||
virtual void DeleteLayer(const TSTR & name) = 0; // deletes a layer
|
||||
virtual void SetCurrentLayer(const TSTR & name) = 0; // sets the current layer
|
||||
virtual void SetCurrentLayer(void) = 0;
|
||||
virtual ILayer * GetCurrentLayer(void) const = 0; // gets the current layer
|
||||
virtual void EditLayer(const TSTR & name) = 0;
|
||||
virtual void DoLayerPropDialog(HWND hWnd) = 0;
|
||||
virtual LayerIterator * MakeIterator(void) = 0;
|
||||
virtual ConstLayerIterator * MakeConstIterator(void) const = 0;
|
||||
virtual int GetLayerCount(void) = 0;
|
||||
virtual ILayer * GetLayer(const TSTR & name) const = 0;
|
||||
virtual void DoLayerSelDialog(HWND hWnd) = 0;
|
||||
virtual void SetupToolList(HWND hWnd) = 0;
|
||||
virtual void ExtendMenu(HMENU hMenu, bool geometry = true, bool grid = false) = 0;
|
||||
virtual TSTR GetSavedLayer(int i) const = 0;
|
||||
virtual ILayer * GetRootLayer() const = 0;
|
||||
virtual void Reset(BOOL fileReset = FALSE) = 0;
|
||||
#ifdef DESIGN_VER
|
||||
virtual ILayer * CreateLayer2(void) = 0;
|
||||
virtual void SelectObjectsByLayer(HWND hWnd) = 0;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
78
lib/maxsdk31/IReagent.h
Executable file
78
lib/maxsdk31/IReagent.h
Executable file
@ -0,0 +1,78 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: IReagent.h
|
||||
|
||||
DESCRIPTION: Declares a class of objects which react
|
||||
|
||||
CREATED BY: John Hutchinson
|
||||
|
||||
HISTORY: Created January 9, 1999
|
||||
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
#pragma once
|
||||
|
||||
#include <IAggregation.h>
|
||||
class IAggregation;
|
||||
class IGeomImp;
|
||||
class IValence;
|
||||
class ValenceDescIterator;
|
||||
class IHost;
|
||||
|
||||
class IReagent
|
||||
{
|
||||
public:
|
||||
//completes the construction process
|
||||
virtual void InitializeSubstrate(INode* n) = 0;//completes the construction process
|
||||
|
||||
virtual IValence* OpenValence() = 0;
|
||||
virtual void OpenValenceTM(TimeValue t, Matrix3& tm)= 0;
|
||||
virtual void CloseValence(IValence* val, bool done = false)= 0;
|
||||
virtual int NumValenceTypes() = 0;
|
||||
virtual Class_ID GetValenceClassID(int which) = 0;
|
||||
//create a valence given a class descriptor and a node(used for its location)
|
||||
//may create a new instance of this type
|
||||
virtual IValence* PrepValence(ClassDesc* cd, INode* me, INode* loc) = 0;
|
||||
|
||||
//pass back the chemistry/geometry of the reagent viz-a-viz the current reaction
|
||||
//Thus this excludes any pending reaction results.
|
||||
//Currently we assumes one reaction at a time. Could pass a valence to identify which.
|
||||
virtual IGeomImp* ReactionSite() = 0;
|
||||
};
|
||||
|
||||
|
||||
class IValence
|
||||
{
|
||||
public:
|
||||
enum bondtype {
|
||||
eStrongBond,//absorb the node
|
||||
eWeakBond,//don't absorb the node
|
||||
eTransientBond,//temporary but affect permanaent change to object stack
|
||||
eTopicalBond};//unused but coneptually a weaker type of transient bonds which just copy node properties
|
||||
|
||||
//set up a controller and possibly record subobj hit data from the host
|
||||
virtual Control* Locate(INode* host, Control* c, Matrix3& oldP, Matrix3& newP) = 0;//may clone the controller
|
||||
virtual commitlevels Occupy(Object* obj) = 0;
|
||||
virtual Object* Occupant()=0;
|
||||
virtual bool Bind(TimeValue t, IGeomImp &complex_geom, Matrix3& tm, Interval iv, IHost* attentivehost = NULL) = 0;
|
||||
virtual commitlevels Validate(TimeValue t, int action, commitlevels current, Matrix3* tm) = 0;
|
||||
virtual bondtype BondStrength()=0;
|
||||
virtual void SetOwner(Object* owner)=0;
|
||||
};
|
||||
|
||||
/*
|
||||
class ValenceDescIterator
|
||||
{
|
||||
public:
|
||||
ValenceDescIterator();
|
||||
~ValenceDescIterator();
|
||||
|
||||
Class_ID First();
|
||||
virtual bool IsDone();
|
||||
Class_ID Next();
|
||||
private:
|
||||
int m_current;
|
||||
};
|
||||
*/
|
||||
//mechanism to test compatibility needs to be done at the class descriptor level.
|
||||
//Since this is what gets enumerated at the point prio to the valence getting created.
|
55
lib/maxsdk31/IRefArray.h
Executable file
55
lib/maxsdk31/IRefArray.h
Executable file
@ -0,0 +1,55 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: IRefArray.h
|
||||
|
||||
DESCRIPTION: An interface to facilitate maintaining multiple arrays of references.
|
||||
|
||||
CREATED BY: John Hutchinson
|
||||
|
||||
HISTORY: created 9/1/98
|
||||
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
#pragma once
|
||||
#ifndef _IREFARRAY
|
||||
#define _IREFARRAY
|
||||
|
||||
//Forward declarations
|
||||
typedef Tab<ReferenceTarget*> ReferenceArray;
|
||||
|
||||
|
||||
|
||||
|
||||
class IRefArray {
|
||||
public :
|
||||
virtual int NumRefCols() const = 0; // The size of my arrays (same size!)
|
||||
virtual int NumRefRows() const = 0; // The number of arrays I maintain including inner
|
||||
virtual void EnlargeAndInitializeArrays(int newsize) = 0; //allocator
|
||||
virtual ReferenceArray& RefRow(int which)= 0; //access to the rows
|
||||
virtual const ReferenceArray& RefRow(int which) const = 0; //const version of above
|
||||
|
||||
protected:
|
||||
virtual int TotalRefs() const = 0; // Equivalent of NumRefs
|
||||
|
||||
virtual IRefArray* Inner() = 0; //PI Access to the containee
|
||||
virtual const IRefArray* Inner() const = 0; //PI Access to the containee
|
||||
virtual int InnerArrays() const = 0; //the number of arrays in any containee
|
||||
virtual int Remap(int row, int col) const = 0; //Converts an index for processing by the inner
|
||||
|
||||
virtual int ArrayOffset() const = 0; // the number of special (non-array) references
|
||||
virtual bool IsSubArrayIndex(int i) const = 0;
|
||||
virtual RefTargetHandle GetSubArrayReference(int i) = 0;//
|
||||
virtual void SetSubArrayReference(int i, RefTargetHandle rtarg) = 0;
|
||||
|
||||
public:
|
||||
//Referencemaker overloads
|
||||
virtual RefTargetHandle GetReference(int row, int col) = 0;
|
||||
virtual void SetReference(int row, int col, RefTargetHandle rtarg) = 0;
|
||||
virtual RefResult MakeRefByID(Interval refInterval, int row, int col, RefTargetHandle rtarg) = 0;
|
||||
virtual RefResult ReplaceReference(int row, int col, RefTargetHandle newtarg, BOOL delOld=TRUE) = 0;
|
||||
virtual RefResult DeleteReference(int row, int col) = 0;
|
||||
virtual BOOL CanTransferReference(int row, int col) = 0;
|
||||
virtual bool FindRef(RefTargetHandle rtarg, int& row, int& col) = 0;
|
||||
virtual void CloneRefs(ReferenceMaker *, RemapDir& remap) = 0;
|
||||
};
|
||||
#endif //_IREFARRAY
|
95
lib/maxsdk31/ISkin.h
Executable file
95
lib/maxsdk31/ISkin.h
Executable file
@ -0,0 +1,95 @@
|
||||
/**********************************************************************
|
||||
|
||||
FILE: ISkin.h
|
||||
|
||||
DESCRIPTION: Skin Bone Deformer API
|
||||
|
||||
CREATED BY: Nikolai Sander, Discreet
|
||||
|
||||
HISTORY: 7/12/99
|
||||
|
||||
|
||||
*> Copyright (c) 1998, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __ISKIN__H
|
||||
#define __ISKIN__H
|
||||
|
||||
#include "ISkinCodes.h"
|
||||
|
||||
#define I_SKIN 0x00010000
|
||||
|
||||
#define SKIN_INVALID_NODE_PTR 0
|
||||
#define SKIN_OK 1
|
||||
|
||||
//#define SKIN_CLASSID Class_ID(0x68477bb4, 0x28cf6b86)
|
||||
#define SKIN_CLASSID Class_ID(9815843,87654)
|
||||
|
||||
class ISkinContextData
|
||||
{
|
||||
public:
|
||||
virtual int GetNumPoints()=0;
|
||||
virtual int GetNumAssignedBones(int vertexIdx)=0;
|
||||
virtual int GetAssignedBone(int vertexIdx, int boneIdx)=0;
|
||||
virtual float GetBoneWeight(int vertexIdx, int boneIdx)=0;
|
||||
|
||||
// These are only used for Spline animation
|
||||
virtual int GetSubCurveIndex(int vertexIdx, int boneIdx)=0;
|
||||
virtual int GetSubSegmentIndex(int vertexIdx, int boneIdx)=0;
|
||||
virtual float GetSubSegmentDistance(int vertexIdx, int boneIdx)=0;
|
||||
virtual Point3 GetTangent(int vertexIdx, int boneIdx)=0;
|
||||
virtual Point3 GetOPoint(int vertexIdx, int boneIdx)=0;
|
||||
|
||||
};
|
||||
|
||||
class ISkin
|
||||
{
|
||||
public:
|
||||
virtual int GetBoneInitTM(INode *pNode, Matrix3 &InitTM, bool bObjOffset = false)=0;
|
||||
virtual int GetSkinInitTM(INode *pNode, Matrix3 &InitTM, bool bObjOffset = false)=0;
|
||||
virtual int GetNumBones()=0;
|
||||
virtual INode *GetBone(int idx)=0;
|
||||
virtual DWORD GetBoneProperty(int idx)=0;
|
||||
virtual ISkinContextData *GetContextInterface(INode *pNode)=0;
|
||||
|
||||
};
|
||||
/*
|
||||
Modifier* FindSkinModifier (INode* node)
|
||||
{
|
||||
// Get object from node. Abort if no object.
|
||||
Object* pObj = node->GetObjectRef();
|
||||
|
||||
|
||||
if (!pObj) return NULL;
|
||||
|
||||
// Is derived object ?
|
||||
while (pObj->SuperClassID() == GEN_DERIVOB_CLASS_ID)
|
||||
{
|
||||
// Yes -> Cast.
|
||||
IDerivedObject* pDerObj = static_cast<IDerivedObject*>(pObj);
|
||||
|
||||
// Iterate over all entries of the modifier stack.
|
||||
int ModStackIndex = 0;
|
||||
while (ModStackIndex < pDerObj->NumModifiers())
|
||||
{
|
||||
// Get current modifier.
|
||||
Modifier* mod = pDerObj->GetModifier(ModStackIndex);
|
||||
|
||||
// Is this Skin ?
|
||||
if (mod->ClassID() == SKIN_CLASSID )
|
||||
{
|
||||
// Yes -> Exit.
|
||||
return mod;
|
||||
}
|
||||
|
||||
// Next modifier stack entry.
|
||||
ModStackIndex++;
|
||||
}
|
||||
pObj = pDerObj->GetObjRef();
|
||||
}
|
||||
|
||||
// Not found.
|
||||
return NULL;
|
||||
}
|
||||
*/
|
||||
#endif
|
24
lib/maxsdk31/ISkinCodes.h
Executable file
24
lib/maxsdk31/ISkinCodes.h
Executable file
@ -0,0 +1,24 @@
|
||||
/**********************************************************************
|
||||
|
||||
FILE: ISkinCodes.h
|
||||
|
||||
DESCRIPTION: Skin Bone Deformer defines
|
||||
|
||||
CREATED BY: Nikolai Sander, Discreet
|
||||
|
||||
HISTORY: 7/12/99
|
||||
|
||||
*> Copyright (c) 1998, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
#ifndef __ISKINCODES__H
|
||||
#define __ISKINCODES__H
|
||||
|
||||
#define BONE_LOCK_FLAG 1
|
||||
#define BONE_ABSOLUTE_FLAG 2
|
||||
#define BONE_SPLINE_FLAG 4
|
||||
#define BONE_SPLINECLOSED_FLAG 8
|
||||
#define BONE_DRAW_ENVELOPE_FLAG 16
|
||||
#define BONE_BONE_FLAG 32
|
||||
#define BONE_DEAD_FLAG 64
|
||||
|
||||
#endif
|
94
lib/maxsdk31/KbdShortcut.h
Executable file
94
lib/maxsdk31/KbdShortcut.h
Executable file
@ -0,0 +1,94 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: KbdShortcut.h
|
||||
|
||||
DESCRIPTION: Keyboard Shortcut table definitions
|
||||
|
||||
CREATED BY: Scott Morrison
|
||||
|
||||
HISTORY: Created 10 July, 1998
|
||||
|
||||
*> Copyright (c) 1998, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __KBDSHORTCUT__
|
||||
#define __KBDSHORTCUT__
|
||||
|
||||
// ShortcutTableIds used by the system
|
||||
const ShortcutTableId kShortcutMainUI = 0;
|
||||
const ShortcutTableId kShortcutTrackView = 1;
|
||||
const ShortcutTableId kShortcutMaterialEditor = 2;
|
||||
const ShortcutTableId kShortcutVideoPost = 3;
|
||||
const ShortcutTableId kShortcutSchematicView = 5;
|
||||
|
||||
|
||||
// Description of a command for building shortcut tables from static data
|
||||
struct ShortcutDescription {
|
||||
int mCmdID;
|
||||
int mResourceID;
|
||||
};
|
||||
|
||||
// Describes an operation that can be attached to a Shortcut
|
||||
class ShortcutOperation {
|
||||
|
||||
public:
|
||||
CoreExport ShortcutOperation()
|
||||
{
|
||||
mCmdId = 0;
|
||||
mpName = NULL;
|
||||
}
|
||||
|
||||
CoreExport int GetId() { return mCmdId; }
|
||||
CoreExport void SetId(int id) { mCmdId = id; }
|
||||
CoreExport TCHAR* GetName() { return mpName;}
|
||||
CoreExport void SetName(TCHAR* pName) { mpName = pName; }
|
||||
|
||||
private:
|
||||
int mCmdId; // The command id sent to the window proc
|
||||
TCHAR* mpName; // The name of the operation the user sees
|
||||
|
||||
};
|
||||
|
||||
// A table of accerators used by plug-ins
|
||||
class ShortcutTable {
|
||||
|
||||
public:
|
||||
CoreExport ShortcutTable(ShortcutTableId id, TSTR& name, HACCEL hDefaults,
|
||||
int numIds, ShortcutDescription* pOps,
|
||||
HINSTANCE hInst);
|
||||
CoreExport ~ShortcutTable();
|
||||
|
||||
CoreExport HACCEL GetHAccel() { return mhAccel; }
|
||||
CoreExport void SetHAccel(HACCEL hAccel) { mhAccel = hAccel; }
|
||||
CoreExport HACCEL GetDefaultHAccel() { return mhDefaultAccel; }
|
||||
CoreExport TSTR& GetName() { return mName; }
|
||||
CoreExport ShortcutTableId GetId() { return mId; }
|
||||
CoreExport ShortcutOperation& operator[](int i) { return mOps[i]; }
|
||||
CoreExport int Count() { return mOps.Count(); }
|
||||
CoreExport void DeleteThis() { delete this; }
|
||||
|
||||
CoreExport TCHAR* GetString(int commandId);
|
||||
|
||||
private:
|
||||
// These values are set by the plug-in to describe a shortcut table
|
||||
|
||||
// Unique identifier of table (like a class id)
|
||||
ShortcutTableId mId;
|
||||
// Name to use in preference dlg drop-down
|
||||
TSTR mName;
|
||||
// Descriptors of all operations that can have Shortcuts
|
||||
Tab<ShortcutOperation> mOps;
|
||||
|
||||
// The windows accelerator table in use
|
||||
HACCEL mhDefaultAccel;
|
||||
// The windows accelerator table in use
|
||||
HACCEL mhAccel;
|
||||
|
||||
};
|
||||
|
||||
class ShortcutCallback {
|
||||
public:
|
||||
virtual BOOL KeyboardShortcut(int id) = 0;
|
||||
};
|
||||
|
||||
#endif
|
44
lib/maxsdk31/MNBigMat.h
Executable file
44
lib/maxsdk31/MNBigMat.h
Executable file
@ -0,0 +1,44 @@
|
||||
// MNBigMat.h
|
||||
// Created by Steve Anderson, Nov. 22 1996.
|
||||
|
||||
// BigMatrix is for when I need good old-fashioned mxn matrices.
|
||||
|
||||
// Classes:
|
||||
// BigMatrix
|
||||
|
||||
#ifndef __MN_BIGMAT_H_
|
||||
#define __MN_BIGMAT_H_
|
||||
|
||||
#define BIGMAT_MAX_SIZE 10000
|
||||
|
||||
class BigMatrix {
|
||||
public:
|
||||
int m, n;
|
||||
float *val;
|
||||
|
||||
BigMatrix () { val=NULL; m=0; n=0; }
|
||||
DllExport BigMatrix (int mm, int nn);
|
||||
DllExport BigMatrix (const BigMatrix & from);
|
||||
~BigMatrix () { Clear (); }
|
||||
|
||||
DllExport void Clear ();
|
||||
DllExport int SetSize (int mm, int nn);
|
||||
|
||||
DllExport float *operator[](int i) const;
|
||||
DllExport BigMatrix & operator= (const BigMatrix & from);
|
||||
|
||||
DllExport void SetTranspose (BigMatrix & trans) const;
|
||||
DllExport float Invert();
|
||||
DllExport void Identity ();
|
||||
|
||||
// Debugging functions:
|
||||
DllExport void Randomize (float scale);
|
||||
DllExport void MNDebugPrint ();
|
||||
|
||||
// Do not use -- does nothing. (Replaced by MNDebugPrint.)
|
||||
DllExport void dump (FILE *fp);
|
||||
};
|
||||
|
||||
DllExport extern BOOL BigMatMult (BigMatrix & a, BigMatrix & b, BigMatrix &c);
|
||||
|
||||
#endif
|
57
lib/maxsdk31/MNCommon.h
Executable file
57
lib/maxsdk31/MNCommon.h
Executable file
@ -0,0 +1,57 @@
|
||||
// Common macros for all MNMath.
|
||||
|
||||
#ifndef MNEPS
|
||||
#define MNEPS 1e-04f
|
||||
#endif
|
||||
|
||||
// Selection levels for internal use:
|
||||
#define MN_SEL_DEFAULT 0 // Default = use whatever's in mesh.
|
||||
#define MN_SEL_OBJECT 1
|
||||
#define MN_SEL_VERTEX 2
|
||||
#define MN_SEL_EDGE 3
|
||||
#define MN_SEL_FACE 4
|
||||
|
||||
// Got sick of redoing the following everywhere:
|
||||
class FlagUser {
|
||||
DWORD FlagUserFlags;
|
||||
public:
|
||||
FlagUser () { FlagUserFlags=0; }
|
||||
void SetFlag (DWORD fl, bool val=TRUE) { if (val) FlagUserFlags |= fl; else FlagUserFlags -= (FlagUserFlags & fl); }
|
||||
void ClearFlag (DWORD fl) { FlagUserFlags -= (FlagUserFlags & fl); }
|
||||
bool GetFlag (DWORD fl) const { return (FlagUserFlags & fl) ? 1 : 0; }
|
||||
void ClearAllFlags () { FlagUserFlags = 0; }
|
||||
|
||||
void CopyFlags (DWORD fl) { FlagUserFlags = fl; }
|
||||
void CopyFlags (const FlagUser & fu) { FlagUserFlags = fu.FlagUserFlags; }
|
||||
void CopyFlags (const FlagUser * fu) { FlagUserFlags = fu->FlagUserFlags; }
|
||||
|
||||
void CopyFlags (DWORD fl, DWORD mask) { FlagUserFlags |= (fl & mask); }
|
||||
void CopyFlags (const FlagUser &fu, DWORD mask) { FlagUserFlags |= (fu.FlagUserFlags & mask); }
|
||||
void CopyFlags (const FlagUser *fu, DWORD mask) { FlagUserFlags |= (fu->FlagUserFlags & mask); }
|
||||
|
||||
void OrFlags (const FlagUser & fu) { FlagUserFlags |= fu.FlagUserFlags; }
|
||||
void OrFlags (const FlagUser * fu) { FlagUserFlags |= fu->FlagUserFlags; }
|
||||
|
||||
void AndFlags (const FlagUser & fu) { FlagUserFlags &= fu.FlagUserFlags; }
|
||||
void AndFlags (const FlagUser * fu) { FlagUserFlags &= fu->FlagUserFlags; }
|
||||
|
||||
bool FlagMatch (DWORD fmask, DWORD fl) const {
|
||||
return ((FlagUserFlags & fmask) == (fl & fmask));
|
||||
}
|
||||
bool FlagMatch (DWORD fmask, const FlagUser & fu) const {
|
||||
return ((FlagUserFlags & fmask) == (fu.FlagUserFlags & fmask));
|
||||
}
|
||||
bool FlagMatch (DWORD fmask, const FlagUser * fu) const {
|
||||
return ((FlagUserFlags & fmask) == (fu->FlagUserFlags & fmask));
|
||||
}
|
||||
|
||||
DWORD ExportFlags () const { return FlagUserFlags; }
|
||||
void ImportFlags (DWORD fl) { FlagUserFlags = fl; }
|
||||
|
||||
IOResult WriteFlags (ISave *isave, ULONG *nb) const {
|
||||
return isave->Write(&FlagUserFlags, sizeof(DWORD), nb);
|
||||
}
|
||||
IOResult ReadFlags (ILoad *iload, ULONG *nb) {
|
||||
return iload->Read (&FlagUserFlags, sizeof(DWORD), nb);
|
||||
}
|
||||
};
|
11
lib/maxsdk31/MNMath.h
Executable file
11
lib/maxsdk31/MNMath.h
Executable file
@ -0,0 +1,11 @@
|
||||
// MN Math.h
|
||||
// Collection of headers for MNMath library
|
||||
|
||||
#ifndef __MNMATH_H_
|
||||
#define __MNMATH_H_
|
||||
|
||||
#include "MNCommon.h"
|
||||
#include "MNMesh.h"
|
||||
#include "MNBigMat.h"
|
||||
|
||||
#endif
|
BIN
lib/maxsdk31/MNMath.lib
Executable file
BIN
lib/maxsdk31/MNMath.lib
Executable file
Binary file not shown.
661
lib/maxsdk31/MNMesh.h
Executable file
661
lib/maxsdk31/MNMesh.h
Executable file
@ -0,0 +1,661 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: MNMesh.h
|
||||
|
||||
DESCRIPTION: Special mesh structures useful for face and edge based mesh operations.
|
||||
|
||||
CREATED BY: Steve Anderson, working for Kinetix!
|
||||
|
||||
HISTORY: created March 1997 from old SDMesh and WMesh.
|
||||
|
||||
*> Copyright (c) 1996 Autodesk, Inc., All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
// Necessary prior inclusions: max.h
|
||||
|
||||
// Classes:
|
||||
// MNMesh
|
||||
// MNVert
|
||||
// MNEdge
|
||||
// MNFace
|
||||
// MNMeshBorder
|
||||
|
||||
#ifndef __MN_MESH_H_
|
||||
#define __MN_MESH_H_
|
||||
|
||||
#define REALLOC_SIZE 10
|
||||
|
||||
// Boolean types: we use the same ones defined in mesh.h
|
||||
//#define MESHBOOL_UNION 1
|
||||
//#define MESHBOOL_INTERSECTION 2
|
||||
//#define MESHBOOL_DIFFERENCE 3
|
||||
|
||||
// General flags for all components
|
||||
// For MNVerts, MNEdges, and MNFaces, bits 0-7 are used for common characteristics
|
||||
// of all components. Bits 8-15 are used for component-specific flags. Bits 16-23 are reserved
|
||||
// for temporary use in MNMesh algorithms. Bits 24-31 are reserved for MNMath.lib users.
|
||||
#define MN_SEL (1<<0)
|
||||
#define MN_DEAD (1<<1)
|
||||
#define MN_TARG (1<<2)
|
||||
#define MN_BACKFACING (1<<3)
|
||||
#define MN_HIDDEN (1<<4)
|
||||
#define MN_WHATEVER (1<<16) // Temporary flag used internally for whatever.
|
||||
#define MN_USER (1<<24) // Anything above this can be used by applications.
|
||||
|
||||
// Vertex flags
|
||||
#define MN_VERT_DONE (1<<8)
|
||||
#define MN_VERT_HIDDEN (1<<9) // different from MN_HIDDEN - means a vert is on a face's hvtx list.
|
||||
|
||||
class MNMesh;
|
||||
|
||||
class MNVert : public FlagUser {
|
||||
public:
|
||||
Point3 p;
|
||||
int orig; // Original point this vert comes from. -- STEVE, remove, only used in connect.
|
||||
|
||||
MNVert () { orig = -1; }
|
||||
DllExport MNVert & operator= (MNVert & from);
|
||||
};
|
||||
|
||||
// Edge flags
|
||||
#define MN_EDGE_INVIS (1<<8)
|
||||
#define MN_EDGE_NOCROSS (1<<9)
|
||||
#define MN_EDGE_MAP_SEAM (1<<10)
|
||||
|
||||
// Edge goes from v1 to v2
|
||||
// f1 is forward-indexing face (face on "left" if surface normal above, v2 in front)
|
||||
// f2 is backward-indexing face, or -1 if no such face exists. (Face on "right")
|
||||
class MNEdge : public FlagUser {
|
||||
public:
|
||||
int v1, v2;
|
||||
int f1, f2;
|
||||
int track; // Keep track of whatever.
|
||||
|
||||
MNEdge() { Init(); }
|
||||
MNEdge (int vv1, int vv2, int fc) { f1=fc; f2=-1; v1=vv1; v2=vv2; track=-1; }
|
||||
void Init() { v1=v2=f1=0; f2=-1; track=-1; }
|
||||
int OtherFace (int ff) { return (ff==f1) ? f2 : f1; }
|
||||
int OtherVert (int vv) { return (vv==v1) ? v2 : v1; }
|
||||
void Invert () { int hold=v1; v1=v2; v2=hold; hold=f1; f1=f2; f2=hold; }
|
||||
DllExport void ReplaceFace (int of, int nf, int vv1=-1);
|
||||
void ReplaceVert (int ov, int nv) { if (v1 == ov) v1 = nv; else { MaxAssert (v2==ov); v2 = nv; } }
|
||||
DllExport bool Uncrossable ();
|
||||
DllExport MNEdge & operator= (const MNEdge & from);
|
||||
DllExport void MNDebugPrint ();
|
||||
};
|
||||
|
||||
class MNMapFace {
|
||||
friend class MNMesh;
|
||||
int dalloc, halloc;
|
||||
public:
|
||||
int deg, hdeg;
|
||||
int *tv, *htv;
|
||||
|
||||
MNMapFace() { Init(); }
|
||||
DllExport MNMapFace (int d, int h=0);
|
||||
~MNMapFace () { Clear(); }
|
||||
DllExport void Init();
|
||||
DllExport void Clear();
|
||||
DllExport void SetAlloc (int d, int h=0);
|
||||
void SetSize (int d, int h=0) { SetAlloc(d,h); deg=d; hdeg=h; }
|
||||
DllExport void MakePoly (int fdeg, int *tt);
|
||||
DllExport void Insert (int pos, int num=1);
|
||||
DllExport void Delete (int pos, int num=1);
|
||||
DllExport void HInsert (int pos, int num=1);
|
||||
DllExport void HDelete (int pos, int num=1);
|
||||
DllExport void RotateStart (int newstart);
|
||||
DllExport void Flip (); // Reverses order of verts. 0 remains start.
|
||||
|
||||
DllExport int VertIndex (int vv);
|
||||
DllExport void ReplaceVert (int ov, int nv);
|
||||
|
||||
DllExport MNMapFace & operator= (const MNMapFace & from);
|
||||
DllExport void MNDebugPrint (bool hinfo=TRUE);
|
||||
};
|
||||
|
||||
// MNFace flags:
|
||||
#define MN_FACE_OPEN_REGION (1<<8) // Face is not part of closed submesh.
|
||||
#define MN_FACE_CHECKED (1<<9) // for recursive face-and-neighbor-checking
|
||||
#define MN_FACE_CHANGED (1<<10)
|
||||
|
||||
class MNFace : public FlagUser {
|
||||
friend class MNMesh;
|
||||
int dalloc, halloc, talloc;
|
||||
void Init();
|
||||
void SwapContents (MNFace & from);
|
||||
public:
|
||||
int deg; // Degree: number of vtx's and edg's that are relevant.
|
||||
int *vtx; // Defining verts of this face.
|
||||
int *edg;
|
||||
int *tri; // Triangulation
|
||||
int hdeg;
|
||||
int *hvtx; // Hidden verts
|
||||
DWORD smGroup;
|
||||
MtlID material;
|
||||
int track; // Keep track of whatever -- MNMesh internal use only.
|
||||
BitArray visedg, edgsel;
|
||||
|
||||
MNFace() { Init(); }
|
||||
DllExport MNFace (int d, int h=0);
|
||||
DllExport MNFace (const MNFace *from);
|
||||
~MNFace () { Clear(); }
|
||||
DllExport void Clear();
|
||||
int TriNum() { return deg - 2 + 2*hdeg; }
|
||||
DllExport int TriVert(int k);
|
||||
DllExport void SetAlloc (int d, int h=0);
|
||||
DllExport void MakePoly (int fdeg, int *vv, bool *vis=NULL, bool *sel=NULL);
|
||||
DllExport void Insert (int pos, int num=1);
|
||||
DllExport bool Delete (int pos, int num=1, int edir=1, bool fixtri=TRUE);
|
||||
DllExport void HInsert (int pos, int num=1);
|
||||
DllExport void HDelete (int pos, int num=1);
|
||||
DllExport void RotateStart (int newstart);
|
||||
DllExport void Flip (); // Reverses order of verts. 0 remains start.
|
||||
|
||||
DllExport int VertIndex (int vv, int ee=-1);
|
||||
DllExport int EdgeIndex (int ee, int vv=-1);
|
||||
DllExport void ReplaceVert (int ov, int nv, int ee=-1);
|
||||
DllExport void ReplaceEdge (int oe, int ne, int vv=-1);
|
||||
|
||||
DllExport MNFace & operator= (const MNFace & from);
|
||||
DllExport void MNDebugPrint (bool triprint=FALSE, bool hinfo=TRUE);
|
||||
|
||||
DllExport IOResult Save (ISave *isave);
|
||||
DllExport IOResult Load (ILoad *iload);
|
||||
};
|
||||
|
||||
/*
|
||||
class MNFaceTriCache {
|
||||
friend class MNMesh;
|
||||
int fid;
|
||||
int deg;
|
||||
int *tri;
|
||||
int hdeg;
|
||||
int *htri;
|
||||
double *hbary;
|
||||
|
||||
MNFaceTriCache () { tri=NULL; htri=NULL; hbary=NULL; hdeg=0; deg=0; fid=-1; }
|
||||
~MNFaceTriCache () { if (tri) delete [] tri; if (htri) delete [] htri; if (hbary) delete [] hbary; }
|
||||
|
||||
DllExport void SetDeg (int degg);
|
||||
DllExport void SetHDeg (int hdegg);
|
||||
};
|
||||
*/
|
||||
|
||||
class MNMap : public FlagUser {
|
||||
friend class MNMesh;
|
||||
int nv_alloc, nf_alloc;
|
||||
public:
|
||||
MNMapFace *f;
|
||||
UVVert *v;
|
||||
|
||||
int numv, numf;
|
||||
|
||||
MNMap () { Init(); }
|
||||
~MNMap () { ClearAndFree (); }
|
||||
|
||||
// Initialization, allocation:
|
||||
DllExport void Init ();
|
||||
DllExport void VAlloc (int num, bool keep=TRUE);
|
||||
DllExport void FAlloc (int num, bool keep=TRUE);
|
||||
|
||||
// Data access:
|
||||
int VNum () const { return numv; }
|
||||
UVVert V(int i) const { return v[i]; }
|
||||
int FNum () const { return numf; }
|
||||
MNMapFace *F(int i) const { return &(f[i]); }
|
||||
|
||||
// Adding new components -- all allocation should go through here!
|
||||
DllExport int NewTri (int a, int b, int c);
|
||||
DllExport int NewTri (int *vv);
|
||||
DllExport int NewQuad (int a, int b, int c, int d);
|
||||
DllExport int NewQuad (int *vv);
|
||||
DllExport int NewFace (int degg=0, int *vv=NULL);
|
||||
DllExport void setNumFaces (int nfnum);
|
||||
DllExport int NewVert (UVVert p, int uoff=0, int voff=0);
|
||||
DllExport void setNumVerts (int nvnum);
|
||||
|
||||
DllExport void CollapseDeadVerts (MNFace *faces); // Figures out which are dead.
|
||||
DllExport void CollapseDeadFaces (MNFace *faces);
|
||||
DllExport void Clear (); // Deletes everything.
|
||||
DllExport void ClearAndFree (); // Deletes everything, frees all memory
|
||||
|
||||
DllExport void Transform (Matrix3 & xfm); // o(n) -- transforms verts
|
||||
|
||||
// operators and debug printing
|
||||
DllExport MNMap & operator= (const MNMap & from);
|
||||
DllExport MNMap & operator+= (const MNMap & from);
|
||||
DllExport MNMap & operator+= (const MNMesh & from);
|
||||
DllExport void ShallowCopy (const MNMap & from);
|
||||
DllExport void NewAndCopy ();
|
||||
DllExport void MNDebugPrint (MNFace *faces);
|
||||
DllExport bool CheckAllData (int mp, int nf, MNFace *faces);
|
||||
|
||||
DllExport IOResult Save (ISave *isave, MNFace *faces=NULL);
|
||||
DllExport IOResult Load (ILoad *iload, MNFace *faces=NULL);
|
||||
};
|
||||
|
||||
// Per-edge data
|
||||
#define MAX_EDGEDATA 10
|
||||
#define EDATA_KNOT 0
|
||||
|
||||
DllExport int EdgeDataType (int edID);
|
||||
DllExport void *EdgeDataDefault (int edID);
|
||||
|
||||
#define MN_MESH_NONTRI (1<<0) // At least 2 triangles have been joined
|
||||
#define MN_MESH_FILLED_IN (1<<1) // All topological links complete
|
||||
#define MN_MESH_RATSNEST (1<<2) // Set if we've replicated points to avoid rats' nest meshes.
|
||||
#define MN_MESH_NO_BAD_VERTS (1<<3) // Set if we've established that each vert has exactly one connected component of faces & edges.
|
||||
#define MN_MESH_VERTS_ORDERED (1<<4) // Set if we've ordered the fac, edg tables in each vert.
|
||||
#define MN_MESH_HAS_VOLUME (1<<7) // Some subset of mesh describes closed surface of solid
|
||||
|
||||
#define MN_MESH_CACHE_FLAGS (MN_MESH_FILLED_IN|MN_MESH_NO_BAD_VERTS|MN_MESH_VERTS_ORDERED)
|
||||
|
||||
class MNMeshBorder;
|
||||
|
||||
typedef MNMap * MNMP;
|
||||
|
||||
// MNMesh selection levels:
|
||||
#define MNM_SL_OBJECT 0
|
||||
#define MNM_SL_VERTEX 1
|
||||
#define MNM_SL_EDGE 2
|
||||
#define MNM_SL_FACE 3
|
||||
#define MNM_SL_TRI 4
|
||||
|
||||
// MNMesh display flags
|
||||
#define MNDISP_VERTTICKS 0x01
|
||||
#define MNDISP_SELVERTS 0x02
|
||||
#define MNDISP_SELFACES 0x04
|
||||
#define MNDISP_SELEDGES 0x08
|
||||
#define MNDISP_NORMALS 0x10
|
||||
#define MNDISP_SMOOTH_SUBSEL 0x20
|
||||
#define MNDISP_BEEN_DISP 0x40
|
||||
|
||||
class MNMesh : public FlagUser {
|
||||
private:
|
||||
int nv_alloc, ne_alloc, nf_alloc, nm_alloc;
|
||||
|
||||
// Cache geometric data for quick rendering
|
||||
Box3 bdgBox;
|
||||
Point3 *fnorm;
|
||||
RVertex *rVerts; // <<< instance specific.
|
||||
GraphicsWindow *cacheGW; // identifies rVerts cache
|
||||
int normalsBuilt;
|
||||
float norScale;
|
||||
|
||||
//Tab<MNFaceTriCache *> tcache;
|
||||
|
||||
// Internal part of SabinDoo method:
|
||||
void SDVEdgeFace (int id, int vid, int *fv, Tab<Tab<int> *> & fmv, DWORD selLevel);
|
||||
|
||||
// Internal part of recursive smoothing-group search.
|
||||
DWORD FindReplacementSmGroup (int ff, DWORD os, int call);
|
||||
|
||||
// Internal parts of Boolean. (MNBool.cpp)
|
||||
int BooleanZip (DWORD sortFlag, float weldThresh);
|
||||
bool BoolZipSeam (Tab<int> *lpi, Tab<int> *lpj, int & starth, int & startk, float weldThresh);
|
||||
void BoolPaintClassification (int ff, DWORD classification, int calldepth);
|
||||
|
||||
// Internal data cache stuff (MNPipe.cpp)
|
||||
void buildBoundingBox ();
|
||||
void buildFaceNormals ();
|
||||
|
||||
public:
|
||||
MNVert *v;
|
||||
MNEdge *e;
|
||||
MNFace *f;
|
||||
MNMap *m;
|
||||
int numv, nume, numf, numm;
|
||||
|
||||
// Vertex Data -- handled as in Meshes:
|
||||
PerData *vd;
|
||||
BitArray vdSupport;
|
||||
|
||||
// Edge Data
|
||||
PerData *ed;
|
||||
BitArray edSupport;
|
||||
|
||||
DWORD selLevel;
|
||||
DWORD dispFlags;
|
||||
|
||||
// Derived data:
|
||||
Tab<int> *vedg;
|
||||
Tab<int> *vfac;
|
||||
|
||||
// Basic class ops
|
||||
MNMesh () { Init(); DefaultFlags (); }
|
||||
MNMesh (const Mesh & from) { Init(); SetFromTri (from); FillInMesh (); }
|
||||
MNMesh (const MNMesh & from) { Init(); DefaultFlags(); *this = from; }
|
||||
~MNMesh() { ClearAndFree (); }
|
||||
|
||||
// Initialization:
|
||||
void DefaultFlags () { ClearAllFlags (); }
|
||||
DllExport void Init ();
|
||||
|
||||
// Array allocation: these functions (& Init) have sole control over nvalloc, etc.
|
||||
void VAlloc (int num, bool keep=TRUE);
|
||||
void VShrink (int num=-1); // default means "Shrink array allocation to numv"
|
||||
void freeVEdge();
|
||||
void VEdgeAlloc();
|
||||
void freeVFace();
|
||||
void VFaceAlloc();
|
||||
void EAlloc (int num, bool keep=TRUE);
|
||||
void EShrink (int num=-1);
|
||||
void FAlloc (int num, bool keep=TRUE);
|
||||
void FShrink (int num=-1);
|
||||
void MAlloc (int num, bool keep=TRUE);
|
||||
void MShrink (int num=-1);
|
||||
|
||||
// Access to components
|
||||
int VNum () const { return numv; }
|
||||
MNVert *V(int i) const { return &(v[i]); }
|
||||
Point3 & P(int i) const { return v[i].p; }
|
||||
int ENum () const { return nume; }
|
||||
MNEdge *E(int i) const { return &(e[i]); }
|
||||
int FNum () const { return numf; }
|
||||
MNFace *F(int i) const { return &(f[i]); }
|
||||
int MNum () const { return numm; }
|
||||
MNMap *M(int i) const { return &(m[i]); }
|
||||
DllExport void SetMapNum (int mpnum);
|
||||
DllExport void InitMap (int mp); // Inits to current MNMesh topology.
|
||||
void ClearMap (int mp) { if (mp<numm) { m[mp].SetFlag (MN_DEAD); m[mp].ClearAndFree (); } }
|
||||
UVVert MV (int mp, int i) const { return m[mp].v[i]; }
|
||||
MNMapFace *MF (int mp, int i) const { return m[mp].F(i); }
|
||||
DllExport int TriNum () const;
|
||||
DllExport int HVNum (bool selFaces=FALSE) const;
|
||||
|
||||
// Per Vertex Data:
|
||||
DllExport void setNumVData (int ct, BOOL keep=FALSE);
|
||||
int VDNum () const { return vdSupport.GetSize(); }
|
||||
|
||||
DllExport BOOL vDataSupport (int vdChan) const;
|
||||
DllExport void setVDataSupport (int vdChan, BOOL support=TRUE);
|
||||
void *vertexData (int vdChan) const { return vDataSupport(vdChan) ? vd[vdChan].data : NULL; }
|
||||
float *vertexFloat (int vdChan) const { return (float *) vertexData (vdChan); }
|
||||
DllExport void freeVData (int vdChan);
|
||||
DllExport void freeAllVData ();
|
||||
|
||||
// Two specific vertex data: these VDATA constants are defined in mesh.h
|
||||
float *getVertexWeights () { return vertexFloat(VDATA_WEIGHT); }
|
||||
void SupportVertexWeights () { setVDataSupport (VDATA_WEIGHT); }
|
||||
void freeVertexWeights () { freeVData (VDATA_WEIGHT); }
|
||||
float *getVSelectionWeights () { return vertexFloat(VDATA_SELECT); }
|
||||
void SupportVSelectionWeights () { setVDataSupport (VDATA_SELECT); }
|
||||
void freeVSelectionWeights () { freeVData (VDATA_SELECT); }
|
||||
|
||||
// Per Edge Data:
|
||||
DllExport void setNumEData (int ct, BOOL keep=FALSE);
|
||||
int EDNum () const { return edSupport.GetSize(); }
|
||||
|
||||
DllExport BOOL eDataSupport (int edChan) const;
|
||||
DllExport void setEDataSupport (int edChan, BOOL support=TRUE);
|
||||
void *edgeData (int edChan) const { return eDataSupport(edChan) ? ed[edChan].data : NULL; }
|
||||
float *edgeFloat (int edChan) const { return (float *) edgeData (edChan); }
|
||||
DllExport void freeEData (int edChan);
|
||||
DllExport void freeAllEData ();
|
||||
|
||||
// One specific edge data: this EDATA constant is defined above
|
||||
float *getEdgeKnots () { return edgeFloat(EDATA_KNOT); }
|
||||
void SupportEdgeKnots () { setEDataSupport (EDATA_KNOT); }
|
||||
void freeEdgeKnots () { freeEData (EDATA_KNOT); }
|
||||
|
||||
// Vertex face/edge list methods:
|
||||
DllExport void VClear (int vv);
|
||||
DllExport void VInit (int vv);
|
||||
DllExport int VFaceIndex (int vv, int ff, int ee=-1);
|
||||
DllExport int VEdgeIndex (int vv, int ee);
|
||||
void VDeleteEdge (int vv, int ee) { if (vedg) vedg[vv].Delete (VEdgeIndex(vv, ee), 1); }
|
||||
DllExport void VDeleteFace (int vv, int ff);
|
||||
DllExport void VReplaceEdge (int vv, int oe, int ne);
|
||||
DllExport void VReplaceFace (int vv, int of, int nf);
|
||||
DllExport void CopyVert (int nv, int ov); // copies face & edge too if appropriate
|
||||
DllExport void MNVDebugPrint (int vv);
|
||||
|
||||
// Adding new components -- all allocation should go through here!
|
||||
DllExport int NewTri (int a, int b, int c, DWORD smG=0, MtlID mt=0);
|
||||
DllExport int NewTri (int *vv, DWORD smG=0, MtlID mt=0);
|
||||
DllExport int NewQuad (int a, int b, int c, int d, DWORD smG=0, MtlID mt=0);
|
||||
DllExport int NewQuad (int *vv, DWORD smG=0, MtlID mt=0);
|
||||
DllExport int NewFace (int initFace, int degg=0, int *vv=NULL, bool *vis=NULL, bool *sel=NULL);
|
||||
DllExport int AppendNewFaces (int nfnum);
|
||||
DllExport void setNumFaces (int nfnum);
|
||||
DllExport int RegisterEdge (int v1, int v2, int f, int fpos);
|
||||
DllExport int SimpleNewEdge (int v1, int v2);
|
||||
DllExport int NewEdge (int v1, int v2, int f, int fpos);
|
||||
DllExport int AppendNewEdges (int nenum);
|
||||
DllExport void setNumEdges (int nenum);
|
||||
DllExport int NewVert (Point3 & p);
|
||||
DllExport int NewVert (Point3 & p, int vid);
|
||||
DllExport int NewVert (int vid);
|
||||
DllExport int NewVert (int v1, int v2, float prop);
|
||||
DllExport int AppendNewVerts (int nvnum);
|
||||
DllExport void setNumVerts (int nvnum);
|
||||
|
||||
DllExport void KillUnusedHiddenVerts ();
|
||||
// To delete, set MN_*_DEAD flag and use following routines, which are all o(n).
|
||||
DllExport void CollapseDeadVerts ();
|
||||
DllExport void CollapseDeadEdges ();
|
||||
DllExport void CollapseDeadFaces ();
|
||||
DllExport void CollapseDeadStructs();
|
||||
DllExport void Clear (); // Deletes everything.
|
||||
DllExport void ClearAndFree (); // Deletes everything, frees all memory
|
||||
DllExport void freeVerts();
|
||||
DllExport void freeEdges();
|
||||
DllExport void freeFaces();
|
||||
DllExport void freeMap(int mp);
|
||||
DllExport void freeMaps();
|
||||
//DllExport void freeTCache();
|
||||
|
||||
// En Masse flag-clearing and setting:
|
||||
void ClearVFlags (DWORD fl) { for (int i=0; i<numv; i++) v[i].ClearFlag (fl); }
|
||||
void ClearEFlags (DWORD fl) { for (int i=0; i<nume; i++) e[i].ClearFlag (fl); }
|
||||
void ClearFFlags (DWORD fl) { for (int i=0; i<numf; i++) f[i].ClearFlag (fl); }
|
||||
DllExport void PaintFaceFlag (int ff, DWORD fl, DWORD fenceflags=0x0);
|
||||
DllExport void VertexSelect (const BitArray & vsel);
|
||||
DllExport void EdgeSelect (const BitArray & esel);
|
||||
DllExport void FaceSelect (const BitArray & fsel);
|
||||
bool getVertexSel (BitArray & vsel) { return getVerticesByFlag (vsel, MN_SEL); }
|
||||
bool getEdgeSel (BitArray & esel) { return getEdgesByFlag (esel, MN_SEL); }
|
||||
bool getFaceSel (BitArray & fsel) { return getFacesByFlag (fsel, MN_SEL); }
|
||||
// In following 3, if fmask is 0 it's set to flags, so only those flags are compared.
|
||||
DllExport bool getVerticesByFlag (BitArray & vset, DWORD flags, DWORD fmask=0x0);
|
||||
DllExport bool getEdgesByFlag (BitArray & eset, DWORD flags, DWORD fmask=0x0);
|
||||
DllExport bool getFacesByFlag (BitArray & fset, DWORD flags, DWORD fmask=0x0);
|
||||
DllExport void ElementFromFace (int ff, BitArray & fset);
|
||||
DllExport void BorderFromEdge (int ee, BitArray & eset);
|
||||
|
||||
// Following also set visedg, edgsel bits on faces:
|
||||
DllExport void SetEdgeVis (int ee, BOOL vis=TRUE);
|
||||
DllExport void SetEdgeSel (int ee, BOOL sel=TRUE);
|
||||
|
||||
// I/O with regular Meshes.
|
||||
void SetFromTri (const Mesh & from) { Clear (); AddTri (from); }
|
||||
DllExport void AddTri (const Mesh & from); // o(n) -- Add another mesh -- simple union
|
||||
DllExport void OutToTri (Mesh & tmesh); // o(n)
|
||||
|
||||
// Internal computation: each of the following 3 requires the previous.
|
||||
DllExport void FillInMesh (); // o(n*5) or so
|
||||
DllExport void EliminateBadVerts (); // o(n*8) or so
|
||||
DllExport void OrderVerts (); // o(n*3) or so
|
||||
DllExport void Triangulate (); // o(n)
|
||||
DllExport void TriangulateFace (int ff); // o(triangles)
|
||||
|
||||
// Random useful stuff.
|
||||
DllExport void Transform (Matrix3 & xfm); // o(n) -- transforms verts
|
||||
bool IsClosed() { for (int i=0; i<nume; i++) if (e[i].f2<0) return FALSE; return nume?TRUE:FALSE; } // o(n)
|
||||
DllExport void FaceBBox (int ff, Box3 & bbox);
|
||||
DllExport void BBox (Box3 & bbox, bool targonly=FALSE);
|
||||
|
||||
// Methods for handling MN_TARG flags.
|
||||
DllExport int TargetVertsBySelection (DWORD selLevel); // o(n)
|
||||
DllExport int TargetEdgesBySelection (DWORD selLevel); // o(n)
|
||||
DllExport int TargetFacesBySelection (DWORD selLevel); // o(n)
|
||||
DllExport int PropegateComponentFlags (DWORD slTo, DWORD flTo,
|
||||
DWORD slFrom, DWORD flFrom, bool ampersand=FALSE, bool set=TRUE);
|
||||
DllExport void DetargetVertsBySharpness (float sharpval); // o(n*deg)
|
||||
|
||||
// Face-center methods
|
||||
DllExport void ComputeCenters (Point3 *ctr, bool targonly=FALSE); // o(n)
|
||||
DllExport void ComputeCenter (int ff, Point3 & ctr);
|
||||
DllExport void ComputeSafeCenters (Point3 *ctr, bool targonly=FALSE, bool detarg=FALSE); // o(n)
|
||||
DllExport bool ComputeSafeCenter (int ff, Point3 & ctr); // o(deg^2)
|
||||
|
||||
// Triangulation-of-polygon methods:
|
||||
DllExport void RetriangulateFace (int ff); // o(deg^2)
|
||||
DllExport void FindExternalTriangulation (int ff, int *tri);
|
||||
DllExport void BestConvexTriangulation (int ff, int *tri=NULL);
|
||||
|
||||
// Normal methods
|
||||
DllExport int FindEdgeFromVertToVert (int vrt1, int vrt2); // o(deg)
|
||||
DllExport Point3 GetVertexNormal (int vrt); // o(deg)
|
||||
DllExport Point3 GetEdgeNormal (int ed); // o(deg)
|
||||
DllExport Point3 GetFaceNormal (int fc, bool nrmlz=FALSE); //o(deg)
|
||||
Point3 GetEdgeNormal (int vrt1, int vrt2) { return GetEdgeNormal (FindEdgeFromVertToVert(vrt1, vrt2)); }
|
||||
|
||||
// Smoothing-group handling
|
||||
DllExport void Resmooth (bool smooth=TRUE, bool targonly=FALSE, DWORD targmask=~0x0); // o(n)
|
||||
DllExport DWORD CommonSmoothing (bool targonly=FALSE); // o(n)
|
||||
DllExport DWORD GetNewSmGroup (bool targonly=FALSE); // o(n)
|
||||
DllExport MtlID GetNewMtlID (bool targonly = FALSE); // o(n)
|
||||
DllExport DWORD GetOldSmGroup (bool targonly=FALSE); // up to o(n).
|
||||
DllExport DWORD GetAllSmGroups (bool targonly=FALSE); // up to o(n)
|
||||
DllExport DWORD FindReplacementSmGroup (int ff, DWORD os);
|
||||
DllExport void PaintNewSmGroup (int ff, DWORD os, DWORD ns);
|
||||
DllExport bool SeparateSmGroups (int v1, int v2);
|
||||
|
||||
// Use following to unify triangles into polygons across invisible edges.
|
||||
DllExport void MakePolyMesh (int maxdeg=0, BOOL elimCollin=TRUE);
|
||||
// NOTE: MakeConvexPolyMesh result not guaranteed for now. Still requires MakeConvex() afterwards to be sure.
|
||||
DllExport void MakeConvexPolyMesh (int maxdeg=0);
|
||||
DllExport void RemoveEdge (int edge);
|
||||
DllExport void MakeConvex ();
|
||||
DllExport void MakeFaceConvex (int ff);
|
||||
DllExport void EliminateCollinearVerts ();
|
||||
DllExport void EliminateCoincidentVerts (float thresh=MNEPS);
|
||||
|
||||
// Following set NOCROSS flags, delete INVIS flags to make "fences" for Sabin-Doo
|
||||
DllExport void FenceMaterials ();
|
||||
DllExport void FenceSmGroups ();
|
||||
DllExport void FenceFaceSel ();
|
||||
DllExport void FenceOneSidedEdges();
|
||||
DllExport void FenceNonPlanarEdges (float thresh=.9999f);
|
||||
DllExport void SetMapSeamFlags (int mapID=-1);
|
||||
|
||||
// Find get detail about a point on a face.
|
||||
DllExport int FindFacePointTri (int ff, Point3 & pt, double *bary=NULL, int *tri=NULL, int tnum=0);
|
||||
DllExport UVVert FindFacePointMapValue (int ff, Point3 & pt, int mp);
|
||||
|
||||
// Extrapolate map information about a point near a face.
|
||||
DllExport UVVert ExtrapolateMapValue (int face, int edge, Point3 & pt, int mp);
|
||||
|
||||
// Useful for tessellation algorithms
|
||||
DllExport void Relax (float relaxval, bool targonly=TRUE);
|
||||
|
||||
// Returns map verts for both ends of each edge (from f1's perspective)
|
||||
// (Very useful for creating new faces at borders.) mv[j*2] corresponds to edge j's v1.
|
||||
DllExport void FindEdgeListMapVerts (const Tab<int> & lp, Tab<int> & mv, int mp);
|
||||
|
||||
// Following functions can be used to find & fix holes in a mesh, if any.
|
||||
DllExport void GetBorder (MNMeshBorder & brd, DWORD selLevel=MESH_OBJECT);
|
||||
DllExport void FillInBorders (MNMeshBorder *b=NULL);
|
||||
DllExport void FindOpenRegions ();
|
||||
|
||||
// To make hidden verts behave when moving real ones, use following:
|
||||
DllExport void PrepForGeomChange ();
|
||||
DllExport void CompleteGeomChange ();
|
||||
|
||||
// operators and debug printing (MNFace.cpp)
|
||||
DllExport MNMesh & operator= (const MNMesh & from);
|
||||
DllExport MNMesh & operator+= (const MNMesh & from);
|
||||
DllExport void MNDebugPrint (bool triprint=FALSE);
|
||||
DllExport void MNDebugPrintVertexNeighborhood (int vv, bool triprint=FALSE);
|
||||
DllExport bool CheckAllData ();
|
||||
|
||||
// Split functions maintain topological info. (MNSplit.cpp)
|
||||
DllExport int SplitTriEdge (int ee, float prop=.5f, float thresh=MNEPS,
|
||||
bool neVis=TRUE, bool neSel=FALSE);
|
||||
DllExport int SplitTriFace (int ff, double *bary=NULL, float thresh=MNEPS,
|
||||
bool neVis=TRUE, bool neSel=FALSE);
|
||||
DllExport void SplitTri6 (int ff, double *bary=NULL, int *nv=NULL);
|
||||
DllExport int SplitEdge (int ee, float prop=.5f);
|
||||
DllExport int SplitEdge (int ee, float prop, int *ntv);
|
||||
DllExport int SplitEdge (int ff, int ed, float prop, bool right, int *nf=NULL,
|
||||
int *ne=NULL, bool neVis=FALSE, bool neSel=FALSE, bool allconvex=FALSE);
|
||||
DllExport int IndentFace (int ff, int ei, int nv, int *ne=NULL, bool nevis=TRUE, bool nesel=FALSE);
|
||||
DllExport void SeparateFace (int ff, int a, int b, int & nf, int & ne, bool neVis=FALSE, bool neSel=FALSE);
|
||||
DllExport void Slice (Point3 & N, float off, float thresh, bool split, bool remove, DWORD selLevel);
|
||||
DllExport void DeleteFlaggedFaces (DWORD deathflags, DWORD nvCopyFlags=0x0);
|
||||
DllExport bool WeldVerts (int a, int b);
|
||||
DllExport bool WeldEdge (int ee);
|
||||
|
||||
// Tessellation methods: (MNTess.cpp)
|
||||
DllExport void TessellateByEdges (float bulge, MeshOpProgress *mop=NULL);
|
||||
DllExport bool AndersonDo (float interp, DWORD selLevel, MeshOpProgress *mop=NULL);
|
||||
DllExport void TessellateByCenters (MeshOpProgress *mop=NULL);
|
||||
|
||||
// Sabin-Doo tessellation: (MNSabDoo.cpp)
|
||||
DllExport void SabinDoo (float interp, DWORD selLevel, MeshOpProgress *mop=NULL, Tab<Point3> *offsets=NULL);
|
||||
DllExport void SabinDooVert (int vid, float interp, DWORD selLevel, Point3 *ctr, Tab<Point3> *offsets=NULL);
|
||||
|
||||
// Non-uniform Rational Mesh Smooth (NURMS.cpp)
|
||||
DllExport void CubicNURMS (MeshOpProgress *mop=NULL, Tab<Point3> *offsets=NULL);
|
||||
DllExport void QuadraticNURMS (MeshOpProgress *mop=NULL, Tab<Point3> *offsets=NULL);
|
||||
|
||||
// Boolean functions: (MNBool.cpp)
|
||||
DllExport void PrepForBoolean ();
|
||||
DllExport bool BooleanCut (MNMesh & m2, int cutType, int fstart=0, MeshOpProgress *mop=NULL);
|
||||
DllExport bool MakeBoolean (MNMesh & m1, MNMesh & m2, int type, MeshOpProgress *mop=NULL);
|
||||
|
||||
// New functionality: mostly pipeline object requirements. (MNPipe.cpp)
|
||||
DllExport void ApplyMapper (UVWMapper & mp, BOOL channel=0, BOOL useSel=FALSE);
|
||||
DllExport void InvalidateGeomCache ();
|
||||
DllExport void InvalidateTopoCache ();
|
||||
DllExport void allocRVerts ();
|
||||
DllExport void updateRVerts (GraphicsWindow *gw);
|
||||
DllExport void freeRVerts ();
|
||||
|
||||
GraphicsWindow *getCacheGW() { return cacheGW; }
|
||||
void setCacheGW(GraphicsWindow *gw) { cacheGW = gw; }
|
||||
|
||||
DllExport void checkNormals (BOOL illum);
|
||||
DllExport void buildNormals ();
|
||||
DllExport void buildRenderNormals ();
|
||||
DllExport void UpdateBackfacing (GraphicsWindow *gw, bool force);
|
||||
|
||||
// Display flags
|
||||
void SetDispFlag(DWORD f) { dispFlags |= f; }
|
||||
DWORD GetDispFlag(DWORD f) { return dispFlags & f; }
|
||||
void ClearDispFlag(DWORD f) { dispFlags &= ~f; }
|
||||
|
||||
DllExport void render(GraphicsWindow *gw, Material *ma, RECT *rp, int compFlags, int numMat=1);
|
||||
DllExport void renderFace (GraphicsWindow *gw, int ff);
|
||||
DllExport void renderEdge (GraphicsWindow *gw, int ee);
|
||||
DllExport BOOL select (GraphicsWindow *gw, Material *ma, HitRegion *hr, int abortOnHit=FALSE, int numMat=1);
|
||||
DllExport void snap(GraphicsWindow *gw, SnapInfo *snap, IPoint2 *p, Matrix3 &tm);
|
||||
DllExport BOOL SubObjectHitTest(GraphicsWindow *gw, Material *ma, HitRegion *hr,
|
||||
DWORD flags, SubObjHitList& hitList, int numMat=1 );
|
||||
DllExport int IntersectRay (Ray& ray, float& at, Point3& norm);
|
||||
DllExport int IntersectRay (Ray& ray, float& at, Point3& norm, int &fi, int &ti, Point3 &bary);
|
||||
DllExport BitArray VertexTempSel (DWORD fmask=MN_DEAD, DWORD fset=0);
|
||||
|
||||
DllExport void ShallowCopy(MNMesh *amesh, DWORD channels);
|
||||
DllExport void NewAndCopyChannels(DWORD channels);
|
||||
DllExport void FreeChannels (DWORD channels, BOOL zeroOthers=1);
|
||||
|
||||
DllExport IOResult Save (ISave *isave);
|
||||
DllExport IOResult Load (ILoad *iload);
|
||||
};
|
||||
|
||||
class MNMeshBorder {
|
||||
friend class MNMesh;
|
||||
Tab<Tab<int> *> bdr;
|
||||
BitArray btarg;
|
||||
public:
|
||||
~MNMeshBorder () { Clear(); }
|
||||
void Clear () { for (int i=0; i<bdr.Count(); i++) if (bdr[i]) delete bdr[i]; bdr.ZeroCount(); }
|
||||
int Num () { return bdr.Count(); }
|
||||
Tab<int> *Loop (int i) { return bdr[i]; }
|
||||
bool LoopTarg (int i) { return ((i>=0) && (i<bdr.Count()) && (btarg[i])); }
|
||||
DllExport void MNDebugPrint (MNMesh *m);
|
||||
};
|
||||
|
||||
#endif
|
BIN
lib/maxsdk31/Maxscrpt.lib
Executable file
BIN
lib/maxsdk31/Maxscrpt.lib
Executable file
Binary file not shown.
11
lib/maxsdk31/MeshDLib.h
Executable file
11
lib/maxsdk31/MeshDLib.h
Executable file
@ -0,0 +1,11 @@
|
||||
#ifndef _MESHADJLIB_H_
|
||||
|
||||
#define _MESHADJLIB_H_
|
||||
#define IMPORTING
|
||||
#include "export.h"
|
||||
#include "meshadj.h"
|
||||
#include "MeshDelta.h"
|
||||
#undef IMPORTING
|
||||
|
||||
#endif
|
||||
|
483
lib/maxsdk31/MeshDelta.h
Executable file
483
lib/maxsdk31/MeshDelta.h
Executable file
@ -0,0 +1,483 @@
|
||||
// MeshDelta.h
|
||||
// By Steve Anderson of Kinetix.
|
||||
// Created June 1998
|
||||
|
||||
#ifndef __MESHDELTA__
|
||||
#define __MESHDELTA__
|
||||
|
||||
#include "export.h"
|
||||
#ifndef __MESHADJ__
|
||||
#include "meshadj.h"
|
||||
#endif
|
||||
|
||||
// STEVE: MeshDeltas and/or MapDeltas lack the following clever features:
|
||||
// - Realloc amounts: currently we realloc arrays with no extra room for growth (dv especially).
|
||||
|
||||
// These classes encompass the notion of a "Mesh Edit". They are the principal means
|
||||
// of keeping track of what's going on in the Edit Mesh modifier, and have many standard
|
||||
// mesh edits available for use elsewhere.
|
||||
|
||||
// Principle is that, while these work as designed on the right mesh, they will give
|
||||
// some result on the wrong mesh.
|
||||
|
||||
// Order of operations:
|
||||
// Verts/TVerts/CVerts created or cloned.
|
||||
// Faces created -- indices correspond to original vert list, then create, then clone.
|
||||
// Face attributes & indices changed.
|
||||
// Verts & faces deleted.
|
||||
|
||||
// "Channels" of data in MeshDelta -- different from PART_GEOM type channels!
|
||||
#define MDELTA_VMOVE 0x0001
|
||||
#define MDELTA_VCREATE 0x0002
|
||||
#define MDELTA_VCLONE 0x0004
|
||||
#define MDELTA_VDELETE 0x0008
|
||||
#define MDELTA_VDATA 0x0010
|
||||
#define MDELTA_FREMAP 0x0020
|
||||
#define MDELTA_FCHANGE 0x0040
|
||||
#define MDELTA_FCREATE 0x0080
|
||||
#define MDELTA_FDELETE 0x0100
|
||||
#define MDELTA_FDATA 0x0200
|
||||
#define MDELTA_NUMBERS 0x0400
|
||||
#define MDELTA_FSMOOTH 0x0800
|
||||
#define MDELTA_ALL 0xffff
|
||||
|
||||
class VertMove {
|
||||
public:
|
||||
DWORD vid;
|
||||
Point3 dv;
|
||||
|
||||
VertMove () {}
|
||||
VertMove (DWORD i, Point3 p) { vid=i; dv=p; }
|
||||
~VertMove () {}
|
||||
VertMove & operator= (VertMove & from) { vid=from.vid; dv=from.dv; return (*this); }
|
||||
};
|
||||
|
||||
class UVVertSet {
|
||||
public:
|
||||
DWORD vid;
|
||||
UVVert v;
|
||||
|
||||
UVVertSet () {}
|
||||
UVVertSet (DWORD i, UVVert p) { vid=i; v=p; }
|
||||
~UVVertSet () {}
|
||||
UVVertSet & operator= (UVVertSet & from) { vid=from.vid; v=from.v; return (*this); }
|
||||
};
|
||||
|
||||
#define FR_V0 1
|
||||
#define FR_V1 2
|
||||
#define FR_V2 4
|
||||
#define FR_ALL 7
|
||||
|
||||
class FaceRemap {
|
||||
public:
|
||||
DWORD f, flags, v[3]; // Face being remapped
|
||||
FaceRemap () { f=flags=0; }
|
||||
FaceRemap (DWORD ff, DWORD fl, DWORD *vv) { f=ff; flags=fl; memcpy (v,vv,3*sizeof(DWORD)); }
|
||||
DllExport void Apply (Face &ff);
|
||||
DllExport void Apply (TVFace & tf);
|
||||
DllExport void Apply (FaceRemap & fr);
|
||||
Face operator* (Face &ff) { Face nf=ff; Apply(nf); return nf; }
|
||||
TVFace operator* (TVFace & ff) { TVFace nf=ff; Apply(nf); return nf; }
|
||||
};
|
||||
|
||||
// Attribute changes available for faces:
|
||||
#define ATTRIB_EDGE_A (1<<0)
|
||||
#define ATTRIB_EDGE_B (1<<1)
|
||||
#define ATTRIB_EDGE_C (1<<2)
|
||||
#define ATTRIB_EDGE_ALL 7
|
||||
#define ATTRIB_HIDE_FACE (1<<3)
|
||||
#define ATTRIB_MATID (1<<4)
|
||||
|
||||
// Mat ID takes bits 5-21
|
||||
#define ATTRIB_MATID_SHIFT 5
|
||||
#define ATTRIB_MATID_MASK 0xffff
|
||||
|
||||
class FaceChange {
|
||||
public:
|
||||
DWORD f, flags, val;
|
||||
FaceChange () { f=flags=0; }
|
||||
FaceChange (DWORD ff, DWORD fl, DWORD v) { f=ff; flags=fl; val=v; }
|
||||
DllExport void Apply (Face &ff);
|
||||
DllExport void Apply (FaceChange & fa);
|
||||
};
|
||||
|
||||
class FaceSmooth {
|
||||
public:
|
||||
DWORD f, mask, val;
|
||||
FaceSmooth () { f=mask=0; }
|
||||
FaceSmooth (DWORD ff, DWORD mk, DWORD vl) { f=ff; mask=mk; val=vl; }
|
||||
DllExport void Apply (Face &ff);
|
||||
DllExport void Apply (FaceSmooth & fs);
|
||||
};
|
||||
|
||||
//STEVE: someday support applying a standard mapping to selected faces?
|
||||
class MapDelta {
|
||||
public:
|
||||
DWORD vnum, fnum;
|
||||
Tab<UVVertSet> vSet;
|
||||
Tab<Point3> vCreate;
|
||||
Tab<TVFace> fCreate; // New texture vert faces -- matches master MeshDelta fCreate in size.
|
||||
Tab<FaceRemap> fRemap; // ordered list of faces using at least one new vertex.
|
||||
|
||||
MapDelta () { vnum=0; fnum=0; }
|
||||
DllExport void ClearAllOps ();
|
||||
|
||||
// Bookkeeping:
|
||||
DllExport int NumVSet (DWORD inVNum);
|
||||
DllExport void SetInVNum (DWORD n);
|
||||
DllExport void SetInFNum (DWORD n);
|
||||
DWORD outVNum () { return vnum + vCreate.Count(); }
|
||||
DWORD outVNum (DWORD inVNum) { return inVNum + vCreate.Count(); }
|
||||
bool IsCreate (DWORD i) { int j=i-vnum; return ((j>=0) && (j<vCreate.Count())); }
|
||||
DllExport DWORD SetID (DWORD i);
|
||||
|
||||
// Topological ops:
|
||||
DllExport DWORD VCreate (UVVert *v, int num=1);
|
||||
DllExport void FCreate (TVFace *f, int num=1);
|
||||
DllExport void FCreateDefault (int num=1);
|
||||
DllExport void FCreateQuad (DWORD *t);
|
||||
DllExport void FClone (TVFace & tf, DWORD remapFlags=0, DWORD *v=NULL);
|
||||
DllExport void FRemap (DWORD f, DWORD flags, DWORD *v); // Creates a (or modifies an existing) remap record.
|
||||
void FRemap (FaceRemap & fr) { FRemap (fr.f, fr.flags, fr.v); }
|
||||
DllExport DWORD RemapID (DWORD ff);
|
||||
DllExport DWORD IsRemapped (DWORD ff, DWORD vid);
|
||||
DllExport TVFace OutFace (TVFace *mf, DWORD ff);
|
||||
DllExport void FDelete (int offset, BitArray & fdel);
|
||||
|
||||
// Geometric ops:
|
||||
DllExport void Set (DWORD i, const UVVert & p);
|
||||
DllExport void Set (BitArray & sel, const UVVert & p);
|
||||
|
||||
// Uses:
|
||||
MapDelta & operator=(MapDelta & from) { CopyMDChannels (from, MDELTA_ALL); return *this; }
|
||||
DllExport MapDelta & operator*=(MapDelta & from);
|
||||
DllExport void Apply (UVVert *tv, TVFace *tf, DWORD inVNum, DWORD inFNum);
|
||||
|
||||
// Handy debugging output
|
||||
DllExport void MyDebugPrint ();
|
||||
|
||||
// Backup stuff:
|
||||
DllExport DWORD ChangeFlags ();
|
||||
DllExport void CopyMDChannels (MapDelta & from, DWORD channels);
|
||||
|
||||
// Double-checking routines, good for after loading.
|
||||
// Return TRUE if already correct, FALSE if they had to make a correction.
|
||||
DllExport BOOL CheckOrder (); // Checks for out of order sets or remaps
|
||||
DllExport BOOL CheckFaces (); // Checks remaps & fCreates for out of bound map vert id's.
|
||||
};
|
||||
|
||||
class VDataDelta {
|
||||
public:
|
||||
PerData *out;
|
||||
|
||||
VDataDelta () { out=NULL; }
|
||||
~VDataDelta () { if (out) delete out; }
|
||||
void SetVNum (int nv, BOOL keep=FALSE) { if (out) out->SetCount(nv,keep); }
|
||||
void Activate (int vnum, int vdID) { if (out==NULL) out = new PerData(vnum, VertexDataType(vdID)); }
|
||||
DllExport void Set (int where, void *data, int num=1);
|
||||
};
|
||||
|
||||
class MeshDelta {
|
||||
DWORD *vlut, *flut;
|
||||
int vlutSize, flutSize;
|
||||
|
||||
// Internal methods:
|
||||
// Parts of Cut:
|
||||
DWORD FindBestNextFace (Mesh & m, Tab<DWORD> *vfac, Point3 *cpv, DWORD startV, Point3 & svP);
|
||||
DWORD FindOtherFace (DWORD ff, Tab<DWORD> * vfa, Tab<DWORD> * vfb);
|
||||
public:
|
||||
DWORD vnum, fnum;
|
||||
|
||||
Tab<VertMove> vMove; // Ordered list of moves to existing verts
|
||||
Tab<Point3> vCreate; // Creation-order list of new points
|
||||
Tab<VertMove> vClone; // Creation-order list of cloned points.
|
||||
BitArray vDelete;
|
||||
|
||||
Tab<Face> fCreate; // New faces
|
||||
Tab<FaceRemap> fRemap; // existing faces using new verts. (Ordered list.)
|
||||
Tab<FaceChange> fChange; // ordered list of face flag changes
|
||||
Tab<FaceSmooth> fSmooth; // ordered list of face smoothing group changes
|
||||
BitArray fDelete; // Also applies to map faces.
|
||||
|
||||
BitArray vsel, esel, fsel, vhide; // Based on output mesh indexing.
|
||||
|
||||
MapDelta *map;
|
||||
BitArray mapSupport;
|
||||
|
||||
VDataDelta *vd; // Based on output mesh indexing.
|
||||
BitArray vdSupport;
|
||||
|
||||
DllExport MeshDelta ();
|
||||
DllExport MeshDelta (const Mesh & m);
|
||||
DllExport ~MeshDelta ();
|
||||
|
||||
DllExport void InitToMesh (const Mesh & m);
|
||||
DllExport void ClearAllOps ();
|
||||
DllExport void SetMapNum (int n, bool keep=TRUE);
|
||||
int GetMapNum () { return mapSupport.GetSize(); }
|
||||
DllExport void SetVDataNum (int size, bool keep=TRUE);
|
||||
int GetVDataNum () { return vdSupport.GetSize(); }
|
||||
DllExport DWORD PartsChanged ();
|
||||
|
||||
// The main work of a MeshDelta.
|
||||
DllExport void Apply(Mesh& mesh);
|
||||
MeshDelta& operator=(MeshDelta& td) { CopyMDChannels (td, MDELTA_ALL); return *this; }
|
||||
MeshDelta& operator*=(MeshDelta& td) { Compose(td); return *this; }
|
||||
DllExport void Compose (MeshDelta & td, Tab<DWORD> *cloneRemapTable=NULL);
|
||||
|
||||
// Following give numbers of clones or deletions, given the input numbers.
|
||||
// (We can't delete vertex 10 on an 8-vert mesh; this counts the number of valid entries.)
|
||||
DllExport DWORD NumVMove (DWORD inVNum);
|
||||
DllExport DWORD NumVClone (DWORD inVNum);
|
||||
DllExport DWORD NumVDelete (DWORD inVNum);
|
||||
DllExport DWORD NumFDelete (DWORD inFNum);
|
||||
|
||||
// Sets the size of the input object -- should be used only in multiplying MeshDeltas,
|
||||
// since it destroys records of changes to out-of-range components.
|
||||
// MeshDelta may be applied to mesh without using these.
|
||||
DllExport void SetInFNum (int nface);
|
||||
DllExport void SetInVNum (int nv);
|
||||
|
||||
int outVNum () { return vnum + vCreate.Count() + vClone.Count() - vDelete.NumberSet(); }
|
||||
int outVNum (int inVNum) { return inVNum + vCreate.Count() + NumVClone(inVNum) - NumVDelete(inVNum); }
|
||||
int outFNum () { return fnum + fCreate.Count() - fDelete.NumberSet(); }
|
||||
int outFNum (int inFNum) { return inFNum + fCreate.Count() - NumFDelete(inFNum); }
|
||||
|
||||
DllExport void FillInFaces (Mesh & m); // Fills in undefined mapping face verts.
|
||||
DllExport void AddVertexColors (); // Adds vertex color mapdelta to match this meshdelta.
|
||||
DllExport void AddMap (int mapID); // Adds mapdelta on specified channel to match this meshdelta.
|
||||
DllExport void AddVertexData (int vdChan, Mesh *m=NULL);
|
||||
|
||||
// Create lookup tables for fast conversion of pre- and post- vert/face indices.
|
||||
DllExport void UpdateLUTs (int extraV=0, int extraF=0);
|
||||
DllExport void ClearLUTs ();
|
||||
|
||||
// Following methods turn output indices to input indices.
|
||||
DllExport DWORD VLut (DWORD i);
|
||||
DllExport DWORD FLut (DWORD i);
|
||||
// Following methods turn input indices to output indices.
|
||||
DllExport DWORD PostVIndex (DWORD i);
|
||||
DllExport DWORD PostFIndex (DWORD i);
|
||||
// Following operate on output indices
|
||||
bool IsVClone (DWORD i) { int j=VLut(i)-vnum-vCreate.Count(); return ((j>=0) && (j<vClone.Count())); }
|
||||
DWORD VCloneOf (DWORD i) { int j=VLut(i)-vnum-vCreate.Count(); return ((j>=0) && (j<vClone.Count())) ? vClone[j].vid : UNDEFINED; }
|
||||
bool IsVCreate (DWORD i) { int j=VLut(i)-vnum; return ((j>=0) && (j<vCreate.Count())); }
|
||||
bool IsFCreate (DWORD i) { int j=FLut(i)-fnum; return ((j>=0) && (j<fCreate.Count())); }
|
||||
DllExport DWORD MoveID (DWORD i);
|
||||
|
||||
// Basic topological operations:
|
||||
// Those that accept DWORD indices require post-operation indices.
|
||||
DllExport DWORD VCreate (Point3 *p, int num=1, BitArray *sel=NULL, BitArray *hide=NULL);
|
||||
DllExport DWORD VClone (DWORD *v, int num=1);
|
||||
DllExport DWORD VClone (DWORD *v, Point3 *off, int num=1);
|
||||
DllExport DWORD VClone (VertMove *vm, int num=1);
|
||||
DWORD VClone (DWORD v) { return VClone (&v, 1); }
|
||||
DWORD VClone (DWORD v, Point3 off) { return VClone (&v, &off, 1); }
|
||||
DllExport Point3 OutVert (Mesh & m, DWORD v);
|
||||
DllExport void VDelete (DWORD *v, int num=1);
|
||||
DllExport void VDelete (BitArray & vdel);
|
||||
DllExport DWORD FCreate (Face *f, int num=1);
|
||||
DllExport DWORD FCreateQuad (DWORD *v, DWORD smG=0, MtlID matID=0);
|
||||
DllExport DWORD FClone (Face & f, DWORD ff, DWORD remapFlags=0, DWORD *v=NULL);
|
||||
DllExport void CreateDefaultMapFaces (int num=1);
|
||||
DllExport void FRemap (FaceRemap *f, int num=1);
|
||||
DllExport void FRemap (DWORD f, DWORD flags, DWORD *v);
|
||||
DllExport DWORD RemapID (DWORD ff);
|
||||
DllExport DWORD IsRemapped (DWORD ff, DWORD vid);
|
||||
DllExport Face OutFace (Mesh & m, DWORD ff);
|
||||
DllExport void FChange (FaceChange *f, int num=1);
|
||||
DllExport void FChange (DWORD f, DWORD flags, DWORD dat);
|
||||
DllExport void FSmooth (FaceSmooth *f, int num=1);
|
||||
DllExport void FSmooth (DWORD f, DWORD mask, DWORD val);
|
||||
void SetMatID (DWORD f, MtlID mt) { FChange (f, ATTRIB_MATID, mt<<ATTRIB_MATID_SHIFT); }
|
||||
void SetSmGroup (DWORD f, DWORD smG) { FSmooth (f, ~0x0, smG); }
|
||||
void SetEdgeVis (DWORD f, DWORD ed, BOOL vis=TRUE) { FChange (f, (1<<ed), vis?(1<<ed):0); }
|
||||
DllExport void FDelete (DWORD *f, int num=1);
|
||||
DllExport void FDelete (BitArray & fdel);
|
||||
|
||||
// Following method will turn vertex clones-of-creates into separate creates, fixing rest of MeshDelta to match.
|
||||
DllExport void DigestClones (Tab<DWORD> *cloneRemapTable=NULL);
|
||||
|
||||
// Geometric ops:
|
||||
DllExport void Move (int i, const Point3 & p);
|
||||
DllExport void Move (BitArray & sel, const Point3 & p);
|
||||
DllExport void Move (VertMove *vm, int num);
|
||||
|
||||
// Gotta be able to save and load this complex thing...
|
||||
DllExport IOResult Save (ISave *isave);
|
||||
DllExport IOResult Load (ILoad *iload);
|
||||
|
||||
// Handy debugging output
|
||||
DllExport void MyDebugPrint (bool lut=FALSE, bool mp=FALSE);
|
||||
|
||||
// Backup-relevant characteristics:
|
||||
DllExport DWORD ChangeFlags (Tab<DWORD> *mChannels=NULL);
|
||||
DllExport void CopyMDChannels (MeshDelta & from, DWORD channels, Tab<DWORD> *mChannels=NULL);
|
||||
|
||||
// Double-checking routines, good for after loading.
|
||||
// Returns TRUE if order was already correct, FALSE if it had to make a correction.
|
||||
DllExport BOOL CheckOrder ();
|
||||
DllExport BOOL CheckMapFaces ();
|
||||
|
||||
// More complex operations, built on the list above.
|
||||
// Mesh given is expected to be result of the current MeshDelta.
|
||||
// Found in MDAppOps.cpp
|
||||
DllExport void AutoSmooth(Mesh &m, BitArray sel, float angle, AdjFaceList *af=NULL, AdjEdgeList *ae=NULL);
|
||||
DllExport void Bevel (Mesh & m, BitArray vset, float outline, Tab<Point3> *odir,
|
||||
float height, Tab<Point3> *hdir);
|
||||
DllExport DWORD CreatePolygon (Mesh & m, int deg, int *v, DWORD smG=0, MtlID matID=0);
|
||||
DllExport void DeleteVertSet (Mesh & m, BitArray sel); // does delete faces
|
||||
DllExport void DeleteEdgeSet (Mesh & m, BitArray sel); // doesn't delete verts
|
||||
DllExport void DeleteFaceSet (Mesh & m, BitArray sel); // doesn't delete verts.
|
||||
DllExport void DeleteSelected (Mesh & m);
|
||||
DllExport void DeleteIsoVerts (Mesh & m);
|
||||
DllExport void FlipNormal (Mesh & m, DWORD face);
|
||||
DllExport void MakeSelFacesPlanar (Mesh &m, BitArray sel);
|
||||
DllExport void MakeSelVertsPlanar (Mesh &m, BitArray sel);
|
||||
DllExport void MoveVertsToPlane (Mesh & m, BitArray sel, Point3 & N, float offset);
|
||||
DllExport void RestrictMatIDs (Mesh & m, int numMats); // like "FitMeshIDsToMaterial".
|
||||
DllExport void SelectFacesByFlags (Mesh & m, BOOL onoff, DWORD flagmask, DWORD flags);
|
||||
// if adj is non-NULL, it uses it to set the "other side" visible too.
|
||||
DllExport void SetSingleEdgeVis (Mesh & m, DWORD ed, BOOL vis, AdjFaceList *adj=NULL);
|
||||
|
||||
// Following will initialize to the mesh given: they can't be used to "add" ops to an existing MeshDelta.
|
||||
// (To add these ops, make a new MeshDelta, call one of the following, and append it to your previous one with Compose.)
|
||||
// Found in MDOps.cpp
|
||||
DllExport void AttachMesh (Mesh & m, Mesh &attachment, Matrix3 & relativeTransform,
|
||||
int matOffset);
|
||||
DllExport void BreakVerts (Mesh & m, BitArray vset);
|
||||
DllExport void ChamferEdges (Mesh & m, BitArray eset, MeshChamferData &mcd, AdjEdgeList *ae=NULL);
|
||||
DllExport void ChamferMove (Mesh & m, MeshChamferData &mcd, float amount, AdjEdgeList *ae=NULL);
|
||||
DllExport void ChamferVertices (Mesh & m, BitArray vset, MeshChamferData &mcd, AdjEdgeList *ae=NULL);
|
||||
DllExport void CloneFaces (Mesh & m, BitArray fset);
|
||||
DllExport void CloneVerts (Mesh & m, BitArray vset);
|
||||
DllExport void CollapseEdges(Mesh &m, BitArray ecol, AdjEdgeList *ae=NULL);
|
||||
DllExport DWORD Cut (Mesh & m, DWORD ed1, float prop1, DWORD ed2, float prop2,
|
||||
Point3 & norm, bool fixNeighbors=TRUE, bool split=FALSE);
|
||||
DllExport void Detach (Mesh & m, Mesh *out, BitArray fset, BOOL faces, BOOL del, BOOL elem);
|
||||
DllExport void DivideEdge (Mesh & m, DWORD ed, float prop=.5f, AdjEdgeList *el=NULL,
|
||||
bool visDiag1=FALSE, bool fixNeighbors=TRUE, bool visDiag2=FALSE, bool split=FALSE);
|
||||
DllExport void DivideEdges (Mesh & m, BitArray eset, AdjEdgeList *el=NULL);
|
||||
DllExport void DivideFace (Mesh & m, DWORD f, float *bary=NULL);
|
||||
DllExport void DivideFaces (Mesh & m, BitArray fset, MeshOpProgress *mop=NULL);
|
||||
DllExport void EdgeTessellate(Mesh &m, BitArray fset, float tens,
|
||||
AdjEdgeList *ae=NULL, AdjFaceList *af=NULL, MeshOpProgress *mop=NULL);
|
||||
DllExport void ExplodeFaces(Mesh &m, float thresh, bool useFaceSel=FALSE, AdjFaceList *af=NULL);
|
||||
DllExport void ExtrudeEdges (Mesh & m, BitArray eset, Tab<Point3> *edir=NULL);
|
||||
DllExport void ExtrudeFaces (Mesh & m, BitArray fset, AdjEdgeList *el=NULL);
|
||||
DllExport void ResetVertWeights (Mesh & m);
|
||||
DllExport void SetFaceColors (Mesh &m, BitArray fset, VertColor vc);
|
||||
DllExport void SetVertColors (Mesh &m, BitArray vset, VertColor vc);
|
||||
DllExport void SetVertWeights (Mesh &m, BitArray vset, float weight);
|
||||
DllExport DWORD TurnEdge (Mesh & m, DWORD ed, AdjEdgeList *el=NULL);
|
||||
DllExport BOOL WeldByThreshold (Mesh & m, BitArray vset, float thresh);
|
||||
DllExport void WeldVertSet (Mesh & m, BitArray vset, Point3 *weldPoint=NULL);
|
||||
DllExport void PropagateFacing (Mesh & m, BitArray & fset, int face,
|
||||
AdjFaceList &af, BitArray &done,BOOL bias=1);
|
||||
DllExport void UnifyNormals (Mesh & m, BitArray fset, AdjFaceList *af=NULL);
|
||||
|
||||
// In slicer.cpp:
|
||||
DllExport void Slice (Mesh & m, Point3 N, float off, bool sep=FALSE, bool remove=FALSE, BitArray *fslice=NULL, AdjEdgeList *ae=NULL);
|
||||
};
|
||||
|
||||
// Following classes provide standard interface for modifiers and objects that
|
||||
// use mesh deltas -- specifically Edit Mesh and Editable Mesh for now.
|
||||
|
||||
enum meshCommandMode { McmCreate, McmAttach, McmExtrude, McmBevel, McmChamfer,
|
||||
McmSlicePlane, McmCut, McmWeldTarget, McmFlipNormalMode, McmDivide, McmTurnEdge };
|
||||
enum meshButtonOp { MopHide, MopUnhideAll, MopDelete, MopDetach, MopBreak, MopViewAlign,
|
||||
MopGridAlign, MopMakePlanar, MopCollapse, MopTessellate, MopExplode, MopSlice, MopWeld,
|
||||
MopRemoveIsolatedVerts, MopSelectOpenEdges, MopCreateShapeFromEdges, MopShowNormal,
|
||||
MopFlipNormal, MopUnifyNormal, MopAutoSmooth, MopVisibleEdge, MopInvisibleEdge, MopAutoEdge };
|
||||
enum meshUIParam { MuiSelByVert, MuiIgBack, MuiIgnoreVis, MuiPolyThresh, MuiSoftSel,
|
||||
MuiSSUseEDist, MuiSSEDist, MuiSSBack, MuiFalloff, MuiPinch, MuiBubble,
|
||||
MuiWeldBoxSize, MuiWeldDist, MuiExtrudeType };
|
||||
|
||||
#define EM_SL_OBJECT 0
|
||||
#define EM_SL_VERTEX 1
|
||||
#define EM_SL_EDGE 2
|
||||
#define EM_SL_FACE 3
|
||||
#define EM_SL_POLYGON 4
|
||||
#define EM_SL_ELEMENT 5
|
||||
|
||||
class MeshDeltaUser {
|
||||
public:
|
||||
virtual void LocalDataChanged (DWORD parts)=0;
|
||||
// start or stop interactive command mode, uses mode enum above
|
||||
virtual void ToggleCommandMode (meshCommandMode mode)=0;
|
||||
// perform button op, uses op enum above
|
||||
virtual void ButtonOp (meshButtonOp opcode)=0;
|
||||
|
||||
// UI controls access
|
||||
virtual void GetUIParam (meshUIParam uiCode, int & ret) { }
|
||||
virtual void SetUIParam (meshUIParam uiCode, int val) { }
|
||||
virtual void GetUIParam (meshUIParam uiCode, float & ret) { }
|
||||
virtual void SetUIParam (meshUIParam uiCode, float val) { }
|
||||
virtual void UpdateApproxUI () { }
|
||||
|
||||
// Should work on any local command mode.
|
||||
virtual void ExitCommandModes ()=0;
|
||||
|
||||
virtual bool Editing () { return FALSE; } // returns TRUE iff between BeginEditParams, EndEditParams
|
||||
virtual DWORD GetEMeshSelLevel () { return EM_SL_OBJECT; }
|
||||
virtual void SetEMeshSelLevel (DWORD sl) { }
|
||||
};
|
||||
|
||||
class MeshDeltaUserData {
|
||||
public:
|
||||
virtual void ApplyMeshDelta (MeshDelta & md, MeshDeltaUser *mdu, TimeValue t)=0;
|
||||
virtual MeshDelta *GetCurrentMDState () { return NULL; } // only non-null in Edit Mesh
|
||||
// functional interface to mesh ops
|
||||
virtual void MoveSelection(int level, TimeValue t, Matrix3& partm, Matrix3& tmAxis, Point3& val, BOOL localOrigin)=0;
|
||||
virtual void RotateSelection(int level, TimeValue t, Matrix3& partm, Matrix3& tmAxis, Quat& val, BOOL localOrigin)=0;
|
||||
virtual void ScaleSelection(int level, TimeValue t, Matrix3& partm, Matrix3& tmAxis, Point3& val, BOOL localOrigin)=0;
|
||||
virtual void ExtrudeSelection(int level, BitArray* sel, float amount, float bevel, BOOL groupNormal, Point3* direction)=0;
|
||||
};
|
||||
|
||||
// Constants used in Edit(able) Mesh's shortcut table - THESE MUST BE MATCHED to values in Editable Mesh's resources.
|
||||
#define EM_SHORTCUT_ID 0x38ba1366
|
||||
|
||||
#define MDUID_EM_SELTYPE 40001
|
||||
#define MDUID_EM_SELTYPE_BACK 40002
|
||||
#define MDUID_EM_SELTYPE_VERTEX 40003
|
||||
#define MDUID_EM_SELTYPE_EDGE 40004
|
||||
#define MDUID_EM_SELTYPE_FACE 40005
|
||||
#define MDUID_EM_SELTYPE_POLYGON 40006
|
||||
#define MDUID_EM_SELTYPE_ELEMENT 40007
|
||||
#define MDUID_EM_SELTYPE_OBJ 40008
|
||||
#define MDUID_EM_AUTOSMOOTH 40009
|
||||
#define MDUID_EM_ATTACH 40010
|
||||
#define MDUID_EM_BREAK 40011
|
||||
#define MDUID_EM_IGBACK 40012
|
||||
#define MDUID_EM_BEVEL 40013
|
||||
#define MDUID_EM_CREATE 40014
|
||||
#define MDUID_EM_CUT 40015
|
||||
#define MDUID_EM_DIVIDE 40016
|
||||
#define MDUID_EM_EXTRUDE 40017
|
||||
#define MDUID_EM_FLIPNORM 40018
|
||||
#define MDUID_EM_SS_BACKFACE 40019
|
||||
#define MDUID_EM_UNIFY_NORMALS 40020
|
||||
#define MDUID_EM_HIDE 40021
|
||||
#define MDUID_EM_EDGE_INVIS 40022
|
||||
#define MDUID_EM_IGNORE_INVIS 40023
|
||||
#define MDUID_EM_IGNORE_INVIS 40023
|
||||
#define MDUID_EM_COLLAPSE 40024
|
||||
#define MDUID_EM_SHOWNORMAL 40025
|
||||
#define MDUID_EM_SELOPEN 40026
|
||||
#define MDUID_EM_REMOVE_ISO 40027
|
||||
#define MDUID_EM_SLICEPLANE 40028
|
||||
#define MDUID_EM_SOFTSEL 40029
|
||||
#define MDUID_EM_SLICE 40030
|
||||
#define MDUID_EM_DETACH 40031
|
||||
#define MDUID_EM_TURNEDGE 40032
|
||||
#define MDUID_EM_UNHIDE 40033
|
||||
#define MDUID_EM_EDGE_VIS 40034
|
||||
#define MDUID_EM_SELBYVERT 40035
|
||||
#define MDUID_EM_AUTOEDGE 40036
|
||||
#define MDUID_EM_WELD 40038
|
||||
#define MDUID_EM_EXPLODE 40039
|
||||
|
||||
DllExport void FindTriangulation (Mesh & m, int deg, int *vv, int *tri);
|
||||
|
||||
|
||||
#endif
|
33
lib/maxsdk31/Meshacc.h
Executable file
33
lib/maxsdk31/Meshacc.h
Executable file
@ -0,0 +1,33 @@
|
||||
/*****************************************************************************
|
||||
*<
|
||||
FILE: meshacc.h
|
||||
|
||||
DESCRIPTION: A class for getting at the private snap data of the mesh class
|
||||
|
||||
CREATED BY: John Hutchinson
|
||||
|
||||
HISTORY: created 1/2/97
|
||||
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
*****************************************************************************/
|
||||
#ifndef _MESHACC_H_
|
||||
|
||||
#define _MESHACC_H_
|
||||
#include "export.h"
|
||||
#include "mesh.h"
|
||||
|
||||
class MeshAccess {
|
||||
private:
|
||||
Mesh *mymesh;
|
||||
public:
|
||||
MeshAccess(Mesh *somemesh){mymesh = somemesh;}
|
||||
DllExport int BuildSnapData(GraphicsWindow *gw,int verts,int edges);
|
||||
char* GetsnapV(){
|
||||
return mymesh->snapV;
|
||||
}
|
||||
char* GetsnapF(){
|
||||
return mymesh->snapF;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
89
lib/maxsdk31/MouseProc.h
Executable file
89
lib/maxsdk31/MouseProc.h
Executable file
@ -0,0 +1,89 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: MouseProc.h
|
||||
|
||||
DESCRIPTION: Declares DataEntryMouseProc class
|
||||
|
||||
CREATED BY: Scott Morrison
|
||||
|
||||
HISTORY: created 7 December, 1998
|
||||
|
||||
*> Copyright (c) 1998, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
class DataEntryMouseProc : public MouseCallBack {
|
||||
public:
|
||||
CoreExport DataEntryMouseProc(Object* pObj, int cursor, HINSTANCE hInst);
|
||||
|
||||
CoreExport DataEntryMouseProc();
|
||||
|
||||
// Called when a point is selected
|
||||
CoreExport virtual BOOL OnPointSelected() {return TRUE; }
|
||||
// Called on every mouse move event
|
||||
CoreExport virtual void OnMouseMove(Point3& p) {}
|
||||
// Tells the system when to allow drawing in mutiple viewports
|
||||
CoreExport virtual BOOL AllowAnyViewport() { return TRUE; }
|
||||
// Called when backspace is pressed
|
||||
CoreExport virtual void RemoveLastPoint() {}
|
||||
// Called when the creation is finished
|
||||
CoreExport virtual int OnMouseAbort() { return CREATE_ABORT; }
|
||||
// Says whether the mouse proc should perform redraws
|
||||
// When used in a CreateMouseCallBack, this should return FALSE
|
||||
CoreExport virtual BOOL PerformRedraw() { return TRUE; }
|
||||
|
||||
// These methods need to be implemented to get the offset line drawn
|
||||
|
||||
// Tells the object to draw offset lines
|
||||
CoreExport virtual void SetUseConstructionLine(BOOL useLine) = 0;
|
||||
// Sets the endpoints of the line (0 is start, 1 is end)
|
||||
CoreExport virtual void SetConstructionLine(int i, Point3 p) = 0;
|
||||
|
||||
// The mouse callback function
|
||||
CoreExport int proc(HWND hwnd, int msg, int point, int flags, IPoint2 m );
|
||||
|
||||
friend class DataEntryBackspaceUser;
|
||||
|
||||
CoreExport void ClearCreationParams();
|
||||
|
||||
CoreExport void SetParams(HINSTANCE hInst, Object* pObj, int cursor);
|
||||
|
||||
private:
|
||||
Point3 GetPoint(IPoint2 m, HWND hWnd, ViewExp* pVpt);
|
||||
void SetOffsetBase(IPoint2 m, HWND hWnd, ViewExp* pVpt);
|
||||
BOOL GetNodeTM(Matrix3& tm);
|
||||
IPoint2 ProjectPointToViewport(ViewExp *pVpt, Point3 fp);
|
||||
IPoint2 AngleSnapPoint(Point3 in3, ViewExp* pVpt);
|
||||
|
||||
// The inverse of the transform on the node (or viewport transform,
|
||||
// for creation mouse procs)
|
||||
Matrix3 mTM;
|
||||
|
||||
// Indicates when to ignore upclicks close to down clicks
|
||||
BOOL mDoNotDouble;
|
||||
// The resource id of the cursor to use
|
||||
int mCursor;
|
||||
// The instance of the dll using the mouse proc
|
||||
HINSTANCE mInstance;
|
||||
|
||||
// State for off-construction plane creation
|
||||
Point3 mSnappedPoint;
|
||||
Matrix3 mOriginalViewTM;
|
||||
|
||||
int mPreviousFlags;
|
||||
|
||||
protected:
|
||||
// The object using the mouse proc
|
||||
Object* mpObject;
|
||||
|
||||
// The number of points selected so far.
|
||||
int mMouseClick;
|
||||
// The 3D coordinates of the points, in the local coordinate system
|
||||
Tab<Point3> mPoints;
|
||||
// The 2D points the user selected in the viewport.
|
||||
Tab<IPoint2> mClickPoints;
|
||||
// TRUE when in the mode where we lift off the construction plane
|
||||
BOOL mLiftOffCP;
|
||||
// The last window we had an event in
|
||||
HWND mHwnd;
|
||||
IPoint2 mLastMovePoint;
|
||||
};
|
40
lib/maxsdk31/Omanapi.h
Executable file
40
lib/maxsdk31/Omanapi.h
Executable file
@ -0,0 +1,40 @@
|
||||
/**********************************************************************
|
||||
FILE: omanapi.h
|
||||
|
||||
DESCRIPTION: Defines an interface to the osnapmanager class
|
||||
|
||||
CREATED BY: John Hutchinson
|
||||
HISTORY: May 14, 1997
|
||||
Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
#ifndef _IOMAN_H
|
||||
#define _IOMAN_H
|
||||
// This class provides an interface to the OsnapManager. People who implement osnaps
|
||||
// need to record hits with the manager. People implementing command modes are responsible
|
||||
// for getting the snap preview done and may be responsible for initting and closing point
|
||||
// sequences.
|
||||
class OsnapHit;
|
||||
|
||||
class IOsnapManager
|
||||
{
|
||||
public:
|
||||
virtual BOOL getactive() const =0;
|
||||
virtual BOOL getAxisConstraint()=0;
|
||||
virtual void RecordHit(OsnapHit* somehit)=0;
|
||||
virtual BOOL OKForRelativeSnap()=0;
|
||||
virtual BOOL RefPointWasSnapped()=0;
|
||||
virtual Point3 GetRefPoint(BOOL top = TRUE)=0;
|
||||
virtual BOOL IsHolding()=0;
|
||||
virtual OsnapHit &GetHit()=0;
|
||||
virtual ViewExp* GetVpt()=0;
|
||||
virtual INode* GetNode()=0;
|
||||
virtual int GetSnapStrength()=0;
|
||||
virtual Matrix3 GetObjectTM()=0;
|
||||
virtual TimeValue GetTime()=0;
|
||||
virtual void wTranspoint(Point3 *inpt, IPoint3 *outpt)=0;
|
||||
virtual void Reset() =0;
|
||||
virtual BOOL TestAFlag(int mask)=0;
|
||||
virtual Point3 GetCurrentPoint()=0;
|
||||
};
|
||||
|
||||
#endif// _IOMAN_H
|
130
lib/maxsdk31/Osnap.h
Executable file
130
lib/maxsdk31/Osnap.h
Executable file
@ -0,0 +1,130 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: osnap.h
|
||||
|
||||
DESCRIPTION: Classes for Osnaps
|
||||
|
||||
CREATED BY: John Hutchinson
|
||||
|
||||
HISTORY: December 9, 1996
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef _OSNAP_H_
|
||||
#define _OSNAP_H_
|
||||
|
||||
#include "tab.h"
|
||||
#define RESET 0
|
||||
#define NEXT 1
|
||||
#define ICON_WIDTH 32
|
||||
|
||||
#define HILITE_NORMAL (1<<0)
|
||||
#define HILITE_BOX (1<<1)
|
||||
#define HILITE_NODE (1<<2)//Not implemented
|
||||
#define HILITE_CROSSHAIR (1<<3)
|
||||
|
||||
#define OSNAP_STATE _T("ObjectSnapPluginState")
|
||||
|
||||
//Some types
|
||||
class Candidate
|
||||
{
|
||||
public:
|
||||
Candidate(){};
|
||||
Candidate(Point3* p, int s, int num=0, ...);
|
||||
void SetMeshPoint(int which, const Point3 p);
|
||||
~Candidate();
|
||||
Point3 *pt;
|
||||
int type;
|
||||
int count;
|
||||
Point3 *meshverts;
|
||||
};
|
||||
|
||||
//typedef Tab<Point3> Point3Tab;
|
||||
typedef Tab<Candidate *> CandidateTab;
|
||||
typedef void (*SnapCallback) (Object* pobj, IPoint2 *p) ;
|
||||
|
||||
class OsnapMarker;
|
||||
class HitMesh;
|
||||
class IOsnapManager;
|
||||
|
||||
//The osnap class
|
||||
//===========================================================================
|
||||
|
||||
class Osnap {
|
||||
friend class OsnapHit;
|
||||
friend class OsnapManager;
|
||||
|
||||
protected:
|
||||
BOOL *m_active;
|
||||
DllExport void _Snap(INode* inode, TimeValue t, ViewExp *vpt, IPoint2 *p, SnapInfo *snap);
|
||||
DllExport Point3 _ReEvaluate(TimeValue t, OsnapHit *hit);
|
||||
DllExport boolean IsActive();
|
||||
DllExport void SetActive(int index, boolean state);
|
||||
DllExport boolean GetActive(int index);
|
||||
|
||||
GraphicsWindow *m_hitgw;
|
||||
|
||||
//Point management.
|
||||
//Some osnaps may want to maintain a list of potential hit points.
|
||||
//Note that the points should be passed in in modeling space
|
||||
DllExport void AddCandidate(Point3 *pt, int type = -1, int num = 0,...);
|
||||
DllExport Point3 *GetCandidatePoint(int index);
|
||||
DllExport void GetCandidateMesh(int index, HitMesh *m);
|
||||
DllExport int GetCandidateType(int index);
|
||||
// DllExport void AddCandidate(Point3 *pt);
|
||||
DllExport void ClearCandidates();
|
||||
DllExport int NumCandidates(){return point_candidates.Count();}
|
||||
virtual DllExport Point3 ReEvaluate(TimeValue t, OsnapHit *hit, Object* pobj);
|
||||
|
||||
//Note: the following version uses an index into the candidate list
|
||||
DllExport BOOL CheckPotentialHit(int ptindex, Point2 cursor);
|
||||
//Note: the following version uses a remote matrix of points
|
||||
DllExport BOOL CheckPotentialHit(Point3 *p, int ptindex, Point2 cursor);
|
||||
int m_baseindex;//an index into the tool array
|
||||
|
||||
public:
|
||||
|
||||
DllExport Osnap();//constructor
|
||||
DllExport virtual ~Osnap();
|
||||
DllExport void Init();
|
||||
|
||||
virtual int numsubs(){return 1;}; //the number of subsnaps this guy has
|
||||
virtual DllExport TCHAR *Category();//JH 01/04/98 {return NULL;}
|
||||
virtual Class_ID ClassID() { return Class_ID( 0, 0); }
|
||||
virtual BOOL UseCallbacks(){return FALSE;}
|
||||
virtual int NumCallbacks(){return 0;}
|
||||
virtual DllExport BOOL GetSupportedObject(INode *iNode, TimeValue t, ObjectState *os);
|
||||
|
||||
virtual TSTR *snapname(int index)=0; // the snap<61>s name to be displayed in the UI
|
||||
virtual TSTR *tooltip(int index){return NULL;} // the snap<61>s name to be displayed in the UI
|
||||
virtual boolean ValidInput(SClass_ID scid, Class_ID cid)=0;//the objects it supports
|
||||
virtual OsnapMarker *GetMarker(int index)=0; // single object might contain subsnaps
|
||||
virtual WORD HiliteMode(){return HILITE_NORMAL;}
|
||||
// UI methods
|
||||
virtual boolean BeginUI(HWND hwnd){return TRUE;}
|
||||
virtual void EndUI(HWND hwnd){};
|
||||
virtual HBITMAP getTools()=0;
|
||||
virtual HBITMAP getMasks()=0;
|
||||
virtual void Snap(Object* pobj, IPoint2 *p, TimeValue t){};
|
||||
virtual BOOL HitTest(Object* pobj, IPoint2 *p, TimeValue t){return TRUE;}
|
||||
virtual SnapCallback GetSnapCallback( int sub){ return NULL;}
|
||||
virtual WORD AccelKey(int index)=0;
|
||||
|
||||
|
||||
protected://data
|
||||
IOsnapManager *theman;
|
||||
// Point3Tab point_candidates; //this will hold the point candidates
|
||||
CandidateTab point_candidates; //this will hold the point candidates
|
||||
|
||||
public://data
|
||||
// INode *m_inode;
|
||||
// ViewExp *m_vpt;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _OSNAP_H_
|
22
lib/maxsdk31/Osnapapi.h
Executable file
22
lib/maxsdk31/Osnapapi.h
Executable file
@ -0,0 +1,22 @@
|
||||
/*****************************************************************************
|
||||
*<
|
||||
FILE: osnapapi.h
|
||||
|
||||
DESCRIPTION: Master include file for implementing osnaps
|
||||
|
||||
CREATED BY: John Hutchinson
|
||||
|
||||
HISTORY: created 5/17/97
|
||||
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _SNAPAPI_H
|
||||
#define _SNAPAPI_H
|
||||
|
||||
#include "omanapi.h"
|
||||
#include "osnap.h"
|
||||
#include "osnapmk.h"
|
||||
#include "osnaphit.h"
|
||||
|
||||
#endif //_SNAPAPI_H
|
76
lib/maxsdk31/Osnapdlg.h
Executable file
76
lib/maxsdk31/Osnapdlg.h
Executable file
@ -0,0 +1,76 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: OsnapDlg.h
|
||||
|
||||
DESCRIPTION: Declares class for the Osnap Dialog
|
||||
|
||||
CREATED BY: John Hutchinson
|
||||
|
||||
HISTORY: January 11 '97
|
||||
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#ifndef __OSNAPDLG__
|
||||
#define __OSNAPDLG__
|
||||
#include "tabdlg.h"
|
||||
|
||||
// The dimensions of the vertical toolbar that gets constructed for the UI
|
||||
#define CHECKBAR_WIDTH 225//230
|
||||
#define CHECKBAR_HEIGHT 130//150//113
|
||||
#define CHECKBAR_HOFFSET 5
|
||||
#define CHECKBAR_VOFFSET 30
|
||||
|
||||
class OsnapDlg : public TabbedDialog {
|
||||
public:
|
||||
HWND hSnapCat;
|
||||
static int curCat;
|
||||
OsnapManager *theMan;
|
||||
BOOL valid, spinDown, block;
|
||||
HWND hWnd;
|
||||
IVertToolbar *iCheckbar;
|
||||
int DoDialog(int page);
|
||||
|
||||
ISpinnerControl *iAbs[3], *iRel[3], *iDolly, *iRoll;
|
||||
|
||||
static int winX, winY;
|
||||
|
||||
OsnapDlg(HWND appWnd,HINSTANCE hInst);
|
||||
~OsnapDlg();
|
||||
|
||||
void Invalidate();
|
||||
void Update();
|
||||
void Init(HWND hWnd);
|
||||
void ChangeCat(int cat);
|
||||
|
||||
|
||||
void WMCommand(int id, int notify, HWND hCtrl);
|
||||
void WMSize(int how);
|
||||
|
||||
};
|
||||
|
||||
|
||||
void ShowOsnapDlg(HWND hWnd,HINSTANCE hInst,int page=0);
|
||||
void HideOsnapDlg();
|
||||
|
||||
class OsnapOffset {
|
||||
public:
|
||||
OsnapOffset(HWND HWnd, HINSTANCE hInst);
|
||||
~OsnapOffset();
|
||||
|
||||
void Init(HWND dWnd);
|
||||
void Update();
|
||||
void OnCommand(int id);
|
||||
void OnSpinnerChange(int id);
|
||||
|
||||
private:
|
||||
ISpinnerControl *iAbs[3], *iRel[3];
|
||||
Point3 refpoint, pAbs, pRel;
|
||||
OsnapManager *theman;
|
||||
HWND hWnd;
|
||||
|
||||
};
|
||||
|
||||
extern void OffsetOsnap(HWND hWnd, HINSTANCE hInst);
|
||||
#endif //__OSNAPDLG__
|
119
lib/maxsdk31/Osnaphit.h
Executable file
119
lib/maxsdk31/Osnaphit.h
Executable file
@ -0,0 +1,119 @@
|
||||
/**********************************************************************
|
||||
FILE: osnaphit.h
|
||||
|
||||
DESCRIPTION: Defines the classes which are passed from the osnaps
|
||||
to the manager.
|
||||
|
||||
CREATED BY: John Hutchinson
|
||||
HISTORY: December 9, 1996
|
||||
Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
#ifndef _OSNAPHIT_H_
|
||||
#define _OSNAPHIT_H_
|
||||
|
||||
class Osnap;
|
||||
class HitMesh;
|
||||
class OsnapMarker;
|
||||
|
||||
class OsnapHit
|
||||
{
|
||||
friend class OsnapManager;
|
||||
friend class Osnap;
|
||||
friend class TypedHit;
|
||||
public:
|
||||
CoreExport OsnapHit(Point3 p3, Osnap* s, int sub, HitMesh *m);
|
||||
CoreExport OsnapHit(Point3 pt);
|
||||
CoreExport OsnapHit(const OsnapHit& h);
|
||||
virtual CoreExport OsnapHit& operator=(const OsnapHit& h);
|
||||
virtual CoreExport ~OsnapHit();
|
||||
virtual CoreExport OsnapHit* clone();
|
||||
|
||||
void setscreendata(IPoint3 screen3, int len);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Display Methods
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
CoreExport virtual boolean display(ViewExp *vpt, TimeValue t, Point3 color, \
|
||||
int markersize, boolean markers = TRUE, boolean hilite = TRUE);
|
||||
CoreExport void erase(ViewExp *vpt, TimeValue t) const; // the hit can erase itself
|
||||
CoreExport void GetViewportRect(TimeValue t,ViewExp *vpt,Rect *rect, int marksize)const;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Accessor Methods
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
CoreExport Point3 GetHitpoint(){return hitpoint;};
|
||||
CoreExport Point3 GetWorldHitpoint(){return worldpoint;};
|
||||
CoreExport IPoint3 GetHitscreen(){return m_hitscreen;};
|
||||
CoreExport int GetSubsnap(){return subsnap;}
|
||||
CoreExport POINT GetCursor(){return m_cursor;}
|
||||
INode *GetNode(){return node;}
|
||||
void Dump()const;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Operator Methods
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
//define comparators so we can sort a list of these
|
||||
CoreExport BOOL operator<(OsnapHit& hit);
|
||||
CoreExport BOOL operator>(OsnapHit& hit);
|
||||
|
||||
public:
|
||||
void Update(TimeValue t);
|
||||
CoreExport Point3 ReEvaluate(TimeValue t);
|
||||
virtual bool IsWorldSpaceHit(){return false;}
|
||||
|
||||
|
||||
private: //data
|
||||
Point3 hitpoint; // the hit location in object space
|
||||
Point3 worldpoint; // the hit location in world space
|
||||
IPoint3 m_hitscreen; // the hit location in screen space
|
||||
POINT m_cursor;//the position of the cursor when this guy was recorded
|
||||
int m_len; //The distace from the cursor
|
||||
int m_z_depth; //The depth in z space
|
||||
BOOL m_complete; //indicates whether the screendata has been set
|
||||
Osnap* snap; //the snap which made this hit
|
||||
int subsnap; //the subsnap index that made this hit
|
||||
OsnapMarker *m_pmarker; //a pointer to this snaps marker
|
||||
|
||||
INode* node;// the node which got hit
|
||||
HitMesh *hitmesh;//a mesh used to hilite the topolgy we hit
|
||||
|
||||
ViewExp *m_vpt;//the viewport which was active
|
||||
|
||||
BOOL m_invisible;//this guy won't display itself
|
||||
};
|
||||
|
||||
//a class to hold a list of object space points for highlighting the geometry
|
||||
class HitMesh
|
||||
{
|
||||
private:
|
||||
int m_numverts;
|
||||
Point3 *m_pverts;
|
||||
static long m_cref;
|
||||
public:
|
||||
CoreExport HitMesh();
|
||||
CoreExport ~HitMesh();
|
||||
CoreExport HitMesh(const HitMesh& h);
|
||||
CoreExport HitMesh(int n);
|
||||
Point3 operator[](int i){return m_pverts[i];}
|
||||
int getNumVerts(){return m_numverts;}
|
||||
void setNumVerts(int n){
|
||||
if(m_pverts != NULL)
|
||||
delete [] m_pverts;
|
||||
m_numverts = n;
|
||||
m_pverts = new Point3[n];
|
||||
}
|
||||
void setVert(int i, const Point3 &xyz){ m_pverts[i] = xyz; }
|
||||
Point3& getVert(int i){return m_pverts[i];}
|
||||
Point3* getVertPtr(){return m_pverts;}
|
||||
};
|
||||
|
||||
|
||||
class TypedHit: public OsnapHit
|
||||
{
|
||||
public:
|
||||
TypedHit(Point3 pt);
|
||||
virtual boolean display(ViewExp *vpt, TimeValue t, Point3 color, \
|
||||
int markersize, boolean markers = TRUE, boolean hilite = TRUE);
|
||||
virtual bool IsWorldSpaceHit(){return true;}
|
||||
};
|
||||
#endif //_OSNAPHIT_H
|
37
lib/maxsdk31/Osnapmk.h
Executable file
37
lib/maxsdk31/Osnapmk.h
Executable file
@ -0,0 +1,37 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: osnapmk.h
|
||||
|
||||
DESCRIPTION: A Class for an osnapmarker
|
||||
|
||||
CREATED BY: John Hutchinson
|
||||
|
||||
HISTORY: Feb 12, 1996
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef _OSNAP_MARK_H_
|
||||
#define _OSNAP_MARK_H_
|
||||
|
||||
class OsnapMarker
|
||||
{
|
||||
private:
|
||||
int m_numpoints;
|
||||
IPoint3 *m_ppt;
|
||||
IPoint3 *m_pcache;
|
||||
IPoint3 m_cache_trans;
|
||||
int m_cache_size;
|
||||
int *m_edgevis;
|
||||
boolean IsCacheValid(IPoint3 trans, int size);
|
||||
void UpdateCache(IPoint3 trans, int size);
|
||||
|
||||
public:
|
||||
CoreExport OsnapMarker();
|
||||
CoreExport ~OsnapMarker();
|
||||
CoreExport OsnapMarker(int n, IPoint3 *ppt, int *pes);
|
||||
CoreExport OsnapMarker(const OsnapMarker& om);
|
||||
CoreExport OsnapMarker& operator=(const OsnapMarker& om);
|
||||
void display(IPoint3 xyz, int markersize, GraphicsWindow *gw);
|
||||
};
|
||||
|
||||
#endif
|
BIN
lib/maxsdk31/Paramblk2.lib
Executable file
BIN
lib/maxsdk31/Paramblk2.lib
Executable file
Binary file not shown.
51
lib/maxsdk31/PrintManager.h
Executable file
51
lib/maxsdk31/PrintManager.h
Executable file
@ -0,0 +1,51 @@
|
||||
// ****************************************************************************
|
||||
//
|
||||
// DESCRIPTION: Declaration of the Print Manager
|
||||
// PATTERN : Singleton
|
||||
// CREATED BY : Michael Pittman
|
||||
// HISTORY : 12/21/1998
|
||||
//
|
||||
// ****************************************************************************
|
||||
#pragma once
|
||||
|
||||
class PrintManager
|
||||
{
|
||||
private:
|
||||
static PrintManager* m_instance; // Singleton instance
|
||||
HDC m_hdc; // Device context of printer
|
||||
int m_ncopies; // Number of copies to print
|
||||
bool m_landscape; // Print in landscape?
|
||||
|
||||
PRINTDLG m_pinfo; // Printer info from PrintDlg
|
||||
PAGESETUPDLG m_pgsetup; // Page Setup info from PageSetupDlg
|
||||
DEVMODE m_devmode; // Device mode structure
|
||||
TCHAR m_driver[128]; // Printer driver name
|
||||
TCHAR m_device[33]; // Printer device name
|
||||
bool m_use_pgsetup; // User has chosen page setup
|
||||
|
||||
PrintManager();
|
||||
|
||||
bool SetupPrintFromDialog(HWND parent);
|
||||
bool SetupPrintExisting(void);
|
||||
bool SetupPrintDefault(void);
|
||||
|
||||
public:
|
||||
typedef enum { k_UseDefault, k_PromptUser, k_UseExisting } PrinterChoice;
|
||||
|
||||
~PrintManager();
|
||||
|
||||
// Access to the singleton
|
||||
CoreExport static PrintManager* Instance(void);
|
||||
|
||||
// Query methods
|
||||
CoreExport HDC GetPrinterDC(PrinterChoice getfrom = k_PromptUser);
|
||||
CoreExport HDC GetDefaultPrinterDC(void) { return GetPrinterDC(k_UseDefault); }
|
||||
CoreExport HDC GetExistingPrinterDC(void) { return GetPrinterDC(k_UseExisting); }
|
||||
CoreExport void ReleasePrinterDC(HDC hdc);
|
||||
CoreExport int NumberCopies(void) { return m_ncopies; }
|
||||
CoreExport bool DoLandscape(void) { return m_landscape; }
|
||||
|
||||
// The standard print methods interface
|
||||
CoreExport bool OnPageSetup(HWND parent);
|
||||
};
|
||||
|
75
lib/maxsdk31/RefArrayBase.h
Executable file
75
lib/maxsdk31/RefArrayBase.h
Executable file
@ -0,0 +1,75 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: RefArrayBase.h
|
||||
|
||||
DESCRIPTION: A base class for implementing objects which need to maintain
|
||||
multiple arrays of references. This implementation makes the following assumptions:
|
||||
|
||||
1) The arrays are implemented as Tab<RefTargetHandle>
|
||||
|
||||
CREATED BY: John Hutchinson
|
||||
|
||||
HISTORY: created 8/24/98
|
||||
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
#pragma once
|
||||
#ifndef _REF_ARRAY_BASE
|
||||
#define _REF_ARRAY_BASE
|
||||
|
||||
#include "object.h"
|
||||
#include "Irefarray.h"
|
||||
|
||||
//SS 4/12/99: Now derives from ShapeObject; if your reference array only
|
||||
// supports mesh geometry, override SuperClassID() and IsShapeObject().
|
||||
class RefArrayBase : public ShapeObject, public IRefArray
|
||||
{
|
||||
public:
|
||||
CoreExport virtual int NumRefCols() const; // the size of arrays (the same size!)
|
||||
|
||||
protected:
|
||||
//From IRefArray
|
||||
CoreExport virtual int TotalRefs() const;
|
||||
|
||||
CoreExport virtual IRefArray* Inner(){return NULL;} //Access to the containee
|
||||
CoreExport virtual const IRefArray* Inner() const{return NULL;} //Access to the containee
|
||||
CoreExport virtual int InnerArrays() const; //the number of arrays in any containee
|
||||
CoreExport virtual int Remap(int row, int col) const; //Converts to linear, inner index
|
||||
|
||||
CoreExport virtual int ArrayOffset() const{return 0;} //The number of non-array references
|
||||
CoreExport virtual bool IsSubArrayIndex(int i) const {return i< ArrayOffset();}
|
||||
CoreExport virtual RefTargetHandle GetSubArrayReference(int i) {assert(0); return NULL;}
|
||||
CoreExport virtual void SetSubArrayReference(int i, RefTargetHandle rtarg) {assert(0);}
|
||||
|
||||
//Local methods
|
||||
CoreExport int LinearIndex(int row, int col);
|
||||
|
||||
public:
|
||||
CoreExport RefArrayBase() : ShapeObject() {}
|
||||
|
||||
//From Animatable
|
||||
CoreExport void * GetInterface(ULONG id)
|
||||
{
|
||||
if (id == I_REFARRAY)
|
||||
return static_cast<IRefArray *>(this);
|
||||
else
|
||||
return GeomObject::GetInterface(id);
|
||||
}
|
||||
|
||||
//From ReferenceMaker
|
||||
CoreExport virtual int NumRefs();
|
||||
CoreExport virtual RefTargetHandle GetReference(int i);
|
||||
CoreExport virtual void SetReference(int i, RefTargetHandle rtarg);
|
||||
|
||||
//Referencemaker overloads
|
||||
CoreExport virtual RefTargetHandle GetReference(int row, int col);
|
||||
CoreExport virtual void SetReference(int row, int col, RefTargetHandle rtarg);
|
||||
CoreExport virtual RefResult MakeRefByID(Interval refInterval, int row, int col, RefTargetHandle rtarg);
|
||||
CoreExport virtual RefResult ReplaceReference(int row, int col, RefTargetHandle newtarg, BOOL delOld=TRUE);
|
||||
CoreExport virtual RefResult DeleteReference(int row, int col);
|
||||
CoreExport virtual BOOL CanTransferReference(int row, int col);
|
||||
CoreExport virtual bool FindRef(RefTargetHandle rtarg, int& row, int& col);
|
||||
CoreExport virtual void CloneRefs(ReferenceMaker *, RemapDir& remap);
|
||||
|
||||
};
|
||||
#endif //_REF_ARRAY_BASE
|
1865
lib/maxsdk31/SURF_API.H
Executable file
1865
lib/maxsdk31/SURF_API.H
Executable file
File diff suppressed because it is too large
Load Diff
501
lib/maxsdk31/SimpComp.h
Executable file
501
lib/maxsdk31/SimpComp.h
Executable file
@ -0,0 +1,501 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: simpcomp.h
|
||||
|
||||
DESCRIPTION: A sample composite/leaf pair.
|
||||
|
||||
CREATED BY: John Hutchinson
|
||||
|
||||
HISTORY: created 8/24/98
|
||||
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
#ifndef _COMP_OBJ
|
||||
#define _COMP_OBJ
|
||||
|
||||
#define _CACHING
|
||||
|
||||
#include "compbase.h"
|
||||
#include "iparamb.h"
|
||||
#ifdef _CACHING
|
||||
#include "shape.h"
|
||||
#endif
|
||||
|
||||
class PickMember;
|
||||
class MoveModBoxCMode;
|
||||
class RotateModBoxCMode;
|
||||
class UScaleModBoxCMode;
|
||||
class NUScaleModBoxCMode;
|
||||
class SquashModBoxCMode;
|
||||
class SelectModBoxCMode;
|
||||
|
||||
extern TCHAR *GetString(int id);
|
||||
extern HINSTANCE hInstance;
|
||||
|
||||
#define BEGIN_EDIT_SKIP_SO_REGISTRATION (1<<7)
|
||||
|
||||
class SimpleComposite : public CompositeBase
|
||||
{
|
||||
friend class SimpleCompositeIterator;
|
||||
friend class UiUpdateRestore;
|
||||
friend class OpSelectionRestore;
|
||||
friend class ToggleHiddenRestore;
|
||||
|
||||
enum { kobjectarray, kcontrolarray };
|
||||
|
||||
//object list (references that we make)
|
||||
Tab<Object*> m_objlist;
|
||||
//controller list
|
||||
Tab<RefTargetHandle> m_ctllist;
|
||||
|
||||
protected://JH 1/13/99 let derived classes get at this stuff
|
||||
NameTab m_opName;
|
||||
BitArray selbits;//bit array to store the selection state of the components
|
||||
BitArray hidebits;//array to store the hidden state
|
||||
#define EXPAND_BITS 64 //the chunk size for resizing the bit array
|
||||
|
||||
bool m_creating;
|
||||
// int iSelLevel; //JH 5/31/99 moving to base class
|
||||
CoreExport static SimpleComposite* editObj;
|
||||
|
||||
Matrix3 m_AmbientTM;
|
||||
Interval ivalid;
|
||||
|
||||
#ifdef _CACHING
|
||||
protected:
|
||||
Mesh meshcache;
|
||||
BezierShape bezcache;
|
||||
Interval meshvalid;
|
||||
Interval shapevalid;
|
||||
#endif
|
||||
int mOpContentFlags; // a cached value; if flag is zero, it is not up-to-date
|
||||
enum
|
||||
{
|
||||
kFlagsValid = 1,
|
||||
kContainsBaseMesh = 2,
|
||||
kContainsBaseShape = 4,
|
||||
kContainsEvalMesh = 8,
|
||||
kContainsEvalShape = 16,
|
||||
};
|
||||
bool mContentUpdateInProgress;
|
||||
|
||||
class CompositeDeleteKeyUser : public EventUser
|
||||
{
|
||||
private:
|
||||
Object* m_composite_obj;
|
||||
public:
|
||||
//local methods
|
||||
CompositeDeleteKeyUser(){m_composite_obj = NULL;}
|
||||
void SetObject(Object* o){m_composite_obj = o;}
|
||||
|
||||
//from Eventuser
|
||||
void Notify();
|
||||
}
|
||||
m_delete_user;
|
||||
|
||||
public: //Class variables
|
||||
//miscellaneous
|
||||
CoreExport static IObjParam *ip; //Access to the interface
|
||||
CoreExport static HWND hParams1; // the object level dialog
|
||||
CoreExport static HWND hParams2; // the subobject dialog
|
||||
static PickMember pickCB;
|
||||
static bool BlockExtract;
|
||||
CoreExport static Class_ID m_classid;
|
||||
|
||||
//subobject modes
|
||||
CoreExport static MoveModBoxCMode *moveMode;
|
||||
CoreExport static RotateModBoxCMode *rotMode;
|
||||
CoreExport static UScaleModBoxCMode *uscaleMode;
|
||||
CoreExport static NUScaleModBoxCMode *nuscaleMode;
|
||||
CoreExport static SquashModBoxCMode *squashMode;
|
||||
CoreExport static SelectModBoxCMode *selectMode;
|
||||
|
||||
public: //methods
|
||||
// Constructor/Destructor
|
||||
CoreExport SimpleComposite();
|
||||
CoreExport ~SimpleComposite();
|
||||
|
||||
// From Animatable
|
||||
CoreExport virtual void DeleteThis(){delete this;}
|
||||
CoreExport virtual void BeginEditParams(IObjParam *ip, ULONG flags, Animatable *prev);
|
||||
CoreExport virtual void EndEditParams(IObjParam *ip, ULONG flags, Animatable *next);
|
||||
CoreExport virtual Class_ID ClassID() { return m_classid; }
|
||||
CoreExport virtual void FreeCaches();
|
||||
CoreExport virtual void* GetInterface(ULONG id);
|
||||
CoreExport virtual void GetClassName(TSTR& s) { s = _T("SimpleComposite"); }
|
||||
|
||||
|
||||
// From ReferenceMaker
|
||||
CoreExport virtual RefResult NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget,
|
||||
PartID& partID, RefMessage message);
|
||||
CoreExport virtual IOResult Load(ILoad* iload);
|
||||
CoreExport virtual IOResult Save(ISave* isave);
|
||||
|
||||
// From ReferenceTarget
|
||||
CoreExport virtual RefTargetHandle Clone(RemapDir& remap);
|
||||
|
||||
// From BaseObject
|
||||
CoreExport virtual int Display(TimeValue t, INode* inode, ViewExp *vpt, int flags);
|
||||
CoreExport virtual int HitTest(TimeValue t, INode* inode, int type, int crossing, int flags,
|
||||
IPoint2 *p, ViewExp *vpt);
|
||||
CoreExport virtual void ActivateSubobjSel(int level, XFormModes& modes);
|
||||
CoreExport virtual CreateMouseCallBack* GetCreateMouseCallBack();
|
||||
CoreExport virtual TCHAR *GetObjectName();
|
||||
CoreExport virtual void SelectSubComponent(HitRecord *hitRec, BOOL selected, BOOL all, BOOL invert=FALSE);
|
||||
CoreExport virtual void ClearSelection(int selLevel);
|
||||
CoreExport virtual void Move( TimeValue t, Matrix3& partm, Matrix3& tmAxis, Point3& val, BOOL localOrigin=FALSE);
|
||||
CoreExport virtual void Rotate( TimeValue t, Matrix3& partm, Matrix3& tmAxis, Quat& val, BOOL localOrigin=FALSE);
|
||||
CoreExport virtual void Scale( TimeValue t, Matrix3& partm, Matrix3& tmAxis, Point3& val, BOOL localOrigin=FALSE);
|
||||
CoreExport virtual void TransformStart(TimeValue t);
|
||||
CoreExport virtual int HitTest(TimeValue t, INode* inode, int type, int crossing, int flags,
|
||||
IPoint2 *p, ViewExp *vpt, ModContext* mc);
|
||||
//4/12/99 JH
|
||||
CoreExport virtual void CloneSelSubComponents(TimeValue t);
|
||||
CoreExport virtual void AcceptCloneSelSubComponents(TimeValue t);
|
||||
|
||||
|
||||
// From Object
|
||||
CoreExport virtual void InitNodeName(TSTR& s);
|
||||
CoreExport virtual Interval ObjectValidity(TimeValue t);
|
||||
CoreExport virtual int UsesWireColor(){return FALSE;}
|
||||
//CoreExport virtual int DoOwnSelectHilite(){return 0;}
|
||||
CoreExport virtual int NumPipeBranches();
|
||||
CoreExport virtual Object *GetPipeBranch(int i);
|
||||
CoreExport virtual INode *GetBranchINode(TimeValue t, INode *node, int i);
|
||||
CoreExport virtual int IsRenderable();
|
||||
CoreExport virtual BOOL IsShapeObject();
|
||||
|
||||
// From IComponent
|
||||
CoreExport virtual void Add(TimeValue t, Object* obj, TSTR objname, Matrix3& oppTm, Matrix3& boolTm, Matrix3& parTM, Control* opCont = NULL);
|
||||
CoreExport virtual void Add(TimeValue t,INode *node,Matrix3& boolTm, bool delnode = true);
|
||||
CoreExport virtual void Remove(ComponentIterator& i);
|
||||
CoreExport virtual void DisposeTemporary();
|
||||
CoreExport virtual ComponentIterator * MakeIterator();
|
||||
CoreExport virtual ComponentIterator * MakeReverseIterator();
|
||||
CoreExport virtual Object* MakeLeaf(Object* o);
|
||||
CoreExport virtual bool IsLeaf() const { return false; }
|
||||
CoreExport virtual void SelectOp(int which, BOOL selected);
|
||||
CoreExport virtual void ClearSelection();
|
||||
CoreExport virtual int GetSubSelectionCount();
|
||||
|
||||
// From IRefArray
|
||||
CoreExport virtual int NumRefRows() const; // the number of arrays I maintain including inner
|
||||
CoreExport virtual void EnlargeAndInitializeArrays(int newsize);
|
||||
CoreExport virtual const ReferenceArray& RefRow(int which) const;
|
||||
CoreExport virtual ReferenceArray& RefRow(int which);
|
||||
|
||||
// From CompositeBase
|
||||
CoreExport virtual ObjectState EvalPipeObj(TimeValue t, Object* obj);
|
||||
CoreExport virtual void CombineComponentMeshes(TimeValue t, Mesh& m);
|
||||
CoreExport virtual void CombineComponentShapes(TimeValue t, BezierShape& Dest);
|
||||
CoreExport virtual void CombineRenderMeshes(TimeValue t, INode *inode, View& view, Mesh& m);
|
||||
CoreExport virtual bool HasOnlyShapeOperands(TimeValue t);
|
||||
|
||||
//Local Methods
|
||||
CoreExport virtual void GetOpTM(TimeValue t,int which, Matrix3& tm, Interval *iv=NULL) const;
|
||||
CoreExport virtual void Invalidate();
|
||||
CoreExport virtual void HideOp(int which, BOOL hidden);
|
||||
CoreExport virtual bool IsSubObjSelected(int i);
|
||||
CoreExport virtual bool IsSubObjHidden(int i);
|
||||
CoreExport virtual void ExtractOperands(TimeValue t, INode* node, bool autodelete = true, bool justhide = false);
|
||||
CoreExport virtual void SetupUI2();
|
||||
CoreExport virtual void DoSubObjSelectionFromList();
|
||||
CoreExport virtual void CheckIfShapeIsRenderable(Object *obj){}
|
||||
CoreExport virtual void SetName(int i, TCHAR *n){ assert(m_opName.Count() > i); m_opName.SetName(i,n); }
|
||||
CoreExport virtual TSTR GetName(int i){ assert(m_opName.Count() > i && m_opName[i]); return m_opName[i]; }
|
||||
|
||||
protected:
|
||||
CoreExport void Clone(SimpleComposite * newob, RemapDir & remap);
|
||||
CoreExport void DisableExtract(bool extract);
|
||||
CoreExport void ToggleHidden(const Tab<int>& opset);
|
||||
CoreExport void UpdateContentFlags(bool recalc = false);
|
||||
CoreExport void EnableDeleteKey(bool OnOff);
|
||||
};
|
||||
|
||||
//FIXME JH
|
||||
//Consider creating a new class GeomObjectWrapper which encapsulates
|
||||
//the delegation of the geoobject methods
|
||||
|
||||
//SS 4/12/99: Now derives from ShapeObject; if you leaf will only
|
||||
// reference mesh geometry, override SuperClassID() and IsShapeObject().
|
||||
class SimpleLeaf : public ShapeObject, public IComponent
|
||||
{
|
||||
friend class SimpleLeafClassDesc;
|
||||
|
||||
static Class_ID m_classid;
|
||||
|
||||
protected:
|
||||
Object* m_obj;
|
||||
bool m_deleteMe;
|
||||
private:
|
||||
|
||||
public:
|
||||
// Constructor/Destructor
|
||||
CoreExport SimpleLeaf() : ShapeObject(), m_obj(NULL), m_deleteMe(false)
|
||||
{}
|
||||
CoreExport SimpleLeaf(Object* o, bool dm = true);
|
||||
CoreExport ~SimpleLeaf();
|
||||
|
||||
// Static methods for dynamic allocation
|
||||
CoreExport static SimpleLeaf* CreateSimpleLeaf(Object *ob, bool dm = true);
|
||||
CoreExport static void DeleteSimpleLeaf(SimpleLeaf* l);
|
||||
|
||||
// From Animatable
|
||||
CoreExport void DeleteThis()
|
||||
{ delete this; }
|
||||
CoreExport SClass_ID SuperClassID();
|
||||
CoreExport void BeginEditParams( IObjParam *ip, ULONG flags,Animatable *prev);
|
||||
CoreExport void EndEditParams( IObjParam *ip, ULONG flags,Animatable *next);
|
||||
CoreExport Class_ID ClassID()
|
||||
{ return m_classid; }
|
||||
CoreExport virtual void FreeCaches();
|
||||
CoreExport virtual void* GetInterface(ULONG id);
|
||||
CoreExport virtual void GetClassName(TSTR& s)
|
||||
{ s = _T("SimpleLeaf"); }
|
||||
|
||||
// From ReferenceMaker
|
||||
CoreExport int NumRefs()
|
||||
{ return 1; }
|
||||
CoreExport void SetReference(int i, RefTargetHandle rtarg)
|
||||
{ m_obj = (Object*) rtarg; }
|
||||
CoreExport RefTargetHandle GetReference(int i)
|
||||
{ return m_obj; }
|
||||
CoreExport RefResult NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget,
|
||||
PartID& partID, RefMessage message)
|
||||
{ return REF_SUCCEED; }
|
||||
CoreExport IOResult Load(ILoad* iload)
|
||||
{ return ShapeObject::Load(iload); }
|
||||
CoreExport IOResult Save(ISave* isave)
|
||||
{ return ShapeObject::Save(isave); }
|
||||
|
||||
// From ReferenceTarget
|
||||
CoreExport virtual RefTargetHandle Clone(RemapDir& remap);
|
||||
|
||||
// From BaseObject
|
||||
CoreExport TCHAR *GetObjectName();
|
||||
CoreExport CreateMouseCallBack* GetCreateMouseCallBack()
|
||||
{ return NULL; }
|
||||
CoreExport int Display(TimeValue t, INode* inode, ViewExp *vpt, int flags);
|
||||
CoreExport int HitTest(TimeValue t, INode* inode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt);
|
||||
CoreExport void Snap(TimeValue t, INode* inode, SnapInfo *snap, IPoint2 *p, ViewExp *vpt);
|
||||
CoreExport void GetWorldBoundBox(TimeValue t, INode *mat, ViewExp *vpt, Box3& box );
|
||||
CoreExport void GetLocalBoundBox(TimeValue t, INode *mat, ViewExp *vpt, Box3& box );
|
||||
// For sub-object selection
|
||||
CoreExport void Move( TimeValue t, Matrix3& partm, Matrix3& tmAxis, Point3& val, BOOL localOrigin=FALSE);
|
||||
CoreExport void Rotate( TimeValue t, Matrix3& partm, Matrix3& tmAxis, Quat& val, BOOL localOrigin);
|
||||
CoreExport void Scale( TimeValue t, Matrix3& partm, Matrix3& tmAxis, Point3& val, BOOL localOrigin);
|
||||
CoreExport void TransformStart(TimeValue t);
|
||||
CoreExport int HitTest(TimeValue t, INode* inode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt, ModContext* mc);
|
||||
CoreExport int Display(TimeValue t, INode* inode, ViewExp *vpt, int flags, ModContext* mc);
|
||||
CoreExport int SubObjectIndex(HitRecord *hitRec);
|
||||
CoreExport void GetSubObjectCenters(SubObjAxisCallback *cb,TimeValue t,INode *node,ModContext *mc);
|
||||
CoreExport void GetSubObjectTMs(SubObjAxisCallback *cb,TimeValue t,INode *node,ModContext *mc);
|
||||
|
||||
// From Object
|
||||
CoreExport void GetDeformBBox(TimeValue t, Box3& box, Matrix3 *tm = NULL, BOOL useSel = FALSE );
|
||||
CoreExport BOOL HasUVW();
|
||||
CoreExport void SetGenUVW(BOOL sw);
|
||||
CoreExport BOOL CanConvertToType(Class_ID obtype);
|
||||
CoreExport Object* ConvertToType(TimeValue t, Class_ID obtype);
|
||||
CoreExport void GetCollapseTypes(Tab<Class_ID> &clist, Tab<TSTR*> &nlist);
|
||||
CoreExport Class_ID PreferredCollapseType();
|
||||
CoreExport int IntersectRay(TimeValue t, Ray& ray, float& at, Point3& norm);
|
||||
CoreExport ObjectState Eval(TimeValue t);
|
||||
CoreExport BOOL IsShapeObject();
|
||||
CoreExport void InitNodeName(TSTR& s);
|
||||
CoreExport Interval ObjectValidity(TimeValue t);
|
||||
CoreExport int DoOwnSelectHilite();
|
||||
CoreExport int NumPipeBranches();
|
||||
CoreExport Object *GetPipeBranch(int i);
|
||||
CoreExport INode *GetBranchINode(TimeValue t,INode *node,int i);
|
||||
|
||||
// From GeomObject
|
||||
CoreExport Mesh* GetRenderMesh(TimeValue t, INode *inode, View& view, BOOL& needDelete);
|
||||
|
||||
// From ShapeObject
|
||||
CoreExport int NumberOfVertices(TimeValue t, int curve = -1);
|
||||
CoreExport int NumberOfCurves();
|
||||
CoreExport BOOL CurveClosed(TimeValue t, int curve);
|
||||
CoreExport Point3 InterpCurve3D(TimeValue t, int curve, float param, int ptype=PARAM_SIMPLE);
|
||||
CoreExport Point3 TangentCurve3D(TimeValue t, int curve, float param, int ptype=PARAM_SIMPLE);
|
||||
CoreExport float LengthOfCurve(TimeValue t, int curve);
|
||||
CoreExport int NumberOfPieces(TimeValue t, int curve);
|
||||
CoreExport Point3 InterpPiece3D(TimeValue t, int curve, int piece, float param, int ptype=PARAM_SIMPLE);
|
||||
CoreExport Point3 TangentPiece3D(TimeValue t, int curve, int piece, float param, int ptype=PARAM_SIMPLE);
|
||||
CoreExport MtlID GetMatID(TimeValue t, int curve, int piece);
|
||||
CoreExport BOOL CanMakeBezier();
|
||||
CoreExport void MakeBezier(TimeValue t, BezierShape &shape);
|
||||
CoreExport void MakePolyShape(TimeValue t, PolyShape &shape, int steps = PSHAPE_BUILTIN_STEPS, BOOL optimize = FALSE);
|
||||
CoreExport ShapeHierarchy &OrganizeCurves(TimeValue t, ShapeHierarchy *hier=NULL);
|
||||
CoreExport int MakeCap(TimeValue t, MeshCapInfo &capInfo, int capType);
|
||||
CoreExport int MakeCap(TimeValue t, PatchCapInfo &capInfo);
|
||||
CoreExport BOOL AttachShape(TimeValue t, INode *thisNode, INode *attachNode, BOOL weldEnds=FALSE, float weldThreshold=0.0f);
|
||||
|
||||
|
||||
// From IComponent
|
||||
CoreExport virtual void Add(TimeValue t, Object*, TSTR objname, Matrix3& oppTm, Matrix3& boolTm, Matrix3& parTM, Control* opCont = NULL);
|
||||
CoreExport virtual void Add(TimeValue t,INode *node,Matrix3& boolTm, bool delnode = true);
|
||||
CoreExport virtual void Remove(ComponentIterator& i);
|
||||
CoreExport virtual void DisposeTemporary();
|
||||
CoreExport virtual ComponentIterator * MakeIterator();
|
||||
CoreExport virtual ComponentIterator * MakeReverseIterator()
|
||||
{ return MakeIterator(); }
|
||||
CoreExport virtual Object* MakeLeaf(Object* o);
|
||||
CoreExport virtual bool IsLeaf() const
|
||||
{ return true; }
|
||||
CoreExport virtual void SelectOp(int which, BOOL selected)
|
||||
{}
|
||||
CoreExport virtual void ClearSelection()
|
||||
{}
|
||||
CoreExport virtual int GetSubSelectionCount()
|
||||
{ return 0; }
|
||||
};
|
||||
|
||||
|
||||
class SimpleCompositeIterator: public CompositeIteratorBase
|
||||
{
|
||||
private:
|
||||
// mutable lets us call non-const methods on SimpleComposte from
|
||||
// const iterator methods (like GetReference... ooohh).
|
||||
mutable SimpleComposite* m_pcomp;
|
||||
|
||||
public:
|
||||
CoreExport static SimpleCompositeIterator * CreateSimpleCompositeIterator(SimpleComposite* it);
|
||||
|
||||
CoreExport SimpleCompositeIterator(/*const*/ SimpleComposite* it);
|
||||
CoreExport virtual ~SimpleCompositeIterator();
|
||||
|
||||
CoreExport virtual Object* GetComponentObject() const;
|
||||
CoreExport virtual INode* GetComponentINode(INode *node) const;
|
||||
CoreExport virtual void DisposeComponentINode(INode *node) const;
|
||||
CoreExport virtual Control* GetComponentControl() const;//This need not be released
|
||||
CoreExport virtual bool Selected() const;//is the corresponding component selected?
|
||||
CoreExport virtual bool Hidden() const;//is the corresponding component hidden?
|
||||
CoreExport virtual void DeleteThis();
|
||||
|
||||
protected:
|
||||
// CompositeIteratorBase methods.
|
||||
CoreExport virtual Object* GetCompositeObject();
|
||||
CoreExport virtual const Object* GetCompositeObject() const;
|
||||
|
||||
CoreExport virtual bool ValidIndex(int which) const;
|
||||
};
|
||||
|
||||
class SimpleCompositeReverseIterator: public SimpleCompositeIterator
|
||||
{
|
||||
public:
|
||||
CoreExport SimpleCompositeReverseIterator(SimpleComposite* it);
|
||||
CoreExport virtual ~SimpleCompositeReverseIterator() {}
|
||||
|
||||
CoreExport virtual void First();
|
||||
CoreExport virtual void Next();
|
||||
CoreExport virtual bool IsDone();
|
||||
};
|
||||
|
||||
class SimpleCompositeClassDesc : public ClassDesc
|
||||
{
|
||||
public:
|
||||
int IsPublic() {return 0;}
|
||||
void * Create(BOOL loading = FALSE) {return new SimpleComposite();}
|
||||
const TCHAR * ClassName();
|
||||
//SS 4/12/99: RefArrayBase now derives from ShapeObject
|
||||
SClass_ID SuperClassID() {return SHAPE_CLASS_ID;}
|
||||
Class_ID ClassID() {return SimpleComposite::m_classid;}
|
||||
const TCHAR* Category();
|
||||
void ResetClassParams (BOOL fileReset);
|
||||
BOOL OkToCreate(Interface *i);
|
||||
int BeginCreate(Interface *i);
|
||||
int EndCreate(Interface *i);
|
||||
|
||||
};
|
||||
|
||||
class SimpleLeafClassDesc : public ClassDesc
|
||||
{
|
||||
public:
|
||||
int IsPublic() {return 0;}
|
||||
void * Create(BOOL loading = FALSE) {return new SimpleLeaf();}
|
||||
const TCHAR * ClassName() { return _T("Simple Leaf"); }
|
||||
//SS 4/12/99: RefArrayBase now derives from ShapeObject
|
||||
SClass_ID SuperClassID() {return SHAPE_CLASS_ID;}
|
||||
Class_ID ClassID() {return SimpleLeaf::m_classid;}
|
||||
const TCHAR* Category() { return _T(""); }
|
||||
void ResetClassParams (BOOL fileReset) {}
|
||||
};
|
||||
|
||||
/*
|
||||
Strategy for solving the ambient tm problem:
|
||||
1. Enhance the DependentEnumProc to accept a return value of SKIP.
|
||||
This is pretty much required for this to work.
|
||||
4a. Define 3 constants and enhance ReferenceTarget::EnumDependents() to
|
||||
support skipping (see my email).
|
||||
DONE
|
||||
2. When an operand is deselected, all its children's selection bits are
|
||||
cleared. There is no sense keeping these bits around, and they will
|
||||
confuse the enumerator.
|
||||
2a. This clearing must be done recursively, because the user can jump to
|
||||
the top of the mod stack in one step.
|
||||
3. We implement the AmbientTmEnumerator to collect all the tms in the selected
|
||||
branch, then calculate the world space transform after enumeration is
|
||||
complete.
|
||||
4. If looking at the operands of a block definition, extraction is disabled
|
||||
(should already be that way now).
|
||||
|
||||
// Here's how this is used: make this call from the link composite or leaf that
|
||||
// wants to know its world space tm.
|
||||
AmbientTmEnumerator getTM(this);
|
||||
EnumDependents(getTM);
|
||||
Matrix3 worldSpaceTMOfMe(1);
|
||||
assert(getTM.TmIsValid());
|
||||
if (getTM.TmIsValid())
|
||||
worldSpaceTMOfMe = getTM.AmbientTm();
|
||||
*/
|
||||
|
||||
|
||||
class AmbientTmEnumerator : public DependentEnumProc
|
||||
{
|
||||
private:
|
||||
// A stack of ptrs.
|
||||
Tab<ReferenceMaker*> mSelectedBranch;
|
||||
// A stack of tms.
|
||||
Tab<Matrix3> mTmStack;
|
||||
// initiating reference target
|
||||
ReferenceTarget * mInitiator;
|
||||
// A status so we know we ended where we should.
|
||||
bool reachedTheNode;
|
||||
|
||||
public:
|
||||
CoreExport AmbientTmEnumerator(ReferenceTarget * rtarg) : reachedTheNode(false) { mInitiator = rtarg; }
|
||||
|
||||
CoreExport virtual int proc(ReferenceMaker* rmaker);
|
||||
CoreExport bool TmIsValid() { return reachedTheNode; }
|
||||
CoreExport Matrix3 AmbientTm()
|
||||
{
|
||||
Matrix3 tm(1);
|
||||
for (int i = 0; i < mTmStack.Count(); i++)
|
||||
tm = mTmStack[i] * tm;
|
||||
//FIXME: calculate the tm using the stack of ptrs here; Pete?
|
||||
return tm;
|
||||
}
|
||||
};
|
||||
|
||||
class NodeEnum : public DependentEnumProc
|
||||
{
|
||||
private:
|
||||
// initiating reference target
|
||||
ReferenceTarget * mInitiator;
|
||||
|
||||
INode * node;
|
||||
|
||||
// A status so we know we ended where we should.
|
||||
bool reachedTheNode;
|
||||
|
||||
public:
|
||||
CoreExport NodeEnum(ReferenceTarget * rtarg) : reachedTheNode(false) { mInitiator = rtarg; }
|
||||
|
||||
CoreExport virtual int proc(ReferenceMaker* rmaker);
|
||||
CoreExport bool NodeIsValid() { return reachedTheNode; }
|
||||
CoreExport INode * Node() { return node; }
|
||||
};
|
||||
|
||||
|
||||
#endif //_COMP_OBJ
|
105
lib/maxsdk31/SpaceArrayCallback.h
Executable file
105
lib/maxsdk31/SpaceArrayCallback.h
Executable file
@ -0,0 +1,105 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Module: SpaceArrayCallback.H
|
||||
// Purpose: SpaceArrayCallback class definition
|
||||
// Author: Peter Sauerbrei
|
||||
// HISTORY: - created January 1998
|
||||
// - changed object type to CloneType 01/28/98 (PJS)
|
||||
// - changed CloneType back to OTYPE 01/30/98 (PJS)
|
||||
// - added proc to act as callback 02/02/98 (PJS)
|
||||
// - added new context modes 02/17/98 (PJS)
|
||||
//
|
||||
|
||||
|
||||
#ifndef __SPACEARRAYCALLBACK_H
|
||||
#define __SPACEARRAYCALLBACK_H
|
||||
|
||||
// include files
|
||||
#include <limits.h>
|
||||
#include <max.h>
|
||||
#include <splshape.h>
|
||||
|
||||
// needed types
|
||||
enum STYPE { SPACE_CENTER, SPACE_EDGE };
|
||||
enum OTYPE { NODE_CPY, NODE_INST, NODE_REF };
|
||||
enum CTYPE { CTXT_FREE, CTXT_CNTRCOUNT, CTXT_CNTRSPACE,
|
||||
CTXT_END, CTXT_ENDCOUNT, CTXT_ENDSPACE,
|
||||
CTXT_START, CTXT_STARTCOUNT, CTXT_STARTSPACE,
|
||||
CTXT_FULLSPACE, CTXT_FULLCOUNT, CTXT_ENDLOCK,
|
||||
CTXT_ENDLOCKCOUNT, CTXT_ENDLOCKSPACE, CTXT_STARTLOCK,
|
||||
CTXT_STARTLOCKCOUNT, CTXT_STARTLOCKSPACE,
|
||||
CTXT_FULLLOCKSPACE, CTXT_FULLLOCKCOUNT,};
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// SpaceArracyCallback
|
||||
//
|
||||
class SpaceArrayCallback
|
||||
{
|
||||
private:
|
||||
ShapeObject * path;
|
||||
float start, end, space;
|
||||
int count;
|
||||
OTYPE oType;
|
||||
bool follow;
|
||||
STYPE sType;
|
||||
CTYPE context;
|
||||
float width;
|
||||
char buffer[100];
|
||||
int countLimit;
|
||||
|
||||
public:
|
||||
SpaceArrayCallback() { path = NULL; start = end = space = 0.0f; count = 1; oType = NODE_CPY; sType = SPACE_CENTER; follow = false;
|
||||
context = CTXT_FREE; width = 0.0f; countLimit = INT_MAX; }
|
||||
virtual ~SpaceArrayCallback() {}
|
||||
|
||||
// methods
|
||||
virtual bool isModal(void) { return true; }
|
||||
virtual bool doPickPath(void) { return false; }
|
||||
virtual TCHAR * dialogTitle(void) { return _T(""); }
|
||||
virtual TCHAR * startMessage(void) { return _T(""); }
|
||||
virtual TCHAR * buttonText(void) { return _T("OK"); }
|
||||
virtual bool isSilent(void) { return false; }
|
||||
virtual bool doObjectType(void) { return true; }
|
||||
virtual void proc(void) {}
|
||||
|
||||
// accessors
|
||||
ShapeObject * getPath(void) { return path; }
|
||||
void setPath(ShapeObject * p) { path = p; }
|
||||
void setPath(Point3 pt1, Point3 pt2) { path = new SplineShape;
|
||||
((SplineShape *)path)->shape.Init();
|
||||
((SplineShape *)path)->shape.NewSpline();
|
||||
Spline3D * spline = ((SplineShape *)path)->shape.GetSpline(0);
|
||||
spline->AddKnot(SplineKnot(KTYPE_CORNER, LTYPE_LINE, pt1, pt1, pt1));
|
||||
spline->AddKnot(SplineKnot(KTYPE_CORNER, LTYPE_LINE, pt2, pt2, pt2));
|
||||
spline->ComputeBezPoints();
|
||||
}
|
||||
void setPath(Spline3D *s) { path = new SplineShape;
|
||||
((SplineShape *)path)->shape.Init();
|
||||
((SplineShape *)path)->shape.AddSpline(s);
|
||||
s->ComputeBezPoints();
|
||||
}
|
||||
float getStart(void) { return start; }
|
||||
float getEnd(void) { return end; }
|
||||
float getSpace(void) { return space; }
|
||||
int getCount(void) { return count; }
|
||||
int getContext(void) { return context; }
|
||||
float getWidth(void) { return width; }
|
||||
void setStart(float f) { start = f; }
|
||||
void setEnd(float f) { end = f; }
|
||||
void setSpace(float f) { space = f; }
|
||||
void setCount(int n) { count = n > countLimit ? countLimit : n; }
|
||||
bool getFollow(void) { return follow; }
|
||||
void setFollow(bool t) { follow = t; }
|
||||
void setContext(CTYPE c) { context = c; }
|
||||
OTYPE getObjectCreationType(void) { return oType; }
|
||||
void setObjectCreationType(OTYPE t) { oType = t; }
|
||||
STYPE getSpacingType(void){ return sType; }
|
||||
void setSpacingType(STYPE s) { sType = s; }
|
||||
void setMessage(char * buf) { strcpy(buffer, buf); }
|
||||
void setWidth(float nWidth) { width = nWidth; }
|
||||
void setCountLimit(int limit) { countLimit = limit; }
|
||||
int getCountLimit(void) { return countLimit; }
|
||||
};
|
||||
|
||||
#endif
|
216
lib/maxsdk31/SvCore.h
Executable file
216
lib/maxsdk31/SvCore.h
Executable file
@ -0,0 +1,216 @@
|
||||
#pragma once
|
||||
|
||||
typedef enum
|
||||
{
|
||||
SVT_PROCEED,
|
||||
SVT_EXISTS,
|
||||
SVT_DO_NOT_PROCEED,
|
||||
} SvTraverseStatus;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
REFTYPE_CHILD,
|
||||
REFTYPE_SUBANIM,
|
||||
REFTYPE_PLUGIN,
|
||||
} SvReferenceType;
|
||||
|
||||
// Filter bits...
|
||||
static const DWORD SV_FILTER_SELOBJECTS = (1<<0);
|
||||
static const DWORD SV_FILTER_OBJECTMODS = (1<<1);
|
||||
static const DWORD SV_FILTER_BASEPARAMS = (1<<2);
|
||||
static const DWORD SV_FILTER_MATPARAMS = (1<<3);
|
||||
static const DWORD SV_FILTER_GEOM = (1<<4);
|
||||
static const DWORD SV_FILTER_SHAPES = (1<<5);
|
||||
static const DWORD SV_FILTER_LIGHTS = (1<<6);
|
||||
static const DWORD SV_FILTER_CAMERAS = (1<<7);
|
||||
static const DWORD SV_FILTER_HELPERS = (1<<8);
|
||||
static const DWORD SV_FILTER_WARPS = (1<<9);
|
||||
static const DWORD SV_FILTER_VISIBLE_OBJS = (1<<10);
|
||||
static const DWORD SV_FILTER_CONTROLLERS = (1<<11);
|
||||
static const DWORD SV_FILTER_ANIMATEDONLY = (1<<12);
|
||||
static const DWORD SV_FILTER_MAPS = (1<<13);
|
||||
static const DWORD SV_FILTER_BONES = (1<<14);
|
||||
|
||||
// Schematic view UI colors...
|
||||
static const int SV_UICLR_WINBK = 0;
|
||||
static const int SV_UICLR_NODEBK = 1;
|
||||
static const int SV_UICLR_SELNODEBK = 2;
|
||||
static const int SV_UICLR_NODE_HIGHLIGHT = 3;
|
||||
static const int SV_UICLR_MATERIAL_HIGHLIGHT = 4;
|
||||
static const int SV_UICLR_MODIFIER_HIGHLIGHT = 5;
|
||||
static const int SV_UICLR_PLUGIN_HIGHLIGHT = 6;
|
||||
static const int SV_UICLR_SUBANIM_LINE = 7;
|
||||
static const int SV_UICLR_CHILD_LINE = 8;
|
||||
static const int SV_UICLR_FRAME = 9;
|
||||
static const int SV_UICLR_SELTEXT = 10;
|
||||
static const int SV_UICLR_TEXT = 11;
|
||||
static const int SV_UICLR_FOCUS = 12;
|
||||
static const int SV_UICLR_MARQUIS = 13;
|
||||
static const int SV_UICLR_COLLAPSEARROW = 14;
|
||||
static const int SV_UICLR_GEOMOBJECT_BK = 15;
|
||||
static const int SV_UICLR_LIGHT_BK = 16;
|
||||
static const int SV_UICLR_CAMERA_BK = 17;
|
||||
static const int SV_UICLR_SHAPE_BK = 18;
|
||||
static const int SV_UICLR_HELPER_BK = 19;
|
||||
static const int SV_UICLR_SYSTEM_BK = 20;
|
||||
static const int SV_UICLR_CONTROLLER_BK = 21;
|
||||
static const int SV_UICLR_MODIFIER_BK = 22;
|
||||
static const int SV_UICLR_MATERIAL_BK = 23;
|
||||
static const int SV_UICLR_MAP_BK = 24;
|
||||
|
||||
static const int SV_UICLR_CACHE_SIZE = 25;
|
||||
|
||||
// Magic value returned from Animatable::SvGetSwatchColor(...)
|
||||
// to indicate that no swatch is to be drawn...
|
||||
static const int SV_NO_SWATCH = 0xFFFFFFFF;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// Bit flags which can be passed to IGraphObjectManager::AddAnimatable(...)
|
||||
// and Animatable::SvTraverseAnimGraph(....)
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
// If set, newly created node will be in the hidden state. If the node
|
||||
// already exists in the graph, the flag is ignored...
|
||||
static const DWORD SV_INITIALLY_HIDDEN = 0x00000001;
|
||||
|
||||
// If set, shared instances of an animatable will produce multiple
|
||||
// graph nodes in the schematic view instead of a single shared graph node...
|
||||
static const DWORD SV_DUPLICATE_INSTANCES = 0x00000002;
|
||||
|
||||
// If set, the newly created children of the newly created node
|
||||
// will be in the hidden state. If the node already exists in the graph,
|
||||
// the flag is ignored. Children of this node that already exist in
|
||||
// the graph will not have their visibility state changed...
|
||||
static const DWORD SV_INITIALLY_CLOSED = 0x00000004;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// Flags which can be passed to IGraphObjectManager::PushLevel(...)
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
// This id, when passed to PushLevel(), indicates that no id is to be associated
|
||||
// with Animatable being pushed onto the stack...
|
||||
static const int SV_NO_ID = 0x80000000;
|
||||
|
||||
class IGraphNode;
|
||||
class Animatable;
|
||||
class IGraphObjectManager;
|
||||
|
||||
class MultiSelectCallback
|
||||
{
|
||||
public:
|
||||
virtual int Priority() = 0; // Used for sorting select order.
|
||||
virtual void Begin(IGraphObjectManager *gom, bool clear) = 0;
|
||||
virtual void Select(IGraphObjectManager *gom, IGraphNode *gNode, bool isSelected) = 0;
|
||||
virtual void End(IGraphObjectManager *gom) = 0;
|
||||
};
|
||||
|
||||
class IGraphRef
|
||||
{
|
||||
public:
|
||||
};
|
||||
|
||||
class IGraphNode
|
||||
{
|
||||
public:
|
||||
|
||||
// Returns the Animatable associated with this node...
|
||||
virtual Animatable *GetAnim() = 0;
|
||||
|
||||
// Returns the "primary parent" of this node. Nodes
|
||||
// can have multiple parents (objects referencing
|
||||
// this node) so this function is not strictly
|
||||
// accurate. That said, many nodes have the
|
||||
// concept of an owner node, which is what this
|
||||
// function returns.
|
||||
virtual IGraphNode *GetParentNode() = 0;
|
||||
|
||||
// Returns the "owner" of this node. Some nodes
|
||||
// have multiple owners. When this is the case, this
|
||||
// function returns the "first" owner (the object
|
||||
// that first added this node to the schematic view)...
|
||||
virtual Animatable *GetOwner() = 0;
|
||||
|
||||
// Return the "id" of this node. When nodes are
|
||||
// added to the schematic view (via the
|
||||
// IGraphObjectManager::AddAnimatable(...) method),
|
||||
// an integer is provided. This value is is not
|
||||
// used internally by the schematic view. Rather,
|
||||
// it is available to implementers of the
|
||||
// Animatable::Sv*() methods to aid in identifying
|
||||
// the node.
|
||||
virtual int GetID() = 0;
|
||||
};
|
||||
|
||||
class SvGraphNodeReference
|
||||
{
|
||||
public:
|
||||
|
||||
IGraphNode *gNode;
|
||||
SvTraverseStatus stat;
|
||||
|
||||
SvGraphNodeReference()
|
||||
{
|
||||
gNode= NULL;
|
||||
stat = SVT_DO_NOT_PROCEED;
|
||||
}
|
||||
};
|
||||
|
||||
class IGraphObjectManager
|
||||
{
|
||||
public:
|
||||
|
||||
// During traversal of the Animatable graph via SvTraverseAnimGraph(...),
|
||||
// PushLevel() and PopLevel() should be called appropriately to
|
||||
// maintain an ownership stack. This is required by the schematic view
|
||||
// when nodes are added to the graph with the "SV_DUPLICATE_INSTANCES"
|
||||
// flag set...
|
||||
virtual void PushLevel(Animatable *anim, int id = SV_NO_ID) = 0;
|
||||
virtual void PopLevel() = 0;
|
||||
|
||||
// Adds an Animatable to the schematic view...
|
||||
virtual SvGraphNodeReference AddAnimatable(Animatable *anim, Animatable *owner, int id, DWORD flags = 0) = 0;
|
||||
|
||||
// Add a reference from "maker" node to "target"...
|
||||
virtual IGraphRef *AddReference(IGraphNode *maker, IGraphNode *target, SvReferenceType type) = 0;
|
||||
|
||||
// Pops up the property editor dialog on the
|
||||
// selected nodes in the schematic view...
|
||||
virtual void SvEditSelectedNodeProperties() = 0;
|
||||
|
||||
// Selects the given node in the material editor.
|
||||
// Does nothing if "gNode" does not represent a
|
||||
// material or map...
|
||||
virtual void SvSelectInMaterialEditor(IGraphNode *gNode) = 0;
|
||||
|
||||
// Selects the given node in the modifier panel.
|
||||
// Does nothing if "gNode" does not represent an
|
||||
// object...
|
||||
virtual void SvSetCurEditObject(IGraphNode *gNode) = 0;
|
||||
|
||||
// Returns true if the given node is current
|
||||
// in the modifier panel...
|
||||
virtual bool SvIsCurEditObject(IGraphNode *gNode) = 0;
|
||||
|
||||
virtual bool ApplyModifier(IGraphNode *gModNode, IGraphNode *gParentNode) = 0;
|
||||
virtual bool DeleteModifier(IGraphNode *gNode) = 0;
|
||||
|
||||
// Invalidates the schematic view window...
|
||||
virtual void SvInvalidateView() = 0;
|
||||
|
||||
// Invalidates a node in the schematic view window...
|
||||
virtual void SvInvalidateNode(IGraphNode *gNode) = 0;
|
||||
|
||||
// Forces the material editor to update...
|
||||
virtual void SvUpdateMaterialEditor() = 0;
|
||||
|
||||
// Forces the modifier panel to update...
|
||||
virtual void SvUpdateModifierPanel() = 0;
|
||||
|
||||
// Set, Clear and Test filter flags...
|
||||
virtual void SetFilter(DWORD mask) = 0;
|
||||
virtual void ClearFilter(DWORD mask) = 0;
|
||||
virtual bool TestFilter(DWORD mask) = 0;
|
||||
|
||||
// Get a SV UI color given a color index...
|
||||
virtual COLORREF SvGetUIColor(int colorIndex) = 0;
|
||||
};
|
52
lib/maxsdk31/Toolmap.h
Executable file
52
lib/maxsdk31/Toolmap.h
Executable file
@ -0,0 +1,52 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: toolmap.h
|
||||
|
||||
DESCRIPTION: defines a mapping between control identifiers and osnaps
|
||||
|
||||
CREATED BY: John Hutchinson
|
||||
|
||||
HISTORY: January 15, 1996
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __TOOLMAP__
|
||||
#define __TOOLMAP__
|
||||
|
||||
|
||||
class msgdata {
|
||||
public:
|
||||
int recipient;
|
||||
int subindex;
|
||||
int msg;
|
||||
msgdata(){};
|
||||
msgdata(int r, int s, int m):recipient(r), subindex(s), msg(m){};
|
||||
};
|
||||
|
||||
|
||||
|
||||
class tooltabentry {
|
||||
|
||||
private:
|
||||
|
||||
int indexer;
|
||||
msgdata data;
|
||||
|
||||
public:
|
||||
|
||||
tooltabentry(){};
|
||||
tooltabentry(int i, int r, int s, int m);
|
||||
msgdata *Query(int i);
|
||||
|
||||
};
|
||||
|
||||
|
||||
class ToolTab : public Tab<tooltabentry *> {
|
||||
public:
|
||||
msgdata *Lookup(int toolid);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif //_TOOLMAP_
|
47
lib/maxsdk31/VIZFunc.h
Executable file
47
lib/maxsdk31/VIZFunc.h
Executable file
@ -0,0 +1,47 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: VIZFunc.h
|
||||
|
||||
DESCRIPTION: General header file for VIZ functionality that
|
||||
needs to be exposed across projects.
|
||||
|
||||
CREATED BY: Michael Larson
|
||||
|
||||
HISTORY: created 11/12/98
|
||||
|
||||
*> Copyright (c) 1998, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
#pragma once
|
||||
#ifndef _VIZFUNC_H_
|
||||
#define _VIZFUNC_H_
|
||||
|
||||
//This class is a catch all for functionality that will show up in VIZ
|
||||
//Note that this guy will be instantiated only once.
|
||||
class VIZFunc
|
||||
{
|
||||
private:
|
||||
static bool mIsInstantiated;
|
||||
|
||||
public:
|
||||
//methods
|
||||
VIZFunc();
|
||||
~VIZFunc() {;}
|
||||
CoreExport bool IsSubObjAnimEnabled(SClass_ID sclID, Class_ID clID); //for checking to see if subobject is enabled for this class ID
|
||||
CoreExport bool IsPluginPresent(SClass_ID sclID, Class_ID clID);
|
||||
};
|
||||
|
||||
extern CoreExport VIZFunc gVIZFunc;
|
||||
|
||||
inline TSTR TwiddleResString(int MAXName, int VIZName)
|
||||
{
|
||||
#ifdef DESIGN_VER
|
||||
return GetResString(VIZName);
|
||||
#else
|
||||
return GetResString(MAXName);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif //_VIZFunc_H_
|
||||
|
||||
|
||||
|
BIN
lib/maxsdk31/acap.lib
Executable file
BIN
lib/maxsdk31/acap.lib
Executable file
Binary file not shown.
180
lib/maxsdk31/acolor.h
Executable file
180
lib/maxsdk31/acolor.h
Executable file
@ -0,0 +1,180 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: acolor.h
|
||||
|
||||
DESCRIPTION: floating point color + alpha
|
||||
|
||||
CREATED BY: Dan Silva
|
||||
|
||||
HISTORY:
|
||||
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef _ACOLOR_H
|
||||
|
||||
#define _ACOLOR_H
|
||||
|
||||
#include "maxtypes.h"
|
||||
#include "point3.h"
|
||||
#include "color.h"
|
||||
|
||||
class AColor {
|
||||
public:
|
||||
float r,g,b,a;
|
||||
|
||||
// Constructors
|
||||
AColor() {}
|
||||
AColor(float R, float G, float B, float A=1.0f) { r = R; g = G; b = B; a = A; }
|
||||
AColor(double R, double G, double B, double A=1.0) {
|
||||
r = (float)R; g = (float)G; b = (float)B; a = (float)A; }
|
||||
AColor(int R, int G, int B, int A=0) {
|
||||
r = (float)R; g = (float)G; b = (float)B; a = (float)A; }
|
||||
AColor(const AColor& c) { r = c.r; g = c.g; b = c.b; a = c.a; }
|
||||
AColor(const Color& c, float alph=1.0f) { r = c.r; g = c.g; b = c.b; a = alph; }
|
||||
DllExport AColor(DWORD rgb, float alph=1.0f); // from Windows RGB value
|
||||
AColor(float af[4]) { r = af[0]; g = af[1]; b = af[2];a = af[3]; }
|
||||
AColor(const BMM_Color_24& c) {
|
||||
r = float(c.r)/255.0f; g = float(c.g)/255.0f; b = float(c.b)/255.0f; a = 1.0f;
|
||||
}
|
||||
AColor(const BMM_Color_32& c) {
|
||||
r = float(c.r)/255.0f; g = float(c.g)/255.0f; b = float(c.b)/255.0f; a = float(c.a)/255.0f;
|
||||
}
|
||||
AColor(const BMM_Color_48& c) {
|
||||
r = float(c.r)/65535.0f; g = float(c.g)/65535.0f; b = float(c.b)/65535.0f; a = 1.0f;
|
||||
}
|
||||
AColor(const BMM_Color_64& c) {
|
||||
r = float(c.r)/65535.0f; g = float(c.g)/65535.0f; b = float(c.b)/65535.0f; a = float(c.a)/65535.0f;
|
||||
}
|
||||
|
||||
void Black() { r = g = b = 0.0f; a = 1.0f; }
|
||||
void White() { r = g = b = 1.0f; a = 1.0f; }
|
||||
|
||||
DllExport void ClampMax(); // makes components >= 0.0
|
||||
DllExport void ClampMin(); // makes components <= 1.0
|
||||
DllExport void ClampMinMax(); // makes components in [0,1]
|
||||
|
||||
// Access operators
|
||||
float& operator[](int i) { return (&r)[i]; }
|
||||
const float& operator[](int i) const { return (&r)[i]; }
|
||||
|
||||
// Conversion functions
|
||||
operator float*() { return(&r); }
|
||||
operator Color() { return Color(r,g,b); }
|
||||
|
||||
// Convert to Bitmap Manager types
|
||||
operator BMM_Color_24() {
|
||||
BMM_Color_24 c;
|
||||
c.r = int(r*255.0f); c.g = int(g*255.0f); c.b = int(b*255.0f);
|
||||
return c;
|
||||
}
|
||||
operator BMM_Color_32() {
|
||||
BMM_Color_32 c;
|
||||
c.r = int(r*255.0f); c.g = int(g*255.0f); c.b = int(b*255.0f); c.a = int(a*255.0f);
|
||||
return c;
|
||||
}
|
||||
operator BMM_Color_48() {
|
||||
BMM_Color_48 c;
|
||||
c.r = int(r*65535.0f); c.g = int(g*65535.0f); c.b = int(b*65535.0f);
|
||||
return c;
|
||||
}
|
||||
operator BMM_Color_64() {
|
||||
BMM_Color_64 c;
|
||||
c.r = int(r*65535.0f); c.g = int(g*65535.0f); c.b = int(b*65535.0f); c.a = int(a*65535.0f);
|
||||
return c;
|
||||
}
|
||||
|
||||
// Convert to Windows RGB
|
||||
operator DWORD() { return RGB(FLto255(r),FLto255(g), FLto255(b)); }
|
||||
|
||||
// Convert to Point3
|
||||
operator Point3() { return Point3(r,g,b); }
|
||||
|
||||
// Unary operators
|
||||
AColor operator-() const { return (AColor(-r,-g,-b, -a)); }
|
||||
AColor operator+() const { return *this; }
|
||||
|
||||
// Assignment operators
|
||||
inline AColor& operator-=(const AColor&);
|
||||
inline AColor& operator+=(const AColor&);
|
||||
inline AColor& operator*=(float);
|
||||
inline AColor& operator/=(float);
|
||||
inline AColor& operator*=(const AColor&); // element-by-element multiplg.
|
||||
|
||||
// Test for equality
|
||||
int operator==(const AColor& p) const { return ((p.r==r)&&(p.g==g)&&(p.b==b)&&(p.a==a)); }
|
||||
int operator!=(const AColor& p) const { return ((p.r!=r)||(p.g!=g)||(p.b!=b)||(p.a!=a)); }
|
||||
|
||||
// Binary operators
|
||||
inline AColor operator-(const AColor&) const;
|
||||
inline AColor operator+(const AColor&) const;
|
||||
inline AColor operator/(const AColor&) const;
|
||||
inline AColor operator*(const AColor&) const;
|
||||
inline AColor operator^(const AColor&) const; // CROSS PRODUCT
|
||||
};
|
||||
|
||||
int DllExport MaxComponent(const AColor&); // the component with the maximum abs value
|
||||
int DllExport MinComponent(const AColor&); // the component with the minimum abs value
|
||||
|
||||
// Inlines:
|
||||
|
||||
inline AColor& AColor::operator-=(const AColor& c) {
|
||||
r -= c.r; g -= c.g; b -= c.b; a -= c.a;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline AColor& AColor::operator+=(const AColor& c) {
|
||||
r += c.r; g += c.g; b += c.b; a += c.a;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline AColor& AColor::operator*=(float f) {
|
||||
r *= f; g *= f; b *= f; a *= f;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline AColor& AColor::operator/=(float f) {
|
||||
r /= f; g /= f; b /= f; a /= f;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline AColor& AColor::operator*=(const AColor& c) {
|
||||
r *= c.r; g *= c.g; b *= c.b; a *= c.a;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
inline AColor AColor::operator-(const AColor& c) const {
|
||||
return(AColor(r-c.r,g-c.g,b-c.b,a-c.a));
|
||||
}
|
||||
|
||||
inline AColor AColor::operator+(const AColor& c) const {
|
||||
return(AColor(r+c.r,g+c.g,b+c.b,a+c.a));
|
||||
}
|
||||
|
||||
inline AColor AColor::operator/(const AColor& c) const {
|
||||
return AColor(r/c.r,g/c.g,b/c.b,a/c.a);
|
||||
}
|
||||
|
||||
inline AColor AColor::operator*(const AColor& c) const {
|
||||
return AColor(r*c.r, g*c.g, b*c.b, a*c.a);
|
||||
}
|
||||
|
||||
inline AColor operator*(float f, const AColor& a) {
|
||||
return(AColor(a.r*f, a.g*f, a.b*f, a.a*f));
|
||||
}
|
||||
|
||||
inline AColor operator*(const AColor& a, float f) {
|
||||
return(AColor(a.r*f, a.g*f, a.b*f, a.a*f));
|
||||
}
|
||||
|
||||
// Composite fg over bg, assuming associated alpha,
|
||||
// i.e. pre-multiplied alpha for both fg and bg
|
||||
inline AColor CompOver(const AColor &fg, const AColor& bg) {
|
||||
return fg + (1.0f-fg.a)*bg;
|
||||
}
|
||||
|
||||
typedef AColor RGBA;
|
||||
|
||||
#endif
|
||||
|
22
lib/maxsdk31/alerts.h
Executable file
22
lib/maxsdk31/alerts.h
Executable file
@ -0,0 +1,22 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// -------------------
|
||||
// File ....: alerts.h
|
||||
// -------------------
|
||||
// Author...: Gus J Grubba
|
||||
// Date ....: April 1997
|
||||
// O.S. ....: Windows NT 4.0
|
||||
//
|
||||
// History .: Apr, 02 1997 - Created
|
||||
//
|
||||
// 3D Studio Max Notification Alerts
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef _ALERTS_H_
|
||||
#define _ALERTS_H_
|
||||
|
||||
#define NOTIFY_FAILURE (1<<0)
|
||||
#define NOTIFY_PROGRESS (1<<1)
|
||||
#define NOTIFY_COMPLETION (1<<2)
|
||||
|
||||
#endif
|
1155
lib/maxsdk31/animtbl.h
Executable file
1155
lib/maxsdk31/animtbl.h
Executable file
File diff suppressed because it is too large
Load Diff
135
lib/maxsdk31/appio.h
Executable file
135
lib/maxsdk31/appio.h
Executable file
@ -0,0 +1,135 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: appio.h
|
||||
|
||||
DESCRIPTION: General chunk-ifying code: useful for writing
|
||||
hierarchical data structures to a linear stream, such as
|
||||
an AppData block.
|
||||
|
||||
CREATED BY: Dan Silva
|
||||
|
||||
HISTORY: created 3/24/97
|
||||
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __APPIO__H
|
||||
#define __APPIO__H
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// AppSave will write hierarchical chunks into a private buffer, enlarging
|
||||
// it as needed. When completed, use the methods BufferPtr() and
|
||||
// NBytesWritten() to get at this buffer. ( AppSave will delete the buffer in
|
||||
// its DeleteThis() method , so you need to copy the buffer to save the data.)
|
||||
|
||||
// The chunk hierarchy should always have a single highest level chunk.
|
||||
// Chunks can be nested to any depth.
|
||||
// A Chunk can contain either sub-chunks, or data, but not both.
|
||||
|
||||
// For example:
|
||||
//
|
||||
// AppSave *asave = NewAppSave(1000);
|
||||
// asave->BeginChunk(MAIN_CHUNK);
|
||||
// asave->BeginChunk(CHUNK1);
|
||||
// .. write data
|
||||
// asave->EndChunk();
|
||||
//
|
||||
// asave->BeginChunk(CHUNK2);
|
||||
// .. write data
|
||||
// asave->EndChunk();
|
||||
//
|
||||
// asave->BeginChunk(CHUNK3);
|
||||
// .. write data
|
||||
// asave->EndChunk();
|
||||
// asave->EndChunk(); // end MAIN_CHUNK
|
||||
|
||||
|
||||
class AppSave {
|
||||
protected:
|
||||
~AppSave() {}
|
||||
public:
|
||||
virtual void DeleteThis()=0;
|
||||
|
||||
// After saving, use this to get pointer to the buffer created.
|
||||
virtual BYTE *BufferPtr()=0;
|
||||
|
||||
// This tells how many bytes were written in the buffer.
|
||||
virtual int NBytesWritten()=0;
|
||||
|
||||
// Begin a chunk.
|
||||
virtual void BeginChunk(USHORT id)=0;
|
||||
|
||||
// End a chunk, and back-patch the length.
|
||||
virtual void EndChunk()=0;
|
||||
|
||||
virtual int CurChunkDepth()=0; // for checking balanced BeginChunk/EndChunk
|
||||
|
||||
// write a block of bytes to the output stream.
|
||||
virtual IOResult Write(const void *buf, ULONG nbytes, ULONG *nwrit)=0;
|
||||
|
||||
// Write character strings
|
||||
virtual IOResult WriteWString(const char *str)=0;
|
||||
virtual IOResult WriteWString(const wchar_t *str)=0;
|
||||
virtual IOResult WriteCString(const char *str)=0;
|
||||
virtual IOResult WriteCString(const wchar_t *str)=0;
|
||||
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// AppLoad takes a chunk-ified data stream, and provides routines for
|
||||
// decoding it.
|
||||
|
||||
class AppLoad {
|
||||
protected:
|
||||
~AppLoad() {};
|
||||
public:
|
||||
virtual void DeleteThis()=0;
|
||||
|
||||
// if OpenChunk returns IO_OK, use following 3 function to get the
|
||||
// info about the chunk. IO_END indicates no more chunks at this level
|
||||
virtual IOResult OpenChunk()=0;
|
||||
|
||||
// These give info about the most recently opened chunk
|
||||
virtual USHORT CurChunkID()=0;
|
||||
virtual ChunkType CurChunkType()=0;
|
||||
virtual ULONG CurChunkLength()=0; // chunk length NOT including header
|
||||
virtual int CurChunkDepth()=0; // for checking balanced OpenChunk/CloseChunk
|
||||
|
||||
// close the currently opened chunk, and position at the next chunk
|
||||
// return of IO_ERROR indicates there is no open chunk to close
|
||||
virtual IOResult CloseChunk()=0;
|
||||
|
||||
// Look at the next chunk ID without opening it.
|
||||
// returns 0 if no more chunks
|
||||
virtual USHORT PeekNextChunkID()=0;
|
||||
|
||||
// Read a block of bytes from the output stream.
|
||||
virtual IOResult Read(void *buf, ULONG nbytes, ULONG *nread )=0;
|
||||
|
||||
// Read a string from a string chunk assumes chunk is already open,
|
||||
// it will NOT close the chunk. Sets buf to point
|
||||
// to a char string. Don't delete buf: ILoad will take care of it.
|
||||
|
||||
// Read a string that was stored as Wide chars.
|
||||
virtual IOResult ReadWStringChunk(char** buf)=0;
|
||||
virtual IOResult ReadWStringChunk(wchar_t** buf)=0;
|
||||
|
||||
// Read a string that was stored as single byte chars
|
||||
virtual IOResult ReadCStringChunk(char** buf)=0;
|
||||
virtual IOResult ReadCStringChunk(wchar_t** buf)=0;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
// Create a new AppLoad for reading chunks out of buf:
|
||||
// bufSize specifies the number of bytes that are valid in
|
||||
// buf..
|
||||
CoreExport AppLoad *NewAppLoad(BYTE *buf, int bufSize);
|
||||
|
||||
// Create a new AppSave for writing chunks
|
||||
// InitbufSize is the initial size the internal buffer is allocated to.
|
||||
// It will be enlarged if necessary.
|
||||
CoreExport AppSave *NewAppSave(int initBufSize);
|
||||
|
||||
#endif
|
35
lib/maxsdk31/arcdlg.h
Executable file
35
lib/maxsdk31/arcdlg.h
Executable file
@ -0,0 +1,35 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: arcdlg.h
|
||||
|
||||
DESCRIPTION:
|
||||
|
||||
CREATED BY: Dan Silva
|
||||
|
||||
HISTORY:
|
||||
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __ARCDLG__H
|
||||
#define __ARCDLG__H
|
||||
|
||||
|
||||
class ArcballDialog {
|
||||
public:
|
||||
virtual void DeleteThis()=0;
|
||||
};
|
||||
|
||||
class ArcballCallback {
|
||||
public:
|
||||
virtual void StartDrag()=0; // called when drag begins (may want to save state at this point)
|
||||
virtual void EndDrag()=0; // called when drag ends
|
||||
virtual void Drag(Quat q, BOOL buttonUp)=0; // called during drag, with q=relative rotation from start
|
||||
virtual void CancelDrag()=0; // called when right button clicked during drag
|
||||
virtual void BeingDestroyed()=0; // called if the window was closed
|
||||
};
|
||||
|
||||
CoreExport ArcballDialog *CreateArcballDialog(ArcballCallback *cb, HWND hwndOwner, TCHAR* title=NULL);
|
||||
|
||||
|
||||
#endif
|
30
lib/maxsdk31/assert1.h
Executable file
30
lib/maxsdk31/assert1.h
Executable file
@ -0,0 +1,30 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: assert1.h
|
||||
|
||||
DESCRIPTION:
|
||||
|
||||
CREATED BY: Dan Silva
|
||||
|
||||
HISTORY:
|
||||
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifdef assert
|
||||
#undef assert
|
||||
#endif
|
||||
|
||||
#define assert( expr ) ( expr || assert1( /*#expr,*/ __LINE__, __FILE__ ) )
|
||||
|
||||
#define MaxAssert( expr ) ( (expr) || assert1( __LINE__, __FILE__ ) )
|
||||
|
||||
extern int UtilExport assert1( /*char *expr,*/ int line, char *file );
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define DbgAssert( expr ) ( (expr) || assert1( __LINE__, __FILE__ ) )
|
||||
#define DbgVerify( expr ) ( (expr) || assert1( __LINE__, __FILE__ ) )
|
||||
#else
|
||||
#define DbgAssert( expr )
|
||||
#define DbgVerify( expr ) ( expr )
|
||||
#endif
|
187
lib/maxsdk31/bezfont.h
Executable file
187
lib/maxsdk31/bezfont.h
Executable file
@ -0,0 +1,187 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: bezfont.h
|
||||
|
||||
DESCRIPTION: Bezier Font Support methods
|
||||
|
||||
CREATED BY: Tom Hudson
|
||||
|
||||
HISTORY: Created 1 November 1995
|
||||
|
||||
*> Copyright (c) 1995, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __BEZFONT_H__
|
||||
|
||||
#define __BEZFONT_H__
|
||||
|
||||
#include "plugin.h"
|
||||
|
||||
// Forward references
|
||||
class BezFontManager;
|
||||
|
||||
class BezFontMetrics {
|
||||
public:
|
||||
LONG Height;
|
||||
LONG Ascent;
|
||||
LONG Descent;
|
||||
LONG InternalLeading;
|
||||
LONG ExternalLeading;
|
||||
LONG AveCharWidth;
|
||||
LONG MaxCharWidth;
|
||||
LONG Weight;
|
||||
LONG Overhang;
|
||||
LONG DigitizedAspectX;
|
||||
LONG DigitizedAspectY;
|
||||
BCHAR FirstChar;
|
||||
BCHAR LastChar;
|
||||
BCHAR DefaultChar;
|
||||
BCHAR BreakChar;
|
||||
BYTE Italic;
|
||||
BYTE Underlined;
|
||||
BYTE StruckOut;
|
||||
BYTE PitchAndFamily;
|
||||
BYTE CharSet;
|
||||
DWORD Flags;
|
||||
UINT SizeEM;
|
||||
UINT CellHeight;
|
||||
UINT AvgWidth;
|
||||
CoreExport BezFontMetrics() {} // To Do; Fill in fields with reasonable values
|
||||
CoreExport BezFontMetrics(NEWTEXTMETRIC *from);
|
||||
};
|
||||
|
||||
// BezFontInfo type
|
||||
#define BEZFONT_TRUETYPE 0
|
||||
#define BEZFONT_OTHER 1
|
||||
|
||||
// BezFontInfo flags
|
||||
// None currently defined
|
||||
|
||||
class BezFontInfo {
|
||||
public:
|
||||
TSTR name;
|
||||
TSTR style;
|
||||
int type; // See above
|
||||
DWORD flags; // See above
|
||||
BezFontMetrics metrics;
|
||||
BezFontInfo() {}
|
||||
BezFontInfo(TSTR n, TSTR s, int t, DWORD f, BezFontMetrics &m) { name=n; style=s; type=t; flags=f; metrics=m; }
|
||||
CoreExport BezFontInfo &operator=(BezFontInfo &from);
|
||||
};
|
||||
|
||||
// A class for Dlls to use for info that will be sent back to them at load time
|
||||
class DllData {
|
||||
public:
|
||||
DllData() {}
|
||||
};
|
||||
|
||||
// This is a callback class which is used to process font enumerations
|
||||
class BezFontEnumProc {
|
||||
public:
|
||||
virtual BOOL CALLBACK Entry(BezFontInfo &info, LPARAM userInfo)=0;
|
||||
};
|
||||
|
||||
// A special enumerator for the font manager
|
||||
class BezFontMgrEnumProc {
|
||||
public:
|
||||
BezFontManager *mgr;
|
||||
CoreExport BOOL CALLBACK Entry(BezFontInfo &info, LPARAM userInfo, DllData *dllData);
|
||||
void SetMgr(BezFontManager *m) { mgr = m; }
|
||||
};
|
||||
|
||||
// A class for listing font input dlls
|
||||
class BezFontDll {
|
||||
public:
|
||||
ClassDesc *dll;
|
||||
BezFontDll() { dll=NULL; }
|
||||
BezFontDll(ClassDesc *d) { dll = d; }
|
||||
};
|
||||
|
||||
typedef Tab<BezFontDll *> BezFontDllTab;
|
||||
|
||||
// A class for providing access to required Max internals
|
||||
class FontMgrInterface {
|
||||
public:
|
||||
virtual HINSTANCE AppInst() = 0;
|
||||
virtual HWND AppWnd() = 0;
|
||||
virtual DllDir *AppDllDir() = 0;
|
||||
virtual int GetFontDirCount() = 0;
|
||||
virtual TCHAR *GetFontDir (int i) = 0;
|
||||
};
|
||||
|
||||
typedef int BEZFONTHANDLE;
|
||||
|
||||
// A class used for listing the fonts we currently have available
|
||||
class AvailableFont {
|
||||
public:
|
||||
BezFontInfo info;
|
||||
DllData *dllData;
|
||||
int dllIndex; // The index of the DLL which provides this font (in BezFontDllTab)
|
||||
AvailableFont() { dllData = NULL; }
|
||||
AvailableFont(BezFontInfo &i, int di, DllData *dd=NULL) { info=i; dllIndex=di; dllData=dd; }
|
||||
~AvailableFont() { if(dllData) delete dllData; }
|
||||
};
|
||||
|
||||
typedef Tab<AvailableFont *> AvailableFontTab;
|
||||
|
||||
// The basic bezier font class
|
||||
class BezFont {
|
||||
public:
|
||||
CoreExport BezFont() { }
|
||||
CoreExport virtual void EnumerateFonts(BezFontMgrEnumProc &proc, LPARAM userInfo)=0;
|
||||
CoreExport virtual int OpenFont(TSTR name, DWORD flags, DllData *dllData)=0;
|
||||
CoreExport virtual void CloseFont()=0;
|
||||
CoreExport virtual BOOL BuildCharacter(UINT index, float height, BezierShape &shape, float &width, int fontShapeVersion=1)=0;
|
||||
};
|
||||
|
||||
// A class used to list the fonts currently open
|
||||
class OpenBezFont {
|
||||
public:
|
||||
int index; // The index in AvailableFont
|
||||
DWORD flags; // The style flags
|
||||
BEZFONTHANDLE handle; // The handle we know it by
|
||||
int count; // The number of users
|
||||
BezFont *loader; // The loader for the font
|
||||
OpenBezFont() {}
|
||||
OpenBezFont(int i, DWORD f, BEZFONTHANDLE h, BezFont *l) { index=i; flags=f; handle=h; count=1; loader=l; }
|
||||
~OpenBezFont();
|
||||
};
|
||||
|
||||
typedef Tab<OpenBezFont *> OpenBezFontTab;
|
||||
|
||||
// This is the interface into Bezier fonts within the MAX system.
|
||||
// This includes TrueType fonts and any other fonts supported via
|
||||
// plugins.
|
||||
|
||||
// OpenFont flags
|
||||
// None currently defined
|
||||
|
||||
class BezFontManager {
|
||||
friend class BezFontMgrEnumProc;
|
||||
|
||||
private:
|
||||
FontMgrInterface *iface;
|
||||
BOOL initialized;
|
||||
BezFontDllTab dllTab;
|
||||
AvailableFontTab available;
|
||||
OpenBezFontTab open;
|
||||
BezFontMgrEnumProc enumProc; // What we use to get the available fonts
|
||||
public:
|
||||
CoreExport BezFontManager();
|
||||
CoreExport ~BezFontManager();
|
||||
CoreExport void SetInterface(FontMgrInterface *i) { iface = i; }
|
||||
CoreExport void Init();
|
||||
CoreExport void Uninit();
|
||||
CoreExport void Reinit();
|
||||
CoreExport void EnumerateFonts(BezFontEnumProc &proc, LPARAM userInfo);
|
||||
CoreExport BOOL FontExists(TSTR name); // Returns TRUE if the font is available
|
||||
CoreExport BEZFONTHANDLE OpenFont(TSTR name, DWORD flags);
|
||||
CoreExport BOOL CloseFont(BEZFONTHANDLE handle); // Returns TRUE if the font is still in use
|
||||
CoreExport BOOL BuildCharacter(BEZFONTHANDLE handle, UINT index, float height, BezierShape &shape, float &width, int fontShapeVersion=1);
|
||||
CoreExport FontMgrInterface *GetInterface() { return iface; }
|
||||
CoreExport BOOL GetFontInfo(TSTR name, BezFontInfo &info);
|
||||
};
|
||||
|
||||
extern CoreExport BezFontManager theBezFontManager;
|
||||
|
||||
#endif //__BEZFONT_H__
|
84
lib/maxsdk31/bitarray.h
Executable file
84
lib/maxsdk31/bitarray.h
Executable file
@ -0,0 +1,84 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: bitarray.h
|
||||
|
||||
DESCRIPTION:
|
||||
|
||||
CREATED BY: Dan Silva
|
||||
|
||||
HISTORY:
|
||||
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef BITARRAY__H
|
||||
#define BITARRAY__H
|
||||
|
||||
#include <windef.h>
|
||||
#include <ioapi.h>
|
||||
|
||||
class BitArrayCallback {
|
||||
public:
|
||||
virtual void proc(int n)=0;
|
||||
};
|
||||
|
||||
// Direction indicators for BitArray::Rotate and BitArray::Shift
|
||||
#define LEFT_BITSHIFT 0
|
||||
#define RIGHT_BITSHIFT 1
|
||||
|
||||
class BitArray {
|
||||
DWORD* bits;
|
||||
long numBits;
|
||||
public:
|
||||
DllExport void SetSize(int n, int save=0); // save=1:preserve old bit values
|
||||
int GetSize() const { return numBits; }
|
||||
DllExport void ClearAll();
|
||||
DllExport void SetAll();
|
||||
DllExport void Set(int i); // set ith bit to 1
|
||||
DllExport void Clear(int i); // set ith bit to 0
|
||||
DllExport void Set(int i, int b); // set ith bit to b
|
||||
DllExport int operator[](int i) const; // get ith bit
|
||||
DllExport int NumberSet(); // how many bits are 1's.
|
||||
DllExport BOOL IsEmpty(); // are NO bits set?. much faster than NumberSet
|
||||
DllExport void Compress();
|
||||
DllExport void Expand();
|
||||
DllExport void Reverse(BOOL keepZero = FALSE); // keepZero=TRUE keeps zero bit where it is
|
||||
DllExport void Rotate(int direction, int count); // With wraparound
|
||||
DllExport void Shift(int direction, int count, int where=0); // Without wraparound
|
||||
DllExport void EnumSet(BitArrayCallback &cb); // enumerates elements that are 1's
|
||||
DllExport void DeleteSet (BitArray & dset, int mult=1);
|
||||
DllExport IOResult Save(ISave* isave);
|
||||
DllExport IOResult Load(ILoad* iload);
|
||||
|
||||
BitArray() { bits = NULL; numBits = 0; }
|
||||
DllExport BitArray(int n);
|
||||
DllExport BitArray(const BitArray& b);
|
||||
DllExport ~BitArray();
|
||||
|
||||
// Comparison operator
|
||||
DllExport BOOL operator==(const BitArray& b);
|
||||
|
||||
// Assignment operators
|
||||
DllExport BitArray& operator=(const BitArray& b);
|
||||
|
||||
// Assignment operators: These require arrays of the same size!
|
||||
DllExport BitArray& operator&=(const BitArray& b); // AND=
|
||||
DllExport BitArray& operator|=(const BitArray& b); // OR=
|
||||
DllExport BitArray& operator^=(const BitArray& b); // XOR=
|
||||
|
||||
// Binary operators: These require arrays of the same size!
|
||||
DllExport BitArray operator&(const BitArray&) const; // AND
|
||||
DllExport BitArray operator|(const BitArray&) const; // OR
|
||||
DllExport BitArray operator^(const BitArray&) const; // XOR
|
||||
|
||||
// Unary operators
|
||||
DllExport BitArray operator~(); // unary NOT function
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
1705
lib/maxsdk31/bitmap.h
Executable file
1705
lib/maxsdk31/bitmap.h
Executable file
File diff suppressed because it is too large
Load Diff
BIN
lib/maxsdk31/bmm.lib
Executable file
BIN
lib/maxsdk31/bmm.lib
Executable file
Binary file not shown.
5
lib/maxsdk31/bmmlib.h
Executable file
5
lib/maxsdk31/bmmlib.h
Executable file
@ -0,0 +1,5 @@
|
||||
#ifndef _BMMLIB_H_
|
||||
#define _BMMLIB_H_
|
||||
#define BMMExport __declspec( dllimport )
|
||||
#include "bitmap.h"
|
||||
#endif
|
68
lib/maxsdk31/box2.h
Executable file
68
lib/maxsdk31/box2.h
Executable file
@ -0,0 +1,68 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: box2.h
|
||||
|
||||
DESCRIPTION:
|
||||
|
||||
CREATED BY: Dan Silva
|
||||
|
||||
HISTORY:
|
||||
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef _BOX2_H
|
||||
|
||||
#define _BOX2_H
|
||||
|
||||
#include "ipoint2.h"
|
||||
#include "point2.h"
|
||||
#include <windef.h>
|
||||
|
||||
|
||||
class Box2: public RECT {
|
||||
public:
|
||||
DllExport Box2();
|
||||
DllExport Box2(const IPoint2 a, const IPoint2 b);
|
||||
DllExport int IsEmpty();
|
||||
DllExport void SetEmpty();
|
||||
DllExport void Rectify(); // makes top<bottom, left<right
|
||||
DllExport void Scale(float f);
|
||||
DllExport void Translate(IPoint2 t);
|
||||
|
||||
IPoint2 GetCenter() { return IPoint2((left+right)/2, (top+bottom)/2); }
|
||||
int x() { return left<right ? left : right; }
|
||||
int y() { return top<bottom ? top : bottom; }
|
||||
int w() { return abs(right-left)+1; }
|
||||
int h() { return abs(bottom-top)+1; }
|
||||
|
||||
void SetW(int w) { right = left + w -1; }
|
||||
void SetH(int h) { bottom = top + h -1; }
|
||||
void SetX(int x) { left = x; }
|
||||
void SetY(int y) { top = y; }
|
||||
void SetWH(int w, int h) { SetW(w); SetH(h); }
|
||||
void SetXY(int x, int y) { SetX(x); SetY(y); }
|
||||
|
||||
DllExport Box2& operator=(const RECT& r);
|
||||
DllExport Box2& operator=(RECT& r);
|
||||
DllExport Box2& operator+=(const Box2& b);
|
||||
DllExport Box2& operator+=(const IPoint2& p);
|
||||
int operator==( const Box2& b ) const { return (left==b.left && right==b.right && top==b.top && bottom==b.bottom); }
|
||||
DllExport int Contains(const IPoint2& p) const; // is point in this box?
|
||||
};
|
||||
|
||||
typedef Box2 Rect;
|
||||
|
||||
|
||||
struct FBox2 {
|
||||
Point2 pmin;
|
||||
Point2 pmax;
|
||||
int IsEmpty() { return pmin.x>pmax.x?1:0; }
|
||||
void SetEmpty() { pmin = Point2(1E30,1E30); pmax = -pmin; }
|
||||
FBox2& operator=(const FBox2& r) { pmin = r.pmin; pmax = r.pmax; return *this; }
|
||||
DllExport FBox2& operator+=(const Point2& p);
|
||||
DllExport FBox2& operator+=(const FBox2& b);
|
||||
DllExport int Contains(const Point2& p) const; // is point in this box?
|
||||
};
|
||||
|
||||
#endif
|
74
lib/maxsdk31/box3.h
Executable file
74
lib/maxsdk31/box3.h
Executable file
@ -0,0 +1,74 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: box3.h
|
||||
|
||||
DESCRIPTION: 3D Box class
|
||||
|
||||
CREATED BY: Dan Silva
|
||||
|
||||
HISTORY:
|
||||
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
#ifndef _BOX3_H
|
||||
|
||||
#define _BOX3_H
|
||||
|
||||
#include "point3.h"
|
||||
#include "matrix3.h"
|
||||
|
||||
class Box3 {
|
||||
public:
|
||||
Point3 pmin,pmax;
|
||||
DllExport Box3();
|
||||
Box3(const Point3& p, const Point3& q) { pmin = p; pmax = q;}
|
||||
DllExport void Init();
|
||||
|
||||
DllExport void MakeCube(const Point3& p, float side);
|
||||
|
||||
// Access
|
||||
Point3 Min() const { return pmin; }
|
||||
Point3 Max() const { return pmax; }
|
||||
Point3 Center() const { return(pmin+pmax)/(float)2.0; }
|
||||
Point3 Width() const { return(pmax-pmin); }
|
||||
|
||||
/* operator[] returns ith corner point: (i == (0..7) )
|
||||
Mapping:
|
||||
X Y Z
|
||||
[0] : (min,min,min)
|
||||
[1] : (max,min,min)
|
||||
[2] : (min,max,min)
|
||||
[3] : (max,max,min)
|
||||
[4] : (min,min,max)
|
||||
[5] : (max,min,max)
|
||||
[6] : (min,max,max)
|
||||
[7] : (max,max,max)
|
||||
*/
|
||||
DllExport Point3 operator[](int i) const;
|
||||
|
||||
// Modifiers
|
||||
DllExport Box3& operator+=(const Point3& p); // expand this box to include Point3
|
||||
DllExport Box3& operator+=(const Box3& b); // expand this box to include Box3
|
||||
|
||||
DllExport void Scale(float s); // scale box about center
|
||||
DllExport void Translate(const Point3 &p); // translate box
|
||||
DllExport void EnlargeBy(float s); // enlarge by this amount on all sides
|
||||
|
||||
// include an array of points, optionally transformed by tm
|
||||
DllExport void IncludePoints(Point3 *pts, int numpoints, Matrix3 *tm=NULL);
|
||||
|
||||
// Returns a box that bounds the 8 transformed corners of the input box.
|
||||
DllExport Box3 operator*(const Matrix3& tm) const;
|
||||
|
||||
// Tests
|
||||
DllExport int IsEmpty() const; // is this box empty?
|
||||
DllExport int Contains(const Point3& p) const; // is point in this box?
|
||||
DllExport int Contains(const Box3& b) const; // is box b totally in this box?
|
||||
DllExport int Intersects(const Box3& b) const; // does box b intersect this box at all?
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
52
lib/maxsdk31/buildver.h
Executable file
52
lib/maxsdk31/buildver.h
Executable file
@ -0,0 +1,52 @@
|
||||
#ifndef _BUILD_VER_
|
||||
|
||||
#define _BUILD_VER_
|
||||
|
||||
// Don't use! Edu version of MAX now keyed off serial number
|
||||
// Define EDU_VERSION to build the educational version of MAX
|
||||
//#define EDU_VERSION
|
||||
|
||||
// Define BETA_VERSION to use Beta lock
|
||||
//#define BETA_VERSION
|
||||
|
||||
// Define STUDENT_VER to build the student version of MAX
|
||||
// #define STUDENT_VER
|
||||
#ifdef STUDENT_VER
|
||||
#define WIN95_ONLY
|
||||
#endif
|
||||
|
||||
//TURN ON SNAPPING FOR INTEGRATION TO ATHENA
|
||||
#define _OSNAP TRUE
|
||||
|
||||
//TURN ON PRIMITIVE CREATION WITH 3D SNAPPING
|
||||
#define _3D_CREATE
|
||||
|
||||
// Turn on sub material assignment : 1/19/98 - CCJ
|
||||
#define _SUBMTLASSIGNMENT
|
||||
|
||||
// Define DESIGN_VER to build the design version of MAX
|
||||
// #define DESIGN_VER
|
||||
|
||||
// Define to build a version with no NURBS
|
||||
// #define NO_NURBS
|
||||
|
||||
// Define APL_DBCS for double-byte character set versions (i.e. Japanese, Chinese)
|
||||
//#define APL_DBCS
|
||||
|
||||
// no longer used by MAX
|
||||
#if !defined(EDU_VERSION) && !defined(STUDENT_VER) && !defined(DESIGN_VER) && !defined(BETA_VERSION)
|
||||
#define ORDINARY_VER
|
||||
#endif
|
||||
|
||||
// errors that will no longer occur
|
||||
#if defined(EDU_VERSION) && defined(STUDENT_VER)
|
||||
#error "Both EDU_VERSION and STUDENT_VER defined in buildver.h!"
|
||||
#endif
|
||||
|
||||
#if defined(EDU_VERSION) && defined(BETA_VERSION)
|
||||
#error "Both EDU_VERSION and BETA_VERSION defined in buildver.h!"
|
||||
#endif
|
||||
|
||||
#endif // _BUILD_VER_
|
||||
|
||||
|
221
lib/maxsdk31/captypes.h
Executable file
221
lib/maxsdk31/captypes.h
Executable file
@ -0,0 +1,221 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: captypes.h
|
||||
|
||||
DESCRIPTION: Capping type defintions
|
||||
|
||||
CREATED BY: Tom Hudson
|
||||
|
||||
HISTORY: Created 12 October 1995
|
||||
|
||||
*> Copyright (c) 1995, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __CAPTYPES_H_
|
||||
|
||||
#define __CAPTYPES_H_
|
||||
|
||||
// Just in case...
|
||||
class PolyShape;
|
||||
class BezierShape;
|
||||
|
||||
// Capping types supported
|
||||
#define CAPTYPE_MORPH 0 // AKA 3D Studio DOS capping
|
||||
#define CAPTYPE_GRID 1 // Max's very own capping
|
||||
|
||||
// Capping information classes:
|
||||
// These classes provide information on how a cap is put together, based on the following:
|
||||
//
|
||||
// For Mesh caps, you get a list of created triangular faces, where the vertex indices are
|
||||
// either original vertices on the PolyShape, newly created vertices inside the shape, or
|
||||
// newly created vertices on the edge of a shape. New vertices are only created for GRID
|
||||
// type capping. Cap info is always stored in unflipped form -- That is, faces are oriented
|
||||
// in a counterclockwise order as viewed from the shape's "front", or positive Z.
|
||||
//
|
||||
// New free vertices are listed in the MeshCapInfo's "newVerts" table, a simple Point3 table.
|
||||
// The "newVert" member of the MeshCapVert class points to the entry in the newVerts table.
|
||||
//
|
||||
// New edge vertices are stored with the polygon and segment number where they reside, along
|
||||
// with a position on that segment (0-1) where they reside. This information allows the cap
|
||||
// user to divide adjacent faces as needed.
|
||||
//
|
||||
// For Patch caps, you can only cap using MORPH type capping. GRID capping is meant for Mesh
|
||||
// caps, where distorting a non-subdivided cap would result in serious surface discontinuities.
|
||||
// Patches are automatically subdivided, so GRID capping is unnecessary there.
|
||||
//
|
||||
|
||||
// CapFace flags
|
||||
#define CF_ABLINE (1<<0)
|
||||
#define CF_BCLINE (1<<1)
|
||||
#define CF_CALINE (1<<2)
|
||||
|
||||
class CapFace {
|
||||
public:
|
||||
int va; // Index of vertex a
|
||||
int vb; // Index of vertex b
|
||||
int vc; // Index of vertex c
|
||||
DWORD flags;
|
||||
CapFace() {}
|
||||
CapFace(int a, int b, int c, DWORD f) { va=a; vb=b; vc=c; flags=f; }
|
||||
};
|
||||
|
||||
// Mesh cap vertices:
|
||||
// These can be original vertices from the PolyShape or new free vertices
|
||||
// in the center of the PolyShape.
|
||||
|
||||
#define MCV_ORIGINAL 0
|
||||
#define MCV_FREE 1
|
||||
|
||||
class MeshCapVert {
|
||||
public:
|
||||
int type; // See above
|
||||
int poly; // The polygon number
|
||||
int index; // The index of the vertex
|
||||
int newVert; // The index of the new vertex
|
||||
MeshCapVert() {}
|
||||
MeshCapVert(int t, int p, int i, int nv=0) { type=t; poly=p; index=i; newVert=nv; }
|
||||
};
|
||||
|
||||
typedef Tab<CapFace> CapFaceTab;
|
||||
typedef Tab<MeshCapVert> MeshCapVertTab;
|
||||
typedef Tab<Point3> Point3Tab;
|
||||
|
||||
// The information class for mesh capping (MORPH or GRID)
|
||||
|
||||
class MeshCapInfo {
|
||||
public:
|
||||
CapFaceTab faces;
|
||||
MeshCapVertTab verts;
|
||||
Point3Tab newVerts;
|
||||
MeshCapInfo &operator=(MeshCapInfo &from) { faces=from.faces; verts=from.verts; newVerts=from.newVerts; return *this; }
|
||||
CoreExport void Init(PolyShape *shape);
|
||||
CoreExport void FreeAll();
|
||||
};
|
||||
|
||||
// Support classes for MeshCapper
|
||||
|
||||
class PolyLine;
|
||||
|
||||
class MeshCapPoly {
|
||||
public:
|
||||
int numVerts;
|
||||
int *verts; // List of verts in mesh corresponding to verts in the PolyLine (1 per vert)
|
||||
MeshCapPoly() { verts = NULL; }
|
||||
CoreExport void Init(PolyLine &line);
|
||||
CoreExport ~MeshCapPoly();
|
||||
CoreExport void SetVert(int index, int vertex);
|
||||
};
|
||||
|
||||
// This class is used to apply the MeshCapInfo data to a mesh -- It will modify the mesh as required to
|
||||
// add the cap. Simply fill in the vertices and faces bordering the cap, then call the CapMesh method.
|
||||
|
||||
class MeshCapper {
|
||||
public:
|
||||
int numPolys;
|
||||
MeshCapPoly *polys;
|
||||
CoreExport MeshCapper(PolyShape &shape);
|
||||
CoreExport ~MeshCapper();
|
||||
CoreExport MeshCapPoly &operator[](int index);
|
||||
CoreExport int CapMesh(Mesh &mesh, MeshCapInfo &capInfo, BOOL flip, DWORD smooth, Matrix3 *tm=NULL, int mtlID=-1);
|
||||
};
|
||||
|
||||
// Patch capping
|
||||
|
||||
class CapPatch {
|
||||
public:
|
||||
int type; // PATCH_TRI or PATCH_QUAD
|
||||
int verts[4];
|
||||
int vecs[8];
|
||||
int interior[4];
|
||||
CapPatch() {}
|
||||
CapPatch(int va, int vab, int vba, int vb, int vbc, int vcb, int vc, int vca, int vac, int i1, int i2, int i3) {
|
||||
type=PATCH_TRI; verts[0]=va; verts[1]=vb; verts[2]=vc; vecs[0]=vab; vecs[1]=vba; vecs[2]=vbc, vecs[3]=vcb;
|
||||
vecs[4]=vca; vecs[5]=vac; interior[0]=i1; interior[1]=i2; interior[2]=i3; }
|
||||
CapPatch(int va, int vab, int vba, int vb, int vbc, int vcb, int vc, int vcd, int vdc, int vd, int vda, int vad, int i1, int i2, int i3, int i4) {
|
||||
type=PATCH_QUAD; verts[0]=va; verts[1]=vb; verts[2]=vc; verts[3]=vd; vecs[0]=vab; vecs[1]=vba; vecs[2]=vbc, vecs[3]=vcb;
|
||||
vecs[4]=vcd; vecs[5]=vdc; vecs[6]=vda, vecs[7]=vad; interior[0]=i1; interior[1]=i2; interior[2]=i3; interior[3]=i4; }
|
||||
};
|
||||
|
||||
// Patch cap vertices:
|
||||
// These can be original vertices from the BezierShape or new free vertices
|
||||
// in the center of the BezierShape.
|
||||
|
||||
#define PCVERT_ORIGINAL 0
|
||||
#define PCVERT_FREE 1
|
||||
|
||||
class PatchCapVert {
|
||||
public:
|
||||
int type;
|
||||
int poly; // The polygon number (ORIGINAL or EDGE)
|
||||
int index; // The index of the vertex (ORIGINAL) or the segment for the EDGE vertex
|
||||
PatchCapVert() {}
|
||||
PatchCapVert(int t, int p, int i) { type=t; poly=p; index=i; }
|
||||
};
|
||||
|
||||
// Patch cap vectors:
|
||||
// When a patch cap is generated, new interior vectors will be generated within the patch, and patch
|
||||
// edges within the cap will have new vectors. Patch edges along the edges of the originating bezier
|
||||
// shape will use existing vectors. This class provides information on which is which.
|
||||
|
||||
#define PCVEC_ORIGINAL 0
|
||||
#define PCVEC_NEW 1
|
||||
|
||||
class PatchCapVec {
|
||||
public:
|
||||
int type; // See above
|
||||
int poly; // Polygon number for ORIGINAL
|
||||
int index; // Index for ORIGINAL or into newVecs table (see below)
|
||||
PatchCapVec() {}
|
||||
PatchCapVec(int t, int p, int i) { type=t; poly=p; index=i; }
|
||||
};
|
||||
|
||||
typedef Tab<CapPatch> CapPatchTab;
|
||||
typedef Tab<PatchCapVert> PatchCapVertTab;
|
||||
typedef Tab<PatchCapVec> PatchCapVecTab;
|
||||
|
||||
// The information class for patch capping
|
||||
|
||||
class PatchCapInfo {
|
||||
public:
|
||||
CapPatchTab patches;
|
||||
PatchCapVertTab verts;
|
||||
PatchCapVecTab vecs;
|
||||
Point3Tab newVerts;
|
||||
Point3Tab newVecs;
|
||||
PatchCapInfo &operator=(PatchCapInfo &from) { patches=from.patches; verts=from.verts; vecs=from.vecs; newVerts=from.newVerts; newVecs=from.newVecs; return *this; }
|
||||
CoreExport void Init(BezierShape *shape);
|
||||
CoreExport void FreeAll();
|
||||
};
|
||||
|
||||
// Support classes for MeshCapper
|
||||
|
||||
class Spline3D;
|
||||
|
||||
class PatchCapPoly {
|
||||
public:
|
||||
int numVerts;
|
||||
int numVecs;
|
||||
int *verts; // List of verts in patch mesh corresponding to verts in the spline (1 per vert)
|
||||
int *vecs; // List of vecs in patch mesh corresponding to vecs in the spline (1 per vector)
|
||||
PatchCapPoly() { verts = vecs = NULL; }
|
||||
CoreExport void Init(Spline3D &spline);
|
||||
CoreExport ~PatchCapPoly();
|
||||
CoreExport void SetVert(int index, int vertex);
|
||||
CoreExport void SetVec(int index, int vector);
|
||||
};
|
||||
|
||||
// This class is used to apply the PatchCapInfo data to a PatchMesh -- It will modify the mesh as required to
|
||||
// add the cap. Simply fill in the vertices, vectors and patches bordering the cap, then call the CapPatch method.
|
||||
|
||||
class PatchCapper {
|
||||
public:
|
||||
int numPolys;
|
||||
PatchCapPoly *polys;
|
||||
CoreExport PatchCapper(BezierShape &shape);
|
||||
CoreExport ~PatchCapper();
|
||||
CoreExport PatchCapPoly &operator[](int index);
|
||||
CoreExport int CapPatchMesh(PatchMesh &mesh, PatchCapInfo &capInfo, BOOL flip, DWORD smooth, Matrix3 *tm=NULL, int mtlID=-1);
|
||||
};
|
||||
|
||||
|
||||
#endif // __CAPTYPES_H_
|
54
lib/maxsdk31/channels.h
Executable file
54
lib/maxsdk31/channels.h
Executable file
@ -0,0 +1,54 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: channel.h
|
||||
|
||||
DESCRIPTION:
|
||||
|
||||
CREATED BY: Dan Silva
|
||||
|
||||
HISTORY:
|
||||
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef __CHANNEL__H
|
||||
#define __CHANNEL__H
|
||||
|
||||
|
||||
// Channels within the object.
|
||||
#define NUM_OBJ_CHANS 10
|
||||
|
||||
// Indices for object channels
|
||||
#define TOPO_CHAN_NUM 0
|
||||
#define GEOM_CHAN_NUM 1
|
||||
#define TEXMAP_CHAN_NUM 2
|
||||
#define MTL_CHAN_NUM 3
|
||||
#define SELECT_CHAN_NUM 4
|
||||
#define SUBSEL_TYPE_CHAN_NUM 5
|
||||
#define DISP_ATTRIB_CHAN_NUM 6
|
||||
#define VERT_COLOR_CHAN_NUM 7
|
||||
#define GFX_DATA_CHAN_NUM 8
|
||||
#define DISP_APPROX_CHAN_NUM 9
|
||||
|
||||
// Bit flags for object channels
|
||||
#define TOPO_CHANNEL (1<<0) // topology (faces, polygons etc)
|
||||
#define GEOM_CHANNEL (1<<1) // vertices
|
||||
#define TEXMAP_CHANNEL (1<<2) // texture vertices and mapping
|
||||
#define MTL_CHANNEL (1<<3) // material on per face basis
|
||||
#define SELECT_CHANNEL (1<<4) // selection bits
|
||||
#define SUBSEL_TYPE_CHANNEL (1<<5) // vertex/face/edge
|
||||
#define DISP_ATTRIB_CHANNEL (1<<6) // display attributes
|
||||
#define VERTCOLOR_CHANNEL (1<<7) // color per vertex
|
||||
#define GFX_DATA_CHANNEL (1<<8) // stripping, edge list, etc.
|
||||
#define DISP_APPROX_CHANNEL (1<<9) // displacement approximation
|
||||
|
||||
#define TM_CHANNEL (1<<10) // Object transform (may be modified by modifiers)
|
||||
#define GLOBMTL_CHANNEL (1<<31) // material applied to object as whole
|
||||
|
||||
#define OBJ_CHANNELS (TOPO_CHANNEL|GEOM_CHANNEL|SELECT_CHANNEL|TEXMAP_CHANNEL|MTL_CHANNEL|SUBSEL_TYPE_CHANNEL|DISP_ATTRIB_CHANNEL|VERTCOLOR_CHANNEL|GFX_DATA_CHANNEL|DISP_APPROX_CHANNEL)
|
||||
#define ALL_CHANNELS (OBJ_CHANNELS|TM_CHANNEL|GLOBMTL_CHANNEL)
|
||||
|
||||
|
||||
#endif // __CHANNEL__H
|
149
lib/maxsdk31/client.h
Executable file
149
lib/maxsdk31/client.h
Executable file
@ -0,0 +1,149 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// -------------------
|
||||
// File ....: Client.h
|
||||
// -------------------
|
||||
// Author...: Gus J Grubba
|
||||
// Date ....: November 1995
|
||||
// O.S. ....: Windows NT 3.51
|
||||
//
|
||||
// History .: Nov, 18 1995 - Created
|
||||
//
|
||||
// 3D Studio Max Network Rendering
|
||||
//
|
||||
// Client
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef _CLIENTINCLUDE_
|
||||
#define _CLIENTINCLUDE_
|
||||
|
||||
#ifndef NETCEXPORT
|
||||
#define NETCEXPORT __declspec( dllimport )
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-- Interface Class ---------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class ClientInterface {
|
||||
|
||||
public:
|
||||
|
||||
virtual HINSTANCE HostInst () = 0;
|
||||
virtual HWND HostWnd () = 0;
|
||||
virtual TCHAR *GetDir (int i) = 0;
|
||||
virtual TCHAR *GetAppDir () = 0;
|
||||
virtual TSTR GetMaxFileName () = 0;
|
||||
virtual BOOL SaveMaxFile (TCHAR *name, TCHAR *archivename, bool archive = false) = 0;
|
||||
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-- Base Class Definition ---------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
// #> Client
|
||||
//
|
||||
|
||||
class Client {
|
||||
|
||||
private:
|
||||
|
||||
TCPcomm *tcp;
|
||||
ConnectionInfo ci;
|
||||
|
||||
#define DEFNUMMANAGERS 4
|
||||
|
||||
char manager[DEFNUMMANAGERS][MAX_PATH];
|
||||
WORD mgrport;
|
||||
|
||||
Tab<ServerList> Servers;
|
||||
ServerReg sReg;
|
||||
ClientInterface *iface;
|
||||
Interface *max;
|
||||
|
||||
int curServer;
|
||||
|
||||
int numSel;
|
||||
int *selBuf;
|
||||
|
||||
int start,end,step;
|
||||
|
||||
int progressNFrames;
|
||||
BOOL alertFailure,alertProgress,alertCompletion;
|
||||
BOOL alertEnabled;
|
||||
|
||||
//-- Flags defined in Common.h (NewJob flags)
|
||||
|
||||
DWORD flags;
|
||||
|
||||
//-- Windows Specific -------------------------------------------------
|
||||
|
||||
HWND hWnd;
|
||||
HBITMAP hBmpBulbOn,hBmpBulbBusy,hBmpBulbOff,hBmpBulbError;
|
||||
HBITMAP hBmpBulbOnSel,hBmpBulbBusySel,hBmpBulbOffSel,hBmpBulbErrorSel;
|
||||
|
||||
//-- Miscelaneous Functions -------------------------------------------
|
||||
|
||||
void UpdateManagerList ( HWND hWnd );
|
||||
BOOL GetMaxFile ( HWND hWnd, TCHAR *name );
|
||||
|
||||
public:
|
||||
|
||||
//-- Job Info
|
||||
|
||||
|
||||
NewJob *TheJob;
|
||||
|
||||
|
||||
//-- Constructors/Destructors -----------------------------------------
|
||||
|
||||
NETCEXPORT Client ( ClientInterface *i, Interface *max );
|
||||
NETCEXPORT ~Client ( );
|
||||
void Close ( );
|
||||
|
||||
//-- Public Interface -------------------------------------------------
|
||||
//
|
||||
|
||||
NETCEXPORT BOOL JobAssignment ( HWND hWnd, NewJob *job);
|
||||
NETCEXPORT BOOL QueueManagement ( HWND hWnd );
|
||||
NETCEXPORT BOOL JobMonitor ( HWND hWnd );
|
||||
|
||||
//-- Dialog Functions -------------------------------------------------
|
||||
//
|
||||
|
||||
BOOL JobDlg ( HWND,UINT,WPARAM,LPARAM );
|
||||
BOOL PropDlg ( HWND,UINT,WPARAM,LPARAM );
|
||||
BOOL AlertDlg ( HWND,UINT,WPARAM,LPARAM );
|
||||
BOOL QueueDlg ( HWND,UINT,WPARAM,LPARAM );
|
||||
BOOL OutputExists ( HWND,UINT,WPARAM,LPARAM );
|
||||
|
||||
BOOL SubmitJob ( HWND hWnd );
|
||||
void LoadServerList ( HWND hWnd );
|
||||
void ResetServerList ( HWND hWnd );
|
||||
void HandleButtonState ( HWND hWnd );
|
||||
void ShowServerProp ( HWND hWnd );
|
||||
void FixJobName ( HWND hWnd );
|
||||
BOOL CanConnect ( HWND );
|
||||
void ConnectManager ( HWND );
|
||||
|
||||
//-- Miscelaneous -----------------------------------------------------
|
||||
//
|
||||
|
||||
Interface* Max ( ) { return max; }
|
||||
void ReadCfg ( );
|
||||
void WriteCfg ( );
|
||||
|
||||
BOOL IsFile ( const TCHAR *filename );
|
||||
void GetIniFile ( TCHAR *name );
|
||||
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-- Interface
|
||||
|
||||
NETCEXPORT void *ClientCreate ( ClientInterface *i, Interface *m );
|
||||
NETCEXPORT void ClientDestroy ( Client *v);
|
||||
|
||||
#endif
|
||||
|
||||
//-- EOF: Client.h ------------------------------------------------------------
|
BIN
lib/maxsdk31/client.lib
Executable file
BIN
lib/maxsdk31/client.lib
Executable file
Binary file not shown.
158
lib/maxsdk31/cmdmode.h
Executable file
158
lib/maxsdk31/cmdmode.h
Executable file
@ -0,0 +1,158 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: cmdmode.h
|
||||
|
||||
DESCRIPTION: Command mode class definition
|
||||
|
||||
CREATED BY: Rolf Berteig
|
||||
|
||||
HISTORY: Created 13 January 1995
|
||||
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __CMDMODE__
|
||||
#define __CMDMODE__
|
||||
|
||||
// This file can be included in plug-in modules so
|
||||
// it shouldn't reference/include private classes or functions.
|
||||
|
||||
class MouseCallBack;
|
||||
class ChangeForegroundCallback;
|
||||
|
||||
class CommandMode {
|
||||
public:
|
||||
virtual int Class()=0;
|
||||
virtual int SuperClass() { return 0; }
|
||||
virtual int ID()=0;
|
||||
virtual MouseCallBack *MouseProc(int *numPoints)=0;
|
||||
virtual ChangeForegroundCallback *ChangeFGProc()=0;
|
||||
virtual BOOL ChangeFG( CommandMode *oldMode )=0;
|
||||
virtual void EnterMode()=0;
|
||||
virtual void ExitMode()=0;
|
||||
};
|
||||
|
||||
// This is just a collection of modes that make up the xform modes.
|
||||
// Plug-ins can specify these for thier sub-object types.
|
||||
class XFormModes {
|
||||
public:
|
||||
CommandMode *move;
|
||||
CommandMode *rotate;
|
||||
CommandMode *scale;
|
||||
CommandMode *uscale;
|
||||
CommandMode *squash;
|
||||
CommandMode *select;
|
||||
XFormModes(
|
||||
CommandMode *move,
|
||||
CommandMode *rotate,
|
||||
CommandMode *scale,
|
||||
CommandMode *uscale,
|
||||
CommandMode *squash,
|
||||
CommandMode *select )
|
||||
{
|
||||
this->move = move;
|
||||
this->rotate = rotate;
|
||||
this->scale = scale;
|
||||
this->uscale = uscale;
|
||||
this->squash = squash;
|
||||
this->select = select;
|
||||
}
|
||||
XFormModes() { move = rotate = scale = uscale = squash = select = NULL; }
|
||||
};
|
||||
|
||||
|
||||
// These can be returned from ChangeFGProc() instead of an actual FG proc
|
||||
// to use predefined FG sets.
|
||||
#define CHANGE_FG_SELECTED ((ChangeForegroundCallback *)1)
|
||||
#define CHANGE_FG_ANIMATED ((ChangeForegroundCallback *)2)
|
||||
|
||||
// command super classes:
|
||||
#define TRANSFORM_CMD_SUPER 1
|
||||
|
||||
// command classes
|
||||
#define VIEWPORT_COMMAND 1
|
||||
#define MOVE_COMMAND 2
|
||||
#define ROTATE_COMMAND 3
|
||||
#define SCALE_COMMAND 4
|
||||
#define USCALE_COMMAND 5
|
||||
#define SQUASH_COMMAND 6
|
||||
#define SELECT_COMMAND 7
|
||||
#define HIERARCHY_COMMAND 8
|
||||
#define CREATE_COMMAND 9
|
||||
#define MODIFY_COMMAND 10
|
||||
#define MOTION_COMMAND 11
|
||||
#define ANIMATION_COMMAND 12
|
||||
#define CAMERA_COMMAND 13
|
||||
#define NULL_COMMAND 14
|
||||
#define DISPLAY_COMMAND 15
|
||||
#define SPOTLIGHT_COMMAND 16
|
||||
#define PICK_COMMAND 17
|
||||
|
||||
|
||||
// command IDs
|
||||
#define CID_USER 0x0000ffff
|
||||
|
||||
// XFORM_COMMAND
|
||||
#define CID_OBJMOVE 1
|
||||
#define CID_OBJROTATE 2
|
||||
#define CID_OBJSCALE 3
|
||||
#define CID_OBJUSCALE 4
|
||||
#define CID_OBJSQUASH 5
|
||||
#define CID_OBJSELECT 6
|
||||
|
||||
#define CID_SUBOBJMOVE 7
|
||||
#define CID_SUBOBJROTATE 8
|
||||
#define CID_SUBOBJSCALE 9
|
||||
#define CID_SUBOBJUSCALE 10
|
||||
#define CID_SUBOBJSQUASH 11
|
||||
#define CID_SUBOBJSELECT 12
|
||||
|
||||
// display branch command modes
|
||||
#define CID_UNFREEZE 13
|
||||
#define CID_UNHIDE 14
|
||||
|
||||
|
||||
// HEIRARCHY_COMMAND
|
||||
#define CID_LINK 100
|
||||
#define CID_BINDWSM 110 // I guess this is a heirarchy command... sort of
|
||||
|
||||
// VIEWPORT_COMMAND
|
||||
#define CID_ZOOMVIEW 200
|
||||
#define CID_ZOOMREGION 201
|
||||
#define CID_PANVIEW 202
|
||||
#define CID_ROTATEVIEW 203
|
||||
#define CID_ZOOMALL 204
|
||||
#define CID_RNDREGION 205
|
||||
|
||||
// CAMERA COMMANDS
|
||||
#define CID_CAMFOV 210
|
||||
#define CID_CAMDOLLY 211
|
||||
#define CID_CAMPERSP 212
|
||||
#define CID_CAMTRUCK 213
|
||||
#define CID_CAMROTATE 214
|
||||
#define CID_CAMROLL 215
|
||||
|
||||
//ANIMATION_COMMAND
|
||||
#define CID_PLAYANIMATION 300
|
||||
|
||||
//CREATE_COMMAND
|
||||
#define CID_SIMPLECREATE 400
|
||||
|
||||
//MODIFIY_COMMAND
|
||||
#define CID_MODIFYPARAM 500
|
||||
|
||||
//MOTION_COMMAND
|
||||
|
||||
#define CID_NULL 600
|
||||
|
||||
// Pick modes
|
||||
#define CID_STDPICK 710
|
||||
#define CID_PICKAXISOBJECT 700
|
||||
|
||||
// ATTACH To GROUP COMMAND
|
||||
#define CID_GRP_ATTACH 800
|
||||
|
||||
|
||||
|
||||
#endif // __CMDMODE
|
||||
|
213
lib/maxsdk31/color.h
Executable file
213
lib/maxsdk31/color.h
Executable file
@ -0,0 +1,213 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: color.h
|
||||
|
||||
DESCRIPTION:
|
||||
|
||||
CREATED BY: Dan Silva
|
||||
|
||||
HISTORY:
|
||||
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef _COLOR_H
|
||||
|
||||
#define _COLOR_H
|
||||
|
||||
#include "point3.h"
|
||||
|
||||
#define FLto255(x) ((int)((x)*255.0f+.5))
|
||||
|
||||
class Color;
|
||||
|
||||
struct RealPixel {
|
||||
unsigned char r,g,b; // mantissas
|
||||
unsigned char e; // exponent
|
||||
DllExport operator Color();
|
||||
};
|
||||
|
||||
DllExport RealPixel MakeRealPixel(float r, float g, float b);
|
||||
DllExport void ExpandRealPixel(const RealPixel &rp, float &r, float &g, float &b);
|
||||
|
||||
|
||||
class Color {
|
||||
public:
|
||||
float r,g,b;
|
||||
|
||||
// Constructors
|
||||
Color() {}
|
||||
Color(float R, float G, float B) { r = R; g = G; b = B; }
|
||||
Color(double R, double G, double B) { r = (float)R; g = (float)G; b = (float)B; }
|
||||
Color(int R, int G, int B) { r = (float)R; g = (float)G; b = (float)B; }
|
||||
Color(const Color& a) { r = a.r; g = a.g; b = a.b; }
|
||||
DllExport Color(DWORD rgb); // from Windows RGB value
|
||||
Color(Point3 p) { r = p.x; g = p.y; b = p.z; }
|
||||
Color(float af[3]) { r = af[0]; g = af[1]; b = af[2]; }
|
||||
Color(RealPixel rp) { ExpandRealPixel(rp,r,g,b); }
|
||||
Color(const BMM_Color_24& c) {
|
||||
r = float(c.r)/255.0f; g = float(c.g)/255.0f; b = float(c.b)/255.0f;
|
||||
}
|
||||
Color(const BMM_Color_32& c) {
|
||||
r = float(c.r)/255.0f; g = float(c.g)/255.0f; b = float(c.b)/255.0f;
|
||||
}
|
||||
Color(const BMM_Color_48& c) {
|
||||
r = float(c.r)/65535.0f; g = float(c.g)/65535.0f; b = float(c.b)/65535.0f;
|
||||
}
|
||||
Color(const BMM_Color_64& c) {
|
||||
r = float(c.r)/65535.0f; g = float(c.g)/65535.0f; b = float(c.b)/65535.0f;
|
||||
}
|
||||
|
||||
|
||||
void Black() { r = g = b = 0.0f; }
|
||||
void White() { r = g = b = 1.0f; }
|
||||
|
||||
DllExport void ClampMax(); // makes components >= 0.0
|
||||
DllExport void ClampMin(); // makes components <= 1.0
|
||||
DllExport void ClampMinMax(); // makes components in [0,1]
|
||||
|
||||
// Access operators
|
||||
float& operator[](int i) { return (&r)[i]; }
|
||||
const float& operator[](int i) const { return (&r)[i]; }
|
||||
|
||||
// Conversion function
|
||||
operator float*() { return(&r); }
|
||||
|
||||
// Convert to Windows RGB
|
||||
operator DWORD() { return RGB(FLto255(r),FLto255(g), FLto255(b)); }
|
||||
|
||||
// Convert to Point3
|
||||
operator Point3() { return Point3(r,g,b); }
|
||||
|
||||
// Convert to RealPixel
|
||||
DllExport operator RealPixel() { return MakeRealPixel(r,g,b); }
|
||||
|
||||
// Convert to Bitmap Manager types
|
||||
operator BMM_Color_24() {
|
||||
BMM_Color_24 c;
|
||||
c.r = int(r*255.0f); c.g = int(g*255.0f); c.b = int(b*255.0f);
|
||||
return c;
|
||||
}
|
||||
operator BMM_Color_32() {
|
||||
BMM_Color_32 c;
|
||||
c.r = int(r*255.0f); c.g = int(g*255.0f); c.b = int(b*255.0f);
|
||||
return c;
|
||||
}
|
||||
operator BMM_Color_48() {
|
||||
BMM_Color_48 c;
|
||||
c.r = int(r*65535.0f); c.g = int(g*65535.0f); c.b = int(b*65535.0f);
|
||||
return c;
|
||||
}
|
||||
operator BMM_Color_64() {
|
||||
BMM_Color_64 c;
|
||||
c.r = int(r*65535.0f); c.g = int(g*65535.0f); c.b = int(b*65535.0f);
|
||||
return c;
|
||||
}
|
||||
|
||||
// Unary operators
|
||||
Color operator-() const { return(Color(-r,-g,-b)); }
|
||||
Color operator+() const { return *this; }
|
||||
|
||||
// Assignment operators
|
||||
inline Color& operator-=(const Color&);
|
||||
inline Color& operator+=(const Color&);
|
||||
inline Color& operator*=(float);
|
||||
inline Color& operator/=(float);
|
||||
inline Color& operator*=(const Color&); // element-by-element multiplg.
|
||||
|
||||
// Test for equality
|
||||
int operator==(const Color& p) const { return ((p.r==r)&&(p.g==g)&&(p.b==b)); }
|
||||
int operator!=(const Color& p) const { return ((p.r!=r)||(p.g!=g)||(p.b!=b)); }
|
||||
|
||||
// Binary operators
|
||||
inline Color operator-(const Color&) const;
|
||||
inline Color operator+(const Color&) const;
|
||||
inline Color operator/(const Color&) const;
|
||||
inline Color operator*(const Color&) const;
|
||||
inline Color operator^(const Color&) const; // CROSS PRODUCT
|
||||
};
|
||||
|
||||
int DllExport MaxComponent(const Color&); // index of the component with the maximum abs value
|
||||
int DllExport MinComponent(const Color&); // index of the component with the minimum abs value
|
||||
|
||||
float DllExport MaxVal(const Color&); // value of the component with the maximum abs value
|
||||
float DllExport MinVal(const Color&); // value of the component with the minimum abs value
|
||||
|
||||
// Inlines:
|
||||
|
||||
inline float Length(const Color& v) {
|
||||
return (float)sqrt(v.r*v.r+v.g*v.g+v.b*v.b);
|
||||
}
|
||||
|
||||
inline Color& Color::operator-=(const Color& a) {
|
||||
r -= a.r; g -= a.g; b -= a.b;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline Color& Color::operator+=(const Color& a) {
|
||||
r += a.r; g += a.g; b += a.b;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline Color& Color::operator*=(float f) {
|
||||
r *= f; g *= f; b *= f;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline Color& Color::operator/=(float f) {
|
||||
r /= f; g /= f; b /= f;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline Color& Color::operator*=(const Color& a) {
|
||||
r *= a.r; g *= a.g; b *= a.b;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline Color Color::operator-(const Color& c) const {
|
||||
return(Color(r-c.r,g-c.g,b-c.b));
|
||||
}
|
||||
|
||||
inline Color Color::operator+(const Color& c) const {
|
||||
return(Color(r+c.r,g+c.g,b+c.b));
|
||||
}
|
||||
|
||||
inline Color Color::operator/(const Color& c) const {
|
||||
return Color(r/c.r,g/c.g,b/c.b);
|
||||
}
|
||||
|
||||
inline Color Color::operator*(const Color& c) const {
|
||||
return Color(r*c.r, g*c.g, b*c.b);
|
||||
}
|
||||
|
||||
inline Color operator*(float f, const Color& a) {
|
||||
return(Color(a.r*f, a.g*f, a.b*f));
|
||||
}
|
||||
|
||||
inline Color operator*(const Color& a, float f) {
|
||||
return(Color(a.r*f, a.g*f, a.b*f));
|
||||
}
|
||||
|
||||
inline Color operator/(const Color& a, float f) {
|
||||
return(Color(a.r/f, a.g/f, a.b/f));
|
||||
}
|
||||
|
||||
inline Color operator+(const Color& a, float f) {
|
||||
return(Color(a.r+f, a.g+f, a.b+f));
|
||||
}
|
||||
|
||||
inline Color operator+(float f, const Color& a) {
|
||||
return(Color(a.r+f, a.g+f, a.b+f));
|
||||
}
|
||||
|
||||
inline Color operator-(const Color& a, float f) {
|
||||
return(Color(a.r-f, a.g-f, a.b-f));
|
||||
}
|
||||
|
||||
inline Color operator-(float f, const Color& a) {
|
||||
return(Color(f-a.r, f-a.g, f-a.b));
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
599
lib/maxsdk31/contextids.h
Executable file
599
lib/maxsdk31/contextids.h
Executable file
@ -0,0 +1,599 @@
|
||||
// 3DS MAX context-sensitive help items
|
||||
// Help Contents (help menu IDs are in the menu section)
|
||||
|
||||
#ifndef _CONTEXTIDS_H_
|
||||
#define _CONTEXTIDS_H_
|
||||
|
||||
#define F1Focus(cmd,data) getHelpSys().setHelpFocus(cmd,data)
|
||||
#define F1Help() getHelpSys().doHelpFocus()
|
||||
#define Help(cmd,data) getHelpSys().help(cmd, data)
|
||||
#define GetClickHelp() getHelpSys().getClickHelp()
|
||||
|
||||
#define idh_contents 1000 // 3DS MAX Online Help (contents page)
|
||||
|
||||
// Titlebar items
|
||||
#define idh_titlebar 2000 // Titlebar
|
||||
|
||||
//Menubar items
|
||||
#define idh_menubar 3000 // Menubar
|
||||
|
||||
// File menu items
|
||||
#define idh_file_menu 3100 // File menu
|
||||
#define idh_file_new 3110 // New
|
||||
#define idh_file_reset 3120 // Reset
|
||||
#define idh_file_open 3130 // Open
|
||||
#define idh_file_merge 3135 // Merge
|
||||
#define idh_file_replace 3137 // Replace
|
||||
#define idh_file_insert_tracks 3138 // Insert Tracks
|
||||
#define idh_file_save 3140 // Save
|
||||
#define idh_file_save_as 3150 // Save As
|
||||
#define idh_file_save_selected 3160 // Save Selected
|
||||
#define idh_file_import 3180 // Import
|
||||
#define idh_file_export 3190 // Export
|
||||
#define idh_file_archive 3200 // Archive
|
||||
#define idh_file_summary_info 3210 // Summary Info
|
||||
#define idh_file_view_file 3230 // View File
|
||||
#define idh_file_configure_paths 3245 // Configure Paths
|
||||
#define idh_file_preferences 3250 // Preferences
|
||||
#define idh_file_properties 3255 // Properties
|
||||
#define idh_file_exit 3260 // Exit
|
||||
#define idh_file_history 3270 // History
|
||||
|
||||
// Edit menu items
|
||||
#define idh_edit_menu 3300 // Edit menu
|
||||
#define idh_edit_undo_redo 3310 // Undo/Redo
|
||||
#define idh_edit_hold 3320 // Hold
|
||||
#define idh_edit_fetch 3330 // Fetch
|
||||
#define idh_edit_delete 3340 // Delete
|
||||
#define idh_edit_clone 3350 // Clone
|
||||
#define idh_edit_select_all 3360 // Select All
|
||||
#define idh_edit_select_none 3370 // Select None
|
||||
#define idh_edit_select_invert 3380 // Select Invert
|
||||
#define idh_edit_select_by 3390 // Select By
|
||||
#define idh_edit_select_by_color 3392
|
||||
#define idh_edit_select_by_name 3394
|
||||
#define idh_edit_region 3400 // Region
|
||||
#define idh_edit_select_region_window 3402
|
||||
#define idh_edit_select_region_crossing 3404
|
||||
#define idh_edit_remove_named_selections 3410 // Remove Named Selections
|
||||
#define idh_edit_edit_named_selections 3412
|
||||
#define idh_edit_transform_type_in 3420 // Transform Type-in
|
||||
#define idh_edit_mirror 3430 // Mirror
|
||||
#define idh_edit_array 3435 // Mirror
|
||||
#define idh_edit_snapshot 3437 // Mirror
|
||||
#define idh_edit_align 3440 // Align
|
||||
#define idh_edit_align_normals 3450 // Align Normals
|
||||
#define idh_edit_place_highlight 3455
|
||||
#define idh_edit_track_view 3459
|
||||
#define idh_edit_schematic_view 3460
|
||||
#define idh_edit_material_editor 3465
|
||||
#define idh_edit_properties 3470 // Properties
|
||||
#define idh_spacing_tool 3471
|
||||
|
||||
// Tools Menu
|
||||
#define idh_tools_menu 3475 // Tools menu
|
||||
#define idh_tools_display_floater 3477 // display floater
|
||||
#define idh_tools_selection_floater 3479 // selection floater
|
||||
#define idh_tools_material_map_browser 3480 // mtl/map browser
|
||||
|
||||
// MAXScript menu (added JBW 11/11/98 & 12/15/98)
|
||||
#define idh_maxscript_listener 3481 // open listener
|
||||
#define idh_maxscript_open 3482 // open script editor
|
||||
#define idh_maxscript_new 3483 // new script
|
||||
#define idh_maxscript_run 3484 // run script file
|
||||
#define idh_maxscript_macrorec 3485 // toggle macrorecorder enable
|
||||
|
||||
// Grouping menu items
|
||||
#define idh_grouping_menu 3500 // Grouping menu
|
||||
#define idh_grouping_group 3510 // Group
|
||||
#define idh_grouping_open 3520 // Open
|
||||
#define idh_grouping_close 3530 // Close
|
||||
#define idh_grouping_ungroup 3540 // Ungroup
|
||||
#define idh_grouping_explode 3550 // Explode
|
||||
#define idh_grouping_detach 3560 // Detach
|
||||
#define idh_grouping_attach 3570 // Attach
|
||||
|
||||
// Views menu items
|
||||
#define idh_views_menu 3600 // Views menu
|
||||
#define idh_views_undo_redo 3610 // Undo/Redo
|
||||
#define idh_views_save_active 3620
|
||||
#define idh_views_restore_active 3621
|
||||
#define idh_views_units_setup 3625
|
||||
#define idh_views_grid_and_snap_settings 3630 // Grid and Snap Settings
|
||||
#define idh_views_grids 3640 // Grids
|
||||
#define idh_views_background_image 3650 // Background Image
|
||||
#define idh_views_update_background_image 3652
|
||||
#define idh_views_reset_background_transform 3654
|
||||
#define idh_views_show_axis_icon 3660 // Show Axis Icon
|
||||
#define idh_views_show_ghosting 3662
|
||||
#define idh_views_show_key_times 3664
|
||||
#define idh_views_shade_selected 3670
|
||||
#define idh_views_show_dependencies 3680
|
||||
#define idh_views_match_camera_to_view 3682
|
||||
#define idh_views_redraw_all_views 3690 // Redraw All Views
|
||||
#define idh_views_deactivate_all_maps 3695 // Deactivate all maps in views
|
||||
#define idh_views_update_during_spinner_drag 3697
|
||||
#define idh_views_expert_mode 3698
|
||||
#ifdef DESIGN_VER
|
||||
#define idh_views_design_mode 3699
|
||||
#define idh_views_standard_mode 3701
|
||||
#endif
|
||||
#define idh_views_viewport_configuration 3710 // Viewport Configuration
|
||||
|
||||
// Rendering menu items
|
||||
#define idh_rendering_menu 3800 // Rendering menu
|
||||
#define idh_rendering_render 3810 // Render
|
||||
#define idh_rendering_video_post 3820 // Video Post
|
||||
#define idh_rendering_environment 3840 // Environment
|
||||
#define idh_rendering_make_preview 3870 // Make Preview
|
||||
#define idh_rendering_view_preview 3880 // View Preview
|
||||
#define idh_rendering_rename_preview 3890 // Rename Preview
|
||||
#define idh_rendering_show_last_render 3892
|
||||
|
||||
#define idh_track_view_menu 3900 // Trackview menu
|
||||
#define idh_track_view_open_track_view 3902
|
||||
#define idh_track_view_new_track_view 3904
|
||||
#define idh_track_view_delete_track_view 3906
|
||||
#define idh_track_view_stored_track_views_list 3908
|
||||
|
||||
// Schematic view menu items...
|
||||
#define idh_schematic_view_open_schematic_view 3910
|
||||
#define idh_schematic_view_new_schematic_view 3911
|
||||
#define idh_schematic_view_delete_schematic_view 3912
|
||||
#define idh_schematic_view_stored_schematic_views_list 3913
|
||||
|
||||
// Help menu items
|
||||
#define idh_help_menu 4300 // Help menu
|
||||
#define idh_help_contents 4310 // Help contents
|
||||
#define idh_help_topics 4320 // topics
|
||||
#define idh_help_plugin_help 4330 // plug-in help
|
||||
#define idh_help_about 4340 // About 3D Studio MAX
|
||||
#define idh_help_learning 4342
|
||||
#define idh_help_connect_to_support_and_information 4344
|
||||
#define idh_help_maxscript 4345
|
||||
|
||||
// Toolbar items
|
||||
#define idh_toolbar 5000 // Toolbar
|
||||
#define idh_tb_undo_redo 5010 // Undo/Redo
|
||||
#define idh_tb_undo 5011
|
||||
#define idh_tb_redo 5012
|
||||
#define idh_tb_link_unlink 5020 // Link/Unlink
|
||||
#define idh_tb_link 5021
|
||||
#define idh_tb_unlink 5022
|
||||
#define idh_tb_bind_to_space_warp 5030 // Bind to Space Warp
|
||||
#define idh_tb_selection 5040 // Selection
|
||||
#define idh_tb_selection_region 5041
|
||||
#define idh_tb_sel_filter 5042
|
||||
#define idh_tb_hit_by_name 5050 // Hit-by-name
|
||||
#define idh_tb_transformations 5060 // Transformations
|
||||
#define idh_tb_move 5061
|
||||
#define idh_tb_rotate 5062
|
||||
#define idh_tb_scale 5063
|
||||
#define idh_tb_coord_sys 5064
|
||||
#define idh_tb_pivot 5070 // Pivot button
|
||||
#define idh_tb_x 5071
|
||||
#define idh_tb_y 5072
|
||||
#define idh_tb_z 5073
|
||||
#define idh_tb_plane 5074
|
||||
#define idh_tb_constraints 5075 // axis constaint buttons
|
||||
#define idh_tb_inverse_kinematics_buttons 5080 // Inverse Kinematics Buttons
|
||||
#define idh_tb_mirror 5085
|
||||
#define idh_tb_array_button 5090 // Array Button
|
||||
#define idh_tb_spacing_tool 5092 // Spacing tool
|
||||
#define idh_tb_align_and_align_normals 5100 // Align and Align Normals
|
||||
#define idh_tb_track_view_button 5110 // Track View Button
|
||||
#define idh_tb_schematic_view_button 5111 // Schematic View Button
|
||||
#define idh_tb_material_editor_button 5115 // Material Editor
|
||||
#define idh_tb_rendering_controls 5120 // Rendering Controls
|
||||
#define idh_tb_render 5121
|
||||
#define idh_tb_render_quick 5122
|
||||
#define idh_tb_render_last 5123
|
||||
#define idh_tb_render_region 5124
|
||||
#define idh_tb_named_selection_sets 5130 // Named Selection Sets
|
||||
|
||||
// the following item was added by Vera (we need this button in the toolbar so a
|
||||
// user can click on UI items that are not selectable or cannot receive focus)
|
||||
|
||||
#define idh_tb_help 5131 // Help button
|
||||
|
||||
// track view items
|
||||
#define idh_track_view 5500 // Track View
|
||||
#define idh_tv_layout 5510 // Track View Layout
|
||||
#define idh_tv_hierarchy_list 5520 // Hierarchy list
|
||||
#define idh_tv_edit_window 5530 // Track View Edit window
|
||||
#define idh_tv_tool_bar 5540 // Track View Tool bar
|
||||
#define idh_tv_navigation_icons 5550 // Track View Navigation icons (are there several?, if so, we need one ID per icon)
|
||||
|
||||
#define idh_view_ports 5600 // View ports
|
||||
#define idh_vp_orthographic 5610 // Orthographic Views
|
||||
#define idh_vp_camera 5620 // Camera Views
|
||||
#define idh_vp_user 5630 // User Views
|
||||
#define idh_vp_grid 5640 // Grid Views
|
||||
#define idh_vp_spotlight 5650 // Spotlight Views
|
||||
|
||||
// Status line and prompt area items
|
||||
#define idh_status_panel 5700
|
||||
#define idh_sp_time_slider 5710 // Time slider
|
||||
#define idh_sp_prompt_line 5720 // Prompt line
|
||||
#define idh_sp_status_line 5730 // Status line
|
||||
#define idh_sp_selection_lock 5735
|
||||
#define idh_sp_window_crossing 5740
|
||||
#define idh_sp_degrade_override 5745
|
||||
#define idh_sp_snap_mode 5750
|
||||
#define idh_sp_snap_toggle 5755
|
||||
#define idh_sp_angle_snap 5760
|
||||
#define idh_sp_percent_snap 5765
|
||||
#define idh_sp_spinner_snap 5770
|
||||
#define idh_sp_object_snap 5780 //object snapping
|
||||
|
||||
// time panel
|
||||
#define idh_time_panel 5800
|
||||
#define idh_tp_animate 5810
|
||||
#define idh_tp_goto_start 5820
|
||||
#define idh_tp_previous 5830
|
||||
#define idh_tp_play 5840
|
||||
#define idh_tp_next 5850
|
||||
#define idh_tp_goto_end 5860
|
||||
#define idh_tp_key_mode 5870
|
||||
#define idh_tp_cur_time 5880
|
||||
#define idh_tp_time_config 5890
|
||||
|
||||
// View control panel (lower right)
|
||||
#define idh_view_control 8200
|
||||
#define idh_vc_zoom 8201
|
||||
#define idh_vc_zoom_all 8202
|
||||
#define idh_vc_zoom_extents 8203
|
||||
#define idh_vc_zoom_ext_sel 8204
|
||||
#define idh_vc_zoom_ext_all 8205
|
||||
#define idh_vc_zoom_ext_all_sel 8206
|
||||
#define idh_vc_zoom_region 8207
|
||||
#define idh_vc_field_of_view 8208
|
||||
#define idh_vc_pan 8209
|
||||
#define idh_vc_arc_rotate 8210
|
||||
#define idh_vc_arc_rotate_sel 8211
|
||||
#define idh_vc_min_max_toggle 8212
|
||||
// camera specific
|
||||
#define idh_vc_dolly 8213
|
||||
#define idh_vc_perspective 8214
|
||||
#define idh_vc_roll 8215
|
||||
#define idh_vc_truck 8216
|
||||
#define idh_vc_orbit 8217
|
||||
#define idh_vc_pan_cam 8218
|
||||
// spotlight specific
|
||||
#define idh_vc_hotspot 8219
|
||||
#define idh_vc_falloff 8220
|
||||
|
||||
// Command panel items
|
||||
#define idh_command_panel 6000 // Command panel
|
||||
|
||||
// Create items
|
||||
#define idh_cp_create 6100 // Create
|
||||
#define idh_create_entity_names 6110 // Entity Names
|
||||
#define idh_create_geometry 6120 // Geometry
|
||||
#define idh_create_space_warps 6130 // Space Warps
|
||||
#define idh_create_object_colors 6140 // Object Colors
|
||||
#define idh_create_materials 6150 // Materials
|
||||
#define idh_create_nonrendering_objects 6160 // Non-rendering Objects
|
||||
#define idh_create_lights 6170 // Lights
|
||||
#define idh_create_cameras 6180 // Cameras
|
||||
#define idh_create_helper_objects 6190 // Helper Objects
|
||||
#define idh_create_systems 6200 // Systems
|
||||
#define idh_create_objects_instances_references 6210 // Objects, Instances, and References
|
||||
|
||||
|
||||
// Modify items
|
||||
#define idh_cp_modify 6300 // Modify
|
||||
#define idh_modify_panel_layout 6310 // Layout of the Modify Command Panel
|
||||
#define idh_modify_modifier_stack 6320 // Modifier Stack
|
||||
#define idh_modify_miscellaneous 6330 // Miscellaneous Additions
|
||||
#define idh_modify_subobject_selection 6340 // Sub-Object Selection
|
||||
#define idh_modify_object_modifiers_editors 6350 // Object Modifiers (Editors)
|
||||
#define idh_modify_object_modifiers_other 6360 // Object Modifiers (Other)
|
||||
#define idh_modify_lights 6370 // Lights
|
||||
#define idh_modify_cameras 6380 // Cameras
|
||||
#define idh_modify_mapping 6390 // Mapping
|
||||
|
||||
// Surface items
|
||||
#define idh_cp_surface 6400 // Surface
|
||||
#define idh_surface_surfaces 6410 // Surfaces
|
||||
#define idh_surface_materials 6420 // Materials
|
||||
|
||||
// Hierarchy items
|
||||
#define idh_cp_hierarchy 6500 // Hierarchy
|
||||
#define idh_hierarchy_adjust_pivot 6510 // Adjust Pivot
|
||||
#define idh_hierarchy_transform 6520 // Transform
|
||||
#define idh_hierarchy_link_info 6530 // Link Info
|
||||
#define idh_hierarchy_ik 6540 // IK
|
||||
#define idh_hierarchy_links 6550 // Links
|
||||
|
||||
// Motion items
|
||||
#define idh_cp_motion 6600 // Motion
|
||||
#define idh_motion_assign_transform_controller 6610 // Assign Transform Controller
|
||||
#define idh_motion_path 6620 // Path
|
||||
#define idh_motion_key_info 6630 // Key Info
|
||||
|
||||
// Display items
|
||||
#define idh_cp_display 6700 // Display
|
||||
#define idh_display_color 6710 // Display Color
|
||||
#define idh_display_category 6720 // Category Displays
|
||||
#define idh_display_individual 6730 // Individual Displays
|
||||
#define idh_display_freeze 6740 // Freeze Displays
|
||||
#define idh_display_optimizations 6750 // Display Optimizations
|
||||
#define idh_display_links 6760 // Display Links
|
||||
|
||||
|
||||
|
||||
// Dialog Box: Viewport Configuration
|
||||
#define idh_dialog_viewport_configuration 7000 // main box
|
||||
// render page
|
||||
#define idh_vpconfig_render_page 7001 // render page
|
||||
#define idh_vpconfig_rendering_level 7002 // rendering level (all)
|
||||
#define idh_vpconfig_apply_to 7003 // apply to (for rendering level)
|
||||
#define idh_vpconfig_rendering_options 7004 // rendering options
|
||||
#define idh_vpconfig_fast_view 7005
|
||||
#define idh_vpconfig_persp_user_view 7006
|
||||
// layout page
|
||||
#define idh_vpconfig_layout_page 7010
|
||||
#define idh_vpconfig_layout_types 7011 // all layout buttons at top
|
||||
#define idh_vpconfig_assign_view 7012 // view assignment region
|
||||
#define idh_vpconfig_current_layout 7013
|
||||
// safeframe page
|
||||
#define idh_vpconfig_safeframe_page 7020
|
||||
#define idh_vpconfig_safeframe_setup 7021 // setup portion
|
||||
#define idh_vpconfig_safeframe_app 7022 // application portion
|
||||
// degradation page
|
||||
#define idh_vpconfig_degrade_page 7030 // degradation page
|
||||
#define idh_vpconfig_general_degrade 7031 // general region
|
||||
#define idh_vpconfig_active_degrade 7032 // active region
|
||||
#define idh_vpconfig_parameters 7033 // degrade parameters
|
||||
#define idh_vpconfig_interrupt 7034
|
||||
// regions page
|
||||
#define idh_vpconfig_regions_page 7040
|
||||
#define idh_vpconfig_blowup_region 7041
|
||||
#define idh_vpconfig_subregion 7042
|
||||
|
||||
// Dialog Box: Path Configuration
|
||||
#define idh_dialog_configure_paths 7050 // main box
|
||||
// general page
|
||||
#define idh_paths_general_page 7051 // general page
|
||||
#define idh_paths_plugin_page 7061 // plugin page
|
||||
#define idh_paths_bitmaps_page 7062 // bitmaps page
|
||||
|
||||
// Dialog Box: Preference Setting
|
||||
#define idh_dialog_preference_settings 8000 // main box
|
||||
// general page
|
||||
#define idh_pref_general_page 8010
|
||||
#define idh_pref_preview_options 8011
|
||||
#define idh_pref_icon_size 8012
|
||||
#define idh_pref_layout 8013
|
||||
#define idh_pref_system_units 8014
|
||||
#define idh_pref_interaction 8015
|
||||
// rendering page
|
||||
#define idh_pref_rendering_page 8018
|
||||
#define idh_pref_video_color 8019
|
||||
#define idh_pref_dithering 8020
|
||||
#define idh_pref_field_order 8021
|
||||
#define idh_pref_super_black 8022
|
||||
#define idh_pref_hotspot_falloff 8023
|
||||
#define idh_pref_def_preview 8024
|
||||
#define idh_pref_renderer 8025
|
||||
#define idh_pref_render_terminate 8026
|
||||
// IK page
|
||||
#define idh_pref_ik_page 8029
|
||||
#define idh_pref_applied_ik 8030
|
||||
#define idh_pref_interactive_ik 8031
|
||||
// animation page
|
||||
#define idh_pref_animation_page 8034
|
||||
#define idh_pref_key_brackets 8035
|
||||
#define idh_pref_animate 8036
|
||||
#define idh_pref_sound 8037
|
||||
#define idh_pref_controller_defs 8038
|
||||
// keyboard page
|
||||
#define idh_pref_keyboard_page 8042
|
||||
#define idh_pref_command 8043
|
||||
#define idh_pref_shortcut 8044
|
||||
#define idh_pref_sets 8045
|
||||
// files page
|
||||
#define idh_pref_files_page 8048
|
||||
#define idh_pref_file_handling 8049
|
||||
#define idh_pref_file_menu 8050
|
||||
#define idh_pref_archive_system 8051
|
||||
// gamma page
|
||||
#define idh_pref_gamma_page 8054
|
||||
#define idh_pref_display 8055
|
||||
#define idh_pref_device 8056
|
||||
#define idh_pref_files 8057
|
||||
// viewports page
|
||||
#define idh_pref_viewports_page 8060
|
||||
#define idh_pref_viewport_params 8061
|
||||
#define idh_pref_viewport_bkgnd 8062
|
||||
#define idh_pref_move_xfm 8063
|
||||
// colors page
|
||||
#define idh_pref_colors_page 8065
|
||||
// maxscript page
|
||||
#define idh_pref_maxscript_page 8066
|
||||
|
||||
// Dialog Box: Select by Name
|
||||
#define idh_dialog_select_by_name 8070
|
||||
#define idh_sbn_list 8071
|
||||
#define idh_sbn_list_control 8072 // bottom All/None/Inv and checkboxes
|
||||
#define idh_sbn_sort 8073
|
||||
#define idh_sbn_list_display 8074
|
||||
#define idh_sbn_selection_sets 8075
|
||||
|
||||
// Scene Info dialog box
|
||||
#define idh_dialog_scene_info 8080
|
||||
#define idh_si_scene_totals 8081
|
||||
#define idh_si_mesh_totals 8082
|
||||
#define idh_si_memory 8083
|
||||
#define idh_si_rendering 8084
|
||||
#define idh_si_description 8085
|
||||
#define idh_si_scene_info 8086
|
||||
#define idh_si_save_to_file 8087
|
||||
#define idh_si_plugin_info 8088
|
||||
|
||||
// Array dialog box
|
||||
#define idh_dialog_array 8092
|
||||
#define idh_ar_transformation 8093
|
||||
#define idh_ar_type_of_entity 8094
|
||||
#define idh_ar_total 8095
|
||||
#define idh_ar_reset 8096
|
||||
|
||||
// Preview dialog box
|
||||
#define idh_dialog_preview 8100
|
||||
#define idh_pv_range 8101
|
||||
#define idh_pv_frame_rate 8102
|
||||
#define idh_pv_image_size 8103
|
||||
#define idh_pv_display 8104
|
||||
#define idh_pv_rnd_level 8105
|
||||
#define idh_pv_output 8106
|
||||
|
||||
|
||||
// dialogs with no "control level" granularity
|
||||
#define idh_dialog_about 9000
|
||||
#define idh_dialog_select_camera 9010
|
||||
#define idh_dialog_collapse_warning 9020 // for both collapse all and collapse range
|
||||
#define idh_dialog_edit_mod_stack 9030
|
||||
#define idh_dialog_file_new 9040
|
||||
#define idh_dialog_file_reset 9050
|
||||
#define idh_dialog_object_prop 9060
|
||||
#define idh_dialog_grid_snap_settings 9070
|
||||
#define idh_dialog_group 9080
|
||||
#define idh_dialog_import_name_conflict 9090
|
||||
#define idh_dialog_missing_dlls 9100
|
||||
#define idh_dialog_merge 9110
|
||||
#define idh_dialog_merge_dup 9111
|
||||
#define idh_dialog_merge_matlib 9112
|
||||
#define idh_dialog_merge_matlib_dup 9113
|
||||
#define idh_dialog_replace 9115
|
||||
#define idh_dialog_mod_setup 9120
|
||||
#define idh_dialog_choose_view 9130
|
||||
#define idh_dialog_mtl_preview 9140
|
||||
#define idh_dialog_object_color 9150
|
||||
#define idh_dialog_clone_options 9160
|
||||
#define idh_dialog_plugin_help 9170
|
||||
#define idh_dialog_plugin_info 9180 // subdialog of scene info
|
||||
#define idh_dialog_preview_cancel 9190
|
||||
#define idh_dialog_rescale_time 9200
|
||||
#define idh_dialog_time_config 9210
|
||||
#define idh_dialog_topo_warning 9220 // topology warning
|
||||
#define idh_dialog_units_setup 9230
|
||||
#define idh_dialog_viewport_background 9240
|
||||
#define idh_dialog_customize_ui 9245
|
||||
|
||||
#define idh_pref_draftrenderer 9250
|
||||
|
||||
//Dans id's
|
||||
#define idh_dialog_mtl_edit 10001
|
||||
#define idh_dialog_medit_opt 10002
|
||||
#define idh_dialog_put_medit 10003
|
||||
#define idh_dialog_mtlbrows 10004
|
||||
#define idh_dialog_render 10005
|
||||
#define idh_dialog_excl_list 10006
|
||||
#define idh_dialog_update_mtls 10007
|
||||
|
||||
// Gus' IDs
|
||||
|
||||
#define idh_net_server_window 10500 //-- Network Render SERVER main UI Window
|
||||
#define idh_net_manager_window 10501 //-- Network Render MANAGER main UI Window
|
||||
#define idh_net_logging_prop 10502 //-- Network Render log properties (common to both Manager and Server)
|
||||
#define idh_net_manager_prop 10503 //-- Network Render Manager Properties Dialogue
|
||||
#define idh_net_server_prop 10504 //-- Network Render Server Properties Dialogue
|
||||
#define idh_notify_main_ui 10505 //-- Notify.exe main UI
|
||||
#define idh_bmm_vfb 10506 //-- BMM Virtual Frame Buffer Window
|
||||
#define idh_net_joboutput 10507 //-- Network Rendering - Job Assignment Dialogue - Ouput Exists Dialogue
|
||||
#define idh_net_job_assignment 10508 //-- Network Rendering - Job Assignment Dialogue
|
||||
#define idh_net_job_assignment_srv_prop 10509 //-- Network Rendering - Job Assignment Dialogue - Server Properties
|
||||
#define idh_net_job_assignment_alerts 10510 //-- Network Rendering - Job Assignment Dialogue - Alerts Dialogue
|
||||
|
||||
// Rolf's IDs
|
||||
#define idh_dialog_trackview_ort 11000
|
||||
#define idh_dialog_trackview_timepaste 11010
|
||||
#define idh_dialog_trackview_trackpaste 11020
|
||||
#define idh_dialog_trackview_reducekeys 11030
|
||||
#define idh_dialog_trackview_filters 11040
|
||||
#define idh_dialog_trackview_pick 11050
|
||||
#define idh_dialog_trackview_choosecontrol 11060
|
||||
|
||||
#define idh_dialog_timeslide_createkey 11070
|
||||
|
||||
#define idh_dialog_pref_control_defaults 11080
|
||||
#define idh_dialog_pref_select_class 11090
|
||||
|
||||
#define idh_dialog_snapshot 11100
|
||||
#define idh_dialog_align 11110
|
||||
#define idh_dialog_mirror 11120
|
||||
#define idh_dialog_normal_align 11130
|
||||
#define idh_dialog_view_align 11135
|
||||
|
||||
#define idh_dialog_render_params 11140
|
||||
#define idh_dialog_render_presetsize 11160
|
||||
|
||||
#define idh_dialog_atmos 11170
|
||||
#define idh_dialog_atmos_create 11180
|
||||
|
||||
#define idh_dialog_medit_browser 11190
|
||||
#define idh_dialog_medit_puttolib 11200
|
||||
|
||||
#define idh_dialog_buttonsets 11210
|
||||
|
||||
#define idh_dialog_xform_typein 11220
|
||||
#define idh_dialog_display_floater 11225
|
||||
|
||||
#define idh_dialog_effect 11230
|
||||
#define idh_dialog_effect_create 11240
|
||||
|
||||
#define idh_dialog_obj_xref 11250 // Object xref dialog
|
||||
#define idh_dialog_scene_xref 11260 // Scene xref dialog
|
||||
|
||||
|
||||
// layer ids
|
||||
#define idh_tb_layer_current_button 11500
|
||||
#define idh_tb_layer_prop_button 11510
|
||||
#define idh_tb_layer_list 11520
|
||||
#define idh_tb_geom_prop_button 11530
|
||||
|
||||
// Schematic view ids...
|
||||
#define idh_dialog_schematicview_filters 11600
|
||||
|
||||
// CCJ Dialog ids
|
||||
#define idh_dialog_file_properties 11700
|
||||
#define idh_ramplayer_window 11710
|
||||
|
||||
// Prs dialog ids
|
||||
#define idh_3dsexp_export 11800 // 3DS Export Dialog
|
||||
|
||||
#define idh_3dsimp_import 11820 // 3DS Import Dialog
|
||||
|
||||
#if 0 // rollups, not currently associated with help
|
||||
#define idh_vrmlexp_anchor 11840 // VRML97 Helpers: Anchor
|
||||
#define idh_vrmlexp_audioclip 11841 // VRML97 Helpers: AudioClip
|
||||
#define idh_vrmlexp_backgroundsky 11842 // VRML97 Helpers: Background: sky colors rollout
|
||||
#define idh_vrmlexp_backgroundground 11843 // VRML97 Helpers: Background: ground colors rollout
|
||||
#define idh_vrmlexp_backgroundimages 11844 // VRML97 Helpers: Background: images rollout
|
||||
#define idh_vrmlexp_bboard 11845 // VRML97 Helpers: Billboard
|
||||
#define idh_vrmlexp_fog 11846 // VRML97 Helpers: Fog
|
||||
#define idh_vrmlexp_inline 11847 // VRML97 Helpers: Inline
|
||||
#define idh_vrmlexp_lod 11848 // VRML97 Helpers: LOD
|
||||
#define idh_vrmlexp_navinfo 11849 // VRML97 Helpers: NavigationInfo
|
||||
#define idh_vrmlexp_proxsensor 11850 // VRML97 Helpers: ProximitySensor
|
||||
#define idh_vrmlexp_sound 11851 // VRML97 Helpers: Sound
|
||||
#define idh_vrmlexp_timesensor 11852 // VRML97 Helpers: TimeSensor
|
||||
#define idh_vrmlexp_touchsensor 11853 // VRML97 Helpers: TouchSensor
|
||||
#endif
|
||||
#define idh_vrmlexp_export 11854 // VRML97 Export Dialog
|
||||
|
||||
#if 0 // rollups, not currently associated with help
|
||||
#define idh_vrblout_inline 11870 // VRML/VRBL Inline Rollout
|
||||
#define idh_vrblout_lod 11871 // VRML/VRBL Level of Detail Rollout
|
||||
#define idh_vrblout_actions 11872 // VRML/VRBL Actions Rollout
|
||||
#define idh_vrblout_animate 11873 // VRML/VRBL Animate Rollout
|
||||
#define idh_vrblout_hyperlink 11874 // VRML/VRBL Hyperlink Jump Rollout
|
||||
#define idh_vrblout_viewpoint 11875 // VRML/VRBL Set Camera Rollout
|
||||
#define idh_vrblout_triggers 11876 // VRML/VRBL Triggers Rollout
|
||||
#endif
|
||||
#define idh_vrblout_export 11877 // VRML/VRBL Export Dialog
|
||||
|
||||
#define idh_vrmlimp_import 11890 // VRML Import Dialog
|
||||
|
||||
#endif // _CONTEXTIDS_H_
|
874
lib/maxsdk31/control.h
Executable file
874
lib/maxsdk31/control.h
Executable file
@ -0,0 +1,874 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: control.h
|
||||
|
||||
DESCRIPTION: Control definitions
|
||||
|
||||
CREATED BY: Dan Silva and Rolf Berteig
|
||||
|
||||
HISTORY: created 9 September 1994
|
||||
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __CONTROL__
|
||||
|
||||
#define __CONTROL__
|
||||
|
||||
#include "plugapi.h"
|
||||
|
||||
extern CoreExport void ApplyScaling(Matrix3 &m, const ScaleValue &v);
|
||||
extern CoreExport void InitControlLists();
|
||||
|
||||
|
||||
class ScaleValue;
|
||||
class ViewExp;
|
||||
class INode;
|
||||
class XFormModes;
|
||||
class INodeTab;
|
||||
class View;
|
||||
|
||||
CoreExport ScaleValue operator+(const ScaleValue& s0, const ScaleValue& s1);
|
||||
CoreExport ScaleValue operator-(const ScaleValue& s0, const ScaleValue& s1);
|
||||
CoreExport ScaleValue operator*(const ScaleValue& s, float f);
|
||||
CoreExport ScaleValue operator*(float f, const ScaleValue& s);
|
||||
CoreExport ScaleValue operator+(const ScaleValue& s, float f);
|
||||
CoreExport ScaleValue operator+(float f, const ScaleValue& s);
|
||||
|
||||
class ScaleValue {
|
||||
public:
|
||||
Point3 s;
|
||||
Quat q;
|
||||
ScaleValue() {}
|
||||
ScaleValue(const Point3& as) { s = as; q = IdentQuat(); }
|
||||
ScaleValue(const Point3& as, const Quat& aq) {s = as; q = aq;}
|
||||
ScaleValue& operator+=(const ScaleValue& s) {(*this)=(*this)+s;return (*this);}
|
||||
ScaleValue& operator*=(const float s) {(*this)=(*this)*s;return (*this);}
|
||||
ScaleValue& operator=(const ScaleValue &v) {s=v.s;q=v.q;return (*this);}
|
||||
float& operator[](int el) {return s[el];}
|
||||
};
|
||||
|
||||
// Types of ORTs
|
||||
#define ORT_BEFORE 1
|
||||
#define ORT_AFTER 2
|
||||
|
||||
// ORTs
|
||||
#define ORT_CONSTANT 1
|
||||
#define ORT_CYCLE 2
|
||||
#define ORT_LOOP 3 // This is cycle with continuity.
|
||||
#define ORT_OSCILLATE 4
|
||||
#define ORT_LINEAR 5
|
||||
#define ORT_IDENTITY 6
|
||||
#define ORT_RELATIVE_REPEAT 7
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
|
||||
// A list of ease curves.
|
||||
class EaseCurveList : public ReferenceTarget {
|
||||
friend class AddEaseRestore;
|
||||
friend class DeleteEaseRestore;
|
||||
|
||||
private:
|
||||
Tab<Control*> eases;
|
||||
|
||||
public:
|
||||
EaseCurveList() {OpenTreeEntry(1,ALL_TRACK_VIEWS);}
|
||||
CoreExport ~EaseCurveList();
|
||||
|
||||
CoreExport TimeValue ApplyEase(TimeValue t,Interval &valid);
|
||||
CoreExport void AppendEaseCurve(Control *cont);
|
||||
CoreExport void DeleteEaseCurve(int i);
|
||||
CoreExport void DisableEaseCurve(int i);
|
||||
CoreExport void EnableEaseCurve(int i);
|
||||
CoreExport BOOL IsEaseEnabled(int i);
|
||||
int NumEaseCurves() {return eases.Count();}
|
||||
|
||||
// Animatable
|
||||
void GetClassName(TSTR& s) { s= TSTR(_T("EaseCurve")); }
|
||||
Class_ID ClassID() { return Class_ID(EASE_LIST_CLASS_ID,0); }
|
||||
SClass_ID SuperClassID() { return EASE_LIST_CLASS_ID; }
|
||||
CoreExport int NumSubs();
|
||||
CoreExport Animatable* SubAnim(int i);
|
||||
CoreExport TSTR SubAnimName(int i);
|
||||
int SubNumToRefNum(int subNum) {return subNum;}
|
||||
BOOL BypassTreeView() { return TRUE; }
|
||||
void DeleteThis() { delete this; }
|
||||
ParamDimension* GetParamDimension(int i) {return stdTimeDim;}
|
||||
CoreExport BOOL AssignController(Animatable *control,int subAnim);
|
||||
CoreExport void* GetInterface(ULONG id);
|
||||
|
||||
CoreExport IOResult Save(ISave *isave);
|
||||
CoreExport IOResult Load(ILoad *iload);
|
||||
|
||||
// Reference
|
||||
CoreExport int NumRefs();
|
||||
CoreExport RefTargetHandle GetReference(int i);
|
||||
CoreExport void SetReference(int i, RefTargetHandle rtarg);
|
||||
CoreExport RefTargetHandle Clone(RemapDir &remap = NoRemap());
|
||||
CoreExport RefResult NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget,
|
||||
PartID& partID, RefMessage message);
|
||||
};
|
||||
|
||||
class EaseCurveAnimProp : public AnimProperty {
|
||||
public:
|
||||
EaseCurveList *el;
|
||||
EaseCurveAnimProp() { el=NULL; }
|
||||
DWORD ID() {return PROPID_EASELIST;}
|
||||
};
|
||||
|
||||
#define GetEaseListInterface(anim) ((EaseCurveList*)anim->GetInterface(I_EASELIST))
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
// A list of multiplier curves.
|
||||
class MultCurveList : public ReferenceTarget {
|
||||
friend class AddMultRestore;
|
||||
friend class DeleteMultRestore;
|
||||
private:
|
||||
Tab<Control*> mults;
|
||||
|
||||
public:
|
||||
MultCurveList() {OpenTreeEntry(1,ALL_TRACK_VIEWS);}
|
||||
CoreExport ~MultCurveList();
|
||||
|
||||
CoreExport float GetMultVal(TimeValue t,Interval &valid);
|
||||
CoreExport void AppendMultCurve(Control *cont);
|
||||
CoreExport void DeleteMultCurve(int i);
|
||||
CoreExport void DisableMultCurve(int i);
|
||||
CoreExport void EnableMultCurve(int i);
|
||||
CoreExport BOOL IsMultEnabled(int i);
|
||||
int NumMultCurves() {return mults.Count();}
|
||||
|
||||
// Animatable
|
||||
void GetClassName(TSTR& s) { s= TSTR(_T("MultCurve")); }
|
||||
Class_ID ClassID() { return Class_ID(MULT_LIST_CLASS_ID,0); }
|
||||
SClass_ID SuperClassID() { return MULT_LIST_CLASS_ID; }
|
||||
CoreExport int NumSubs();
|
||||
CoreExport Animatable* SubAnim(int i);
|
||||
CoreExport TSTR SubAnimName(int i);
|
||||
int SubNumToRefNum(int subNum) {return subNum;}
|
||||
BOOL BypassTreeView() { return TRUE; }
|
||||
void DeleteThis() { delete this; }
|
||||
ParamDimension* GetParamDimension(int i) {return stdNormalizedDim;}
|
||||
CoreExport BOOL AssignController(Animatable *control,int subAnim);
|
||||
CoreExport void* GetInterface(ULONG id);
|
||||
|
||||
CoreExport IOResult Save(ISave *isave);
|
||||
CoreExport IOResult Load(ILoad *iload);
|
||||
|
||||
// Reference
|
||||
CoreExport int NumRefs();
|
||||
CoreExport RefTargetHandle GetReference(int i);
|
||||
CoreExport void SetReference(int i, RefTargetHandle rtarg);
|
||||
CoreExport RefTargetHandle Clone(RemapDir &remap = NoRemap());
|
||||
CoreExport RefResult NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget,
|
||||
PartID& partID, RefMessage message);
|
||||
};
|
||||
|
||||
class MultCurveAnimProp : public AnimProperty {
|
||||
public:
|
||||
MultCurveList *ml;
|
||||
MultCurveAnimProp() { ml=NULL; }
|
||||
DWORD ID() {return PROPID_MULTLIST;}
|
||||
};
|
||||
|
||||
#define GetMultListInterface(anim) ((MultCurveList*)anim->GetInterface(I_MULTLIST))
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
|
||||
|
||||
//
|
||||
// For hit testing controller apparatus
|
||||
//
|
||||
|
||||
class CtrlHitRecord {
|
||||
friend class CtrlHitLog;
|
||||
CtrlHitRecord *next;
|
||||
public:
|
||||
INode *nodeRef;
|
||||
DWORD distance;
|
||||
ulong hitInfo;
|
||||
DWORD infoExtra;
|
||||
CtrlHitRecord() {next=NULL; distance=0; hitInfo=0; nodeRef=NULL;}
|
||||
CtrlHitRecord(CtrlHitRecord *nxt,INode *nr, DWORD d, ulong inf, DWORD extra) {
|
||||
next=nxt;nodeRef=nr;distance=d;hitInfo=inf;infoExtra=extra;}
|
||||
CtrlHitRecord *Next() {return next;}
|
||||
};
|
||||
|
||||
class CtrlHitLog {
|
||||
CtrlHitRecord *first;
|
||||
int hitIndex;
|
||||
public:
|
||||
CtrlHitLog() { first = NULL; }
|
||||
~CtrlHitLog() { Clear(); }
|
||||
CoreExport void Clear();
|
||||
CoreExport void ClearHitIndex() { hitIndex = 0; }
|
||||
CoreExport void IncrHitIndex() { hitIndex++; }
|
||||
CtrlHitRecord* First() { return first; }
|
||||
CoreExport CtrlHitRecord* ClosestHit();
|
||||
void LogHit(INode *nr,DWORD dist,ulong info,DWORD infoExtra)
|
||||
{first = new CtrlHitRecord(first,nr,dist,info,infoExtra);}
|
||||
};
|
||||
|
||||
|
||||
// For enumerating IK paramaters
|
||||
class IKEnumCallback {
|
||||
public:
|
||||
virtual void proc(Control *c, int index)=0;
|
||||
};
|
||||
|
||||
class IKDeriv {
|
||||
public:
|
||||
virtual int NumEndEffectors()=0;
|
||||
virtual Point3 EndEffectorPos(int index)=0;
|
||||
virtual void DP(Point3 dp,int index)=0;
|
||||
virtual void DR(Point3 dr,int index)=0;
|
||||
virtual void NextDOF()=0;
|
||||
};
|
||||
|
||||
// Flags passed to CompDerivs
|
||||
#define POSITION_DERIV (1<<0)
|
||||
#define ROTATION_DERIV (1<<1)
|
||||
|
||||
|
||||
// This class is used to store IK parameters that have been
|
||||
// copied to a clipboard.
|
||||
class IKClipObject {
|
||||
public:
|
||||
// Identifies the creator of the clip object
|
||||
virtual SClass_ID SuperClassID()=0;
|
||||
virtual Class_ID ClassID()=0;
|
||||
|
||||
virtual void DeleteThis()=0;
|
||||
};
|
||||
|
||||
// Values for 'which' pasted to Copy/PasteIKParams
|
||||
#define COPYPASTE_IKPOS 1
|
||||
#define COPYPASTE_IKROT 2
|
||||
|
||||
// Passed to InitIKJoints() which is called when importing
|
||||
// R4 3DS files that have IK joint data.
|
||||
class InitJointData {
|
||||
public:
|
||||
BOOL active[3];
|
||||
BOOL limit[3];
|
||||
BOOL ease[3];
|
||||
Point3 min, max, damping;
|
||||
};
|
||||
|
||||
// This structure is passed to GetDOFParams().
|
||||
// Controllers that support IK can provide info about their DOFs
|
||||
// so that bones can display this information.
|
||||
// The first 3 DOFs are assumed to be position
|
||||
// and the next 3 are assumed to be rotation
|
||||
class DOFParams {
|
||||
public:
|
||||
BOOL display[6]; // Should this DOF be displayed?
|
||||
Point3 axis[6]; // DOF axis
|
||||
Point3 pos[6]; // Base of axis
|
||||
BOOL limit[6]; // is joint limited?
|
||||
float min[6]; // min limit
|
||||
float max[6]; // max limit
|
||||
float curval[6]; // Current value of the parameter
|
||||
BOOL sel[6]; // should DOF be highlighted
|
||||
BOOL endEffector; // is there an end effector for this controller
|
||||
Matrix3 eeTM; // world TM of the end effector if present
|
||||
};
|
||||
|
||||
|
||||
// These two ways values can be retreived or set.
|
||||
// For get:
|
||||
// RELATIVE = Apply
|
||||
// ABSOLUTE = Just get the value
|
||||
// For set:
|
||||
// RELATIVE = Add the value to the existing value (i.e Move/Rotate/Scale)
|
||||
// ABSOLUTE = Just set the value
|
||||
enum GetSetMethod {CTRL_RELATIVE,CTRL_ABSOLUTE};
|
||||
|
||||
|
||||
// Control class provides default implementations for load and save which save the ORT type in these chunks:
|
||||
#define CONTROLBASE_CHUNK 0x8499
|
||||
#define INORT_CHUNK 0x3000
|
||||
#define OUTORT_CHUNK 0x3001
|
||||
#define CONT_DISABLED_CHUNK 0x3002
|
||||
|
||||
// Inheritance flags.
|
||||
#define INHERIT_POS_X (1<<0)
|
||||
#define INHERIT_POS_Y (1<<1)
|
||||
#define INHERIT_POS_Z (1<<2)
|
||||
#define INHERIT_ROT_X (1<<3)
|
||||
#define INHERIT_ROT_Y (1<<4)
|
||||
#define INHERIT_ROT_Z (1<<5)
|
||||
#define INHERIT_SCL_X (1<<6)
|
||||
#define INHERIT_SCL_Y (1<<7)
|
||||
#define INHERIT_SCL_Z (1<<8)
|
||||
#define INHERIT_ALL 511
|
||||
|
||||
class Control : public ReferenceTarget {
|
||||
public:
|
||||
Control() {SetORT(ORT_CONSTANT,ORT_BEFORE);SetORT(ORT_CONSTANT,ORT_AFTER);};
|
||||
virtual ~Control() {};
|
||||
|
||||
virtual void Copy(Control *from)=0;
|
||||
virtual void CommitValue(TimeValue t) {}
|
||||
virtual void RestoreValue(TimeValue t) {}
|
||||
virtual INode* GetTarget() { return NULL; }
|
||||
virtual RefResult SetTarget(INode *targ) {return REF_SUCCEED;}
|
||||
|
||||
// Implemented by transform controllers that have position controller
|
||||
// that can be edited in the trajectory branch
|
||||
virtual Control *GetPositionController() {return NULL;}
|
||||
virtual Control *GetRotationController() {return NULL;}
|
||||
virtual Control *GetScaleController() {return NULL;}
|
||||
virtual BOOL SetPositionController(Control *c) {return FALSE;}
|
||||
virtual BOOL SetRotationController(Control *c) {return FALSE;}
|
||||
virtual BOOL SetScaleController(Control *c) {return FALSE;}
|
||||
|
||||
// If a controller has an 'X', 'Y', or 'Z' controller, it can implement
|
||||
// these methods so that its sub controllers can respect track view filters
|
||||
virtual Control *GetXController() {return NULL;}
|
||||
virtual Control *GetYController() {return NULL;}
|
||||
virtual Control *GetZController() {return NULL;}
|
||||
|
||||
// Implemented by look at controllers that have a float valued roll
|
||||
// controller so that the roll can be edited via the transform type-in
|
||||
virtual Control *GetRollController() {return NULL;}
|
||||
virtual BOOL SetRollController(Control *c) {return FALSE;}
|
||||
|
||||
// Implemented by any Point3 controller that wishes to indicate that it is intended
|
||||
// to control floating point RGB color values
|
||||
virtual BOOL IsColorController() {return FALSE;}
|
||||
|
||||
// Implemented by TM controllers that support
|
||||
// filtering out inheritance
|
||||
virtual DWORD GetInheritanceFlags() {return INHERIT_ALL;}
|
||||
virtual BOOL SetInheritanceFlags(DWORD f,BOOL keepPos) {return FALSE;} // return TRUE if TM controller supports inheritance
|
||||
|
||||
virtual BOOL IsLeaf() {return TRUE;}
|
||||
virtual int IsKeyable() {return 1;}
|
||||
|
||||
// If a controller does not want to allow another controller
|
||||
// to be assigned on top of it, it can return FALSE to this method.
|
||||
virtual BOOL IsReplaceable() {return TRUE;}
|
||||
|
||||
// This is called on TM, pos, rot, and scale controllers when their
|
||||
// input matrix is about to change. If they return FALSE, the node will
|
||||
// call SetValue() to make the necessary adjustments.
|
||||
virtual BOOL ChangeParents(TimeValue t,const Matrix3& oldP,const Matrix3& newP,const Matrix3& tm) {return FALSE;}
|
||||
|
||||
// val points to an instance of a data type that corresponds with the controller
|
||||
// type. float for float controllers, etc.
|
||||
// Note that for SetValue on Rotation controllers, if the SetValue is
|
||||
// relative, val points to an AngAxis while if it is absolute it points
|
||||
// to a Quat.
|
||||
virtual void GetValue(TimeValue t, void *val, Interval &valid, GetSetMethod method=CTRL_ABSOLUTE)=0;
|
||||
virtual void SetValue(TimeValue t, void *val, int commit=1, GetSetMethod method=CTRL_ABSOLUTE)=0;
|
||||
|
||||
// Transform controllers that do not inherit their parent's transform
|
||||
// should override this method. Returning FALSE will cause SetValue
|
||||
// to be called even in the case when the parent is also being transformed.
|
||||
virtual BOOL InheritsParentTransform() { return TRUE; }
|
||||
|
||||
virtual int GetORT(int type) {return (aflag>>(type==ORT_BEFORE?A_ORT_BEFORESHIFT:A_ORT_AFTERSHIFT))&A_ORT_MASK;}
|
||||
CoreExport virtual void SetORT(int ort,int type);
|
||||
|
||||
// Sets the enabled/disabled state for ORTs
|
||||
CoreExport virtual void EnableORTs(BOOL enable);
|
||||
|
||||
// Default implementations of load and save handle loading and saving of out of range type.
|
||||
// Call these from derived class load and save.
|
||||
// NOTE: Must call these before any of the derived class chunks are loaded or saved.
|
||||
CoreExport IOResult Save(ISave *isave);
|
||||
CoreExport IOResult Load(ILoad *iload);
|
||||
|
||||
// For IK
|
||||
// Note: IK params must be given in the order they are applied to
|
||||
// the parent matrix. When derivatives are computed for a parameter
|
||||
// that parameter will apply itself to the parent matrix so the next
|
||||
// parameter has the appropriate reference frame. If a controller isn't
|
||||
// participating in IK then it should return FALSE and the client (usually PRS)
|
||||
// will apply the controller's value to the parent TM.
|
||||
virtual void EnumIKParams(IKEnumCallback &callback) {}
|
||||
virtual BOOL CompDeriv(TimeValue t,Matrix3& ptm,IKDeriv& derivs,DWORD flags) {return FALSE;}
|
||||
virtual float IncIKParam(TimeValue t,int index,float delta) {return 0.0f;}
|
||||
virtual void ClearIKParam(Interval iv,int index) {return;}
|
||||
virtual BOOL CanCopyIKParams(int which) {return FALSE;}
|
||||
virtual IKClipObject *CopyIKParams(int which) {return NULL;}
|
||||
virtual BOOL CanPasteIKParams(IKClipObject *co,int which) {return FALSE;}
|
||||
virtual void PasteIKParams(IKClipObject *co,int which) {}
|
||||
virtual void InitIKJoints(InitJointData *posData,InitJointData *rotData) {}
|
||||
virtual BOOL GetIKJoints(InitJointData *posData,InitJointData *rotData) {return FALSE;}
|
||||
virtual BOOL GetDOFParams(TimeValue t,Matrix3 &ptm,DOFParams &dofs,BOOL nodeSel) {return FALSE;}
|
||||
virtual BOOL CreateLockKey(TimeValue t, int which) {return FALSE;}
|
||||
virtual void MirrorIKConstraints(int axis,int which,BOOL pasteMirror=FALSE) {}
|
||||
virtual BOOL TerminateIK() {return FALSE;} // controllers can act as terminators.
|
||||
|
||||
// Called on a transform controller when the a message is received from a pin node
|
||||
virtual RefResult PinNodeChanged(RefMessage message,Interval changeInt, PartID &partID) {return REF_SUCCEED;}
|
||||
|
||||
// Called on a transform controller when one of the node level IK parameters has been changed
|
||||
virtual void NodeIKParamsChanged() {}
|
||||
|
||||
// Called in a transform controller when a node invalidates its TM cache
|
||||
virtual void TMInvalidated() {}
|
||||
|
||||
// Let's the TM controller determine if it's OK to bind (IK bind) to a particular node.
|
||||
virtual BOOL OKToBindToNode(INode *node) {return TRUE;}
|
||||
|
||||
// Ease curves
|
||||
virtual BOOL CanApplyEaseMultCurves() {return TRUE;}
|
||||
CoreExport TimeValue ApplyEase(TimeValue t,Interval &valid);
|
||||
CoreExport void AppendEaseCurve(Control *cont);
|
||||
CoreExport void DeleteEaseCurve(int i);
|
||||
CoreExport int NumEaseCurves();
|
||||
|
||||
// Multiplier curves
|
||||
CoreExport float GetMultVal(TimeValue t,Interval &valid);
|
||||
CoreExport void AppendMultCurve(Control *cont);
|
||||
CoreExport void DeleteMultCurve(int i);
|
||||
CoreExport int NumMultCurves();
|
||||
|
||||
// These are implemented to handle ease curves. If a controller
|
||||
// is a leaf controller, then it MUST NOT BY DEFINITION have any
|
||||
// sub controllers or references. If it is a leaf controller, then
|
||||
// these are implemented to handle the ease curve list.
|
||||
// If it is NOT a leaf controller, then these can be overridden.
|
||||
CoreExport int NumRefs();
|
||||
CoreExport RefTargetHandle GetReference(int i);
|
||||
CoreExport void SetReference(int i, RefTargetHandle rtarg);
|
||||
CoreExport int NumSubs();
|
||||
CoreExport Animatable* SubAnim(int i);
|
||||
CoreExport TSTR SubAnimName(int i);
|
||||
|
||||
// Default implementations of some Animatable methods
|
||||
CoreExport void* GetInterface(ULONG id);
|
||||
CoreExport int PaintFCurves(
|
||||
ParamDimensionBase *dim,
|
||||
HDC hdc,
|
||||
Rect& rcGraph,
|
||||
Rect& rcPaint,
|
||||
float tzoom,
|
||||
int tscroll,
|
||||
float vzoom,
|
||||
int vscroll,
|
||||
DWORD flags );
|
||||
CoreExport int GetFCurveExtents(
|
||||
ParamDimensionBase *dim,
|
||||
float &min, float &max, DWORD flags);
|
||||
|
||||
|
||||
// This is called on transform controller after a node is
|
||||
// cloned and the clone process has finished
|
||||
virtual void PostCloneNode() {}
|
||||
|
||||
// Slave TM controllers can implement this to prevent plug-ins
|
||||
// deleting their node via the DeleteNode API.
|
||||
virtual BOOL PreventNodeDeletion() {return FALSE;}
|
||||
|
||||
// New interface for visibility float controllers to allow view dependent visibility
|
||||
// The default implementation will call GetValue()
|
||||
CoreExport virtual float EvalVisibility(TimeValue t,View &view,Box3 pbox,Interval &valid);
|
||||
|
||||
// Called on visibility controllers. Gives them the option to completely hide an object in the viewports
|
||||
virtual BOOL VisibleInViewports() {return TRUE;}
|
||||
|
||||
// Called on transform controllers or visibility controllers when a node is cloned and the user has chosen to instance
|
||||
virtual BOOL CanInstanceController() {return TRUE;}
|
||||
|
||||
// Should be called by any leaf controller's clone method so
|
||||
// that ease and multipier curves are cloned.
|
||||
CoreExport void CloneControl(Control *ctrl,RemapDir &remap);
|
||||
|
||||
//-------------------------------------------------------
|
||||
// Controllers that wish to have an apparatus available in
|
||||
// the scene will implement these methods:
|
||||
// NOTE: Most of these methods are duplicated in BaseObject or Object
|
||||
// (see object.h for descriptions).
|
||||
virtual int Display(TimeValue t, INode* inode, ViewExp *vpt, int flags) { return 0; };
|
||||
virtual int HitTest(TimeValue t, INode* inode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt) { return 0; }
|
||||
virtual void GetWorldBoundBox(TimeValue t,INode* inode, ViewExp *vpt, Box3& box) {}
|
||||
|
||||
virtual void ActivateSubobjSel(int level, XFormModes& modes ) {}
|
||||
|
||||
virtual void SelectSubComponent(CtrlHitRecord *hitRec, BOOL selected, BOOL all, BOOL invert=FALSE) {}
|
||||
virtual void ClearSelection(int selLevel) {}
|
||||
virtual int SubObjectIndex(CtrlHitRecord *hitRec) {return 0;}
|
||||
virtual void SelectAll(int selLevel) {}
|
||||
virtual void InvertSelection(int selLevel) {}
|
||||
|
||||
virtual void GetSubObjectCenters(SubObjAxisCallback *cb,TimeValue t,INode *node) {}
|
||||
virtual void GetSubObjectTMs(SubObjAxisCallback *cb,TimeValue t,INode *node) {}
|
||||
|
||||
// Modify sub object apparatuses
|
||||
virtual void SubMove( TimeValue t, Matrix3& partm, Matrix3& tmAxis, Point3& val, BOOL localOrigin=FALSE ){}
|
||||
virtual void SubRotate( TimeValue t, Matrix3& partm, Matrix3& tmAxis, Quat& val, BOOL localOrigin=FALSE ){}
|
||||
virtual void SubScale( TimeValue t, Matrix3& partm, Matrix3& tmAxis, Point3& val, BOOL localOrigin=FALSE ){}
|
||||
|
||||
// Schematic View Animatable Overides...
|
||||
CoreExport SvGraphNodeReference SvTraverseAnimGraph(IGraphObjectManager *gom, Animatable *object, int id, DWORD flags);
|
||||
|
||||
// Called when the user rescales time in the time configuration dialog. If FALSE
|
||||
// is returned from this method then MapKeys() will be used to perform the scaling.
|
||||
// Controllers can override this method to handle things like rescaling tagents that
|
||||
// MapKeys() won't affect and return TRUE if they don't want map keys to be called.
|
||||
virtual BOOL RescaleTime(Interval oseg, Interval nseg) {return FALSE;}
|
||||
};
|
||||
|
||||
|
||||
// Any controller that does not evaluate itself as a function of it's
|
||||
// input can subclass off this class.
|
||||
// GetValueLocalTime() will never ask the controller to apply the value,
|
||||
// it will always ask for it absolute.
|
||||
class StdControl : public Control {
|
||||
public:
|
||||
virtual void GetValueLocalTime(TimeValue t, void *val, Interval &valid, GetSetMethod method=CTRL_ABSOLUTE)=0;
|
||||
virtual void SetValueLocalTime(TimeValue t, void *val, int commit=1, GetSetMethod method=CTRL_ABSOLUTE)=0;
|
||||
CoreExport void GetValue(TimeValue t, void *val, Interval &valid, GetSetMethod method=CTRL_ABSOLUTE);
|
||||
CoreExport void SetValue(TimeValue t, void *val, int commit=1, GetSetMethod method=CTRL_ABSOLUTE);
|
||||
|
||||
virtual void Extrapolate(Interval range,TimeValue t,void *val,Interval &valid,int type)=0;
|
||||
|
||||
virtual void *CreateTempValue()=0;
|
||||
virtual void DeleteTempValue(void *val)=0;
|
||||
virtual void ApplyValue(void *val, void *delta)=0;
|
||||
virtual void MultiplyValue(void *val, float m)=0;
|
||||
};
|
||||
|
||||
|
||||
// Each super class of controller may have a specific packet defined that
|
||||
// the 'val' pointer will point to instead of a literal value.
|
||||
// In reality, probably only the Transform controller will do this.
|
||||
enum SetXFormCommand { XFORM_MOVE, XFORM_ROTATE, XFORM_SCALE, XFORM_SET };
|
||||
class SetXFormPacket {
|
||||
public:
|
||||
SetXFormCommand command;
|
||||
Matrix3 tmParent;
|
||||
Matrix3 tmAxis; // if command is XFORM_SET, this will contain the new value for the XFORM.
|
||||
Point3 p;
|
||||
Quat q;
|
||||
AngAxis aa;
|
||||
BOOL localOrigin;
|
||||
|
||||
// XFORM_SET
|
||||
SetXFormPacket(const Matrix3& mat,const Matrix3& par=Matrix3(1))
|
||||
{command=XFORM_SET,tmParent=par,tmAxis=mat;}
|
||||
|
||||
// XFORM_MOVE
|
||||
SetXFormPacket(Point3 pt, const Matrix3& par=Matrix3(1),
|
||||
const Matrix3& a=Matrix3(1))
|
||||
{command=XFORM_MOVE;tmParent=par;tmAxis=a;p=pt;localOrigin=FALSE;}
|
||||
|
||||
// XFORM_ROTATE
|
||||
SetXFormPacket(Quat qt, BOOL l, const Matrix3& par=Matrix3(1),
|
||||
const Matrix3& a=Matrix3(1))
|
||||
{command=XFORM_ROTATE;tmParent=par;tmAxis=a;q=qt;aa=AngAxis(q);localOrigin=l;}
|
||||
SetXFormPacket(AngAxis aA, BOOL l, const Matrix3& par=Matrix3(1),
|
||||
const Matrix3& a=Matrix3(1))
|
||||
{command=XFORM_ROTATE;tmParent=par;tmAxis=a;q=Quat(aA);aa=aA;localOrigin=l;}
|
||||
|
||||
// XFORM_SCALE
|
||||
SetXFormPacket(Point3 pt, BOOL l, const Matrix3& par=Matrix3(1),
|
||||
const Matrix3& a=Matrix3(1))
|
||||
{command=XFORM_SCALE;tmParent=par;tmAxis=a;p=pt;localOrigin=l;}
|
||||
|
||||
// Just in case you want to do it by hand...
|
||||
SetXFormPacket() {};
|
||||
};
|
||||
|
||||
|
||||
|
||||
// This is a special control base class for controllers that control
|
||||
// morphing of geomoetry.
|
||||
//
|
||||
// The 'val' pointer used with GetValue will point to an object state.
|
||||
// This would be the result of evaluating a combination of targets and
|
||||
// producing a new object that is some combination of the targets.
|
||||
//
|
||||
// The 'val' pointer used with SetValue will point to a
|
||||
// SetMorphTargetPacket data structure. This has a pointer to
|
||||
// an object (entire pipeline) and the name of the target.
|
||||
|
||||
// A pointer to one of these is passed to SetValue
|
||||
class SetMorphTargetPacket {
|
||||
public:
|
||||
Matrix3 tm;
|
||||
Object *obj;
|
||||
TSTR name;
|
||||
BOOL forceCreate; // Make sure the key is created even if it is at frame 0
|
||||
SetMorphTargetPacket(Object *o,TSTR n,Matrix3 &m,BOOL fc=FALSE) {obj = o;name = n;tm = m;forceCreate=fc;}
|
||||
SetMorphTargetPacket(Object *o,TSTR n,BOOL fc=FALSE) {obj = o;name = n;tm = Matrix3(1);forceCreate=fc;}
|
||||
};
|
||||
|
||||
class MorphControl : public Control {
|
||||
public:
|
||||
|
||||
// Access the object pipelines of the controller's targets. Note
|
||||
// that these are pointers to the pipelines, not the result of
|
||||
// evaluating the pipelines.
|
||||
virtual int NumMorphTargs() {return 0;}
|
||||
virtual Object *GetMorphTarg(int i) {return NULL;}
|
||||
virtual void DeleteMorphTarg(int i) {}
|
||||
virtual void GetMorphTargName(int i,TSTR &name) {name.printf(_T("Target #%d"),i);}
|
||||
virtual void SetMorphTargName(int i,TSTR name) {}
|
||||
virtual Matrix3 GetMorphTargTM(int i) {return Matrix3(1);}
|
||||
|
||||
// Checks an object to see if it is an acceptable target.
|
||||
virtual BOOL ValidTarget(TimeValue t,Object *obj) {return FALSE;}
|
||||
|
||||
// When a REFMSG_SELECT_BRANCH message is received the morph controller should
|
||||
// mark the target indicated and be prepared to return its ID from this method.
|
||||
virtual int GetFlaggedTarget() {return -1;}
|
||||
|
||||
// Should call these methods on targets
|
||||
virtual BOOL HasUVW() { return 1; }
|
||||
virtual void SetGenUVW(BOOL sw) { }
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Control base class for Master Controllers
|
||||
//
|
||||
|
||||
class MasterPointControl : public Control {
|
||||
public:
|
||||
// Set the number of sub-controllers
|
||||
virtual void SetNumSubControllers(int num, BOOL keep=FALSE) {}
|
||||
// Return the number of sub-controllers
|
||||
virtual int GetNumSubControllers() { return 0; }
|
||||
// Delete all the sub-controllers that are set to TRUE in the BitArray
|
||||
virtual void DeleteControlSet (BitArray set) {}
|
||||
// Add a new sub-controller
|
||||
virtual int AddSubController(Control* ctrl) { return 0; }
|
||||
// Return i'th of sub-controller
|
||||
virtual Control* GetSubController(int i) { return NULL; }
|
||||
// Set the i'th sub-controller
|
||||
virtual void SetSubController(int i, Control* ctrl) {}
|
||||
};
|
||||
|
||||
|
||||
//----------------------------------------------------------------//
|
||||
//
|
||||
// Some stuff to help with ORTs - these could actually be Interval methods
|
||||
|
||||
inline TimeValue CycleTime(Interval i,TimeValue t)
|
||||
{
|
||||
int res, dur = i.Duration()-1;
|
||||
if (dur<=0) return t;
|
||||
res = (t-i.Start())%dur;
|
||||
if (t<i.Start()) {
|
||||
return i.End()+res;
|
||||
} else {
|
||||
return i.Start()+res;
|
||||
}
|
||||
}
|
||||
|
||||
inline int NumCycles(Interval i,TimeValue t)
|
||||
{
|
||||
int dur = i.Duration()-1;
|
||||
if (dur<=0) return 1;
|
||||
if (t<i.Start()) {
|
||||
return (abs(t-i.Start())/dur)+1;
|
||||
} else
|
||||
if (t>i.End()) {
|
||||
return (abs(t-i.End())/dur)+1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Types that use this template must support:
|
||||
// T + T, T - T, T * float, T + float
|
||||
|
||||
template <class T> T
|
||||
LinearExtrapolate(TimeValue t0, TimeValue t1, T &val0, T &val1, T &endVal)
|
||||
{
|
||||
return (T)(endVal + (val1-val0) * float(t1-t0));
|
||||
}
|
||||
|
||||
template <class T> T
|
||||
RepeatExtrapolate(Interval range, TimeValue t,
|
||||
T &startVal, T &endVal, T &cycleVal)
|
||||
{
|
||||
int cycles = NumCycles(range,t);
|
||||
T delta;
|
||||
if (t<range.Start()) {
|
||||
delta = startVal - endVal;
|
||||
} else {
|
||||
delta = endVal - startVal;
|
||||
}
|
||||
return (T)(cycleVal + delta * float(cycles));
|
||||
}
|
||||
|
||||
template <class T> T
|
||||
IdentityExtrapolate(TimeValue endPoint, TimeValue t, T &endVal )
|
||||
{
|
||||
return (T)(endVal + float(t-endPoint));
|
||||
}
|
||||
|
||||
CoreExport Quat LinearExtrapolate(TimeValue t0, TimeValue t1, Quat &val0, Quat &val1, Quat &endVal);
|
||||
CoreExport Quat RepeatExtrapolate(Interval range, TimeValue t,
|
||||
Quat &startVal, Quat &endVal, Quat &cycleVal);
|
||||
CoreExport Quat IdentityExtrapolate(TimeValue endPoint, TimeValue t, Quat &endVal );
|
||||
|
||||
CoreExport ScaleValue LinearExtrapolate(TimeValue t0, TimeValue t1, ScaleValue &val0, ScaleValue &val1, ScaleValue &endVal);
|
||||
CoreExport ScaleValue RepeatExtrapolate(Interval range, TimeValue t, ScaleValue &startVal, ScaleValue &endVal, ScaleValue &cycleVal);
|
||||
CoreExport ScaleValue IdentityExtrapolate(TimeValue endPoint, TimeValue t, ScaleValue &endVal);
|
||||
|
||||
|
||||
template <class T> T
|
||||
LinearInterpolate(const T &v0,const T &v1,float u)
|
||||
{
|
||||
return (T)((1.0f-u)*v0 + u*v1);
|
||||
}
|
||||
|
||||
inline Quat
|
||||
LinearInterpolate(const Quat &v0,const Quat &v1,float u)
|
||||
{
|
||||
return Slerp(v0,v1,u);
|
||||
}
|
||||
|
||||
inline ScaleValue
|
||||
LinearInterpolate(const ScaleValue &v0,const ScaleValue &v1,float u)
|
||||
{
|
||||
ScaleValue res;
|
||||
res.s = ((float)1.0-u)*v0.s + u*v1.s;
|
||||
res.q = Slerp(v0.q,v1.q,u);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
inline Interval TestInterval(Interval iv, DWORD flags)
|
||||
{
|
||||
TimeValue start = iv.Start();
|
||||
TimeValue end = iv.End();
|
||||
if (!(flags&TIME_INCLEFT)) {
|
||||
start++;
|
||||
}
|
||||
if (!(flags&TIME_INCRIGHT)) {
|
||||
end--;
|
||||
}
|
||||
if (end<start) {
|
||||
iv.SetEmpty();
|
||||
} else {
|
||||
iv.Set(start,end);
|
||||
}
|
||||
return iv;
|
||||
}
|
||||
|
||||
inline Quat ScaleQuat(Quat q, float s)
|
||||
{
|
||||
float angle;
|
||||
Point3 axis;
|
||||
AngAxisFromQ(q,&angle,axis);
|
||||
return QFromAngAxis(angle*s,axis);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// A place to store values during Hold/Restore periods
|
||||
//
|
||||
//********************************************************
|
||||
// TempStore: This is a temporary implementation:
|
||||
// It uses a linear search-
|
||||
// A hash-coded dictionary would be faster.
|
||||
// (if there are ever a lot of entries)
|
||||
//********************************************************
|
||||
|
||||
struct Slot {
|
||||
void *key;
|
||||
void *pdata;
|
||||
int nbytes;
|
||||
Slot *next;
|
||||
public:
|
||||
Slot() { pdata = NULL; }
|
||||
~Slot() {
|
||||
if (pdata) free(pdata);
|
||||
pdata = NULL;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class TempStore {
|
||||
Slot *slotList;
|
||||
Slot* Find(int n, void *data, void *ptr);
|
||||
public:
|
||||
TempStore() { slotList = NULL; }
|
||||
~TempStore() { ClearAll(); }
|
||||
CoreExport void ClearAll(); // empty out the store
|
||||
CoreExport void PutBytes(int n, void *data, void *ptr);
|
||||
CoreExport void GetBytes(int n, void *data, void *ptr);
|
||||
CoreExport void Clear(void *ptr); // Remove single entry
|
||||
void PutFloat(float f, void *ptr) {
|
||||
PutBytes(sizeof(float),(void *)&f,ptr);
|
||||
}
|
||||
CoreExport void PutInt(int i, void *ptr) {
|
||||
PutBytes(sizeof(int),(void *)&i,ptr);
|
||||
}
|
||||
CoreExport void GetFloat(float *f, void *ptr) {
|
||||
GetBytes(sizeof(float),(void *)f,ptr);
|
||||
}
|
||||
CoreExport void GetInt(int *i, void *ptr) {
|
||||
GetBytes(sizeof(int),(void *)i,ptr);
|
||||
}
|
||||
CoreExport void PutPoint3(Point3 f, void *ptr) {
|
||||
PutBytes(sizeof(Point3),(void *)&f,ptr);
|
||||
}
|
||||
CoreExport void GetPoint3(Point3 *f, void *ptr) {
|
||||
GetBytes(sizeof(Point3),(void *)f,ptr);
|
||||
}
|
||||
CoreExport void PutQuat( Quat f, void *ptr) {
|
||||
PutBytes(sizeof(Quat),(void *)&f,ptr);
|
||||
}
|
||||
CoreExport void GetQuat( Quat *f, void *ptr) {
|
||||
GetBytes(sizeof(Quat),(void *)f,ptr);
|
||||
}
|
||||
CoreExport void PutScaleValue( ScaleValue f, void *ptr) {
|
||||
PutBytes(sizeof(ScaleValue),(void *)&f,ptr);
|
||||
}
|
||||
CoreExport void GetScaleValue( ScaleValue *f, void *ptr) {
|
||||
GetBytes(sizeof(ScaleValue),(void *)f,ptr);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
extern CoreExport TempStore tmpStore; // this should be in the scene data struct.
|
||||
|
||||
|
||||
CoreExport int Animating(); // is the animate switch on??
|
||||
CoreExport void AnimateOn(); // turn animate on
|
||||
CoreExport void AnimateOff(); // turn animate off
|
||||
CoreExport void SuspendAnimate(); // suspend animation (uses stack)
|
||||
CoreExport void ResumeAnimate(); // resume animation ( " )
|
||||
|
||||
CoreExport TimeValue GetAnimStart();
|
||||
CoreExport TimeValue GetAnimEnd();
|
||||
CoreExport void SetAnimStart(TimeValue s);
|
||||
CoreExport void SetAnimEnd(TimeValue e);
|
||||
|
||||
CoreExport Control *NewDefaultFloatController();
|
||||
CoreExport Control *NewDefaultPoint3Controller();
|
||||
CoreExport Control *NewDefaultMatrix3Controller();
|
||||
CoreExport Control *NewDefaultPositionController();
|
||||
CoreExport Control *NewDefaultRotationController();
|
||||
CoreExport Control *NewDefaultScaleController();
|
||||
CoreExport Control *NewDefaultBoolController();
|
||||
CoreExport Control *NewDefaultColorController();
|
||||
CoreExport Control *NewDefaultMasterPointController();
|
||||
|
||||
CoreExport Control* CreateInterpFloat();
|
||||
CoreExport Control* CreateInterpPosition();
|
||||
CoreExport Control* CreateInterpPoint3();
|
||||
CoreExport Control* CreateInterpRotation();
|
||||
CoreExport Control* CreateInterpScale();
|
||||
CoreExport Control* CreatePRSControl();
|
||||
CoreExport Control* CreateLookatControl();
|
||||
CoreExport Control* CreateMasterPointControl();
|
||||
|
||||
CoreExport void SetDefaultController(SClass_ID sid, ClassDesc *desc);
|
||||
CoreExport ClassDesc *GetDefaultController(SClass_ID sid);
|
||||
|
||||
CoreExport void SetDefaultColorController(ClassDesc *desc);
|
||||
CoreExport void SetDefaultBoolController(ClassDesc *desc);
|
||||
|
||||
|
||||
|
||||
#endif //__CONTROL__
|
BIN
lib/maxsdk31/core.lib
Executable file
BIN
lib/maxsdk31/core.lib
Executable file
Binary file not shown.
23
lib/maxsdk31/coreexp.h
Executable file
23
lib/maxsdk31/coreexp.h
Executable file
@ -0,0 +1,23 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: coreexp.h
|
||||
|
||||
DESCRIPTION:
|
||||
|
||||
CREATED BY: Dan Silva
|
||||
|
||||
HISTORY:
|
||||
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __COREEXPORT__H
|
||||
#define __COREEXPORT__H
|
||||
|
||||
#ifdef BLD_CORE
|
||||
#define CoreExport __declspec( dllexport )
|
||||
#else
|
||||
#define CoreExport __declspec( dllimport )
|
||||
#endif
|
||||
|
||||
#endif // __COREEXPORT__H
|
23
lib/maxsdk31/coregen.h
Executable file
23
lib/maxsdk31/coregen.h
Executable file
@ -0,0 +1,23 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: coregen.h
|
||||
|
||||
DESCRIPTION: General includes for core (must include corebas.h
|
||||
before this file).
|
||||
|
||||
CREATED BY: Rolf Berteig
|
||||
|
||||
HISTORY: created 19 November 1994
|
||||
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __COREGEN__
|
||||
#define __COREGEN__
|
||||
|
||||
#include "..\core\control.h"
|
||||
#include "..\core\object.h"
|
||||
|
||||
#endif // __COREGEN__
|
||||
|
||||
|
1124
lib/maxsdk31/custcont.h
Executable file
1124
lib/maxsdk31/custcont.h
Executable file
File diff suppressed because it is too large
Load Diff
19
lib/maxsdk31/dbgprint.h
Executable file
19
lib/maxsdk31/dbgprint.h
Executable file
@ -0,0 +1,19 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: dbgprint.cpp
|
||||
|
||||
DESCRIPTION: Simple Debug Print Function
|
||||
|
||||
CREATED BY: Tom Hudson
|
||||
|
||||
HISTORY: Created 3 July 1995
|
||||
|
||||
*> Copyright (c) 1995, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __DBGPRINT__H
|
||||
#define __DBGPRINT__H
|
||||
|
||||
void UtilExport DebugPrint(const TCHAR *format, ...);
|
||||
|
||||
#endif //__DBGPRINT__H
|
29
lib/maxsdk31/decomp.h
Executable file
29
lib/maxsdk31/decomp.h
Executable file
@ -0,0 +1,29 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: decomp.h
|
||||
|
||||
DESCRIPTION:
|
||||
|
||||
CREATED BY: Dan Silva
|
||||
|
||||
HISTORY:
|
||||
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef _H_Decompose
|
||||
#define _H_Decompose
|
||||
|
||||
typedef struct {
|
||||
Point3 t; /* Translation components */
|
||||
Quat q; /* Essential rotation */
|
||||
Quat u; /* Stretch rotation */
|
||||
Point3 k; /* Stretch factors */
|
||||
float f; /* Sign of determinant */
|
||||
} AffineParts;
|
||||
|
||||
CoreExport void SpectralDecomp(Matrix3 m, Point3 &s, Quat& q);
|
||||
CoreExport void decomp_affine(Matrix3 A, AffineParts *parts);
|
||||
CoreExport void invert_affine(AffineParts *parts, AffineParts *inverse);
|
||||
#endif
|
||||
|
125
lib/maxsdk31/dpoint3.h
Executable file
125
lib/maxsdk31/dpoint3.h
Executable file
@ -0,0 +1,125 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: dpoint3.h
|
||||
|
||||
DESCRIPTION:
|
||||
|
||||
CREATED BY: Dan Silva
|
||||
|
||||
HISTORY:
|
||||
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __DPOINT3__
|
||||
|
||||
#define __DPOINT3__
|
||||
|
||||
#include "point3.h"
|
||||
|
||||
class ostream;
|
||||
|
||||
class DPoint3 {
|
||||
public:
|
||||
double x,y,z;
|
||||
|
||||
// Constructors
|
||||
DPoint3(){}
|
||||
DPoint3(double X, double Y, double Z) { x = X; y = Y; z = Z; }
|
||||
DPoint3(const DPoint3& a) { x = a.x; y = a.y; z = a.z; }
|
||||
DPoint3(const Point3& a) { x = a.x; y = a.y; z = a.z; }
|
||||
DPoint3(double af[3]) { x = af[0]; y = af[1]; z = af[2]; }
|
||||
|
||||
// Access operators
|
||||
double& operator[](int i) { return (&x)[i]; }
|
||||
const double& operator[](int i) const { return (&x)[i]; }
|
||||
|
||||
// Conversion function
|
||||
operator double*() { return(&x); }
|
||||
|
||||
// Unary operators
|
||||
DPoint3 operator-() const { return(DPoint3(-x,-y,-z)); }
|
||||
DPoint3 operator+() const { return *this; }
|
||||
|
||||
// Assignment operators
|
||||
DllExport DPoint3& operator=(const Point3& a) { x = a.x; y = a.y; z = a.z; return *this; }
|
||||
DllExport DPoint3& operator-=(const DPoint3&);
|
||||
DllExport DPoint3& operator+=(const DPoint3&);
|
||||
DllExport DPoint3& operator*=(double);
|
||||
DllExport DPoint3& operator/=(double);
|
||||
|
||||
// Binary operators
|
||||
DllExport DPoint3 operator-(const DPoint3&) const;
|
||||
DllExport DPoint3 operator+(const DPoint3&) const;
|
||||
DllExport double operator*(const DPoint3&) const; // DOT PRODUCT
|
||||
DllExport DPoint3 operator^(const DPoint3&) const; // CROSS PRODUCT
|
||||
|
||||
};
|
||||
|
||||
double DllExport Length(const DPoint3&);
|
||||
int DllExport MaxComponent(const DPoint3&); // the component with the maximum abs value
|
||||
int DllExport MinComponent(const DPoint3&); // the component with the minimum abs value
|
||||
DPoint3 DllExport Normalize(const DPoint3&); // Return a unit vector.
|
||||
|
||||
DPoint3 DllExport operator*(double, const DPoint3&); // multiply by scalar
|
||||
DPoint3 DllExport operator*(const DPoint3&, double); // multiply by scalar
|
||||
DPoint3 DllExport operator/(const DPoint3&, double); // divide by scalar
|
||||
|
||||
ostream DllExport &operator<<(ostream&, const DPoint3&);
|
||||
|
||||
// Inlines:
|
||||
|
||||
inline double Length(const DPoint3& v) {
|
||||
return (double)sqrt(v.x*v.x+v.y*v.y+v.z*v.z);
|
||||
}
|
||||
|
||||
inline DPoint3& DPoint3::operator-=(const DPoint3& a) {
|
||||
x -= a.x; y -= a.y; z -= a.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline DPoint3& DPoint3::operator+=(const DPoint3& a) {
|
||||
x += a.x; y += a.y; z += a.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline DPoint3& DPoint3::operator*=(double f) {
|
||||
x *= f; y *= f; z *= f;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline DPoint3& DPoint3::operator/=(double f) {
|
||||
x /= f; y /= f; z /= f;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline DPoint3 DPoint3::operator-(const DPoint3& b) const {
|
||||
return(DPoint3(x-b.x,y-b.y,z-b.z));
|
||||
}
|
||||
|
||||
inline DPoint3 DPoint3::operator+(const DPoint3& b) const {
|
||||
return(DPoint3(x+b.x,y+b.y,z+b.z));
|
||||
}
|
||||
|
||||
inline double DPoint3::operator*(const DPoint3& b) const {
|
||||
return(x*b.x+y*b.y+z*b.z);
|
||||
}
|
||||
|
||||
inline DPoint3 operator*(double f, const DPoint3& a) {
|
||||
return(DPoint3(a.x*f, a.y*f, a.z*f));
|
||||
}
|
||||
|
||||
inline DPoint3 operator*(const DPoint3& a, double f) {
|
||||
return(DPoint3(a.x*f, a.y*f, a.z*f));
|
||||
}
|
||||
|
||||
inline DPoint3 operator/(const DPoint3& a, double f) {
|
||||
return(DPoint3(a.x/f, a.y/f, a.z/f));
|
||||
}
|
||||
|
||||
DPoint3 DllExport CrossProd(const DPoint3& a, const DPoint3& b); // CROSS PRODUCT
|
||||
|
||||
double DllExport DotProd(const DPoint3& a, const DPoint3& b) ; // DOT PRODUCT
|
||||
|
||||
#endif
|
||||
|
87
lib/maxsdk31/dummy.h
Executable file
87
lib/maxsdk31/dummy.h
Executable file
@ -0,0 +1,87 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: dummy.h
|
||||
|
||||
DESCRIPTION:
|
||||
|
||||
CREATED BY: Dan Silva
|
||||
|
||||
HISTORY:
|
||||
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __DUMMY__H
|
||||
#define __DUMMY__H
|
||||
|
||||
|
||||
extern CoreExport Class_ID dummyClassID;
|
||||
|
||||
class DummyObject: public HelperObject {
|
||||
friend class DummyObjectCreateCallBack;
|
||||
friend BOOL CALLBACK DummyParamDialogProc( HWND hDlg, UINT message,
|
||||
WPARAM wParam, LPARAM lParam );
|
||||
|
||||
// Mesh cache
|
||||
Mesh mesh;
|
||||
long dumFlags;
|
||||
Point3 color;
|
||||
Box3 box;
|
||||
Interval valid;
|
||||
void BuildMesh();
|
||||
void UpdateMesh();
|
||||
|
||||
// inherited virtual methods for Reference-management
|
||||
RefResult NotifyRefChanged( Interval changeInt, RefTargetHandle hTarget,
|
||||
PartID& partID, RefMessage message );
|
||||
|
||||
public:
|
||||
CoreExport DummyObject();
|
||||
|
||||
CoreExport Box3 GetBox() const;
|
||||
CoreExport void SetBox(Box3& b);
|
||||
CoreExport void SetColor(Point3 color);
|
||||
CoreExport void EnableDisplay();
|
||||
CoreExport void DisableDisplay();
|
||||
CoreExport void SetValidity(Interval v);
|
||||
|
||||
// inherited virtual methods:
|
||||
// From BaseObject
|
||||
CoreExport int HitTest(TimeValue t, INode* inode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt);
|
||||
CoreExport void Snap(TimeValue t, INode* inode, SnapInfo *snap, IPoint2 *p, ViewExp *vpt);
|
||||
CoreExport int Display(TimeValue t, INode* inode, ViewExp *vpt, int flags);
|
||||
CoreExport CreateMouseCallBack* GetCreateMouseCallBack();
|
||||
CoreExport RefTargetHandle Clone(RemapDir& remap = NoRemap());
|
||||
Interval ObjectValidity(TimeValue t) { return valid; }
|
||||
|
||||
// From Object
|
||||
CoreExport ObjectState Eval(TimeValue time);
|
||||
void InitNodeName(TSTR& s);
|
||||
int DoOwnSelectHilite() {return 1; }
|
||||
int IsRenderable(){ return 0; }
|
||||
TCHAR *GetObjectName();
|
||||
|
||||
// From Object
|
||||
CoreExport void GetWorldBoundBox(TimeValue t, INode *mat, ViewExp *vpt, Box3& box );
|
||||
CoreExport void GetLocalBoundBox(TimeValue t, INode *mat, ViewExp *vpt, Box3& box );
|
||||
CoreExport void GetDeformBBox(TimeValue t, Box3& box, Matrix3 *tm, BOOL useSel=FALSE );
|
||||
|
||||
|
||||
// IO
|
||||
CoreExport IOResult Save(ISave *isave);
|
||||
CoreExport IOResult Load(ILoad *iload);
|
||||
|
||||
// From ReferenceMaker
|
||||
CoreExport void RescaleWorldUnits(float f);
|
||||
|
||||
// Animatable methods
|
||||
void DeleteThis() { delete this; }
|
||||
Class_ID ClassID() { return dummyClassID; }
|
||||
void GetClassName(TSTR& s);
|
||||
int IsKeyable(){ return 1;}
|
||||
LRESULT CALLBACK TrackViewWinProc( HWND hwnd, UINT message,
|
||||
WPARAM wParam, LPARAM lParam ){return(0);}
|
||||
};
|
||||
|
||||
CoreExport ClassDesc* GetDummyObjDescriptor();
|
||||
#endif // __DUMMY__H
|
32
lib/maxsdk31/dynamic.h
Executable file
32
lib/maxsdk31/dynamic.h
Executable file
@ -0,0 +1,32 @@
|
||||
#ifndef _DYNAMIC_H_
|
||||
|
||||
#define _DYNAMIC_H_
|
||||
#include "iparamm.h"
|
||||
#include "Simpobj.h"
|
||||
|
||||
class DynamHelperObject : public SimpleObject, IParamArray {
|
||||
public:
|
||||
virtual INode *GetEndNode1(){return NULL;}
|
||||
virtual INode *GetEndNode2(){return NULL;}
|
||||
virtual Point3 ApplyAtEnd1(TimeValue t){return Point3(0.0f,0.0f,0.0f);}
|
||||
virtual Point3 ApplyAtEnd2(TimeValue t){return Point3(0.0f,0.0f,0.0f);}
|
||||
virtual Point3 Force(TimeValue t,TimeValue dt){return Point3(0.0f,0.0f,0.0f);}
|
||||
};
|
||||
|
||||
typedef struct{
|
||||
TimeValue t1,t2;
|
||||
Point3 FlectForce,ApplyAt;
|
||||
int Num;
|
||||
} FlectForces;
|
||||
|
||||
class DynamModObject : public SimpleWSMObject
|
||||
{ public:
|
||||
virtual FlectForces ForceData(TimeValue t)
|
||||
{FlectForces f1;f1.t1=0;f1.t2=0;
|
||||
f1.FlectForce=Point3(0.0f,0.0f,0.0f);
|
||||
f1.ApplyAt=Point3(0.0f,0.0f,0.0f);return f1;}
|
||||
};
|
||||
|
||||
#endif // _DYNAMIC_H_
|
||||
|
||||
|
BIN
lib/maxsdk31/edmodel.lib
Executable file
BIN
lib/maxsdk31/edmodel.lib
Executable file
Binary file not shown.
41
lib/maxsdk31/euler.h
Executable file
41
lib/maxsdk31/euler.h
Executable file
@ -0,0 +1,41 @@
|
||||
/*******************************************************************
|
||||
*
|
||||
* DESCRIPTION: euler.h
|
||||
*
|
||||
* AUTHOR: Converted from Ken Shoemake's Graphics Gems IV code by Dan Silva
|
||||
*
|
||||
* HISTORY: converted 11/21/96
|
||||
*
|
||||
* RB: This file provides only a subset of those
|
||||
* found in the original Graphics Gems paper.
|
||||
* All orderings are 'static axis'.
|
||||
*
|
||||
*******************************************************************/
|
||||
|
||||
#ifndef __EULER__
|
||||
#define __EULER__
|
||||
|
||||
#include "matrix3.h"
|
||||
#include "quat.h"
|
||||
|
||||
#define EULERTYPE_XYZ 0
|
||||
#define EULERTYPE_XZY 1
|
||||
#define EULERTYPE_YZX 2
|
||||
#define EULERTYPE_YXZ 3
|
||||
#define EULERTYPE_ZXY 4
|
||||
#define EULERTYPE_ZYX 5
|
||||
#define EULERTYPE_XYX 6
|
||||
#define EULERTYPE_YZY 7
|
||||
#define EULERTYPE_ZXZ 8
|
||||
|
||||
#define EULERTYPE_RF 16 // rotating frame (axes) --prs.
|
||||
|
||||
void DllExport QuatToEuler(const Quat &q, float *ang,int type);
|
||||
void DllExport EulerToQuat(float *ang, Quat &q,int type);
|
||||
void DllExport MatrixToEuler(const Matrix3 &mat, float *ang,int type);
|
||||
void DllExport EulerToMatrix(float *ang, Matrix3 &mat,int type);
|
||||
float DllExport GetEulerQuatAngleRatio(Quat &quat1,Quat &quat2, float *euler1, float *euler2, int type = EULERTYPE_XYZ);
|
||||
float DllExport GetEulerMatAngleRatio(Matrix3 &mat1,Matrix3 &mat2, float *euler1, float *euler2, int type = EULERTYPE_XYZ);
|
||||
|
||||
#endif // __EULER__
|
||||
|
40
lib/maxsdk31/evrouter.h
Executable file
40
lib/maxsdk31/evrouter.h
Executable file
@ -0,0 +1,40 @@
|
||||
/*********************************************************************
|
||||
*<
|
||||
FILE: evrouter.h
|
||||
|
||||
DESCRIPTION: Event router functionality
|
||||
|
||||
CREATED BY: Tom Hudson
|
||||
|
||||
HISTORY: Created 16 June 1995
|
||||
|
||||
*> Copyright (c) 1995, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __EVROUTER__
|
||||
#define __EVROUTER__
|
||||
|
||||
#include "evuser.h"
|
||||
|
||||
typedef EventUser* PEventUser;
|
||||
typedef Tab<PEventUser> PEventUserTab;
|
||||
|
||||
class EventRouter {
|
||||
private:
|
||||
PEventUserTab userTab;
|
||||
BOOL notifyMultiple;
|
||||
public:
|
||||
EventRouter(BOOL multiple = FALSE) { notifyMultiple = multiple; }
|
||||
CoreExport void Register(EventUser *user);
|
||||
CoreExport void UnRegister(EventUser *user);
|
||||
// Process the event. Returns TRUE if the event was handed off to a user.
|
||||
CoreExport BOOL Process();
|
||||
};
|
||||
|
||||
extern CoreExport EventRouter deleteRouter;
|
||||
extern CoreExport EventRouter backspaceRouter;
|
||||
#ifdef _OSNAP
|
||||
extern CoreExport EventRouter tabkeyRouter;
|
||||
#endif
|
||||
|
||||
#endif // __EVROUTER__
|
46
lib/maxsdk31/evuser.h
Executable file
46
lib/maxsdk31/evuser.h
Executable file
@ -0,0 +1,46 @@
|
||||
/*********************************************************************
|
||||
*<
|
||||
FILE: evuser.h
|
||||
|
||||
DESCRIPTION: Event user functionality
|
||||
|
||||
CREATED BY: Tom Hudson
|
||||
|
||||
HISTORY: Created 16 June 1995
|
||||
|
||||
*> Copyright (c) 1995, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
/**********************************************************************
|
||||
How to use:
|
||||
|
||||
This is a set of classes which form a generic notification system. To
|
||||
use:
|
||||
|
||||
* Create an EventUser object.
|
||||
|
||||
* Register the EventUser object with the appropriate router.
|
||||
|
||||
* The EventRouter will call your EventUser's Notify() method when
|
||||
the event occurs.
|
||||
|
||||
* When you're done with the EventUser object, call the EventRouter's
|
||||
UnRegister() method. This will delete the EventUser from the router's
|
||||
notification system.
|
||||
|
||||
* If your code is part of a window proc, call the router's Register
|
||||
and UnRegister methods when the window receives WM_ACTIVATE messages.
|
||||
This will properly uncouple the notification system when the window is
|
||||
deactivated.
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __EVUSER__
|
||||
#define __EVUSER__
|
||||
|
||||
class EventUser {
|
||||
public:
|
||||
virtual void Notify()=0;
|
||||
};
|
||||
|
||||
#endif // __EVUSER__
|
10
lib/maxsdk31/export.h
Executable file
10
lib/maxsdk31/export.h
Executable file
@ -0,0 +1,10 @@
|
||||
#ifdef DllExport
|
||||
#undef DllExport
|
||||
#endif
|
||||
|
||||
#ifdef IMPORTING
|
||||
#define DllExport __declspec( dllimport )
|
||||
#else
|
||||
#define DllExport __declspec( dllexport )
|
||||
#endif
|
||||
|
113
lib/maxsdk31/expr.h
Executable file
113
lib/maxsdk31/expr.h
Executable file
@ -0,0 +1,113 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: expr.h
|
||||
|
||||
DESCRIPTION: expression object include file.
|
||||
|
||||
CREATED BY: Don Brittain
|
||||
|
||||
HISTORY:
|
||||
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef _EXPR_H_
|
||||
|
||||
#define _EXPR_H_
|
||||
|
||||
#include "export.h"
|
||||
|
||||
#define SCALAR_EXPR 1
|
||||
#define VECTOR_EXPR 3
|
||||
|
||||
#define SCALAR_VAR SCALAR_EXPR
|
||||
#define VECTOR_VAR VECTOR_EXPR
|
||||
|
||||
class Expr;
|
||||
|
||||
typedef int (*ExprFunc)(Expr *e, float f);
|
||||
|
||||
class DllExport Inst {
|
||||
public:
|
||||
ExprFunc func;
|
||||
float sVal;
|
||||
};
|
||||
|
||||
class ExprVar {
|
||||
public:
|
||||
TSTR name;
|
||||
int type;
|
||||
int regNum;
|
||||
};
|
||||
|
||||
MakeTab(float);
|
||||
MakeTab(Point3);
|
||||
MakeTab(Inst);
|
||||
MakeTab(ExprVar);
|
||||
|
||||
class Expr {
|
||||
public:
|
||||
Expr() { sValStk = vValStk = instStk = nextScalar = nextVector = 0; }
|
||||
~Expr() { deleteAllVars(); }
|
||||
|
||||
DllExport int load(char *s);
|
||||
DllExport int eval(float *ans, int sRegCt, float *sRegs, int vRegCt=0, Point3 *vRegs=NULL);
|
||||
int getExprType(void) { return exprType; }
|
||||
TCHAR * getExprStr(void) { return origStr; }
|
||||
TCHAR * getProgressStr(void){ return progressStr; }
|
||||
DllExport int defVar(int type, TCHAR *name);
|
||||
DllExport int getVarCount(int type);
|
||||
DllExport TCHAR * getVarName(int type, int i);
|
||||
DllExport int getVarRegNum(int type, int i);
|
||||
DllExport BOOL deleteAllVars();
|
||||
DllExport BOOL deleteVar(TCHAR *name);
|
||||
|
||||
// pseudo-private: (only to be used by the "instruction" functions
|
||||
void setExprType(int type) { exprType = type; }
|
||||
void pushInst(ExprFunc fn, float f)
|
||||
{ if(instStk >= inst.Count()) inst.SetCount(instStk+30);
|
||||
inst[instStk].func = fn; inst[instStk++].sVal = f; }
|
||||
void pushSVal(float f) { if(sValStk>=sVal.Count())sVal.SetCount(sValStk+10);sVal[sValStk++]=f; }
|
||||
float popSVal() { return sVal[--sValStk]; }
|
||||
void pushVVal(Point3 &v) { if(vValStk>=vVal.Count())vVal.SetCount(vValStk+10);vVal[vValStk++]=v; }
|
||||
Point3 & popVVal() { return vVal[--vValStk]; }
|
||||
int getSRegCt(void) { return sRegCt; }
|
||||
float getSReg(int index) { return sRegPtr[index]; }
|
||||
int getVRegCt(void) { return vRegCt; }
|
||||
Point3 & getVReg(int index) { return vRegPtr[index]; }
|
||||
|
||||
ExprVarTab vars; // named variables
|
||||
private:
|
||||
TCHAR * exprPtr; // pointer to current str pos during parsing
|
||||
TCHAR * exprStr; // ptr to original expression string to parse
|
||||
TSTR origStr; // original expression string that was loaded
|
||||
TSTR progressStr; // string to hold part of expr successfully parsed
|
||||
int sRegCt; // actual number of scalar registers passed to "eval"
|
||||
float *sRegPtr; // pointer to the scalar register array
|
||||
int vRegCt; // actual number of vector registers passed to "eval"
|
||||
Point3 *vRegPtr; // pointer to the vector register array
|
||||
int exprType; // expression type: SCALAR_EXPR or VECTOR_EXPR (set by load)
|
||||
|
||||
int sValStk; // scalar value stack
|
||||
floatTab sVal;
|
||||
int vValStk; // vector value stack
|
||||
Point3Tab vVal;
|
||||
int instStk; // instruction stack
|
||||
InstTab inst;
|
||||
|
||||
int nextScalar; // next scalar slot
|
||||
int nextVector; // next vector slot
|
||||
|
||||
friend yylex();
|
||||
friend yyerror(char *);
|
||||
};
|
||||
|
||||
#define EXPR_NORMAL 0
|
||||
#define EXPR_INST_OVERFLOW -1 // instruction stack overflow during parsing
|
||||
#define EXPR_UNKNOWN_TOKEN -2 // unknown function, const, or reg during parsing
|
||||
#define EXPR_TOO_MANY_VARS -3 // value stack overflow
|
||||
#define EXPR_TOO_MANY_REGS -4 // register array overflow, or reg number too big
|
||||
#define EXPR_CANT_EVAL -5 // function can't be evaluated with given arg
|
||||
#define EXPR_CANT_PARSE -6 // expression can't be parsed (syntactically)
|
||||
|
||||
#endif // _EXPR_H_
|
BIN
lib/maxsdk31/expr.lib
Executable file
BIN
lib/maxsdk31/expr.lib
Executable file
Binary file not shown.
9
lib/maxsdk31/exprlib.h
Executable file
9
lib/maxsdk31/exprlib.h
Executable file
@ -0,0 +1,9 @@
|
||||
#ifndef _EXPRLIB_H_
|
||||
|
||||
#define _EXPRLIB_H_
|
||||
|
||||
#define IMPORTING
|
||||
#include "expr.h"
|
||||
#undef IMPORTING
|
||||
|
||||
#endif // _EXPRLIB_H_
|
115
lib/maxsdk31/fbwin.h
Executable file
115
lib/maxsdk31/fbwin.h
Executable file
@ -0,0 +1,115 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: fbwin.h
|
||||
|
||||
DESCRIPTION: framebuffer window include file.
|
||||
|
||||
CREATED BY: Don Brittain
|
||||
|
||||
HISTORY:
|
||||
|
||||
*> Copyright (c) 1995, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#if !defined(_FBWIN_H_)
|
||||
|
||||
#define _FBWIN_H_
|
||||
|
||||
#ifdef WIN95STUFF
|
||||
#include <vfw.h>
|
||||
#endif
|
||||
|
||||
#define FBW_MSG_OFFSET (WM_USER + 1000)
|
||||
|
||||
#define FBW_LBUTTONDOWN (WM_LBUTTONDOWN + FBW_MSG_OFFSET)
|
||||
#define FBW_LBUTTONUP (WM_LBUTTONUP + FBW_MSG_OFFSET)
|
||||
#define FBW_LBUTTONDBLCLK (WM_LBUTTONDBLCLK + FBW_MSG_OFFSET)
|
||||
#define FBW_RBUTTONDOWN (WM_RBUTTONDOWN + FBW_MSG_OFFSET)
|
||||
#define FBW_RBUTTONUP (WM_RBUTTONUP + FBW_MSG_OFFSET)
|
||||
#define FBW_RBUTTONDBLCLK (WM_RBUTTONDBLCLK + FBW_MSG_OFFSET)
|
||||
#define FBW_MOUSEMOVE (WM_MOUSEMOVE + FBW_MSG_OFFSET)
|
||||
|
||||
|
||||
class FB_RGBA_Pixel {
|
||||
union {
|
||||
struct {
|
||||
BYTE red;
|
||||
BYTE green;
|
||||
BYTE blue;
|
||||
BYTE alpha;
|
||||
} rgba;
|
||||
DWORD pix;
|
||||
};
|
||||
};
|
||||
|
||||
// framebuffer window setup structure
|
||||
class FBWinSetup {
|
||||
public:
|
||||
DllExport FBWinSetup();
|
||||
DWORD winStyle;
|
||||
POINT winSize;
|
||||
POINT winPlace;
|
||||
POINT fbSize;
|
||||
};
|
||||
|
||||
class FrameBufferWindow {
|
||||
public:
|
||||
DllExport FrameBufferWindow(HWND hParent, FBWinSetup &fbw);
|
||||
DllExport ~FrameBufferWindow();
|
||||
|
||||
HWND getHWnd() { return hWnd; }
|
||||
int getBitsPerPixel() { return bpp; }
|
||||
|
||||
void setNotify(int n) { notify = n; }
|
||||
int getNotify() { return notify; }
|
||||
|
||||
int getOriginX() { return origin.x; }
|
||||
int getOriginY() { return origin.y; }
|
||||
void setOrigin(int x, int y) { origin.x = x; origin.y = y; }
|
||||
|
||||
int getFbSizeX() { return fbSize.x; }
|
||||
int getFbSizeY() { return fbSize.y; }
|
||||
#if 0
|
||||
DllExport void setFbSize(int x, int y);
|
||||
|
||||
DllExport void loadDIB(LPBITMAPINFOHEADER dib);
|
||||
#endif
|
||||
|
||||
DllExport void startScanlineLoad();
|
||||
DllExport void scanline(int line, int start, int count, FB_RGBA_Pixel *pixels);
|
||||
DllExport void scanline(int line, int start, int count, BYTE *red, BYTE *green, BYTE *blue);
|
||||
DllExport void endScanlineLoad();
|
||||
|
||||
friend LRESULT CALLBACK FBWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
private:
|
||||
void onPaint(HWND hWnd, WPARAM wParam, LPARAM lParam);
|
||||
void onSize(HWND hWnd, WPARAM wParam, LPARAM lParam);
|
||||
void setupPalette();
|
||||
void setupDIB();
|
||||
|
||||
static int refCount;
|
||||
HWND hWnd;
|
||||
HWND hParent;
|
||||
|
||||
int notify;
|
||||
|
||||
#ifdef WIN95STUFF
|
||||
HDRAWDIB hDrawDC;
|
||||
#endif
|
||||
int bpp;
|
||||
int paletted;
|
||||
|
||||
POINT winSize;
|
||||
POINT fbSize;
|
||||
POINT origin;
|
||||
|
||||
int dibLoaded;
|
||||
LOGPALETTE * logPal;
|
||||
LPBITMAPINFOHEADER pbih;
|
||||
BYTE * pixBuf;
|
||||
int pixBufSize;
|
||||
};
|
||||
|
||||
|
||||
#endif // _FBWIN_H_
|
697
lib/maxsdk31/filters.h
Executable file
697
lib/maxsdk31/filters.h
Executable file
@ -0,0 +1,697 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// --------------------
|
||||
// File ....: Filters.h
|
||||
// --------------------
|
||||
// Author...: Gus Grubba
|
||||
// Date ....: September 1995
|
||||
//
|
||||
// History .: Sep, 07 1995 - Started
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef FILTERS_H_DEFINED
|
||||
#define FILTERS_H_DEFINED
|
||||
|
||||
#include <fltapi.h>
|
||||
#include <tvnode.h>
|
||||
|
||||
//-- Just to make it shorter
|
||||
|
||||
#define dVirtual FLTExport virtual
|
||||
|
||||
//-- How long can a filter name be
|
||||
|
||||
#define MAXFILTERNAME MAX_PATH
|
||||
#define MAXRESOURCE MAX_PATH
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
//-- Frame Range
|
||||
//
|
||||
|
||||
class FrameRange {
|
||||
|
||||
int start;
|
||||
int end;
|
||||
int current;
|
||||
|
||||
public:
|
||||
|
||||
FLTExport FrameRange ( ) {start = end = current = 0;}
|
||||
FLTExport ~FrameRange ( ) {};
|
||||
|
||||
FLTExport int First ( ) { return (start); }
|
||||
FLTExport int Last ( ) { return (end); }
|
||||
FLTExport int Count ( ) { return (end - start + 1); }
|
||||
FLTExport int Current ( ) { return (current); }
|
||||
FLTExport int Elapsed ( ) { return (current - start); }
|
||||
|
||||
FLTExport void SetFirst ( int u ) { start = u; }
|
||||
FLTExport void SetLast ( int u ) { end = u; }
|
||||
FLTExport void SetCurrent ( int u ) { current = u; }
|
||||
|
||||
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
//-- Forward Reference
|
||||
|
||||
class ImageFilter;
|
||||
class FilterManager;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
//-- Time Change Notification (R2)
|
||||
|
||||
class TimeChange : public TimeChangeCallback {
|
||||
public:
|
||||
BOOL set;
|
||||
TimeChange () { set = FALSE; }
|
||||
ImageFilter *filter;
|
||||
void TimeChanged(TimeValue t);
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
//-- Filter Info
|
||||
//
|
||||
|
||||
enum MaskType {
|
||||
MASK_R = 0,
|
||||
MASK_G,
|
||||
MASK_B,
|
||||
MASK_A,
|
||||
MASK_L,
|
||||
MASK_Z,
|
||||
MASK_MTL_ID,
|
||||
MASK_NODE_ID
|
||||
|
||||
};
|
||||
|
||||
#define NUMMASKFLAGS (MASK_NODE_ID - MASK_R) + 1
|
||||
|
||||
class ImageFilterInfo {
|
||||
|
||||
//-- Name of the filter used internally for identitification.
|
||||
|
||||
TCHAR name[MAXFILTERNAME];
|
||||
|
||||
//-- Filters may want to identify themselves by something more
|
||||
// specific than their names. Specially filters that give names
|
||||
// to parameter sets. If "resource" below is not empty, it
|
||||
// will be used to identify the filter in the Video Post Queue.
|
||||
// This is saved along with everything else by the host (Max).
|
||||
// If all the filter needs is a resource to identify a set of
|
||||
// parameters, this will sufice.
|
||||
|
||||
TCHAR resource[MAXRESOURCE];
|
||||
|
||||
//-- Plug-In Parameter Block ------------------------------------------
|
||||
//
|
||||
// No direct access to clients. Use the methods in the filter class.
|
||||
//
|
||||
|
||||
void *pidata;
|
||||
DWORD pisize;
|
||||
|
||||
//-- New R2 Stuff
|
||||
|
||||
TCHAR *userlabel; //-- Optional label given by user
|
||||
ITrackViewNode *node; //-- TV Node (if any)
|
||||
Class_ID nodeid; //-- TV Node ID (if any);
|
||||
|
||||
int flttype;
|
||||
|
||||
public:
|
||||
|
||||
FLTExport ImageFilterInfo ( );
|
||||
FLTExport ~ImageFilterInfo ( );
|
||||
|
||||
//-- Mask Information -------------------------------------------------
|
||||
|
||||
BOOL maskenabled,evCopy;
|
||||
BOOL invertedmask;
|
||||
BitmapInfo mask;
|
||||
WORD maskflag;
|
||||
|
||||
//-- This is a BitmapInfo that holds information about the current
|
||||
// Video Post main queue Image buffer. This can be used to get
|
||||
// VP's (or target image) resolution, etc. To make an analogy, if
|
||||
// this was a BitmapIO plug-in, this is the BitmapInfo given as
|
||||
// the argument. This used primarilly at the time the filter
|
||||
// receives the "Setup()" call as at render time, all this can be
|
||||
// found in srcmap.
|
||||
|
||||
BitmapInfo imgQueue;
|
||||
|
||||
//-- Internal Helpers -------------------------------------------------
|
||||
|
||||
FLTExport void SetName ( const TCHAR *n ) { _tcscpy(name,n);}
|
||||
FLTExport void SetResource ( const TCHAR *n ) { _tcscpy(resource,n);}
|
||||
FLTExport const TCHAR *Name ( ) { return (const TCHAR *)name;}
|
||||
FLTExport const TCHAR *Resource ( ) { return (const TCHAR *)resource;}
|
||||
|
||||
//-- Plug-In Parameter Block ------------------------------------------
|
||||
|
||||
FLTExport void *GetPiData ( ) { return pidata; }
|
||||
FLTExport void SetPiData ( void *ptr ) { pidata = ptr; }
|
||||
FLTExport DWORD GetPiDataSize ( ) { return pisize; }
|
||||
FLTExport void SetPiDataSize ( DWORD s ) { pisize = s; }
|
||||
FLTExport void ResetPiData ( );
|
||||
FLTExport BOOL AllocPiData ( DWORD size );
|
||||
|
||||
FLTExport ImageFilterInfo &operator= ( ImageFilterInfo &from );
|
||||
|
||||
//-- Load/Save
|
||||
|
||||
FLTExport IOResult Save ( ISave *isave );
|
||||
FLTExport IOResult Load ( ILoad *iload, Interface *max );
|
||||
|
||||
//-- Execution Info ---------------------------------------------------
|
||||
//
|
||||
// 12/06/95 - GG
|
||||
//
|
||||
// QueueRange defines the entire Video Post Queue range. Execution
|
||||
// is only the portion being rendered. This is, unless the user selects
|
||||
// a "range", the same as QueueRange. FilterRange is where this filter
|
||||
// starts and ends.
|
||||
//
|
||||
// Video Post Queue
|
||||
//
|
||||
// 1 2 3 4 5
|
||||
// 0----|----|----|----|----|----|----|----|----|----|----|----|----|---- ...
|
||||
//
|
||||
// Video Post spans from 0 to 49 (QueueRange) Start: 0 End: 49
|
||||
//
|
||||
// qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
|
||||
//
|
||||
// User executes a "range" from 10 to 30 (Execution Range) Start: 10 End: 30
|
||||
//
|
||||
// uuuuuuuuuuuuuuuuuuuuu
|
||||
//
|
||||
// This filter appears in the queue from 5 to 35 (Filter Range) Start: 5 End: 35
|
||||
//
|
||||
// fffffffffffffffffffffffffffffff
|
||||
|
||||
FrameRange QueueRange; //-- Entire Video Post Queue
|
||||
FrameRange ExecutionRange; //-- Segement being rendered
|
||||
FrameRange FilterRange; //-- Filter Segment
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//-- R2 Stuff Below ----------------------------------------------------
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
//-- Trackview Node Functions ------------------------------------------
|
||||
|
||||
FLTExport ITrackViewNode *Node ( ) { return node; }
|
||||
FLTExport void SetNode (ITrackViewNode *n) { node = n; }
|
||||
|
||||
FLTExport Class_ID NodeID ( ) { return nodeid;}
|
||||
FLTExport void SetNodeID ( Class_ID id ) { nodeid = id; }
|
||||
|
||||
//-- Optional Label given by user while adding or editing a filter. This label
|
||||
// replaces the filter's name in Video Post's tracks for easier identification.
|
||||
|
||||
FLTExport TCHAR *UserLabel ( ) { return userlabel; }
|
||||
|
||||
//-- Used by VP to update the label. Not to be used by filters.
|
||||
|
||||
FLTExport void SetUserLabel ( TCHAR *l) { userlabel = l; }
|
||||
|
||||
//-- Used to determine what type of filter this is at "Setup" time.
|
||||
|
||||
#define FLT_FILTER 0
|
||||
#define FLT_LAYER 1
|
||||
|
||||
FLTExport int FilterType ( ) { return flttype; }
|
||||
FLTExport void SetFilterType ( int type ) { flttype = type; }
|
||||
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
//-- Filter Plug-Ins Handler
|
||||
//
|
||||
|
||||
class FLT_FilterHandler {
|
||||
|
||||
//-- Name and Capabilities ------------------------
|
||||
|
||||
TCHAR fltDescription[MAXFILTERNAME];
|
||||
DWORD fltCapability;
|
||||
|
||||
//-- DLL Handler ----------------------------------
|
||||
|
||||
ClassDesc *cd;
|
||||
|
||||
public:
|
||||
|
||||
FLT_FilterHandler();
|
||||
|
||||
FLTExport TCHAR *Description ( const TCHAR *d = NULL );
|
||||
|
||||
FLTExport void SetCD ( ClassDesc *dll ) { cd = dll;}
|
||||
FLTExport ClassDesc *GetCD ( ) { return cd;}
|
||||
|
||||
FLTExport void SetCapabilities ( DWORD cap ) { fltCapability |= cap;}
|
||||
FLTExport DWORD GetCapabilities ( ) { return (fltCapability);}
|
||||
FLTExport BOOL TestCapabilities ( DWORD cap ) { return (fltCapability & cap);}
|
||||
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-- Messages sent back by various (client) methods
|
||||
|
||||
//-- Sent by the plug-in to notify host of current progress. The host should
|
||||
// return TRUE if it's ok to continue or FALSE to abort process.
|
||||
|
||||
#define FLT_PROGRESS WM_USER + 0x20 //-- wParam: Current lParam: Total
|
||||
|
||||
//-- Sent by the plug-in to check for process interruption. The host should
|
||||
// return FALSE (by setting *lParam) if it's ok to continue or TRUE to abort
|
||||
// process.
|
||||
|
||||
#define FLT_CHECKABORT WM_USER + 0x21 //-- wParam: 0 lParam: BOOL*
|
||||
|
||||
//-- Sent by the plug-in to display an optional textual message (for progress
|
||||
// report).
|
||||
|
||||
#define FLT_TEXTMSG WM_USER + 0x22 //-- wParam: 0 lParam: LPCTSTR
|
||||
|
||||
//-- Sent by the host TO the plug-in to notify the time has changed (the user
|
||||
// moved the time slider in Max).
|
||||
|
||||
#define FLT_TIMECHANGED WM_USER + 0x23 //-- wParam: 0 lParam: TimeValue t
|
||||
|
||||
//-- Sent by the host TO the plug-in to notify that an Undo operation has been done.
|
||||
// The plugin will set some boolean internally and wait for the next WM_PAINT message
|
||||
// in order to update any spinners or other values that may have been undone.
|
||||
|
||||
#define FLT_UNDO WM_USER + 0x24 //-- wParam: 0 lParam: 0
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
//-- List of Filter Plug-Ins
|
||||
//
|
||||
|
||||
class FLT_FilterList: public Tab<FLT_FilterHandler> {
|
||||
|
||||
BOOL listed;
|
||||
|
||||
public:
|
||||
|
||||
FLT_FilterList ( ) { listed = FALSE; }
|
||||
|
||||
BOOL Listed ( BOOL f) { listed = f; return (listed);};
|
||||
BOOL Listed ( ) { return (listed);};
|
||||
|
||||
FLTExport int FindFilter ( const TCHAR *name );
|
||||
FLTExport DWORD GetFilterCapabilities ( const TCHAR *name );
|
||||
|
||||
//-- This Creates an Instance - Make sure to "delete" it after use.
|
||||
|
||||
FLTExport ImageFilter *CreateFilterInstance(const TCHAR *d);
|
||||
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-- Undo Notification
|
||||
|
||||
class UndoNotify : public TVNodeNotify {
|
||||
HWND hWnd;
|
||||
public:
|
||||
UndoNotify (HWND hwnd) {hWnd = hwnd;}
|
||||
RefResult NotifyRefChanged (Interval changeInt, RefTargetHandle hTarget,
|
||||
PartID& partID, RefMessage message) {
|
||||
SendMessage(hWnd,FLT_UNDO,0,0);
|
||||
InvalidateRect(hWnd,NULL,FALSE);
|
||||
return(REF_SUCCEED);
|
||||
}
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
//-- ImageFilter Capability Flags
|
||||
//
|
||||
// It is valid for a plug-in to both Filter and Compositor. If both flags are
|
||||
// set, the user will be able to select it from both the Filter list and from
|
||||
// the Compositor list. The plug-in will know it is running as a filter when
|
||||
// the foreground map pointer is NULL.
|
||||
//
|
||||
|
||||
#define IMGFLT_NONE 0 // None
|
||||
|
||||
#define IMGFLT_MASK (1<<0) // Supports Masking
|
||||
#define IMGFLT_CONTROL (1<<1) // Plug-In has a Control Panel
|
||||
#define IMGFLT_FILTER (1<<2) // Plug-In is a Filter
|
||||
#define IMGFLT_COMPOSITOR (1<<3) // Plug-In is a Compositor
|
||||
#define IMGFLT_THREADED (1<<4) // Thread aware plug-in
|
||||
|
||||
//-- Class ID's for various DLL's
|
||||
|
||||
#define NEGATIVECLASSID 0x4655434A
|
||||
#define ALPHACLASSID 0x655434A4
|
||||
#define ADDCLASSID 0x55434A46
|
||||
#define BLURCLASSID 0x5434A465
|
||||
#define CROSFADECLASSID 0x434A4655
|
||||
#define GLOWCLASSID 0x35A46554
|
||||
#define COOKIECLASSID 0x4A465543
|
||||
#define WIPECLASSID 0xA4655434
|
||||
#define FADECLASSID 0x4655434B
|
||||
#define PDALPHACLASSID 0x655434B4
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
//-- Image Filter Class
|
||||
//
|
||||
|
||||
class ImageFilter {
|
||||
|
||||
protected:
|
||||
|
||||
BOOL interactive;
|
||||
HWND vpSetuphWnd,vphWnd,dlghWnd;
|
||||
|
||||
//-- Bitmap Pointers --------------------------------------------------
|
||||
//
|
||||
// All filters will have at least a pointer to "srcmap". This is VP's
|
||||
// (or any other process') main image pipeline.
|
||||
//
|
||||
// Composition filters will also receive a second [frgmap] bitmap
|
||||
// which should be composited above the main [srcmap] bitmap.
|
||||
//
|
||||
// If "mskmap" is not NULL, it will contain a pointer to a grayscale
|
||||
// image to be used as a mask for the process.
|
||||
//
|
||||
// 12/06/95 - GG
|
||||
//
|
||||
// The srcmap (Background) is the Video Post queue bitmap. Use its
|
||||
// methods to find out dimmensions (width, height, aspect ratio, etc.)
|
||||
// If the queue is using Alpha channel, it will be noted in the bitmap
|
||||
// flags (srcmap). The same is true for Z and G buffers. Again, simply
|
||||
// use the bitmap methods to access these.
|
||||
//
|
||||
|
||||
Bitmap *srcmap; //-- Source (Background)
|
||||
Bitmap *mskmap; //-- Mask (Grayscale Masking)
|
||||
Bitmap *frgmap; //-- Foreground (for layering/transitions)
|
||||
|
||||
//-- Set by Host ----------------------------------
|
||||
|
||||
ImageFilterInfo *ifi;
|
||||
|
||||
public:
|
||||
|
||||
FLTExport ImageFilter ( );
|
||||
dVirtual ~ImageFilter ( );
|
||||
|
||||
//-- Filter Info ---------------------------------
|
||||
|
||||
dVirtual const TCHAR *Description ( ) = 0; // ASCII description (i.e. "Convolution Filter")
|
||||
dVirtual const TCHAR *AuthorName ( ) = 0; // ASCII Author name
|
||||
dVirtual const TCHAR *CopyrightMessage ( ) = 0; // ASCII Copyright message
|
||||
dVirtual UINT Version ( ) = 0; // Version number * 100 (i.e. v3.01 = 301)
|
||||
dVirtual DWORD Capability ( ) = 0; // Returns capability flags (see above)
|
||||
|
||||
//-- Dialogs ----------------------------------------------------------
|
||||
//
|
||||
// An About Box is mandatory. The Control panel is optional and its
|
||||
// existence should be flagged by the Capability flag above.
|
||||
//
|
||||
|
||||
dVirtual void ShowAbout ( HWND hWnd ) = 0;
|
||||
dVirtual BOOL ShowControl ( HWND hWnd ) { return FALSE; }
|
||||
|
||||
//-- Parameter Setting (Host's Responsability) ----
|
||||
|
||||
dVirtual void SetSource ( Bitmap *map ) {srcmap = map;}
|
||||
dVirtual void SetForeground ( Bitmap *map ) {frgmap = map;}
|
||||
dVirtual void SetMask ( Bitmap *map ) {mskmap = map;}
|
||||
dVirtual void SetFilterInfo ( ImageFilterInfo *i ) {ifi = i;}
|
||||
|
||||
//-- Execution ------------------------------------
|
||||
//
|
||||
// The "hWnd" argument is a window handler to which
|
||||
// the plug-in will be sending messages.
|
||||
|
||||
dVirtual BOOL Render ( HWND hWnd ) = 0;
|
||||
|
||||
//-- Max Interface ----------------------------------------------------
|
||||
//
|
||||
// Some of Max's core functions exported through the Interface class.
|
||||
//
|
||||
|
||||
dVirtual Interface *Max ( );
|
||||
|
||||
//-- Helpers --------------------------------------
|
||||
|
||||
dVirtual int Lerp (int a, int b, int l);
|
||||
dVirtual int Lerp (int a, int b, float f);
|
||||
|
||||
//-- Parameter Block Load and Save ------------------------------------
|
||||
//
|
||||
// The host will call EvaluateConfigure() to determine the buffer size
|
||||
// required by the plug-in.
|
||||
//
|
||||
// SaveConfigure() will be called so the plug-in can transfer its
|
||||
// parameter block to the host ( ptr is a pre-allocated buffer).
|
||||
//
|
||||
// LoadConfigure() will be called so the plug-in can load its
|
||||
// parameter block back.
|
||||
//
|
||||
// Memory management is performed by the host using standard
|
||||
// LocalAlloc() and LocalFree().
|
||||
//
|
||||
|
||||
dVirtual DWORD EvaluateConfigure ( ) { return 0; }
|
||||
dVirtual BOOL LoadConfigure ( void *ptr ) { return (FALSE); }
|
||||
dVirtual BOOL SaveConfigure ( void *ptr ) { return (FALSE); }
|
||||
|
||||
//-- Preview Facility -------------------------------------------------
|
||||
//
|
||||
// This is used by plug-ins that want to have a preview bitmap while
|
||||
// displaying its control dialogue.
|
||||
//
|
||||
// The flag controls how much of the queue to run:
|
||||
//
|
||||
// PREVIEW_BEFORE - The queue is run up to the event before the filter
|
||||
// calling it.
|
||||
//
|
||||
// PREVIEW_UP ----- The queue is run up to the event (filter) calling
|
||||
// this function.
|
||||
//
|
||||
// PREVIEW_WHOLE -- The whole queue is run including events after
|
||||
// this filter.
|
||||
//
|
||||
// The given frame is the Video Post Queue frame number and not Max's
|
||||
// frame number.
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
//
|
||||
// hWnd - WIndow handle to send messages to. These are the progress,
|
||||
// check for abort, text messages etc. If the plug in wants to support
|
||||
// a cancel button and progress bars etc, it must handle these messages.
|
||||
// It is Ok to send a NULL window handle in which case nothing is checked.
|
||||
//
|
||||
// back - Pointer to a Bitmap pointer. If the Bitmap pointer is NULL, a
|
||||
// new bitmap is created using the given dimmensions. This pointer must be
|
||||
// NULL the first time this function is called as the bitmap must be
|
||||
// created by Video Post. Once this function is called and a bitmap is
|
||||
// returned, it is ok to call it again using this map. In this case, Video
|
||||
// Post will simply use it instead of creating a new one. You must delete
|
||||
// the bitmap when done.
|
||||
//
|
||||
// fore - For layer plug-ins, this points to the foreground image. This is
|
||||
// only valid if flag is set to PREVIEW_BEFORE. In this case back will hold
|
||||
// Video Post main queue and fore will have the foreground image to be
|
||||
// composited. This is usefull if you, a layer plug-in, want to collect the
|
||||
// images and run a real time preview. If flag is not PREVIEW_BEFORE, fore
|
||||
// will be a NULL pointer indicating there is no bitmap.
|
||||
//
|
||||
// frame - The desired frame. Make sure you request a frame within the
|
||||
// range your plug-in is active.
|
||||
//
|
||||
// width & height - Self explanatory.
|
||||
//
|
||||
// flag - Explained above.
|
||||
//
|
||||
|
||||
#ifndef PREVIEW_BEFORE
|
||||
#define PREVIEW_BEFORE 1
|
||||
#define PREVIEW_UP 2
|
||||
#define PREVIEW_WHOLE 3
|
||||
#endif
|
||||
|
||||
dVirtual BOOL CreatePreview (
|
||||
HWND hWnd, //-- Window handle to send messages to
|
||||
Bitmap **back, //-- Pointer to Bitmap Pointer (Background)
|
||||
int frame, //-- Desired Frame
|
||||
int width, //-- Desired Width
|
||||
int height, //-- Desired Height
|
||||
float aspect, //-- Desired Aspect Ratio
|
||||
Bitmap **fore = NULL, //-- Pointer to Bitmap Pointer (Foreground)
|
||||
DWORD flag = PREVIEW_UP );
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//-- Channels Required
|
||||
//
|
||||
// By setting this flag, the plug-in can request the host to generate
|
||||
// the given channels. Prior to Rendering, the host will scan the
|
||||
// plug-ins in the chain of events and list all types of channels
|
||||
// being requested. The plug-in, at the time of the Render() call,
|
||||
// will have access to these channels through the channel interface
|
||||
// described in Bitmap.h - BitmapStorage.
|
||||
//
|
||||
// The generation of these channels should not, normally, be a
|
||||
// default setting for a plug-in. These channels are memory hungry and
|
||||
// if the plug-in won't use it, it should not ask for it. Normally
|
||||
// the plug-in would ask the user which channels to use and set only
|
||||
// the proper flags.
|
||||
//
|
||||
|
||||
dVirtual DWORD ChannelsRequired ( ) { return BMM_CHAN_NONE; }
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//-- R2 Stuff Below ----------------------------------------------------
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
TimeChange timeChange;
|
||||
UndoNotify* undonotify;
|
||||
|
||||
dVirtual HWND DlgHandle ( void ) { return dlghWnd; }
|
||||
|
||||
//-- Filter Control Dialogue Interactivity -----------------------------
|
||||
|
||||
dVirtual void MakeDlgInteractive ( HWND hWnd );
|
||||
dVirtual BOOL IsInteractive ( void ) { return interactive; }
|
||||
|
||||
//-- Trackview Node Functions ------------------------------------------
|
||||
|
||||
dVirtual ITrackViewNode *CreateNode ( );
|
||||
dVirtual ITrackViewNode *Node ( ) { return ifi->Node(); }
|
||||
|
||||
//-- FilterUpdate() ----------------------------------------------------
|
||||
//
|
||||
// Whenever a filter instance is created or updated (i.e. the user went,
|
||||
// through the Filter Edit Control dialogue) this is call is issued to
|
||||
// the filter. The filter may use it to create/update its node controls.
|
||||
//
|
||||
// See example in negative.cpp.
|
||||
|
||||
dVirtual void FilterUpdate ( ) { }
|
||||
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
//-- Main Filter Manager Class
|
||||
//
|
||||
//
|
||||
|
||||
class FilterManager {
|
||||
|
||||
TCHAR name[MAXFILTERNAME];
|
||||
FLTInterface *iface;
|
||||
ImageFilterInfo *ifi;
|
||||
Interface *max;
|
||||
|
||||
//-- General Private Methods
|
||||
|
||||
BOOL SetupPlugIn ( HWND hWnd, WORD item );
|
||||
void HandleMaskFile ( HWND hWnd, WORD item );
|
||||
|
||||
//-- Image Filter Private Methods
|
||||
|
||||
int GetCurrentFilter ( HWND hWnd, TCHAR *plugin );
|
||||
void HandleFilterDialogState ( HWND hWnd );
|
||||
|
||||
public:
|
||||
|
||||
FLTExport FilterManager ( FLTInterface *i);
|
||||
FLTExport FilterManager ( FLTInterface *i,const TCHAR *name);
|
||||
FLTExport ~FilterManager ( );
|
||||
|
||||
FLTExport FLTInterface *iFace ( ) { return iface;}
|
||||
|
||||
void DoConstruct ( FLTInterface *i,const TCHAR *name);
|
||||
|
||||
FLT_FilterList fltList;
|
||||
FLTExport void ListFilters ( );
|
||||
|
||||
FLTExport HINSTANCE AppInst ( );
|
||||
FLTExport HWND AppWnd ( );
|
||||
FLTExport DllDir *AppDllDir ( );
|
||||
FLTExport Interface *Max ( ) { return max; }
|
||||
|
||||
//-- User Interface -------------------------------
|
||||
|
||||
BOOL ImageFilterControl ( HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam );
|
||||
|
||||
//-- This function will create a mask bitmap based
|
||||
// on the given ImageFilterInfo class.
|
||||
|
||||
Bitmap *ProcessMask ( HWND hWnd, ImageFilterInfo *ii );
|
||||
|
||||
//-- This function will list all available filter
|
||||
// plug-ins. The "item" argument defines an id
|
||||
// for a combo box to receive the list whithin
|
||||
// the hWnd context. It returns the number of
|
||||
// filters found.
|
||||
|
||||
FLTExport int GetFilterList ( HWND hWnd, int item );
|
||||
FLTExport int GetLayerList ( HWND hWnd, int item );
|
||||
|
||||
//-- This runs the show. Thew window handle is used
|
||||
// to send progress messages back. See above the
|
||||
// discussion about messages. The host should
|
||||
// check keyboard and cancel buttons and return
|
||||
// FALSE to a FLT_PROGRESS or FLT_CHECKABORT
|
||||
// message telling the Plug-In to cancel.
|
||||
|
||||
FLTExport BOOL RenderFilter ( HWND hWnd,
|
||||
ImageFilterInfo *ii,
|
||||
Bitmap *map,
|
||||
Bitmap *foreMap = NULL);
|
||||
|
||||
//-- This will bring a full blown dialog giving the
|
||||
// user an interface to select and define a plug-
|
||||
// in filter. Returns FALSE if the user cancels.
|
||||
|
||||
FLTExport BOOL SelectImageFilter( HWND hWnd, ImageFilterInfo *ii );
|
||||
|
||||
//-- This will fill out the given combo box with a
|
||||
// list of available mask options
|
||||
|
||||
FLTExport void ListMaskOptions ( HWND hWnd, int item);
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//-- R2 Stuff Below ----------------------------------------------------
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
//-- Internal Use
|
||||
|
||||
FLTExport void UpdateFilter ( ImageFilterInfo *ii );
|
||||
|
||||
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-- Forward References
|
||||
//
|
||||
|
||||
extern FLTExport void OpenFLT ( FLTInterface *i );
|
||||
extern FLTExport void CloseFLT ( );
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-- The Primary Filter Manager Object
|
||||
//
|
||||
// TO DO: Move to App data structure?
|
||||
|
||||
extern FLTExport FilterManager *TheFilterManager;
|
||||
|
||||
#endif
|
||||
|
||||
//-- EOF: filters.h -----------------------------------------------------------
|
BIN
lib/maxsdk31/flt.lib
Executable file
BIN
lib/maxsdk31/flt.lib
Executable file
Binary file not shown.
28
lib/maxsdk31/fltapi.h
Executable file
28
lib/maxsdk31/fltapi.h
Executable file
@ -0,0 +1,28 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// -------------------
|
||||
// File ....: fltapi.h
|
||||
// -------------------
|
||||
// Author...: Gus Grubba
|
||||
// Date ....: September 1995
|
||||
//
|
||||
// History .: Sep, 07 1995 - Started
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-- FLT Interface class
|
||||
|
||||
class FLTInterface {
|
||||
|
||||
public:
|
||||
|
||||
virtual HINSTANCE AppInst () = 0;
|
||||
virtual HWND AppWnd () = 0;
|
||||
virtual DllDir *AppDllDir () = 0;
|
||||
virtual TCHAR *GetDir (int i) = 0;
|
||||
virtual int GetMapDirCount () = 0;
|
||||
virtual TCHAR *GetMapDir (int i) = 0;
|
||||
virtual BOOL CreatePreview (HWND,Bitmap**,int,int,int,float,Bitmap**,DWORD) = 0;
|
||||
virtual Interface *GetMaxInterface ( ) = 0;
|
||||
|
||||
};
|
||||
|
8
lib/maxsdk31/fltlib.h
Executable file
8
lib/maxsdk31/fltlib.h
Executable file
@ -0,0 +1,8 @@
|
||||
#ifndef __INFILTERS__
|
||||
#ifndef _FLTLIB_H_
|
||||
#define _FLTLIB_H_
|
||||
#define FLTExport __declspec( dllimport )
|
||||
#include "Filters.h"
|
||||
#undef FLTExport
|
||||
#endif
|
||||
#endif
|
247
lib/maxsdk31/frontend.h
Executable file
247
lib/maxsdk31/frontend.h
Executable file
@ -0,0 +1,247 @@
|
||||
/*********************************************************************
|
||||
*<
|
||||
FILE: frontend.h
|
||||
|
||||
DESCRIPTION: A new plug-in type that controls the main UI for MAX
|
||||
|
||||
CREATED BY: Rolf Berteig
|
||||
|
||||
HISTORY: 4/01/97
|
||||
|
||||
*> Copyright (c) 1997, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __FRONTEND_H__
|
||||
#define __FRONTEND_H__
|
||||
|
||||
// layout bits
|
||||
#define FE_LAYOUT_NO_TIMESLIDER (1<<0)
|
||||
#define FE_LAYOUT_NO_TOOLBAR (1<<1)
|
||||
#define FE_LAYOUT_NO_COMMAND_PANEL (1<<2)
|
||||
#define FE_LAYOUT_CONTROL_COMMAND_PANEL (1<<3)
|
||||
#define FE_LAYOUT_DEFAULT 0
|
||||
|
||||
|
||||
// Tool bar buttons
|
||||
#define TOOLBUT_HELP 0
|
||||
#define TOOLBUT_UNDO 1
|
||||
#define TOOLBUT_REDO 2
|
||||
#define TOOLBUT_LINK 3
|
||||
#define TOOLBUT_UNLINK 4
|
||||
#define TOOLBUT_SPACEWARP_BIND 5
|
||||
#define TOOLBUT_SELECT 6
|
||||
#define TOOLBUT_REGION_TYPE 7
|
||||
#define TOOLBUT_SELECT_FILTER 8
|
||||
#define TOOLBUT_SELECT_BYNAME 9
|
||||
#define TOOLBUT_MOVE 10
|
||||
#define TOOLBUT_ROTATE 11
|
||||
#define TOOLBUT_SCALE 12
|
||||
#define TOOLBUT_REF_COORDSYS 13
|
||||
#define TOOLBUT_REF_CENTER 14
|
||||
#define TOOLBUT_CONST_X 15
|
||||
#define TOOLBUT_CONST_Y 16
|
||||
#define TOOLBUT_CONST_Z 17
|
||||
#define TOOLBUT_CONST_PLANE 18
|
||||
#define TOOLBUT_IK 19
|
||||
#define TOOLBUT_MIRROR 20
|
||||
#define TOOLBUT_ARRAY 21
|
||||
#define TOOLBUT_ALIGN 22
|
||||
#define TOOLBUT_NAMED_SELSETS 23
|
||||
#define TOOLBUT_TRACKVIEW 24
|
||||
#define TOOLBUT_MEDIT 25
|
||||
#define TOOLBUT_RENDER 26
|
||||
#define TOOLBUT_QUICK_RENDER 27
|
||||
#define TOOLBUT_RENDER_TYPE 28
|
||||
#define TOOLBUT_RENDER_LAST 29
|
||||
#define TOOLBUT_SEPERATOR 30
|
||||
#define TOOLBUT_LAYER_CURRENT 31
|
||||
#define TOOLBUT_LAYER_PROP 32
|
||||
#define TOOLBUT_LAYER_CONTROL 33
|
||||
#define TOOLBUT_LAYER_OBJ_PROP 34
|
||||
#define TOOLBUT_MEASURE 35
|
||||
#define TOOLBUT_SCHEMATIC_VIEW 36
|
||||
|
||||
// Standard MAX tool buttons use IDs greater then this value.
|
||||
// FE plug-in tool buttons should use IDs less then this max value
|
||||
// and greater then this min value.
|
||||
// Note that the actual resource IDs for standard MAX buttons will
|
||||
// be converted to the above #defines when passed to ProcessToolButton().
|
||||
#define MIN_FE_CUSTOM_TOOLID 1000
|
||||
#define MAX_FE_CUSTOM_TOOLID 30000
|
||||
|
||||
|
||||
// Menu items
|
||||
#define MENUITEM_FILE_NEW 0
|
||||
#define MENUITEM_FILE_RESET 1
|
||||
#define MENUITEM_FILE_OPEN 2
|
||||
#define MENUITEM_FILE_MERGE 3
|
||||
#define MENUITEM_FILE_REPLACE 4
|
||||
#define MENUITEM_FILE_INSERTTRACKS 5
|
||||
#define MENUITEM_FILE_SAVE 6
|
||||
#define MENUITEM_FILE_SAVEAS 7
|
||||
#define MENUITEM_FILE_SAVESELECTED 8
|
||||
#define MENUITEM_FILE_IMPORT 9
|
||||
#define MENUITEM_FILE_EXPORT 10
|
||||
#define MENUITEM_FILE_ARCHIVE 11
|
||||
#define MENUITEM_FILE_SUMMARYINFO 12
|
||||
#define MENUITEM_FILE_VIEWFILE 13
|
||||
#define MENUITEM_FILE_CONFIGUREPATHS 14
|
||||
#define MENUITEM_FILE_PREFERENCES 15
|
||||
#define MENUITEM_FILE_EXIT 16
|
||||
|
||||
#define MENUITEM_EDIT_UNDO 17
|
||||
#define MENUITEM_EDIT_REDO 18
|
||||
#define MENUITEM_EDIT_HOLD 19
|
||||
#define MENUITEM_EDIT_FETCH 20
|
||||
#define MENUITEM_EDIT_DELETE 21
|
||||
#define MENUITEM_EDIT_CLONE 22
|
||||
#define MENUITEM_EDIT_SELECTALL 23
|
||||
#define MENUITEM_EDIT_SELECTNONE 24
|
||||
#define MENUITEM_EDIT_SELECTINVERT 25
|
||||
#define MENUITEM_EDIT_SELECTBY_COLOR 26
|
||||
#define MENUITEM_EDIT_SELECTBY_MATERIAL 27
|
||||
#define MENUITEM_EDIT_SELECTBY_SMOOTHING 28
|
||||
#define MENUITEM_EDIT_SELECTBY_NAME 29
|
||||
#define MENUITEM_EDIT_REGION_WINDOW 30
|
||||
#define MENUITEM_EDIT_REGION_CROSSING 31
|
||||
#define MENUITEM_EDIT_REMOVENAMEDSELECTIONS 32
|
||||
#define MENUITEM_EDIT_PROPERTIES 33
|
||||
|
||||
#define MENUITEM_TOOLS_TRANSFORMTYPEIN 34
|
||||
#define MENUITEM_TOOLS_DISPLAYFLOATER 35
|
||||
#define MENUITEM_TOOLS_SELECTIONFLOATER 36
|
||||
#define MENUITEM_TOOLS_MIRROR 37
|
||||
#define MENUITEM_TOOLS_ARRAY 38
|
||||
#define MENUITEM_TOOLS_SNAPSHOT 39
|
||||
#define MENUITEM_TOOLS_ALIGN 40
|
||||
#define MENUITEM_TOOLS_ALIGNNORMALS 41
|
||||
#define MENUITEM_TOOLS_PLACEHIGHLIGHT 42
|
||||
#define MENUITEM_TOOLS_MTLEDIT 43
|
||||
#define MENUITEM_TOOLS_MTLBROWSE 44
|
||||
|
||||
#define MENUITEM_GROUP_GROUP 45
|
||||
#define MENUITEM_GROUP_OPEN 46
|
||||
#define MENUITEM_GROUP_CLOSE 47
|
||||
#define MENUITEM_GROUP_UNGROUP 48
|
||||
#define MENUITEM_GROUP_EXPLODE 49
|
||||
#define MENUITEM_GROUP_ATTACH 50
|
||||
#define MENUITEM_GROUP_DETACH 51
|
||||
|
||||
#define MENUITEM_VIEWS_UNDO 52
|
||||
#define MENUITEM_VIEWS_REDO 53
|
||||
#define MENUITEM_VIEWS_SAVEACTIVEVIEW 54
|
||||
#define MENUITEM_VIEWS_RESTOREACTIVEVIEW 55
|
||||
#define MENUITEM_VIEWS_UNITSETUP 56
|
||||
#define MENUITEM_VIEWS_DRAWINGAIDS 57
|
||||
#define MENUITEM_VIEWS_GRIDS_SHOWHOMEGRID 58
|
||||
#define MENUITEM_VIEWS_GRIDS_ACTIVATEHOMEGRID 59
|
||||
#define MENUITEM_VIEWS_GRIDS_ACTIVATEGRIDOBJECT 60
|
||||
#define MENUITEM_VIEWS_GRIDS_ALIGN 61
|
||||
#define MENUITEM_VIEWS_IMAGEBACKGROUND 62
|
||||
#define MENUITEM_VIEWS_UPDATEBKGIMAGE 63
|
||||
#define MENUITEM_VIEWS_RESETBKGXFORM 64
|
||||
#define MENUITEM_VIEWS_SHOWAXISICON 65
|
||||
#define MENUITEM_VIEWS_SHOWGHOSTING 66
|
||||
#define MENUITEM_VIEWS_SHOWKEYTIMES 67
|
||||
#define MENUITEM_VIEWS_SHADESELECTED 68
|
||||
#define MENUITEM_VIEWS_SHOWDEP 69
|
||||
#define MENUITEM_VIEWS_MATCHCAMERATOVIEW 70
|
||||
#define MENUITEM_VIEWS_REDRAW 71
|
||||
#define MENUITEM_VIEWS_DEACT_MAPS 72
|
||||
#define MENUITEM_VIEWS_UPDATEDURINGSPINNERDRAG 73
|
||||
#define MENUITEM_VIEWS_EXPERTMODE 74
|
||||
#define MENUITEM_VIEWS_VIEWPORTCONFIG 75
|
||||
|
||||
#define MENUITEM_RENDER_RENDER 76
|
||||
#define MENUITEM_RENDER_VIDEOPOST 77
|
||||
#define MENUITEM_RENDER_SHOW_LAST_IMG 78
|
||||
#define MENUITEM_RENDER_ATMOSPHERE 79
|
||||
#define MENUITEM_RENDER_PREVIEW 80
|
||||
#define MENUITEM_RENDER_VIEWPREVIEW 81
|
||||
#define MENUITEM_RENDER_RENAMEPREVIEW 82
|
||||
|
||||
#define MENUITEM_HELP_CONTENTS 83
|
||||
#define MENUITEM_HELP_INDEX 84
|
||||
#define MENUITEM_HELP_PLUGINHELP 85
|
||||
#define MENUITEM_HELP_ABOUT 86
|
||||
|
||||
// VIZ specific
|
||||
#define MENUITEM_TOOLS_SPACETOOL 87
|
||||
#define MENUITEM_TOOLS_LAYERPROP 88
|
||||
|
||||
// JBW added MAXScript menu (11/11/98 & 12/15/98)
|
||||
#define MENUITEM_MAXSCRIPT_LISTENER 89
|
||||
#define MENUITEM_MAXSCRIPT_OPEN 90
|
||||
#define MENUITEM_MAXSCRIPT_NEW 91
|
||||
#define MENUITEM_MAXSCRIPT_RUN 92
|
||||
#define MENUITEM_MAXSCRIPT_MACROREC 93
|
||||
|
||||
|
||||
// Standard MAX menu items use IDs greater then this value.
|
||||
// FE plug-in menu items should use IDs less then this max value
|
||||
// and greater then this min value.
|
||||
// Note that the actual resource IDs for standard MAX menu items will
|
||||
// be converted to the above #defines when passed to ProcessMenuItem().
|
||||
#define MIN_FE_CUSTOM_MENUEITEM 1000
|
||||
#define MAX_FE_CUSTOM_MENUEITEM 30000
|
||||
|
||||
|
||||
|
||||
|
||||
// Special interface given only to front end controllers
|
||||
class IFrontEnd {
|
||||
public:
|
||||
virtual HWND GetCommandPanelHWND()=0;
|
||||
|
||||
virtual void *GetInterface(DWORD id)=0;
|
||||
|
||||
virtual void ClearToolBar()=0;
|
||||
virtual void RemoveStandardToolButton(int id)=0;
|
||||
virtual void AddStandardToolButton(int id,int sepSize=-1)=0;
|
||||
virtual void CheckStandardTool(int id, BOOL onOff)=0;
|
||||
virtual BOOL IsStandardToolChecked(int id, BOOL onOdd)=0;
|
||||
virtual void EnableStandardTool(int id, BOOL enabled)=0;
|
||||
virtual void SetStandardToolFlyoff(int id, int fly)=0;
|
||||
virtual int GetStandardToolFlyoff(int id)=0;
|
||||
virtual ICustToolbar *GetMainToolbar()=0;
|
||||
|
||||
virtual HMENU GetMainMenu()=0;
|
||||
virtual void SetMainMenu(HMENU hMenu)=0;
|
||||
virtual int MenuIDtoResID(int id)=0; // given one of the above defines, what is the corrisponding resource ID
|
||||
virtual int ResIDtoMenuID(int id)=0; // oppisite of above
|
||||
};
|
||||
|
||||
|
||||
class FrontEndController {
|
||||
public:
|
||||
virtual void DeleteThis()=0;
|
||||
|
||||
virtual void *GetInterface(DWORD id) {return NULL;}
|
||||
|
||||
// Called once on startup. Note that MAX windows have been created
|
||||
// but not necessarily sized.
|
||||
virtual void Initialize(IFrontEnd *ife,Interface *ip) {}
|
||||
|
||||
virtual DWORD GetLayout() {return FE_LAYOUT_DEFAULT;}
|
||||
|
||||
// Notifications
|
||||
virtual DWORD GeneralNotify(DWORD id, DWORD param1, DWORD param2) {return 0;}
|
||||
virtual void SelectionChanged() {}
|
||||
virtual void TimeChanged(TimeValue t) {}
|
||||
virtual DWORD ProcessToolButton(int id, int notify) {return 0;}
|
||||
virtual DWORD ProcessMenuItem(int id, int notify) {return 0;}
|
||||
virtual DWORD ProcessInitMenu(HMENU hMenu) {return 0;}
|
||||
virtual DWORD ProcessViewportRightClick(HWND hWnd, IPoint2 m) {return 0;}
|
||||
virtual DWORD ProcessViewportLabelClick(HWND hWnd, IPoint2 m) {return 0;}
|
||||
virtual DWORD ProcessViewportMenuItem(int id, int notify) {return 0;}
|
||||
virtual DWORD ProcessViewportInitMenu(HMENU hMenu) {return 0;}
|
||||
virtual void Resize() {}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif //__FRONTEND_H__
|
||||
|
129
lib/maxsdk31/gamma.h
Executable file
129
lib/maxsdk31/gamma.h
Executable file
@ -0,0 +1,129 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: gamma.h
|
||||
|
||||
DESCRIPTION: Gamma utilities
|
||||
|
||||
CREATED BY: Dan Silva
|
||||
|
||||
HISTORY: created 26 December 1995
|
||||
|
||||
*> Copyright (c) 1995, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#ifndef __GAMMA__H
|
||||
#define __GAMMA__H
|
||||
|
||||
#define WRDMAX 65535
|
||||
#define FWRDMAX 65535.0f
|
||||
|
||||
#define RCBITS 13 // number of bits used to represent colors before gamma correction.
|
||||
// this keeps the lookup table a reasonable size
|
||||
#define RCOLN (1<<RCBITS)
|
||||
#define RCMAX (RCOLN-1)
|
||||
#define FRCMAX ((float)RCMAX)
|
||||
#define RCHALF (RCOLN>>1)
|
||||
#define RCSH (RCBITS-8) /* shift amount from 8 bit to RCBITS */
|
||||
#define RCSH16 (16-RCBITS) /* shift amount from 16 bit to RCBITS */
|
||||
#define RCFRACMASK ((ulong)((1<<RCSH)-1))
|
||||
#define RC_SCL (1<<RCSH)
|
||||
#define RC_SCLHALF (1<<(RCSH-1))
|
||||
#define FRC_SCL ((float)RC_SCL)
|
||||
#define RCSHMASK (0xffffffffL<<RCSH)
|
||||
#define RCSHMAX (0xffL<<RCSH)
|
||||
|
||||
|
||||
#define GAMMA_NTSC 2.2f
|
||||
#define GAMMA_PAL 2.8f
|
||||
|
||||
class GammaMgr {
|
||||
public:
|
||||
BOOL enable;
|
||||
BOOL dithTrue;
|
||||
BOOL dithPaletted;
|
||||
float dispGamma;
|
||||
float fileInGamma;
|
||||
float fileOutGamma;
|
||||
UBYTE disp_gamtab[256]; // (8->8) display gamma for drawing color swatches (8->8)
|
||||
UBYTE disp_gamtabw[RCOLN]; // (RCBITS->8) display gamma
|
||||
UBYTE file_in_gamtab[256]; // (8->8)
|
||||
UWORD file_in_degamtab[256]; // (8->16) for de-gamifying bitmaps on input
|
||||
UWORD file_out_gamtab[RCOLN]; // (RCBITS->16) gamma correct for file output, before dither
|
||||
|
||||
inline COLORREF DisplayGammaCorrect(COLORREF col) {
|
||||
return RGB(disp_gamtab[GetRValue(col)], disp_gamtab[GetGValue(col)], disp_gamtab[GetBValue(col)]);
|
||||
}
|
||||
|
||||
CoreExport Color DisplayGammaCorrect(Color c);
|
||||
|
||||
CoreExport void Enable(BOOL onOff);
|
||||
BOOL IsEnabled() { return enable;}
|
||||
|
||||
CoreExport void SetDisplayGamma(float gam);
|
||||
float GetDisplayGamma() { return dispGamma; }
|
||||
|
||||
CoreExport void SetFileInGamma(float gam);
|
||||
float GetFileInGamma() { return fileInGamma; }
|
||||
|
||||
CoreExport void SetFileOutGamma(float gam);
|
||||
float GetFileOutGamma() { return fileOutGamma; }
|
||||
|
||||
GammaMgr();
|
||||
|
||||
|
||||
};
|
||||
|
||||
CoreExport extern GammaMgr gammaMgr;
|
||||
|
||||
|
||||
inline COLORREF gammaCorrect(DWORD c) { return gammaMgr.DisplayGammaCorrect(c); }
|
||||
inline UBYTE gammaCorrect(UBYTE b) { return gammaMgr.disp_gamtab[b]; }
|
||||
|
||||
|
||||
#define GAMMA16to8(b) gammaMgr.disp_gamtabw[b>>RCSH16]
|
||||
|
||||
// Build Gamma table that maps 8->8
|
||||
CoreExport void BuildGammaTab8(UBYTE gamtab[256], float gamma, int onoff=TRUE);
|
||||
|
||||
// Build a Gamma table that maps 8->16
|
||||
CoreExport void BuildGammaTab8(UWORD gamtab[256], float gamma, int onoff=TRUE);
|
||||
|
||||
// Build Gamma table that maps RCBITS->8
|
||||
CoreExport void BuildGammaTab(UBYTE gamtab[RCOLN], float gamma, int onoff=TRUE);
|
||||
|
||||
// Build Gamma table that maps RCBITS->16
|
||||
CoreExport void BuildGammaTab(UWORD gamtab[RCOLN], float gamma, int onoff=TRUE);
|
||||
|
||||
CoreExport float gammaCorrect(float v, float gamma);
|
||||
CoreExport float deGammaCorrect(float v, float gamma);
|
||||
CoreExport UBYTE gammaCorrect(UBYTE v, float gamma);
|
||||
CoreExport UBYTE deGammaCorrect(UBYTE v, float gamma);
|
||||
CoreExport UWORD gammaCorrect(UWORD c, float gamma);
|
||||
CoreExport UWORD deGammaCorrect(UWORD c, float gamma);
|
||||
|
||||
|
||||
// Temporary table for converting 16->16.
|
||||
class GamConvert16 {
|
||||
float gamma;
|
||||
UWORD* gtab;
|
||||
public:
|
||||
GamConvert16(float gam=1.0f);
|
||||
~ GamConvert16();
|
||||
void SetGamma(float gam);
|
||||
UWORD Convert(UWORD v) { return gtab[v>>RCSH16]; }
|
||||
|
||||
};
|
||||
|
||||
// Temporary table for converting 8->16.
|
||||
class GamConvert8 {
|
||||
float gamma;
|
||||
UWORD gtab[256];
|
||||
public:
|
||||
GamConvert8(float gam=1.0f);
|
||||
void SetGamma(float gam);
|
||||
UWORD Convert(UBYTE v) { return gtab[v]; }
|
||||
|
||||
};
|
||||
|
||||
#endif
|
162
lib/maxsdk31/gbuf.h
Executable file
162
lib/maxsdk31/gbuf.h
Executable file
@ -0,0 +1,162 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: gbuf.h : GBuffer manager.
|
||||
|
||||
DESCRIPTION:
|
||||
|
||||
CREATED BY: Dan Silva
|
||||
|
||||
HISTORY:
|
||||
|
||||
*> Copyright (c) 1998, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __GBUF__H
|
||||
#define __GBUF__H
|
||||
|
||||
#define NUMGBCHAN 13
|
||||
|
||||
// GBuffer channels (number of bytes in parenthesis)
|
||||
#define GB_Z 0 // (4) Z-Buffer depth, float
|
||||
#define GB_MTL_ID 1 // (1) ID assigned to mtl via mtl editor
|
||||
#define GB_NODE_ID 2 // (2) ID assigned to node via properties
|
||||
#define GB_UV 3 // (8) UV coordinates - Point2
|
||||
#define GB_NORMAL 4 // (4) Normal vector in view space, compressed
|
||||
#define GB_REALPIX 5 // (4) Non clamped colors in "RealPixel" format
|
||||
#define GB_COVERAGE 6 // (1) Pixel coverage
|
||||
#define GB_BG 7 // (3) RGB color of what's behind layer
|
||||
#define GB_NODE_RENDER_ID 8 // (2) Node render index, word
|
||||
#define GB_COLOR 9 // (3) Color (RGB)
|
||||
#define GB_TRANSP 10 // (3) Transparency (RGB)
|
||||
#define GB_VELOC 11 // (8) Velocity (Point2)
|
||||
#define GB_WEIGHT 12 // (3) Weight of layers contribution to pixel color
|
||||
|
||||
CoreExport int GBDataSize(int i);
|
||||
|
||||
CoreExport TCHAR *GBChannelName(int i);
|
||||
|
||||
// Recognized channel bits
|
||||
|
||||
#define BMM_CHAN_NONE 0
|
||||
#define BMM_CHAN_Z (1<<GB_Z) // Z-buffer depth, float
|
||||
#define BMM_CHAN_MTL_ID (1<<GB_MTL_ID) // ID assigned to mtl via mtl editor
|
||||
#define BMM_CHAN_NODE_ID (1<<GB_NODE_ID) // ID assigned to node via properties
|
||||
#define BMM_CHAN_UV (1<<GB_UV) // UV coordinates - Point2
|
||||
#define BMM_CHAN_NORMAL (1<<GB_NORMAL) // Normal vector in view space, compressed
|
||||
#define BMM_CHAN_REALPIX (1<<GB_REALPIX) // Non clamped colors in "RealPixel" format
|
||||
#define BMM_CHAN_COVERAGE (1<<GB_COVERAGE) // Pixel coverage of front surface
|
||||
#define BMM_CHAN_BG (1<<GB_BG) // RGB color of what's behind front object
|
||||
#define BMM_CHAN_NODE_RENDER_ID (1<<GB_NODE_RENDER_ID) // node render index
|
||||
#define BMM_CHAN_COLOR (1<<GB_COLOR) // Color (Color24)
|
||||
#define BMM_CHAN_TRANSP (1<<GB_TRANSP) // Transparency (Color24)
|
||||
#define BMM_CHAN_VELOC (1<<GB_VELOC) // Velocity ( Point2 )
|
||||
#define BMM_CHAN_WEIGHT (1<<GB_WEIGHT) // Weight ( Color24 )
|
||||
|
||||
// Recognized types of channels
|
||||
#define BMM_CHAN_TYPE_UNKNOWN 0
|
||||
#define BMM_CHAN_TYPE_8 2 // 1 byte per pixel
|
||||
#define BMM_CHAN_TYPE_16 3 // 1 word per pixel
|
||||
#define BMM_CHAN_TYPE_24 8 // 3 bytes per pixel
|
||||
#define BMM_CHAN_TYPE_32 4 // 2 words per pixel
|
||||
#define BMM_CHAN_TYPE_48 5 // 3 words per pixel
|
||||
#define BMM_CHAN_TYPE_64 6 // 4 words per pixel
|
||||
#define BMM_CHAN_TYPE_96 7 // 6 words per pixel
|
||||
|
||||
struct GBufData {
|
||||
float z;
|
||||
UBYTE mtl_id;
|
||||
UWORD node_id;
|
||||
Point2 uv;
|
||||
DWORD normal;
|
||||
RealPixel realpix;
|
||||
UBYTE coverage;
|
||||
UWORD rend_id;
|
||||
Color24 color;
|
||||
Color24 transp;
|
||||
Color24 weight;
|
||||
Point2 veloc;
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------gbuf.h ----------------------------------------------
|
||||
|
||||
class GBufReader {
|
||||
public:
|
||||
virtual int StartLine(int y)=0; // -1 = no data for line, or x of first non-empty pixel
|
||||
virtual BOOL StartPixel(int x)=0; // -1 = eol,; 0 = empty; 1= has data ( Automatically starts first layer)
|
||||
virtual BOOL StartPixel(int x,int y)=0; // -1 = eol,; 0 = empty; 1= has data ( includes StartLine)
|
||||
virtual BOOL StartNextLayer()=0; // 0 = no more layers ( Do not call before first layer )
|
||||
virtual int NextPixel()=0; // -1 = eol,; 0 = empty; 1 = has data
|
||||
// Read a data element: chan is one of { GB_Z, GB_MTL_ID, GB_NODE_ID, ... etc }
|
||||
virtual BOOL ReadChannelData(int chan, void *data)=0; // 1= has data; 0= didnt have data
|
||||
virtual BOOL ReadAllData(GBufData *data)=0; // 1= has data; 0= didnt have data
|
||||
virtual void DeleteThis()=0;
|
||||
// Generic expansion function
|
||||
virtual int Execute(int cmd, ULONG arg1=0, ULONG arg2=0, ULONG arg3=0) { return 0; }
|
||||
};
|
||||
|
||||
|
||||
// This assumes pixels are created in increasing order of x.
|
||||
class GBufWriter {
|
||||
public:
|
||||
virtual void StartLine(int y)=0; // 1 = success 0 = fail ( Must call before every line)
|
||||
virtual void StartPixel(int x)=0; // 1 = success 0 = fail ( Must call to start each pixel )
|
||||
virtual void StartNextLayer()=0; // 1 = success 0 = fail ( Must call before first layer)
|
||||
// Write a data element: chan is one of { GB_Z, GB_MTL_ID, GB_NODE_ID, ... etc }
|
||||
virtual BOOL WriteChannelData(int chan, void *data)=0; // 1=success 0=fail
|
||||
virtual BOOL WriteAllData(GBufData *data)=0; // 1= success; 0= fail
|
||||
virtual BOOL EndLine()=0; // 1=success 0=fail ( Just call after every line)
|
||||
virtual void DeleteThis()=0;
|
||||
// Generic expansion function
|
||||
virtual int Execute(int cmd, ULONG arg1=0, ULONG arg2=0, ULONG arg3=0) { return 0; }
|
||||
};
|
||||
|
||||
class GBuffer {
|
||||
public:
|
||||
virtual void SetRasterSize(int ww, int hh)=0; // when create bitmap or size changes.
|
||||
virtual int Width()=0;
|
||||
virtual int Height()=0;
|
||||
virtual int InitBuffer()=0; // call before writing buffer.
|
||||
virtual ULONG CreateChannels(ULONG channelMask)=0; // create specified channels
|
||||
virtual void DeleteChannels(ULONG channelMask)=0; // delete specified channels
|
||||
virtual ULONG ChannelsPresent()=0;
|
||||
virtual void *GetChannel( ULONG channelID, ULONG& chanType)=0;
|
||||
virtual GBufReader *CreateReader()=0;
|
||||
virtual void DestroyReader(GBufReader *pRdr)=0;
|
||||
virtual GBufWriter *CreateWriter()=0;
|
||||
virtual void DestroyWriter(GBufWriter *pRdr)=0;
|
||||
virtual BOOL IsDefaultGBuffer() { return FALSE; }
|
||||
virtual void DeleteThis()=0;
|
||||
virtual void Copy(GBuffer *gbfrom)=0;
|
||||
virtual void CopyScale(GBuffer *gbfrom, int cw=-1, int ch=-1)=0;
|
||||
virtual void Position(int srcy, int trgy, int srcx, int trgx, int trgw, int trgh )=0;
|
||||
|
||||
// for file writing
|
||||
virtual int NumberLayerRecords(int y)=0;
|
||||
virtual int GetLayerChannel(int y, int ichan, char *data)=0; // ichan = -1 creates array of x values
|
||||
|
||||
// for file reading
|
||||
virtual int CreateLayerRecords(int y, int num)=0;
|
||||
virtual int SetLayerChannel(int y, int ichan, char *data)=0; // ichan = -1 gets array of x values
|
||||
|
||||
// This scans the entire image and updates the minimum and maximum values
|
||||
virtual void UpdateChannelMinMax()=0;
|
||||
|
||||
// Get Channel limits ( currently only valid for z,uv,veloc)
|
||||
virtual BOOL GetChannelMin(int chan, void *data)=0;
|
||||
virtual BOOL GetChannelMax(int chan, void *data)=0;
|
||||
|
||||
// names indexed by NodeRenderId
|
||||
virtual NameTab &NodeRenderIDNameTab()=0;
|
||||
|
||||
// Generic expansion function
|
||||
virtual int Execute(int cmd, ULONG arg1=0, ULONG arg2=0, ULONG arg3=0) { return 0; }
|
||||
|
||||
};
|
||||
|
||||
CoreExport void SetMaximumGBufferLayerDepth(int m);
|
||||
CoreExport int GetMaximumGBufferLayerDepth();
|
||||
|
||||
CoreExport GBuffer *NewDefaultGBuffer();
|
||||
|
||||
#endif// __GBUF__H
|
239
lib/maxsdk31/gcomm.h
Executable file
239
lib/maxsdk31/gcomm.h
Executable file
@ -0,0 +1,239 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// ------------------
|
||||
// File ....: gcomm.h
|
||||
// ------------------
|
||||
// Author...: Gus J Grubba
|
||||
// Date ....: September 1995
|
||||
// O.S. ....: Windows NT 3.51
|
||||
//
|
||||
// Note ....: Copyright 1991, 1995 Gus J Grubba
|
||||
//
|
||||
// History .: Sep, 03 1995 - Ported to C++ / WinNT
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef _GCOMMINCLUDE_
|
||||
#define _GCOMMINCLUDE_
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-- Common Error Codes
|
||||
|
||||
typedef unsigned int GCRES;
|
||||
|
||||
#define GCRES_SUCCESS 0x0000
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-- Error Handler
|
||||
|
||||
typedef void (WINAPI *PERROR_HANDLER)(
|
||||
int ErrorCode,
|
||||
const TCHAR *ErrorMessage
|
||||
);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-- Client Types
|
||||
|
||||
#define gcTCP 1 //-- 0x1000 ... 0x1FFF
|
||||
#define gcUART 2 //-- 0x2000 ... 0x2FFF
|
||||
#define gcSCSI 3 //-- 0x3000 ... 0x3FFF
|
||||
#define gcCENTRONICS 4 //-- 0x4000 ... 0x4FFF
|
||||
#define gcIPX 5 //-- 0x5000 ... 0x5FFF
|
||||
#define gcNETBIOS 6 //-- 0x6000 ... 0x6FFF
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-- Error Types (for logging)
|
||||
|
||||
#define ERR_FATAL 0 // Fatal Error, won't procede
|
||||
#define ERR_WARN 1 // Warning Error, will procede with defaults (No Error Dialogue)
|
||||
#define ERR_INFO 2 // Not an error, just a logging message (No Error Dialogue)
|
||||
#define ERR_DEBUG 3 // Not an error, just debugging information (No Error Dialogue)
|
||||
|
||||
//-----------------------------------------------
|
||||
//-- NetBios
|
||||
|
||||
#ifndef ADAPTER_STATUS_BLOCK
|
||||
|
||||
#include <nb30.h>
|
||||
|
||||
typedef struct tag_ADAPTER_STATUS_BLOCK {
|
||||
ADAPTER_STATUS asb_header;
|
||||
NAME_BUFFER asb_Names[32];
|
||||
} ADAPTER_STATUS_BLOCK;
|
||||
|
||||
typedef struct tag_MAC_ADDRESS {
|
||||
unsigned char addr[6];
|
||||
} MAC_ADDRESS;
|
||||
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-- FileName Class Definition -----------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
// #> CFileName
|
||||
//
|
||||
|
||||
class CFileName {
|
||||
TCHAR filename[MAX_PATH];
|
||||
public:
|
||||
GCOMMEXPORT CFileName ( ) { filename[0] = 0; }
|
||||
GCOMMEXPORT CFileName ( TCHAR *name ) { SetName(name); }
|
||||
GCOMMEXPORT void SetName ( TCHAR *name ) { _tcscpy(filename,name); }
|
||||
GCOMMEXPORT void SetExtension( TCHAR *ext );
|
||||
GCOMMEXPORT TCHAR* Extension ( );
|
||||
GCOMMEXPORT TCHAR* FileName ( );
|
||||
GCOMMEXPORT DWORD FileSize ( );
|
||||
GCOMMEXPORT TCHAR* FullName ( ) { return filename; }
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-- Timer Class Definition --------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
// #> Timer
|
||||
//
|
||||
|
||||
class Timer {
|
||||
|
||||
float timer,count;
|
||||
|
||||
public:
|
||||
|
||||
//-- Timer methods ----------------------------------------------------
|
||||
//
|
||||
// Timers are kept in fractional units of seconds with a resolution
|
||||
// no less than 10ms.
|
||||
|
||||
GCOMMEXPORT Timer ( float t = 2.0f ) { timer = t; Start(); }
|
||||
GCOMMEXPORT void Set ( float t = 2.0f ) { timer = t; }
|
||||
GCOMMEXPORT void Start ( );
|
||||
GCOMMEXPORT BOOL IsTimeout ( );
|
||||
GCOMMEXPORT float Elapsed ( );
|
||||
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-- Base Class Definition ---------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
// #> tcCOMM
|
||||
//
|
||||
|
||||
class tcCOMM {
|
||||
|
||||
private:
|
||||
|
||||
//-- Windows Specific -------------------------------------------------
|
||||
|
||||
HINSTANCE tcphInst;
|
||||
HWND hWnd;
|
||||
|
||||
//-- System -----------------------------------------------------------
|
||||
|
||||
BOOL silentmode;
|
||||
PERROR_HANDLER errorhandler;
|
||||
TCHAR error_title[64];
|
||||
|
||||
public:
|
||||
|
||||
//-- Constructors/Destructors -----------------------------------------
|
||||
|
||||
GCOMMEXPORT tcCOMM ( );
|
||||
GCOMMEXPORT ~tcCOMM ( );
|
||||
|
||||
//-- Initialization process -------------------------------------------
|
||||
//
|
||||
|
||||
virtual BOOL Init ( HWND hWnd )=0;
|
||||
virtual BOOL Setup ( void *setupdata )=0;
|
||||
virtual void Close ( )=0;
|
||||
|
||||
//-- Application provided hooks for saving/restoring session ----------
|
||||
//
|
||||
// If the application wants to save and restore session data, such
|
||||
// as numbers, names, addresses, etc., it should use these methods.
|
||||
// Each subclassed object should implement a method for saving and
|
||||
// restoring its own session data.
|
||||
//
|
||||
// The host will issue a LoadSession() with previously saved data
|
||||
// before issuing an Init() call. At the end of a session, it will
|
||||
// issue the SaveSession() before calling Close();
|
||||
//
|
||||
// The host will use EvaluateDataSize() to find out the size of the
|
||||
// buffer needed (called prior to SaveSession()).
|
||||
//
|
||||
|
||||
virtual BOOL SaveSession ( void *ptr )=0;
|
||||
virtual BOOL LoadSession ( void *ptr )=0;
|
||||
virtual DWORD EvaluateDataSize ( )=0;
|
||||
|
||||
//-- Services ---------------------------------------------------------
|
||||
//
|
||||
// If you want your own error handler, use this function to register
|
||||
// one. Whenever an error occurs, it will be called with an error
|
||||
// code and with an optional error string message. The function
|
||||
// prototype is:
|
||||
//
|
||||
// void WINAPI ErrorHandler (int ErrorCode, TCHAR *ErrorMessage);
|
||||
//
|
||||
// ErrorCode is one of the defined error codes above.
|
||||
// ErrorMessage, if not NULL, contains a textual description of the
|
||||
// error and can be used directly.
|
||||
//
|
||||
// Note that only ERR_FATAL warrants a mandatory action. All other
|
||||
// error types are handled as you please. The idea is to provide
|
||||
// ongoing messages for logging purposes and debugging. Internally,
|
||||
// only ERR_FATAL will generate a dialogue message (provided the
|
||||
// silence flag is set to FALSE);
|
||||
//
|
||||
|
||||
GCOMMEXPORT void RegisterErrorHandler (PERROR_HANDLER handler);
|
||||
|
||||
//-- If you do not provide an error handler, the driver will produce
|
||||
// its own error messages. If you don't pass a Window handler, the
|
||||
// driver will use the system window (root) as the parent window.
|
||||
//
|
||||
// You can set the driver not to produce any error message at all
|
||||
// by setting the Silent flag to TRUE. Simply use SetSilentMode().
|
||||
|
||||
|
||||
HWND GethWnd ( ) { return hWnd; }
|
||||
void SethWnd ( HWND hwnd ) { hWnd = hwnd; }
|
||||
BOOL SilentMode ( ) { return silentmode; }
|
||||
void SetSilentMode ( BOOL v ) { silentmode = v; }
|
||||
|
||||
//-- Error Dialogue Title ---------------------------------------------
|
||||
//
|
||||
// If you let the driver produce its own error dialogue boxes, you
|
||||
// still can set the Window title if you want something other than
|
||||
// the default "Transport Error".
|
||||
|
||||
void SetErrorTitle ( TCHAR *t ) {_tcscpy(error_title,t);}
|
||||
|
||||
//-- Internal Services ------------------------------------------------
|
||||
//
|
||||
|
||||
void SetInstance ( HINSTANCE hi ) { tcphInst = hi; }
|
||||
HINSTANCE GetInstance ( ) { return (tcphInst); }
|
||||
TCHAR *GetLastErrorText ( TCHAR *buf, DWORD size );
|
||||
void Error ( int type, const TCHAR *message );
|
||||
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-- Interface
|
||||
|
||||
GCOMMEXPORT void* gcommCreate ( int type );
|
||||
GCOMMEXPORT void gcommDestroy ( void* ptr );
|
||||
GCOMMEXPORT bool gcInitNetRender ( char* target=NULL );
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-- Utilities
|
||||
|
||||
GCOMMEXPORT bool gcGetMacAddress (MAC_ADDRESS *addr);
|
||||
GCOMMEXPORT bool gcMatchMacAddress (MAC_ADDRESS *addr1, MAC_ADDRESS *addr2);
|
||||
GCOMMEXPORT void gcMac2String (MAC_ADDRESS *addr, TCHAR *string);
|
||||
GCOMMEXPORT void gcMac2StringCondensed (MAC_ADDRESS *addr, TCHAR *string);
|
||||
|
||||
#include "tcp.h"
|
||||
|
||||
#endif
|
||||
|
||||
//-- EOF: gcomm.h -------------------------------------------------------------
|
BIN
lib/maxsdk31/gcomm.lib
Executable file
BIN
lib/maxsdk31/gcomm.lib
Executable file
Binary file not shown.
5
lib/maxsdk31/gcommlib.h
Executable file
5
lib/maxsdk31/gcommlib.h
Executable file
@ -0,0 +1,5 @@
|
||||
#ifndef _GCOMMLIB_
|
||||
#define _GCOMMLIB_
|
||||
#define GCOMMEXPORT __declspec( dllimport )
|
||||
#include "gcomm.h"
|
||||
#endif
|
48
lib/maxsdk31/gencam.h
Executable file
48
lib/maxsdk31/gencam.h
Executable file
@ -0,0 +1,48 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: gencamera.h
|
||||
|
||||
DESCRIPTION: Defines General-Purpose cameras
|
||||
|
||||
CREATED BY: Tom Hudson
|
||||
|
||||
HISTORY: created 5 December 1995
|
||||
|
||||
*> Copyright (c) 1995, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __GENCAM__H__
|
||||
|
||||
#define __GENCAM__H__
|
||||
|
||||
// Camera types
|
||||
#define FREE_CAMERA 0
|
||||
#define TARGETED_CAMERA 1
|
||||
#define PARALLEL_CAMERA 2
|
||||
|
||||
#define NUM_CAM_TYPES 2
|
||||
|
||||
class GenCamera: public CameraObject {
|
||||
public:
|
||||
virtual GenCamera *NewCamera(int type)=0;
|
||||
virtual void SetConeState(int s)=0;
|
||||
virtual int GetConeState()=0;
|
||||
virtual void SetHorzLineState(int s)=0;
|
||||
virtual int GetHorzLineState()=0;
|
||||
virtual void Enable(int enab)=0;
|
||||
virtual BOOL SetFOVControl(Control *c)=0;
|
||||
virtual void SetFOVType(int ft)=0;
|
||||
virtual int GetFOVType()=0;
|
||||
virtual Control *GetFOVControl()=0;
|
||||
virtual int Type()=0;
|
||||
virtual void SetType(int tp)=0;
|
||||
|
||||
virtual void SetDOFEnable(TimeValue t, BOOL onOff) {}
|
||||
virtual BOOL GetDOFEnable(TimeValue t, Interval& valid = Interval(0,0)) { return 0; }
|
||||
virtual void SetDOFFStop(TimeValue t, float fs) {}
|
||||
virtual float GetDOFFStop(TimeValue t, Interval& valid = Interval(0,0)) { return 1.0f; }
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // __GENCAM__H__
|
59
lib/maxsdk31/genhier.h
Executable file
59
lib/maxsdk31/genhier.h
Executable file
@ -0,0 +1,59 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: hierclas.h
|
||||
|
||||
DESCRIPTION: Simple utility class for describing hierarchies
|
||||
|
||||
CREATED BY: Tom Hudson
|
||||
|
||||
HISTORY: Created 3 July 1995
|
||||
|
||||
*> Copyright (c) 1995, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __HIERCLAS__H
|
||||
#define __HIERCLAS__H
|
||||
|
||||
#define INVALID_HIERARCHY -1
|
||||
|
||||
class HierarchyEntry {
|
||||
public:
|
||||
int data;
|
||||
int children;
|
||||
HierarchyEntry *parent;
|
||||
HierarchyEntry *sibling;
|
||||
HierarchyEntry *child;
|
||||
TSTR sortKey;
|
||||
UtilExport HierarchyEntry();
|
||||
UtilExport HierarchyEntry(int d, HierarchyEntry *p, HierarchyEntry *s);
|
||||
UtilExport int HierarchyLevel();
|
||||
UtilExport void AddChild(int d);
|
||||
UtilExport int GetChild(int index);
|
||||
int Children() { return children; }
|
||||
UtilExport void Sort();
|
||||
};
|
||||
|
||||
class GenericHierarchy {
|
||||
private:
|
||||
HierarchyEntry root;
|
||||
void FreeTree(HierarchyEntry* start = NULL);
|
||||
BOOL isSorted;
|
||||
void CopyTree(int parent, HierarchyEntry* ptr);
|
||||
public:
|
||||
GenericHierarchy() { root = HierarchyEntry(-1,NULL,NULL); isSorted = FALSE; }
|
||||
UtilExport ~GenericHierarchy();
|
||||
UtilExport void AddEntry(int data, int parent = -1); // Add one entry, given its parent
|
||||
UtilExport int Entries(); // Total number of members in the hierarchy
|
||||
UtilExport HierarchyEntry* GetStart() { return root.child; } // Get the first item under the root
|
||||
UtilExport HierarchyEntry* FindEntry(int data, HierarchyEntry* start = NULL);
|
||||
UtilExport int NumberOfChildren(int data); // The number of children for this item
|
||||
UtilExport int GetChild(int data, int index); // Get the nth child of this item
|
||||
UtilExport void New(); // Clear out the hierarchy tree
|
||||
UtilExport void Sort(); // Sort tree by children/siblings
|
||||
UtilExport BOOL IsCompatible(GenericHierarchy& hier); // Are they compatible?
|
||||
UtilExport void Dump(HierarchyEntry* start = NULL); // DebugPrint the tree
|
||||
UtilExport GenericHierarchy& operator=(GenericHierarchy& from); // Copy operator
|
||||
UtilExport TSTR& SortKey(); // Get the sort key for the hierarchy
|
||||
};
|
||||
|
||||
#endif __HIERCLAS__H
|
171
lib/maxsdk31/genlight.h
Executable file
171
lib/maxsdk31/genlight.h
Executable file
@ -0,0 +1,171 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: genlight.h
|
||||
|
||||
DESCRIPTION: Defines General-Purpose lights
|
||||
|
||||
CREATED BY: Tom Hudson
|
||||
|
||||
HISTORY: created 5 December 1995
|
||||
|
||||
*> Copyright (c) 1995, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __GENLIGHT__H__
|
||||
|
||||
#define __GENLIGHT__H__
|
||||
|
||||
|
||||
#define OMNI_LIGHT 0 // Omnidirectional
|
||||
#define TSPOT_LIGHT 1 // Targeted
|
||||
#define DIR_LIGHT 2 // Directional
|
||||
#define FSPOT_LIGHT 3 // Free
|
||||
#define TDIR_LIGHT 4 // Targeted directional
|
||||
|
||||
#define NUM_LIGHT_TYPES 5
|
||||
|
||||
#define DECAY_NONE 0
|
||||
#define DECAY_INV 1
|
||||
#define DECAY_INVSQ 2
|
||||
|
||||
// SetAtten types
|
||||
#define ATTEN1_START 0 // near
|
||||
#define ATTEN1_END 1 // near
|
||||
#define ATTEN_START 2 // far
|
||||
#define ATTEN_END 3 // far
|
||||
|
||||
// Shapes
|
||||
#define RECT_LIGHT 0
|
||||
#define CIRCLE_LIGHT 1
|
||||
|
||||
class ShadowType;
|
||||
|
||||
class GenLight: public LightObject {
|
||||
public:
|
||||
virtual GenLight *NewLight(int type)=0;
|
||||
virtual RefResult EvalLightState(TimeValue t, Interval& valid, LightState* cs)=0;
|
||||
virtual int Type()=0; // OMNI_LIGHT, TSPOT_LIGHT, DIR_LIGHT, FSPOT_LIGHT, TDIR_LIGHT
|
||||
virtual void SetType(int tp) {} // OMNI_LIGHT, TSPOT_LIGHT, DIR_LIGHT, FSPOT_LIGHT, TDIR_LIGHT
|
||||
virtual BOOL IsSpot()=0;
|
||||
virtual BOOL IsDir()=0;
|
||||
virtual void SetUseLight(int onOff)=0;
|
||||
virtual BOOL GetUseLight(void)=0;
|
||||
virtual void SetSpotShape(int s)=0;
|
||||
virtual int GetSpotShape(void)=0;
|
||||
virtual void SetHotspot(TimeValue time, float f)=0;
|
||||
virtual float GetHotspot(TimeValue t, Interval& valid = Interval(0,0))=0;
|
||||
virtual void SetFallsize(TimeValue time, float f)=0;
|
||||
virtual float GetFallsize(TimeValue t, Interval& valid = Interval(0,0))=0;
|
||||
virtual void SetAtten(TimeValue time, int which, float f)=0;
|
||||
virtual float GetAtten(TimeValue t, int which, Interval& valid = Interval(0,0))=0;
|
||||
virtual void SetTDist(TimeValue time, float f)=0;
|
||||
virtual float GetTDist(TimeValue t, Interval& valid = Interval(0,0))=0;
|
||||
virtual ObjLightDesc *CreateLightDesc(INode *n)=0;
|
||||
virtual void SetRGBColor(TimeValue t, Point3& rgb)=0;
|
||||
virtual Point3 GetRGBColor(TimeValue t, Interval &valid = Interval(0,0))=0;
|
||||
virtual void SetHSVColor(TimeValue t, Point3& hsv)=0;
|
||||
virtual Point3 GetHSVColor(TimeValue t, Interval &valid = Interval(0,0))=0;
|
||||
virtual void SetIntensity(TimeValue time, float f)=0;
|
||||
virtual float GetIntensity(TimeValue t, Interval& valid = Interval(0,0))=0;
|
||||
virtual void SetContrast(TimeValue time, float f)=0;
|
||||
virtual float GetContrast(TimeValue t, Interval& valid = Interval(0,0))=0;
|
||||
virtual void SetAspect(TimeValue t, float f)=0;
|
||||
virtual float GetAspect(TimeValue t, Interval& valid = Interval(0,0))=0;
|
||||
virtual void SetConeDisplay(int s, int notify=TRUE)=0;
|
||||
virtual BOOL GetConeDisplay(void)=0;
|
||||
virtual void SetUseAtten(int s)=0;
|
||||
virtual BOOL GetUseAtten(void)=0;
|
||||
virtual void SetAttenDisplay(int s)=0;
|
||||
virtual BOOL GetAttenDisplay(void)=0;
|
||||
virtual void SetUseAttenNear(int s)=0;
|
||||
virtual BOOL GetUseAttenNear(void)=0;
|
||||
virtual void SetAttenNearDisplay(int s)=0;
|
||||
virtual BOOL GetAttenNearDisplay(void)=0;
|
||||
virtual void Enable(int enab)=0;
|
||||
virtual void SetMapBias(TimeValue t, float f)=0;
|
||||
virtual float GetMapBias(TimeValue t, Interval& valid = Interval(0,0))=0;
|
||||
virtual void SetMapRange(TimeValue t, float f)=0;
|
||||
virtual float GetMapRange(TimeValue t, Interval& valid = Interval(0,0))=0;
|
||||
virtual void SetMapSize(TimeValue t, int f)=0;
|
||||
virtual int GetMapSize(TimeValue t, Interval& valid = Interval(0,0))=0;
|
||||
virtual void SetRayBias(TimeValue t, float f)=0;
|
||||
virtual float GetRayBias(TimeValue t, Interval& valid = Interval(0,0))=0;
|
||||
|
||||
virtual int GetUseGlobal()=0;
|
||||
virtual void SetUseGlobal(int a)=0;
|
||||
virtual int GetShadow()=0;
|
||||
virtual void SetShadow(int a)=0;
|
||||
|
||||
virtual int GetShadowType()=0;
|
||||
virtual void SetShadowType(int a)=0;
|
||||
|
||||
// Pluggable Shadow generator (11/2/98):
|
||||
virtual void SetShadowGenerator(ShadowType *s) {};
|
||||
virtual ShadowType *GetShadowGenerator() { return NULL; }
|
||||
|
||||
virtual int GetAbsMapBias()=0;
|
||||
virtual void SetAbsMapBias(int a)=0;
|
||||
|
||||
virtual void SetAtmosShadows(TimeValue t, int onOff) {}
|
||||
virtual int GetAtmosShadows(TimeValue t) { return 0; }
|
||||
virtual void SetAtmosOpacity(TimeValue t, float f) {}
|
||||
virtual float GetAtmosOpacity(TimeValue t, Interval& valid=FOREVER) { return 0.0f; }
|
||||
virtual void SetAtmosColAmt(TimeValue t, float f) {}
|
||||
virtual float GetAtmosColAmt(TimeValue t, Interval& valid=FOREVER) { return 0.0f; }
|
||||
virtual void SetUseShadowColorMap(TimeValue t, int onOff) { }
|
||||
virtual int GetUseShadowColorMap(TimeValue t) { return FALSE; }
|
||||
|
||||
virtual int GetOvershoot()=0;
|
||||
virtual void SetOvershoot(int a)=0;
|
||||
|
||||
virtual NameTab& GetExclusionList()=0;
|
||||
virtual void SetExclusionList(NameTab &list)=0;
|
||||
|
||||
virtual BOOL SetHotSpotControl(Control *c)=0;
|
||||
virtual BOOL SetFalloffControl(Control *c)=0;
|
||||
virtual BOOL SetColorControl(Control *c)=0;
|
||||
virtual Control* GetHotSpotControl()=0;
|
||||
virtual Control* GetFalloffControl()=0;
|
||||
virtual Control* GetColorControl()=0;
|
||||
|
||||
virtual void SetAffectDiffuse(BOOL onOff) {}
|
||||
virtual BOOL GetAffectDiffuse() {return 0;}
|
||||
virtual void SetAffectSpecular(BOOL onOff) {}
|
||||
virtual BOOL GetAffectSpecular() {return 0;}
|
||||
|
||||
virtual void SetDecayType(BOOL onOff) {}
|
||||
virtual BOOL GetDecayType() {return 0;}
|
||||
virtual void SetDecayRadius(TimeValue time, float f) {}
|
||||
virtual float GetDecayRadius(TimeValue t, Interval& valid = Interval(0,0)) { return 0.0f;}
|
||||
virtual void SetDiffuseSoft(TimeValue time, float f) {}
|
||||
virtual float GetDiffuseSoft(TimeValue t, Interval& valid = Interval(0,0)) { return 0.0f; }
|
||||
|
||||
virtual void SetShadColor(TimeValue t, Point3& rgb) {}
|
||||
virtual Point3 GetShadColor(TimeValue t, Interval &valid = Interval(0,0)) { return Point3(0,0,0); }
|
||||
virtual BOOL GetLightAffectsShadow() { return 0; }
|
||||
virtual void SetLightAffectsShadow(BOOL b) { }
|
||||
virtual void SetShadMult(TimeValue t, float m) {}
|
||||
virtual float GetShadMult(TimeValue t, Interval &valid = Interval(0,0)) { return 1.0f; }
|
||||
|
||||
virtual Texmap* GetProjMap() { return NULL; }
|
||||
virtual void SetProjMap(Texmap* pmap) {}
|
||||
virtual Texmap* GetShadowProjMap() { return NULL; }
|
||||
virtual void SetShadowProjMap(Texmap* pmap) {}
|
||||
|
||||
virtual void SetAmbientOnly(BOOL onOff) { }
|
||||
virtual BOOL GetAmbientOnly() { return FALSE; }
|
||||
|
||||
virtual void SetEmitterEnable(TimeValue t, BOOL onOff) {}
|
||||
virtual BOOL GetEmitterEnable(TimeValue t, Interval& valid = Interval(0,0)) { return 0; }
|
||||
virtual void SetEmitterEnergy(TimeValue t, float energy) {}
|
||||
virtual float GetEmitterEnergy(TimeValue t, Interval& valid = Interval(0,0)) { return 0.0f; }
|
||||
virtual void SetEmitterDecayType(TimeValue t, int decay) {}
|
||||
virtual int GetEmitterDecayType(TimeValue t, Interval& valid = Interval(0,0)) { return 0; }
|
||||
virtual void SetEmitterCausticPhotons(TimeValue t, int photons) {}
|
||||
virtual int GetEmitterCausticPhotons(TimeValue t, Interval& valid = Interval(0,0)) { return 0; }
|
||||
virtual void SetEmitterGlobalIllumPhotons(TimeValue t, int photons) {}
|
||||
virtual int GetEmitterGlobalIllumPhotons(TimeValue t, Interval& valid = Interval(0,0)) { return 0; }
|
||||
};
|
||||
|
||||
|
||||
#endif // __GENLIGHT_H__
|
20
lib/maxsdk31/genshape.h
Executable file
20
lib/maxsdk31/genshape.h
Executable file
@ -0,0 +1,20 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: genshape.h
|
||||
|
||||
DESCRIPTION: Defines Generic Shape Class
|
||||
|
||||
CREATED BY: Tom Hudson
|
||||
|
||||
HISTORY: created 13 November 1995
|
||||
|
||||
*> Copyright (c) 1995, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __GENSHAPE__
|
||||
|
||||
#define __GENSHAPE__
|
||||
|
||||
extern CoreExport Class_ID genericShapeClassID;
|
||||
|
||||
#endif // __GENSHAPE__
|
26
lib/maxsdk31/geom.h
Executable file
26
lib/maxsdk31/geom.h
Executable file
@ -0,0 +1,26 @@
|
||||
#ifndef _GEOM_H_
|
||||
|
||||
#define _GEOM_H_
|
||||
|
||||
#include <export.h>
|
||||
#include "gfloat.h"
|
||||
#include "point2.h"
|
||||
#include "point3.h"
|
||||
#include "point4.h"
|
||||
#include "ipoint2.h"
|
||||
#include "ipoint3.h"
|
||||
#include "dpoint3.h"
|
||||
#include "matrix2.h"
|
||||
#include "matrix3.h"
|
||||
#include "quat.h"
|
||||
#include "stack3.h"
|
||||
#include "box3.h"
|
||||
#include "box2.h"
|
||||
#include "bitarray.h"
|
||||
#include "color.h"
|
||||
#include "acolor.h"
|
||||
#include "euler.h"
|
||||
#include "gutil.h"
|
||||
#endif // _GEOM_H_
|
||||
|
||||
|
BIN
lib/maxsdk31/geom.lib
Executable file
BIN
lib/maxsdk31/geom.lib
Executable file
Binary file not shown.
9
lib/maxsdk31/geomlib.h
Executable file
9
lib/maxsdk31/geomlib.h
Executable file
@ -0,0 +1,9 @@
|
||||
#ifndef _GEOMLIB_H_
|
||||
|
||||
#define _GEOMLIB_H_
|
||||
|
||||
#define IMPORTING
|
||||
#include "geom.h"
|
||||
#undef IMPORTING
|
||||
|
||||
#endif // _GEOMLIB_H_
|
79
lib/maxsdk31/gfloat.h
Executable file
79
lib/maxsdk31/gfloat.h
Executable file
@ -0,0 +1,79 @@
|
||||
/**********************************************************************
|
||||
*<
|
||||
FILE: gfloat
|
||||
|
||||
DESCRIPTION: Single Precision Floating Point Routines
|
||||
|
||||
CREATED BY: Don Brittain & Dan Silva
|
||||
|
||||
HISTORY:
|
||||
|
||||
*> Copyright (c) 1994, All Rights Reserved.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef _GFLOAT_H
|
||||
|
||||
#define _GFLOAT_H
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
// Single precision floating point stuff...
|
||||
//
|
||||
inline void SinCos (float angle, float *sine, float *cosine)
|
||||
{
|
||||
#ifdef _M_IX86 // if on Intel, use assembly language
|
||||
__asm {
|
||||
push ecx
|
||||
fld dword ptr angle
|
||||
fsincos
|
||||
mov ecx, dword ptr[cosine]
|
||||
fstp dword ptr [ecx]
|
||||
mov ecx, dword ptr[sine]
|
||||
fstp dword ptr [ecx]
|
||||
pop ecx
|
||||
}
|
||||
#else
|
||||
*sine = (float)sin (angle);
|
||||
*cosine = (float)cos (angle);
|
||||
#endif
|
||||
}
|
||||
|
||||
inline float Sin(float angle)
|
||||
{
|
||||
#ifdef _M_IX86
|
||||
float s, c;
|
||||
SinCos(angle, &s, &c);
|
||||
return s;
|
||||
#else
|
||||
return (float)sin((double)angle);
|
||||
#endif
|
||||
}
|
||||
|
||||
inline float Cos(float angle)
|
||||
{
|
||||
#ifdef _M_IX86
|
||||
float s, c;
|
||||
SinCos(angle, &s, &c);
|
||||
return c;
|
||||
#else
|
||||
return (float)cos((double)angle);
|
||||
#endif
|
||||
}
|
||||
|
||||
inline float Sqrt(float arg)
|
||||
{
|
||||
#ifdef _M_IX86
|
||||
float ans;
|
||||
__asm {
|
||||
fld dword ptr arg
|
||||
fsqrt
|
||||
fstp dword ptr [ans]
|
||||
}
|
||||
return ans;
|
||||
#else
|
||||
return (float)sqrt((double)arg);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#endif
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user