Initial full mirror of c:\VWE (source + assets + toolchain + outputs) via Git LFS

Complete disaster-recovery snapshot: engine/game source, game data assets,
VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive.
Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false,
no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
This commit is contained in:
Cyd
2026-06-24 21:28:16 -05:00
commit 2b8ca921cb
66341 changed files with 7923174 additions and 0 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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; }
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
@@ -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
@@ -0,0 +1,956 @@
/**********************************************************************
*<
FILE: animtbl.h
DESCRIPTION: Defines Animatable Classes
CREATED BY: Rolf Berteig & Dan Silva
HISTORY: created 9 September 1994
*> Copyright (c) 1994, All Rights Reserved.
**********************************************************************/
#ifndef _ANIMTBL_H_
#define _ANIMTBL_H_
#define ANIMTYPE_NODE 1
#define ANIMTYPE_ROOTNODE 3
#define ANIMTYPE_CONTROL 2
/*---------------------------------------------------*/
class TreeListExp;
class AnimEnum;
class ReferenceTarget;
class DWORDTab;
class IObjParam;
class INodeTab;
class AppDataChunk;
// The maximum number of track views that can be opened. Each
// animatable stores 3 bits for each track to identify it's open/close
// state and selection state.
#define MAX_TRACK_VIEWS 16
#define ALL_TRACK_VIEWS 0xffff
// The maximum number of track view selection sets
#define MAX_TRACKVIEW_SELSETS 16
// Values for flags in aflag
#define A_EVALUATING 1
#define A_NOTIFYDEP (1<<1)
#define A_CHILD_TREE_OPEN (1<<2)
#define A_SUBANIM_TREE_OPEN (1<<3)
#define A_OBJECT_REDUCED (1<<4)
// BITS 5-11 are reserved for specific sub-class use.
// Atmospheric flags
#define A_ATMOS_DISABLED (1<<5)
// OBJECT flags
#define A_OBJ_CREATING (1<<5) // The object is being created. It doesn't want to snap to itself.
#ifdef _OSNAP
#define A_OBJ_LONG_CREATE (1<<6) // Persists throughout the wholle creation process as
// opposed to the previous flag which gets cleared as
// as the object is added to the scene.
#endif
// MODIFIER flags .
#define A_MOD_DISABLED (1<<5) // Modifier flag
#define A_MOD_BEING_EDITED (1<<6)
#define A_MOD_USE_SEL (1<<7) // Modifier flag (use sub-ob selection)
#define A_MOD_DISABLED_INVIEWS (1<<8) // Modifier is disabled in viewports only
// MODAPP flags.
#define A_MODAPP_DISABLED (1<<5) // ModApp flag
#define A_MODAPP_SELECTED (1<<6) // ModApp flag (parent node is selected)
#define A_MODAPP_DISPLAY_ACTIVE (1<<7) // ModApp flag
#define A_MODAPP_DYNAMIC_BOX (1<<8) // ModApp flag
#define A_MODAPP_RENDERING (1<<9) // Render begin turns this on and render end turns it off
// Derived Object Flags
#define A_DERIVEDOBJ_DONTDELETE (1<<9) // When the last modifier is deleted form this derived object, don't delete the derived object
// CONTROL flags
#define A_ORT_MASK 7
#define A_ORT_BEFORESHIFT 5 // Uses bit 5,6,7,8,9 and 10 to store ORT
#define A_ORT_AFTERSHIFT 8
#define A_CTRL_DISABLED (1<<11)
#define A_ORT_DISABLED A_SUPERCLASS1 // indicates that the ORT is disabled
// INODE flags
#define A_INODE_IK_TERMINATOR (1<<5) // Terminates the top of an IK chain
#define A_INODE_IK_POS_PINNED (1<<6)
#define A_INODE_IK_ROT_PINNED (1<<7)
#ifdef _OSNAP
#define A_INODE_CLONE_TARGET (1<<8)
#endif
// Flags for Hold and Restore logic, for "lazy holding",
// to avoid multiple holding.
#define A_HELD (1<<12)
#define A_SET (1<<13)
// Deleted but kept around for UNDO
#define A_IS_DELETED (1<<14)
// To prevent AutoDelete from being re-entered.
#define A_BEING_AUTO_DELETED (1<<15)
// Reserved for superclass use
#define A_SUPERCLASS1 (1<<20)
#define A_SUPERCLASS2 (1<<21)
// These are reserved for use by the plug-in. No should will set these flags (except the plug-in class itself)
#define A_PLUGIN1 (1<<22)
#define A_PLUGIN2 (1<<23)
#define A_PLUGIN3 (1<<24)
#define A_PLUGIN4 (1<<25)
// Used to test for a dependency
#define A_DEPENDENCY_TEST (1<<26)
// Ref target isn't deleted when dependents goes to 0 if this flag is set.
#define A_LOCK_TARGET (1<<27)
#define A_WORK1 (1<<28)
#define A_WORK2 (1<<29)
#define A_WORK3 (1<<30)
#define A_WORK4 (1<<31)
#define A_OPENFLAG(t) ((t==0)?A_CHILD_TREE_OPEN:A_SUBANIM_TREE_OPEN)
class TimeMap {
public:
virtual TimeValue map(TimeValue t)=0;
virtual TimeValue prevmap(TimeValue t)=0;
};
class TrackHitRecord {
public:
DWORD hit;
DWORD flags;
TrackHitRecord(DWORD h=0,DWORD f=0) {hit=h;flags=f;}
};
typedef Tab<TrackHitRecord> TrackHitTab;
// Flags passed to MapKeys and DeleteKeys
#define TRACK_DOSEL (1<<0)
#define TRACK_DOALL (1<<1) // ignore selection
#define TRACK_SLIDEUNSEL (1<<2) // Slide unselected keys to the right
#define TRACK_RIGHTTOLEFT (1<<3) // Enumerate right to left. If TRACK_SLIDEUNSEL is set, keys will slide to the left.
#define TRACK_DOSUBANIMS (1<<4) // This flag is only passed to MapKeys
#define TRACK_DOCHILDNODES (1<<5) // This flag is only passed to MapKeys
#define TRACK_MAPRANGE (1<<6) // The range, if not locked to first and last key, should be mapped as well.
// Flags passed to EditTimeRange
#define EDITRANGE_LINKTOKEYS (1<<0) // This means if one of the ends of the interval is at a key, link it to the key so that if the key moves, the interval moves.
// Flags passed to hit test tracks and fcurves.
#define HITTRACK_SELONLY (1<<0)
#define HITTRACK_UNSELONLY (1<<1)
#define HITTRACK_ABORTONHIT (1<<2)
#define HITCURVE_TESTTANGENTS (1<<3)
#define HITTRACK_SUBTREEMODE (1<<4) // Subtree mode is on so the anim is being asked to hittest itself in one of its ancestor's tracks
// Flags passed to SelectKeys
// Either SELECT, DESELECT, or a combination of CLEARKEYS and CLEARCURVE
// will be specified.
#define SELKEYS_SELECT (1<<0)
#define SELKEYS_DESELECT (1<<1)
#define SELKEYS_CLEARKEYS (1<<2)
#define SELKEYS_CLEARCURVE (1<<3)
#define SELKEYS_FCURVE (1<<4) // indicates that were operating on keys of a function curve, not a track
// Flags passed to GetTimeRange
#define TIMERANGE_SELONLY (1<<0) // The bounding interval of selected keys
#define TIMERANGE_ALL (1<<1) // Whatever the channel's time range is - usually the bunding interval of all keys.
#define TIMERANGE_CHILDNODES (1<<2) // A node's time range should include child nodes.
#define TIMERANGE_CHILDANIMS (1<<3) // A animatable's child anim ranges should be included
// Passed to the functions that modify a time range such as copy,paste,delete,reverse
#define TIME_INCLEFT (1<<10) // Include left endpoint
#define TIME_INCRIGHT (1<<11) // Include right endpoint
#define TIME_NOSLIDE (1<<12) // Delete any keys in the interval but don't actually remove the block of time.
// In addition to the TIME_ flags above, the following flag may be passed to PasteTrck()
#define PASTE_RELATIVE (1<<20) // Add the keys relative to existing keys
// Flags passed to AddKey
#define ADDKEY_SELECT (1<<0) // Select the new key and deselect any other selected keys
#define ADDKEY_INTERP (1<<1) // Init the new key to the interpolated value at that time. Otherwise, init the key to the value of the previous key.
#define ADDKEY_FLAGGED (1<<2) // Flag the newly created key as if FlagKey() was called for it
// Flags passed to CopyKeysFromTime()
#define COPYKEY_POS (1<<0) // These filter flags are passed to a tm controller. The tm
#define COPYKEY_ROT (1<<1) // can decide what to do with them... they have obvious meaning
#define COPYKEY_SCALE (1<<2) // For the PRS controller.
// Flags passed to GetNextKeyTime()
#define NEXTKEY_LEFT (1<<0) // Search to the left.
#define NEXTKEY_RIGHT (1<<1) // Search to the right.
#define NEXTKEY_POS (1<<2)
#define NEXTKEY_ROT (1<<3)
#define NEXTKEY_SCALE (1<<4)
// Flags passed to IsKeyAtTime
#define KEYAT_POSITION (1<<0)
#define KEYAT_ROTATION (1<<1)
#define KEYAT_SCALE (1<<2)
// Flags passed to PaintTrack and PaintFCurves
#define PAINTTRACK_SHOWSEL (1<<0)
#define PAINTTRACK_SHOWSTATS (1<<1) // Show for selected keys
#define PAINTCURVE_SHOWTANGENTS (1<<2) // Show for selected keys
#define PAINTCURVE_FROZEN (1<<3) // Curve is in a frozen state
#define PAINTCURVE_GENCOLOR (1<<4) // Draw curve in generic color
#define PAINTCURVE_XCOLOR (1<<5) // Draw curve in red
#define PAINTCURVE_YCOLOR (1<<6) // Draw curve in green
#define PAINTCURVE_ZCOLOR (1<<7) // Draw curve in blue
#define PAINTTRACK_SUBTREEMODE (1<<8) // Subtree mode is on so the anim is being asked to paint itself in one of its ancestor's tracks
#define PAINTTRACK_HIDESTATICVALUES (1<<9) // Indicates that static values shouldn't be displayed in tracks.
// Flags passed to GetFCurveExtents
#define EXTENTS_SHOWTANGENTS (1<<0) // Tangents are visible for selected keys
// Values returned from PaintTrack, PaintFCurve and HitTestTrack
#define TRACK_DONE 1 // Track was successfully painted/hittested
#define TRACK_DORANGE 2 // This anim has no track. Draw/hittest the bounding range of it's subanims
#define TRACK_ASKCLIENT 3 // Ask client anim to paint the track
// Values returned from HitTestFCurve
#define HITCURVE_KEY 1 // Hit one or more keys
#define HITCURVE_WHOLE 2 // Hit the curve (anywhere)
#define HITCURVE_TANGENT 3 // Hit a tangent handle
#define HITCURVE_NONE 4 // Didn't hit squat
#define HITCURVE_ASKCLIENT 5 // Ask client to hit test fcurve.
// These flags are passed into PaintFCurves, HitTestFCurves, and GetFCurveExtnents
// They are filters for controllers with more than one curve
// NOTE: RGB controllers interpret X as red, Y as green and Z as blue.
#define DISPLAY_XCURVE (1<<29)
#define DISPLAY_YCURVE (1<<30)
#define DISPLAY_ZCURVE (1<<31)
// Values returned from GetSelKeyCoords()
#define KEYS_NONESELECTED (1<<0)
#define KEYS_MULTISELECTED (1<<1)
#define KEYS_COMMONTIME (1<<2) // Both of these last two bits
#define KEYS_COMMONVALUE (1<<3) // could be set.
// Flags passed to GetSelKeyCoords()
#define KEYCOORDS_TIMEONLY (1<<0)
#define KEYCOORDS_VALUEONLY (1<<1)
// Variable definitions for SetSelKeyCoordsExpr()
#define KEYCOORDS_TIMEVAR _T("n")
#define KEYCOORDS_VALVAR _T("n")
// Return values from SetSelKeyCoordsExpr()
#define KEYCOORDS_EXPR_UNSUPPORTED 0 // Don't implement this method
#define KEYCOORDS_EXPR_ERROR 1 // Error in expression
#define KEYCOORDS_EXPR_OK 2 // Expression evaluated
// Returned from NumKeys() if the animatable is not keyframeable
#define NOT_KEYFRAMEABLE -1
// Flags passed to AdjustTangents
#define ADJTAN_LOCK (1<<0)
#define ADJTAN_BREAK (1<<1)
// Flags passed to EditTrackParams
#define EDITTRACK_FCURVE (1<<0) // The user is in the function curve editor.
#define EDITTRACK_TRACK (1<<1) // The user is in one of the track views.
#define EDITTRACK_SCENE (1<<2) // The user is editing a path in the scene.
#define EDITTRACK_BUTTON (1<<3) // The user invoked by choosing the properties button. In this case the time parameter is NOT valid.
#define EDITTRACK_MOUSE (1<<4) // The user invoked by right clicking with the mouse. In this case the time parameter is valid.
// These are returned from TrackParamsType(). They define how the track parameters are invoked.
#define TRACKPARAMS_NONE 0 // Has no track parameters
#define TRACKPARAMS_KEY 1 // Entered by right clicking on a selected key
#define TRACKPARAMS_WHOLE 2 // Entered by right clicking anywhere in the track.
// Flags passed into RenderBegin
#define RENDERBEGIN_IN_MEDIT 1 // Indicates that the render is occuring in the material editor.
// Macros for converting track screen coords to time and back.
#define TimeToScreen(t,scale,scroll) (int(floor((t)*(scale)+0.5)) - (scroll))
#define ScreenToTime(s,scale,scroll) ((int)floor((s)/(scale) + (scroll)/(scale)+0.5))
#define ValueToScreen(v,h,scale,scroll) (h-int(floor((v)*(scale)+0.5)) - (scroll))
#define ScreenToValue(s,h,scale,scroll) ((float(h)-(float(s)+float(scroll)))/(scale))
// Scales a value about an origin
#define ScaleAboutOrigin(val,origin,scale) ((((val)-(origin))*(scale))+(origin))
class TrackClipObject {
public:
// Specifies the interval of time clipped.
Interval clip;
// Identifies the creator of the clip object
virtual SClass_ID SuperClassID()=0;
virtual Class_ID ClassID()=0;
TrackClipObject(Interval iv) {clip = iv;}
virtual void DeleteThis()=0;
virtual int NumKeys() {return 0;}
virtual BOOL GetKeyVal(int i, void *val) {return FALSE;}
virtual BOOL SetKeyVal(int i, void *val) {return FALSE;}
};
// This must be updated if a new entry is added to DimType!
#define NUM_BUILTIN_DIMS 10
enum DimType {
DIM_WORLD,
DIM_ANGLE,
DIM_COLOR, //0-1
DIM_COLOR255, //0-255
DIM_PERCENT, //0-100
DIM_NORMALIZED, //0-1
DIM_SEGMENTS,
DIM_TIME,
DIM_CUSTOM,
DIM_NONE
};
// These two classes describes the dimension of a parameter (sub-anim).
// The dimension type and possibly the dimension scale (if the type is
// custom) are used to determine a scale factor for the parameter.
// When a controller is drawing a function curve, it only needs to
// use the Convert() function - the scale factor is rolled into the single
// 'vzoom' parameter passed to PaintFCurves.
// So, for a controller to plot a value 'val' at time t it would do the
// following:
// int x = TimeToScreen(t,tzoom,tscroll);
// int y = ValueToScreen(dim->Convert(val),rect.h()-1,vzoom,vscroll);
//
class ParamDimensionBase {
public:
virtual DimType DimensionType()=0;
virtual float Convert(float value)=0;
virtual float UnConvert(float value)=0;
};
class ParamDimension : public ParamDimensionBase {
public:
// If the DimType is custom than these must be implemented.
virtual float GetDimScale() {return 1.0f;}
virtual void SetDimScale() {}
virtual TCHAR *DimensionName() {return _T("");}
};
// These point to default implementations for the standard DIM types.
CoreExport extern ParamDimension *defaultDim;
CoreExport extern ParamDimension *stdWorldDim;
CoreExport extern ParamDimension *stdAngleDim;
CoreExport extern ParamDimension *stdColorDim;
CoreExport extern ParamDimension *stdColor255Dim;
CoreExport extern ParamDimension *stdPercentDim;
CoreExport extern ParamDimension *stdNormalizedDim;
CoreExport extern ParamDimension *stdSegmentsDim;
CoreExport extern ParamDimension *stdTimeDim;
// Interface IDs for GetInterface() - NOTE: doesn't need to be released.
#define I_CONTROL 0x00001001
#define I_MASTER 0x00001010
#define I_EASELIST 0x00001020
#define I_MULTLIST 0x00001030
#define I_BASEOBJECT 0x00001040
#define I_PARTICLEOBJ 0x00001050
#define I_KEYCONTROL 0x00001060
#define I_TEXTOBJECT 0x00001070
#define I_WAVESOUND 0x00001080
#ifdef _SUBMTLASSIGNMENT
#define I_SUBMTLAPI 0x00001090
#endif
// Plug-in defined interfaces should be > this id
#define I_USERINTERFACE 0x0000ffff
#define GetControlInterface(anim) ((Control*)anim->GetInterface(I_CONTROL))
#define GetObjectInterface(anim) ((BaseObject*)anim->GetInterface(I_BASEOBJECT))
#define GetParticleInterface(anim) ((ParticleObject*)anim->GetInterface(I_PARTICLEOBJ))
#define GetKeyControlInterface(anim) ((IKeyControl*)anim->GetInterface(I_KEYCONTROL))
#define GetMasterController(anim) ((ReferenceTarget*)anim->GetInterface(I_MASTER))
#define GetTextObjectInterface(anim) ((ITextObject*)anim->GetInterface(I_TEXTOBJECT))
#define GetWaveSoundInterface(anim) ((IWaveSound*)anim->GetInterface(I_WAVESOUND))
// This is the base class for classes that can be hung off an animatable's
// property list. When an animatable is deleted, it's properties will be
// deleted and their virtual destructor will be called.
class AnimProperty {
public:
virtual BOOL DontDelete() {return FALSE;}
virtual ~AnimProperty() {}
virtual DWORD ID()=0;
};
class AnimPropertyList : public Tab<AnimProperty*> {
public:
CoreExport int FindProperty(DWORD id,int start=0);
};
// Property IDs
#define PROPID_APPDATA 0x00000010
#define PROPID_EASELIST 0x00000020
#define PROPID_MULTLIST 0x00000030
#define PROPID_NOTETRACK 0x00000040
#define PROPID_CLEARCACHES 0x00000050
#define PROPID_HAS_WSM 0x00000060
#define PROPID_PSTAMP_SMALL 0x00000070
#define PROPID_PSTAMP_LARGE 0x00000071
#define PROPID_FORCE_RENDER_MESH_COPY 0x000000100
#define PROPID_EVAL_STEPSIZE_BUG_FIXED 0x1000
#define PROPID_USER 0x0000FFFF
// Values above PROPID_USER can be used by plug-ins.
// Note: that a plug-in should only put user defined properties on it's
// own list. So IDs only have to be unique within a plug-in. If a plug-in
// needs to attach data to another object, it can do so via APP_DATA.
// BeginEditParams flags values
#define BEGIN_EDIT_CREATE (1<<0)
#define BEGIN_EDIT_MOTION (1<<1) // Controller is being edited in the motion branch
#define BEGIN_EDIT_HIERARCHY (1<<2) // Same as BEGIN_EDIT_IK
#define BEGIN_EDIT_IK (1<<2) // Controller is being edited in the IK subtask of the hierarchy branch
#define BEGIN_EDIT_LINKINFO (1<<3) // Controller is being edited in the Link Info subtask of the hierarchy branch
// EndEditParams flags values
#define END_EDIT_REMOVEUI (1<<0)
// Flags passed to EnumAuxFiles
#define FILE_ENUM_INACTIVE (1<<0) // enumerate inactive files
#define FILE_ENUM_VP (1<<1) // enumerate video post files
#define FILE_ENUM_RENDER (1<<2) // enumerate render files
#define FILE_ENUM_ALL (FILE_ENUM_INACTIVE|FILE_ENUM_VP|FILE_ENUM_RENDER) // enumerate ALL files
#define FILE_ENUM_MISSING_ONLY (1<<8) // enumerate missing files only
#define FILE_ENUM_1STSUB_MISSING (1<<9) // just enumerate 1st file named by ifl if missing
#define FILE_ENUM_DONT_RECURSE (1<<10) // don't enumerate references
#define FILE_ENUM_CHECK_AWORK1 (1<<11) // don't enumerate things with flag A_WORK1 set
// To enumerate all active but missing files
#define FILE_ENUM_MISSING_ACTIVE (FILE_ENUM_VP|FILE_ENUM_RENDER|FILE_ENUM_MISSING_ONLY)
// To enumerate all active but missing files, but only enumerate first subfile pointed
// to by an ifl (enumerating all of them can be very slow).
#define FILE_ENUM_MISSING_ACTIVE1 (FILE_ENUM_MISSING_ACTIVE|FILE_ENUM_1STSUB_MISSING )
// A callback object passed to EnumAuxFiles().
class NameEnumCallback {
public:
virtual void RecordName(TCHAR *name)=0;
};
class NoteTrack;
class Animatable {
friend class ISaveImp;
friend class ILoadImp;
protected:
unsigned long aflag;
AnimPropertyList aprops;
DWORD tvflags1, tvflags2;
public:
void SetAFlag(int mask) { aflag|=mask; }
void ClearAFlag(int mask) { aflag &= ~mask; }
int TestAFlag(int mask) { return(aflag&mask?1:0); }
CoreExport Animatable();
Animatable& operator=(const Animatable& an) { aflag = an.aflag; return *this; }
virtual void GetClassName(TSTR& s) { s= TSTR(_T("Animatable")); }
CoreExport virtual Class_ID ClassID();
CoreExport virtual SClass_ID SuperClassID();
CoreExport virtual ~Animatable();
// This is how things are actually deleted.
// Since they are created with the ClassDesc::Create() function, and
// deleted via this function, they can use a different memory allocator
// than the core code. (theoretically)
CoreExport virtual void DeleteThis();
// Get rid of anything that can be rebuilt
// Objects have a default implementation.
virtual void FreeCaches() {}
// 'create' is TRUE if parameters are being edited in the create branch.
// 'removeUI' is TRUE if the object's UI should be removed.
virtual void BeginEditParams(IObjParam *ip,ULONG flags,Animatable *prev=NULL) {}
virtual void EndEditParams(IObjParam *ip,ULONG flags,Animatable *next=NULL) {}
// OLE-like method for adding new interfaces
virtual void* GetInterface(ULONG id) { return NULL; }
virtual void ReleaseInterface(ULONG id,void *i) {}
// General method for adding properties, when
// defining a new Interface would be too cumbersome
virtual int SetProperty(ULONG id, void *data) { return 0; }
virtual void *GetProperty(ULONG id) { return NULL; }
virtual int NumSubs() { return 0; } // How many sub-animatables are there?
virtual Animatable* SubAnim(int i) { return NULL; } // access the ith sub-animatable
CoreExport virtual TSTR SubAnimName(int i); // get name of ith subanim
virtual BOOL BypassTreeView() { return FALSE; } // return TRUE and you won't appear in the TreeView however your children will.
virtual BOOL AssignController(Animatable *control,int subAnim) {return FALSE;}
// Return the suggested color to draw a sub-anim's function curve
// can be one of PAINTCURVE_GENCOLOR, PAINTCURVE_XCOLOR, PAINTCURVE_YCOLOR, PAINTCURVE_ZCOLOR
virtual DWORD GetSubAnimCurveColor(int subNum) {return PAINTCURVE_GENCOLOR;}
// Converts an anim index to a ref index or returns -1 if there is no
// corrispondance. This is used for copying and pasting in the track
// view. If a client does not wish an anim to be copy/pastable then
// it can return -1 even if there is a corrisponding ref num.
virtual int SubNumToRefNum(int subNum) {return -1;}
// In addition to SubNumToRefNum(), if an anim doesn't want to be coppied it can return FALSE from this function
virtual BOOL CanCopyAnim() {return TRUE;}
// An anim can implement this to reutrn FALSE to prohibit make unique
virtual BOOL CanMakeUnique() {return TRUE;}
virtual int NumChildren() {return 0; } // Non-zero only for nodes.
virtual Animatable* ChildAnim(int i) { return NULL; } // access the ith child
CoreExport virtual TSTR NodeName(); // For nodes only
CoreExport int EnumAnimTree(AnimEnum *animEnum, Animatable *client, int subNum);
CoreExport int HasSubElements(int type=0);
// called once at the beginning of each render
virtual int RenderBegin(TimeValue t, ULONG flags=0) { return 0; }
// called once at the end of each render
virtual int RenderEnd(TimeValue t) { return 0; }
// edit the track or parameters
virtual void EditTrack() { assert(0); }
// Get the number of keys and the time of the ith key.
virtual int NumKeys() {return NOT_KEYFRAMEABLE;}
virtual TimeValue GetKeyTime(int index) {return 0;}
virtual int GetKeyIndex(TimeValue t) {return -1;}
virtual BOOL GetNextKeyTime(TimeValue t,DWORD flags,TimeValue &nt) {return FALSE;}
virtual void CopyKeysFromTime(TimeValue src,TimeValue dst,DWORD flags) {}
virtual void DeleteKeyAtTime(TimeValue t) {}
virtual BOOL IsKeyAtTime(TimeValue t,DWORD flags) {return FALSE;}
// The value returned from these two methods should be the number of keys skipped because their times were before
// range.Start(). So sel[i] is the selection state for the offset+ith key.
virtual int GetKeyTimes(Tab<TimeValue> &times,Interval range,DWORD flags) {return 0;}
virtual int GetKeySelState(BitArray &sel,Interval range,DWORD flags) {return 0;}
// TreeView Methods
/////////////////////////////////////////////////////////////
// the 'tv' parameter specifies which track view.
// each track view uses one bit, there can be up to MAX_TRACK_VIEWS
CoreExport void OpenTreeEntry(int type, DWORD tv);
CoreExport void CloseTreeEntry(int type, DWORD tv);
CoreExport int IsTreeEntryOpen(int type, DWORD tv);
// Track view selected state
CoreExport BOOL GetSelInTrackView(DWORD tv);
CoreExport void SetSelInTrackView(DWORD tv, BOOL sel);
// Track view selection sets: 'which' should be >=0 and <MAX_TRACKVIEW_SELSETS
CoreExport BOOL InTrackViewSelSet(int which);
CoreExport void SetTrackViewSelSet(int which, BOOL inOut);
// The tracks time range:
CoreExport virtual Interval GetTimeRange(DWORD flags);
virtual void EditTimeRange(Interval range,DWORD flags) {};
// Operations to a selected block of time
virtual void DeleteTime(Interval iv, DWORD flags) {}
virtual void ReverseTime(Interval iv, DWORD flags) {}
virtual void ScaleTime(Interval iv, float s) {}
virtual void InsertTime(TimeValue ins, TimeValue amount) {}
// If an anim supports the above time operations it should return TRUE from this method.
// Returning TRUE enables time selection on the track view for the track.
virtual BOOL SupportTimeOperations() {return FALSE;}
// Operations to keys
CoreExport virtual void MapKeys(TimeMap *map, DWORD flags);
virtual void DeleteKeys(DWORD flags) {}
virtual void DeleteKeyByIndex(int index) {}
virtual void SelectKeys(TrackHitTab& sel, DWORD flags) {}
virtual void SelectSubKeys(int subNum,TrackHitTab& sel, DWORD flags) {} // this is called on the client when the client takes over control of an anims fcurve
virtual void SelectSubCurve(int subNum,BOOL sel) {}
virtual void SelectKeyByIndex(int i,BOOL sel) {}
virtual BOOL IsKeySelected(int i) {return FALSE;}
virtual void FlagKey(TrackHitRecord hit) {}
virtual int GetFlagKeyIndex() {return -1;}
virtual int NumSelKeys() {return 0;}
virtual void CloneSelectedKeys(BOOL offset=FALSE) {} // When offset is TRUE, set the new key time to be centered between the original key and the next key
virtual void AddNewKey(TimeValue t,DWORD flags) {}
virtual void MoveKeys(ParamDimensionBase *dim,float delta,DWORD flags) {} // move selected keys vertically in the function curve editor
virtual void ScaleKeyValues(ParamDimensionBase *dim,float origin,float scale,DWORD flags) {}
virtual void SelectCurve(BOOL sel) {}
virtual BOOL IsCurveSelected() {return FALSE;}
virtual BOOL IsSubCurveSelected(int subNum) {return FALSE;}
virtual int GetSelKeyCoords(TimeValue &t, float &val,DWORD flags) {return KEYS_NONESELECTED;}
virtual void SetSelKeyCoords(TimeValue t, float val,DWORD flags) {}
virtual int SetSelKeyCoordsExpr(ParamDimension *dim,TCHAR *timeExpr, TCHAR *valExpr, DWORD flags) {return KEYCOORDS_EXPR_UNSUPPORTED;}
virtual void AdjustTangents(
TrackHitRecord hit,
ParamDimensionBase *dim,
Rect& rcGraph,
float tzoom,
int tscroll,
float vzoom,
int vscroll,
int dx,int dy,
DWORD flags) {};
// Does this animatable actually have animation?
// Default implementation returns TRUE if a child anim has animation.
CoreExport virtual BOOL IsAnimated();
// Clipboard methods:
virtual BOOL CanCopyTrack(Interval iv, DWORD flags) {return FALSE;}
virtual BOOL CanPasteTrack(TrackClipObject *cobj,Interval iv, DWORD flags) {return FALSE;}
virtual TrackClipObject *CopyTrack(Interval iv, DWORD flags) {return NULL;}
virtual void PasteTrack(TrackClipObject *cobj,Interval iv, DWORD flags) {}
// Plug-ins can implement copying and pasting for cases where their subanims
// don't implement it. These aren't called on the client unless the sub-anim
// doesn't implement the above versions.
virtual BOOL CanCopySubTrack(int subNum,Interval iv, DWORD flags) {return FALSE;}
virtual BOOL CanPasteSubTrack(int subNum,TrackClipObject *cobj,Interval iv, DWORD flags) {return FALSE;}
virtual TrackClipObject *CopySubTrack(int subNum,Interval iv, DWORD flags) {return NULL;}
virtual void PasteSubTrack(int subNum,TrackClipObject *cobj,Interval iv, DWORD flags) {}
// Drawing and hit testing tracks
virtual int GetTrackVSpace( int lineHeight ) { return 1; }
virtual int HitTestTrack(
TrackHitTab& hits,
Rect& rcHit,
Rect& rcTrack,
float zoom,
int scroll,
DWORD flags ) { return TRACK_DORANGE; }
virtual int PaintTrack(
ParamDimensionBase *dim,
HDC hdc,
Rect& rcTrack,
Rect& rcPaint,
float zoom,
int scroll,
DWORD flags ) { return TRACK_DORANGE; }
virtual int PaintSubTrack(
int subNum,
ParamDimensionBase *dim,
HDC hdc,
Rect& rcTrack,
Rect& rcPaint,
float zoom,
int scroll,
DWORD flags) {return TRACK_DORANGE;}
// Drawing and hit testing function curves
virtual int PaintFCurves(
ParamDimensionBase *dim,
HDC hdc,
Rect& rcGraph,
Rect& rcPaint,
float tzoom,
int tscroll,
float vzoom,
int vscroll,
DWORD flags ) { return 0; }
virtual int HitTestFCurves(
ParamDimensionBase *dim,
TrackHitTab& hits,
Rect& rcHit,
Rect& rcGraph,
float tzoom,
int tscroll,
float vzoom,
int vscroll,
DWORD flags ) { return HITCURVE_NONE; }
// Versions that allow clients to paint and hit test their subanims curves
virtual int PaintSubFCurves(
int subNum,
ParamDimensionBase *dim,
HDC hdc,
Rect& rcGraph,
Rect& rcPaint,
float tzoom,
int tscroll,
float vzoom,
int vscroll,
DWORD flags ) { return 0; }
virtual int HitTestSubFCurves(
int subNum,
ParamDimensionBase *dim,
TrackHitTab& hits,
Rect& rcHit,
Rect& rcGraph,
float tzoom,
int tscroll,
float vzoom,
int vscroll,
DWORD flags ) { return HITCURVE_NONE; }
// Edit key info (or whatever) for selected keys.
// hParent is the parent window that should be used to create any dialogs.
// This function should not return until the user has completed editng at which
// time any windows that were created should be destroyed. Unlike
// BeginEditParams/EndEditParams this interface is modal.
virtual void EditTrackParams(
TimeValue t, // The horizontal position of where the user right clicked.
ParamDimensionBase *dim,
TCHAR *pname, // The name of the parameter as given by the client
HWND hParent,
IObjParam *ip,
DWORD flags) {}
// Returns a value indicating how track parameters are
// are invoked. See description above by
// TRACKPARAMS_NONE, TRACKPARAMS_KEY, TRACKPARAMS_WHOLE
virtual int TrackParamsType() {return TRACKPARAMS_NONE;}
// Calculate the largest and smallest values.
// If this is processed, return non-zero.
virtual int GetFCurveExtents(
ParamDimensionBase *dim,
float &min, float &max, DWORD flags) {return 0;}
virtual int GetSubFCurveExtents(
int subNum,
ParamDimensionBase *dim,
float &min, float &max, DWORD flags) {return 0;}
// Describes the type of dimension of the ith sub-anim
virtual ParamDimension* GetParamDimension(int i) {return defaultDim;}
// This is not used anymore.
virtual LRESULT CALLBACK TrackViewWinProc( HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam ) { return 0;}
// Called when the user clicks on the icon of a subAnim in the track view.
virtual BOOL SelectSubAnim(int subNum) {return FALSE;}
// Add/delete note tracks
CoreExport void AddNoteTrack(NoteTrack *note);
CoreExport void DeleteNoteTrack(NoteTrack *note,BOOL delNote=TRUE); // If delNote is FALSE the note track will be removed from the anim but not deleted.
CoreExport BOOL HasNoteTracks();
CoreExport int NumNoteTracks();
CoreExport NoteTrack *GetNoteTrack(int i);
// Enumerate auxiliary files -- see ref.h for default implementation
virtual void EnumAuxFiles(NameEnumCallback& nameEnum, DWORD flags = FILE_ENUM_ALL) {}
// Free all bitmaps in the Animatable: don't recurse
virtual void FreeAllBitmaps() {}
// A master controller should implement this method to give the
// MAX a list of nodes that are part of the system.
virtual void GetSystemNodes(INodeTab &nodes) {}
// If an object is a sub-class of a particular class, it will have a
// different ClassID() because it is a different class. This method
// allows an object to indicate that it is a sub-class of a particluar
// class and therefore can be treated as one.
// For example, a class could be derived from TriObject. This derived
// class would have a different ClassID() then TriObject's class ID
// however it still can be treated (cast) as a TriObject because it
// is derived from TriObject.
// Note the default implelementation: a class is considered to also
// be a subclass of itself.
virtual BOOL IsSubClassOf(Class_ID classID) {return classID==ClassID();}
// Access app data chunks
CoreExport void AddAppDataChunk(Class_ID cid, SClass_ID sid, DWORD sbid, DWORD len, void *d);
CoreExport AppDataChunk *GetAppDataChunk(Class_ID cid, SClass_ID sid, DWORD sbid);
CoreExport BOOL RemoveAppDataChunk(Class_ID cid, SClass_ID sid, DWORD sbid);
CoreExport void ClearAllAppData();
CoreExport virtual void MouseCycleCompleted(TimeValue t);
CoreExport virtual void MouseCycleStarted(TimeValue t);
};
//
// Callback for EnumAnimTree:
//
// Scope values:
#define SCOPE_DOCLOSED 1 // do "closed" animatables.
#define SCOPE_SUBANIM 2 // do the sub anims
#define SCOPE_CHILDREN 4 // do the node children
#define SCOPE_OPEN (SCOPE_SUBANIM|SCOPE_CHILDREN) // do all open animatables
#define SCOPE_ALL (SCOPE_OPEN|SCOPE_DOCLOSED) // do all animatables
// Return values for AnimEnum procs
#define ANIM_ENUM_PROCEED 1
#define ANIM_ENUM_STOP 2
#define ANIM_ENUM_ABORT 3
class AnimEnum {
protected:
int depth;
int scope;
DWORD tv;
public:
AnimEnum(int s = SCOPE_OPEN, int deep = 0, DWORD tv=0xffffffff)
{scope = s; depth = deep; this->tv = tv;}
void SetScope(int s) { scope = s; }
int Scope() { return scope; }
void IncDepth() { depth++; }
void DecDepth() { depth--; }
int Depth() { return depth; }
DWORD TVBits() {return tv;}
virtual int proc(Animatable *anim, Animatable *client, int subNum)=0;
};
// A usefule enumeration
class ClearAnimFlagEnumProc : public AnimEnum {
DWORD flag;
public:
ClearAnimFlagEnumProc(DWORD f) {flag=f;}
int proc(Animatable *anim, Animatable *client, int subNum) {
anim->ClearAFlag(flag);
return ANIM_ENUM_PROCEED;
}
};
//
// The is used by the two functions GetSubObjectCenters() and
// GetSubObjectTMs() found in the classes BaseObject and Control.
//
class SubObjAxisCallback {
public:
virtual void Center(Point3 c,int id)=0;
virtual void TM(Matrix3 tm,int id)=0;
virtual int Type()=0;
};
// Values returned by Type();
#define SO_CENTER_SELECTION 1
#define SO_CENTER_PIVOT 2
// --- AppData ---------------------------------------------
// An individual app data chunk
class AppDataChunk {
public:
// Note that data pointer should be allocated with standard malloc
// since it will be freed in the destructor.
AppDataChunk(Class_ID cid, SClass_ID sid, DWORD sbid, DWORD len, void *d)
{classID=cid; superClassID=sid; subID=sbid; length=len; data=d;}
AppDataChunk() {length=0;data=NULL;}
~AppDataChunk() {
if (data) free(data);
}
// The super class and class IDs of the object that
// is the owner of this chunk.
Class_ID classID;
SClass_ID superClassID;
// An extra ID that lets the owner identify its sub chunks.
DWORD subID;
// The chunk data itself
DWORD length;
void *data;
// IO
CoreExport IOResult Load(ILoad *iload);
CoreExport IOResult Save(ISave *isave);
};
// This list is maintained by the systems. Plug-ins need not concern themselves with it.
class AnimAppData : public AnimProperty {
public:
Tab<AppDataChunk*> chunks;
CRITICAL_SECTION csect;
AppDataChunk *lastSearch;
DWORD ID() {return PROPID_APPDATA;}
CoreExport ~AnimAppData();
CoreExport AnimAppData();
CoreExport AppDataChunk *FindChunk(Class_ID cid, SClass_ID sid, DWORD sbid);
void AddChunk(AppDataChunk *newChunk) {chunks.Append(1,&newChunk);}
CoreExport BOOL RemoveChunk(Class_ID cid, SClass_ID sid, DWORD sbid);
CoreExport IOResult Load(ILoad *iload);
CoreExport IOResult Save(ISave *isave);
};
CoreExport void SetLockFailureLevel(int level);
CoreExport int GetLockFailureLevel();
class Interface;
CoreExport Interface *GetCOREInterface();
// This API allows plug-in to query various system settings.
CoreExport int GetSystemSetting(int id);
// Values to pass to GetSystemSetting():
// Are editable meshes enabled?
#define SYSSET_ENABLE_EDITABLEMESH 1
// When GetSystemSetting is called with this the undo buffer is
// cleared. GetSystemSetting will return 0.
// Note that this will only work with version 1.1 of MAX or later.
#define SYSSET_CLEAR_UNDO 2
// Are keyboard accelerators enabled for the editable mesh.
#define SYSSET_EDITABLEMESH_ENABLE_KEYBOARD_ACCEL 3
// Is the edit meh modifier enabled?
#define SYSSET_ENABLE_EDITMESHMOD 4
// Returns the state of the VERSION_3DSMAX #define from PLUGAPI.H
// when the running version of MAX was compiled.
CoreExport DWORD Get3DSMAXVersion();
// Special access to the MAX INI file for motion capture
#define MCAP_INI_CHANNEL 1
#define MCAP_INI_PRESET 2
#define MCAP_INI_STOP 3
#define MCAP_INI_PLAY 4
#define MCAP_INI_RECORD 5
#define MCAP_INI_SSENABLE 6
CoreExport int GetMotionCaptureINISetting(int ID);
CoreExport void SetMotionCaptureINISetting(int ID, int val);
#endif // _ANIMTBL_H_
@@ -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
@@ -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
@@ -0,0 +1,20 @@
/**********************************************************************
*<
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__ ) )
extern int UtilExport assert1( /*char *expr,*/ int line, char *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__
@@ -0,0 +1,72 @@
/**********************************************************************
*<
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>
// 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 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 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();
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
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,5 @@
#ifndef _BMMLIB_H_
#define _BMMLIB_H_
#define BMMExport __declspec( dllimport )
#include "bitmap.h"
#endif
@@ -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 min(left,right); }
int y() { return min(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
@@ -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
@@ -0,0 +1,43 @@
#ifndef _BUILD_VER_
#define _BUILD_VER_
// 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
#if !defined(EDU_VERSION) && !defined(STUDENT_VER) && !defined(DESIGN_VER) && !defined(BETA_VERSION)
#define ORDINARY_VER
#endif
#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_
@@ -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_
@@ -0,0 +1,52 @@
/**********************************************************************
*<
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 9
// 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
// 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 TM_CHANNEL (1<<9) // Object transform (may be modified by modifiers)
#define GLOBMTL_CHANNEL (1<<10) // 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)
#define ALL_CHANNELS (OBJ_CHANNELS|TM_CHANNEL|GLOBMTL_CHANNEL)
#endif // __CHANNEL__H
@@ -0,0 +1,151 @@
//-----------------------------------------------------------------------------
// -------------------
// 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 void SaveMaxFile (TCHAR *name) = 0;
virtual int ArchiveToFile (const TCHAR *fname) = 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 ArchiveMaps ( TCHAR *maxfile, TCHAR *zipfile );
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 ------------------------------------------------------------
@@ -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
@@ -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
@@ -0,0 +1,843 @@
/**********************************************************************
*<
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 ){}
};
// 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) { }
};
//----------------------------------------------------------------//
//
// 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* CreateInterpFloat();
CoreExport Control* CreateInterpPosition();
CoreExport Control* CreateInterpPoint3();
CoreExport Control* CreateInterpRotation();
CoreExport Control* CreateInterpScale();
CoreExport Control* CreatePRSControl();
CoreExport Control* CreateLookatControl();
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__
@@ -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
@@ -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__
@@ -0,0 +1,691 @@
/**********************************************************************
*<
FILE: custcont.h
DESCRIPTION: Custom Controls for Jaguar
CREATED BY: Rolf Berteig
HISTORY: created 17 November, 1994
*> Copyright (c) 1994, All Rights Reserved.
**********************************************************************/
#ifndef __CUSTCONT__
#define __CUSTCONT__
#include "winutil.h"
void CoreExport InitCustomControls( HINSTANCE hInst );
// Values returned by DADMgr::SlotOwner()
#define OWNER_MEDIT_SAMPLE 0
#define OWNER_NODE 1
#define OWNER_MTL_TEX 2 // button in mtl or texture
#define OWNER_SCENE 3 // button in light, modifier, atmospheric, etc
#define OWNER_BROWSE_NEW 4
#define OWNER_BROWSE_LIB 5
#define OWNER_BROWSE_MEDIT 6
#define OWNER_BROWSE_SCENE 7
class ReferenceTarget;
class DADMgr {
public:
// Called on the source to see what if anything can be dragged from this x,y
// returns 0 if can't drag anything from this point
virtual SClass_ID GetDragType(HWND hwnd, POINT p)=0;
// Return TRUE if creating instance witb "new", rather than returning
// a pointer to an existing entity.
// If GetInstance creates a new instance every time it is called, then IsNew should
// return TRUE. This prevents GetInstance from being called repeatedly as the
// drag progresses.
virtual BOOL IsNew(HWND hwnd, POINT p, SClass_ID type) { return FALSE; }
// called on potential target to see if can drop type at this x,y
virtual BOOL OkToDrop(ReferenceTarget *dropThis, HWND hfrom, HWND hto, POINT p, SClass_ID type, BOOL isNew = FALSE)=0;
// called on potential target to allow it to substitute custom cursors. (optional)
virtual HCURSOR DropCursor(ReferenceTarget *dropThis, HWND hfrom, HWND hto, POINT p, SClass_ID type, BOOL isNew = FALSE){ return NULL;}
// Return one of the OWNER_ values above
virtual int SlotOwner() { return OWNER_MTL_TEX; }
// This should return a pointer to the drag source. HWND is the window the mouse
// down occured in, and p is the position in that window. Type tells the expected
// type of object.
virtual ReferenceTarget *GetInstance(HWND hwnd, POINT p, SClass_ID type)=0;
// This routine is called on the target with the pointer returned by the source's GetInstance,
// or possibly a clone of it as the dropThis. hwnd is where the mouse was released
// for the drop, p is the position within hwnd, and type is the type of object
// being dropped.
virtual void Drop(ReferenceTarget *dropThis, HWND hwnd, POINT p, SClass_ID type)=0;
// This is called when the source and target WINDOW are the same
virtual void SameWinDragAndDrop(HWND h1, POINT p1, POINT p2) {}
// This lets the manager know whether to call LocalDragAndDrop when the
// same DADMgr handles both source and target windows.
virtual BOOL LetMeHandleLocalDAD() { return 0; }
// This is called if the same DADMgr is handling both the source and target windows,
// if LetMeHandleLocalDAD() returned true.
virtual void LocalDragAndDrop(HWND h1, HWND h2, POINT p1, POINT p2){}
// If this returns true, the CustButtons that have this DADManager
// will automatically make their text a tooltip
virtual BOOL AutoTooltip(){ return FALSE; }
// If a drag source doesn't want any references being made to the instance returned,
// then this method should return true: it will force a copy to be made.
virtual BOOL CopyOnly(HWND hwnd, POINT p, SClass_ID type) { return FALSE; }
// Normally the mouse down and mouse up messages are not sent to the
// source window when doing DAD, but if you need them, return TRUE
virtual BOOL AlwaysSendButtonMsgsOnDrop(){ return FALSE; }
// Generic expansion function
virtual int Execute(int cmd, ULONG arg1=0, ULONG arg2=0, ULONG arg3=0) { return 0; }
};
class ICustomControl {
public:
virtual HWND GetHwnd()=0;
virtual void Enable(BOOL onOff=TRUE)=0;
virtual void Disable()=0;
virtual BOOL IsEnabled()=0;
// this second enable function is used to disable and enable custom controls
// when the associated parameter has a non-keyframable parameter.
// The effective enable state is the AND of these two enable bits.
virtual void Enable2(BOOL onOff=TRUE)=0;
// Generic expansion function
virtual int Execute(int cmd, ULONG arg1=0, ULONG arg2=0, ULONG arg3=0) { return 0; }
};
// This is a bitmap brush where the bitmap is a gray and white checker board.
HBRUSH CoreExport GetLTGrayBrush();
HBRUSH CoreExport GetDKGrayBrush();
// Makes the grid pattern brushes solid for screen shots
void CoreExport MakeBrushesSolid(BOOL onOff);
// The standard font...
HFONT CoreExport GetFixedFont();
// The hand cursor used for panning.
HCURSOR CoreExport GetPanCursor();
//---------------------------------------------------------------------------//
// Spinner control
#define SPINNERWINDOWCLASS _T("SpinnerControl")
// LOWORD(wParam) = ctrlID,
// HIWORD(wParam) = TRUE if user is dragging the spinner interactively.
// lParam = pointer to ISpinnerControl
#define CC_SPINNER_CHANGE WM_USER + 600
// LOWORD(wParam) = ctrlID,
// lParam = pointer to ISpinnerControl
#define CC_SPINNER_BUTTONDOWN WM_USER + 601
// LOWORD(wParam) = ctrlID,
// HIWORD(wParam) = FALSE if user cancelled - TRUE otherwise
// lParam = pointer to ISpinnerControl
#define CC_SPINNER_BUTTONUP WM_USER + 602
enum EditSpinnerType {
EDITTYPE_INT,
EDITTYPE_FLOAT,
EDITTYPE_UNIVERSE,
EDITTYPE_POS_INT,
EDITTYPE_POS_FLOAT,
EDITTYPE_POS_UNIVERSE,
EDITTYPE_TIME
};
class ISpinnerControl : public ICustomControl {
public:
virtual float GetFVal()=0;
virtual int GetIVal()=0;
virtual void SetAutoScale(BOOL on=TRUE)=0;
virtual void SetScale( float s )=0;
virtual void SetValue( float v, int notify )=0;
virtual void SetValue( int v, int notify )=0;
virtual void SetLimits( int min, int max, int limitCurValue = TRUE )=0;
virtual void SetLimits( float min, float max, int limitCurValue = TRUE )=0;
virtual void LinkToEdit( HWND hEdit, EditSpinnerType type )=0;
virtual void SetIndeterminate(BOOL i=TRUE)=0;
virtual BOOL IsIndeterminate()=0;
virtual void SetResetValue(float v)=0;
virtual void SetResetValue(int v)=0;
virtual void SetKeyBrackets(BOOL onOff)=0;
};
ISpinnerControl CoreExport *GetISpinner( HWND hCtrl );
void CoreExport ReleaseISpinner( ISpinnerControl *isc );
CoreExport void SetSnapSpinner(BOOL b);
CoreExport BOOL GetSnapSpinner();
CoreExport void SetSnapSpinValue(float f);
CoreExport float GetSnapSpinValue();
CoreExport void SetSpinnerPrecision(int p);
CoreExport int GetSpinnerPrecision();
//---------------------------------------------------------------------------//
// Rollup window control
#define ROLLUPWINDOWCLASS _T("RollupWindow")
typedef void *RollupState;
// Flags passed to AppendRollup
#define APPENDROLL_CLOSED (1<<0) // Starts the page out rolled up.
#define DONTAUTOCLOSE (1<<1) // Dont close this rollup when doing Close All
class IRollupWindow : public ICustomControl {
public:
// Shows or hides all
virtual void Show()=0;
virtual void Hide()=0;
// Shows or hides by index
virtual void Show(int index)=0;
virtual void Hide(int index)=0;
virtual HWND GetPanelDlg(int index)=0;
virtual int GetPanelIndex(HWND hWnd)=0;
virtual void SetPanelTitle(int index,TCHAR *title)=0;
// returns index of new panel
virtual int AppendRollup( HINSTANCE hInst, TCHAR *dlgTemplate,
DLGPROC dlgProc, TCHAR *title, LPARAM param=0,DWORD flags=0 )=0;
virtual int ReplaceRollup( int index, HINSTANCE hInst, TCHAR *dlgTemplate,
DLGPROC dlgProc, TCHAR *title, LPARAM param=0,DWORD flags=0 )=0;
virtual void DeleteRollup( int index, int count )=0;
virtual void SetPageDlgHeight(int index,int height)=0;
virtual void SaveState( RollupState *hState )=0;
virtual void RestoreState( RollupState *hState )=0;
// Passing WM_LBUTTONDOWN, WM_MOUSEMOVE, and WM_LBUTTONUP to
// this function allows scrolling with unused areas in the dialog.
virtual void DlgMouseMessage( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )=0;
virtual int GetNumPanels()=0;
virtual BOOL IsPanelOpen(int index) = 0;
virtual void SetPanelOpen(int index, BOOL isOpen) =0;
virtual int GetScrollPos()=0;
virtual void SetScrollPos(int spos)=0;
};
// This function returns TRUE if a particular rollup panel is open given
// a handle to the dialog window in the panel.
CoreExport BOOL IsRollupPanelOpen(HWND hDlg);
IRollupWindow CoreExport *GetIRollup( HWND hCtrl );
void CoreExport ReleaseIRollup( IRollupWindow *irw );
//----------------------------------------------------------------------------//
// CustEdit control
#define CUSTEDITWINDOWCLASS _T("CustEdit")
// Sent when the user hits the enter key in an edit control.
// wParam = cust edit ID
// lParam = HWND of cust edit control.
#define WM_CUSTEDIT_ENTER (WM_USER+685)
class ICustEdit : public ICustomControl {
public:
virtual void GetText( TCHAR *text, int ct )=0;
virtual void SetText( TCHAR *text )=0;
virtual void SetText( int i )=0;
virtual void SetText( float f, int precision=3 )=0;
virtual int GetInt(BOOL *valid=NULL)=0;
virtual float GetFloat(BOOL *valid=NULL)=0;
virtual void SetLeading(int lead)=0;
virtual void WantReturn(BOOL yesNo)=0;
virtual BOOL GotReturn()=0; // call this on receipt of EN_CHANGE
virtual void GiveFocus()=0;
virtual BOOL HasFocus()=0;
virtual void WantDlgNextCtl(BOOL yesNo)=0;
virtual void SetNotifyOnKillFocus(BOOL onOff)=0;
};
ICustEdit CoreExport *GetICustEdit( HWND hCtrl );
void CoreExport ReleaseICustEdit( ICustEdit *ice );
//----------------------------------------------------------------------------//
// CustButton control
#define CUSTBUTTONWINDOWCLASS _T("CustButton")
#define CC_COMMAND WM_USER + 700
// send these with CC_COMMAND: wParam = CC_???
#define CC_CMD_SET_TYPE 23 // lParam = CBT_PUSH, CBT_CHECK
#define CC_CMD_SET_STATE 24 // lParam = 0/1 for popped/pushed
#define CC_CMD_HILITE_COLOR 25 // lParam = RGB packed int
#define RED_WASH RGB(255,192,192)
#define GREEN_WASH RGB(192,255,192)
#define BLUE_WASH RGB(192,192,255)
enum CustButType { CBT_PUSH, CBT_CHECK };
// If the button is set to notify on button down, it will send a WM_COMMAND
// with this notify code when the user touches the button.
#define BN_BUTTONDOWN 8173
// It will also send this message when the mouse is released regardless
// if the mouse is released inside the toolbutton rectangle
#define BN_BUTTONUP 8174
// If a button is set to notify on right clicks, it will send a WM_COMMAND
// with this notify code when the user right clicks on the button.
#define BN_RIGHTCLICK 8183
// When the user chooses a new fly-off item, this notify code will be sent.
#define BN_FLYOFF 8187
// When the user presses a button a WM_MENUSELECT message is sent so that
// the client can display a status prompt describing the function of
// the tool. The fuFlags parameter is set to this value:
#define CMF_TOOLBUTTON 9274
class FlyOffData {
public:
int iOutEn;
int iInEn;
int iOutDis;
int iInDis;
};
// Directions the fly off will go.
#define FLY_VARIABLE 1
#define FLY_UP 2
#define FLY_DOWN 3
#define FLY_HVARIABLE 4 // horizontal variable
#define FLY_LEFT 5
#define FLY_RIGHT 6
class ICustButton : public ICustomControl {
public:
virtual void GetText( TCHAR *text, int ct )=0;
virtual void SetText( TCHAR *text )=0;
virtual void SetImage( HIMAGELIST hImage,
int iOutEn, int iInEn, int iOutDis, int iInDis, int w, int h )=0;
virtual void SetType( CustButType type )=0;
virtual void SetFlyOff(int count,FlyOffData *data,int timeOut,int init,int dir=FLY_VARIABLE, int columns=1)=0;
virtual void SetCurFlyOff(int f,BOOL notify=FALSE)=0;
virtual int GetCurFlyOff()=0;
virtual BOOL IsChecked()=0;
virtual void SetCheck( BOOL checked )=0;
virtual void SetCheckHighlight( BOOL highlight )=0;
virtual void SetButtonDownNotify(BOOL notify)=0;
virtual void SetRightClickNotify(BOOL notify)=0;
virtual void SetHighlightColor(COLORREF clr)=0;
virtual void SetTooltip(BOOL onOff, LPSTR text)=0;
virtual void SetDADMgr(DADMgr *dad)=0;
virtual DADMgr *GetDADMgr()=0;
};
ICustButton CoreExport *GetICustButton( HWND hCtrl );
void CoreExport ReleaseICustButton( ICustButton *icb );
//---------------------------------------------------------------------------//
// CustStatus
#define CUSTSTATUSWINDOWCLASS _T("CustStatus")
enum StatusTextFormat {
STATUSTEXT_LEFT,
STATUSTEXT_CENTERED,
STATUSTEXT_RIGHT };
class ICustStatus : public ICustomControl {
public:
virtual void SetText(TCHAR *text)=0;
virtual void SetTextFormat(StatusTextFormat f)=0;
virtual void GetText(TCHAR *text, int ct)=0;
virtual void SetTooltip(BOOL onOff, LPSTR text)=0;
};
ICustStatus CoreExport *GetICustStatus( HWND hCtrl );
void CoreExport ReleaseICustStatus( ICustStatus *ics );
//----------------------------------------------------------------------------//
// CustToolbar control
#define CUSTTOOLBARWINDOWCLASS _T("CustToolbar")
#ifdef _OSNAP
#define VERTTOOLBARWINDOWCLASS _T("VertToolbar")
#endif
// Sent in a WM_COMMAND when the user right clicks in open space
// on a toolbar.
#define TB_RIGHTCLICK 0x2861
enum ToolItemType {
CTB_PUSHBUTTON,
CTB_CHECKBUTTON,
CTB_SEPARATOR,
CTB_STATUS,
CTB_OTHER
#ifdef _OSNAP
, CTB_IMAGE
#endif
};
class ToolItem {
public:
ToolItemType type;
int id;
DWORD helpID;
int w, h;
virtual ~ToolItem() {}
};
class ToolButtonItem : public ToolItem {
public:
int iOutEn, iInEn;
int iOutDis, iInDis;
int iw;
int ih;
ToolButtonItem(ToolItemType t,
int iOE, int iIE, int iOD, int iID,
int iW, int iH, int wd,int ht, int ID, DWORD hID=0)
{
type = t;
iOutEn = iOE; iInEn = iIE; iOutDis = iOD; iInDis = iID;
iw = iW; ih = iH; w = wd; h = ht; id = ID; helpID = hID;
}
};
class ToolSeparatorItem : public ToolItem {
public:
ToolSeparatorItem(int w) {
type = CTB_SEPARATOR;
id = 0;
helpID = 0;
this->w = w;
h = 0;
}
};
class ToolStatusItem : public ToolItem {
public:
BOOL fixed;
ToolStatusItem(int w, int h,BOOL f,int id, DWORD hID=0) {
type = CTB_STATUS;
this->w = w;
this->h = h;
this->id = id;
this->helpID = hID;
fixed = f;
}
};
#define CENTER_TOOL_VERTICALLY 0xffffffff
class ToolOtherItem : public ToolItem {
public:
int y;
DWORD style;
TCHAR *className;
TCHAR *windowText;
ToolOtherItem(TCHAR *cls,int w,int h,int id,DWORD style=WS_CHILD|WS_VISIBLE,
int y=CENTER_TOOL_VERTICALLY,TCHAR *wt=NULL,DWORD hID=0) {
type = CTB_OTHER;
this->y = y;
this->w = w;
this->h = h;
this->id = id;
this->helpID = hID;
this->style = style;
className = cls;
windowText = wt;
}
};
#ifdef _OSNAP //allow image controls on toolbars
class ToolImageItem : public ToolItem {
public:
int y;
int il_index;
ToolImageItem(int w,int h,int k,int id, int y=CENTER_TOOL_VERTICALLY,DWORD hID=0) {
type = CTB_IMAGE;
this->y = y;
this->w = w;
this->h = h;
this->il_index = k;
this->id = id;
this->helpID = hID;
}
};
#endif
class ICustToolbar : public ICustomControl {
public:
virtual void SetImage( HIMAGELIST hImage )=0;
virtual void AddTool( const ToolItem& entry, int pos=-1 )=0;
virtual void DeleteTools( int start, int num=-1 )=0; // num = -1 deletes 'start' through count-1 tools
virtual void SetBottomBorder(BOOL on)=0;
virtual void SetTopBorder(BOOL on)=0;
virtual ICustButton *GetICustButton( int id )=0;
virtual ICustStatus *GetICustStatus( int id )=0;
virtual HWND GetItemHwnd(int id)=0;
virtual int GetNumItems()=0;
virtual int GetItemID(int index)=0;
virtual int FindItem(int id)=0;
virtual void DeleteItemByID(int id)=0;
};
ICustToolbar CoreExport *GetICustToolbar( HWND hCtrl );
void CoreExport ReleaseICustToolbar( ICustToolbar *ict );
#ifdef _OSNAP
class IVertToolbar : public ICustomControl {
public:
virtual void SetImage( HIMAGELIST hImage )=0;
virtual void AddTool( const ToolItem& entry, int pos=-1 )=0;
virtual void DeleteTools( int start, int num=-1 )=0; // num = -1 deletes 'start' through count-1 tools
virtual void SetBottomBorder(BOOL on)=0;
virtual void SetTopBorder(BOOL on)=0;
virtual ICustButton *GetICustButton( int id )=0;
virtual ICustStatus *GetICustStatus( int id )=0;
virtual HWND GetItemHwnd(int id)=0;
virtual void Enable(BOOL onOff=TRUE){};
};
IVertToolbar CoreExport *GetIVertToolbar( HWND hCtrl );
void CoreExport ReleaseIVertToolbar( IVertToolbar *ict );
#endif
//---------------------------------------------------------------------------//
// CustImage
#define CUSTIMAGEWINDOWCLASS _T("CustImage")
class ICustImage : public ICustomControl {
public:
virtual void SetImage( HIMAGELIST hImage,int index, int w, int h )=0;
};
ICustImage CoreExport *GetICustImage( HWND hCtrl );
void CoreExport ReleaseICustImage( ICustImage *ici );
#ifdef _OSNAP
//---------------------------------------------------------------------------//
// CustImage 2D Version for displaying osnap icons
#define CUSTIMAGEWINDOWCLASS2D _T("CustImage2D")
class ICustImage2D : public ICustomControl {
public:
virtual void SetImage( HIMAGELIST hImage,int index, int w, int h )=0;
};
//ICustImage CoreExport *GetICustImage2D( HWND hCtrl );
//void CoreExport ReleaseICustImage2D( ICustImage2D *ici );
#endif
//------------------------------------------------------------------------
// Off Screen Buffer
class IOffScreenBuf {
public:
virtual HDC GetDC()=0;
virtual void Erase(Rect *rct=NULL)=0;
virtual void Blit(Rect *rct=NULL)=0;
virtual void Resize()=0;
virtual void SetBkColor(COLORREF color)=0;
virtual COLORREF GetBkColor()=0;
};
CoreExport IOffScreenBuf *CreateIOffScreenBuf(HWND hWnd);
CoreExport void DestroyIOffScreenBuf(IOffScreenBuf *iBuf);
//------------------------------------------------------------------------
// Color swatch control
// Puts up the ColorPicker when user right clicks on it.
//
// This message is sent as the color is being adjusted in the
// ColorPicker.
// LOWORD(wParam) = ctrlID,
// HIWORD(wParam) = 1 if button UP
// = 0 if mouse drag.
// lParam = pointer to ColorSwatchControl
#define CC_COLOR_CHANGE WM_USER + 603
// LOWORD(wParam) = ctrlID,
// lParam = pointer to ColorSwatchControl
#define CC_COLOR_BUTTONDOWN WM_USER + 606
// LOWORD(wParam) = ctrlID,
// HIWORD(wParam) = FALSE if user cancelled - TRUE otherwise
// lParam = pointer to ColorSwatchControl
#define CC_COLOR_BUTTONUP WM_USER + 607
// This message is sent if the color has been clicked on, before
// bringing up the color picker.
// LOWORD(wParam) = ctrlID,
// HIWORD(wParam) = 0
// lParam = pointer to ColorSwatchControl
#define CC_COLOR_SEL WM_USER + 604
// This message is sent if another color swatch has been dragged and dropped
// on this swatch.
// LOWORD(wParam) = toCtrlID,
// HIWORD(wParam) = 0
// lParam = pointer to ColorSwatchControl
#define CC_COLOR_DROP WM_USER + 605
#define COLORSWATCHWINDOWCLASS _T("ColorSwatch")
class IColorSwatch: public ICustomControl {
public:
// sets only the varying color of the color picker if showing
virtual COLORREF SetColor(COLORREF c, int notify=FALSE)=0; // returns old color
// sets both the varying color and the "reset"color of the color picker
virtual COLORREF InitColor(COLORREF c, int notify=FALSE)=0; // returns old color
virtual COLORREF GetColor()=0;
virtual void ForceDitherMode(BOOL onOff)=0;
virtual void SetModal()=0;
virtual void Activate(int onOff)=0;
virtual void EditThis(BOOL startNew=TRUE)=0;
virtual void SetKeyBrackets(BOOL onOff)=0;
};
IColorSwatch CoreExport *GetIColorSwatch( HWND hCtrl, COLORREF col, TCHAR *name);
IColorSwatch CoreExport *GetIColorSwatch(HWND hCtrl);
void CoreExport ReleaseIColorSwatch( IColorSwatch *ics );
//---------------------------------------------------------------------------//
// DragAndDrop Window
#define DADWINDOWCLASS _T("DragDropWindow")
typedef LRESULT CALLBACK WindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
class IDADWindow : public ICustomControl {
public:
// Installing this makes it do drag and drop.
virtual void SetDADMgr( DADMgr *dadMgr)=0;
virtual DADMgr *GetDADMgr()=0;
// Install Window proc called to do all the normal things after
// drag/and/drop processing is done.
virtual void SetWindowProc( WindowProc *proc)=0;
};
IDADWindow CoreExport *GetIDADWindow( HWND hWnd);
void CoreExport ReleaseIDADWindow( IDADWindow *idw );
//------------------------------------------------------------------------
// Window thumb tack
// This function installs a thumb tack in the title bar of a window
// which allows the user to make it an always on top window.
// NOTE: The window class for the window should have 4 extra bytes in
// the window structure for SetWindowLong().
CoreExport void InstallThumbTack(HWND hwnd);
CoreExport void RemoveThumbTack(HWND hwnd);
// Handy routines for setting up Spinners.
CoreExport ISpinnerControl *SetupIntSpinner(HWND hwnd, int idSpin, int idEdit, int min, int max, int val);
CoreExport ISpinnerControl *SetupFloatSpinner(HWND hwnd, int idSpin, int idEdit, float min, float max, float val, float scale = 0.1f);
CoreExport ISpinnerControl *SetupUniverseSpinner(HWND hwnd, int idSpin, int idEdit, float min, float max, float val, float scale = 0.1f);
// Controls whether or not spinners send notifications while the user adjusts them with the mouse
CoreExport void SetSpinDragNotify(BOOL onOff);
CoreExport BOOL GetSpinDragNotify();
//---------------------------------------------------------------------------
//
CoreExport void DisableAccelerators();
CoreExport void EnableAccelerators();
CoreExport BOOL AcceleratorsEnabled();
CoreExport void SetSaveRequired(int b=TRUE);
CoreExport BOOL GetSaveRequired();
#endif // __CUSTCONT__
@@ -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
@@ -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
@@ -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
@@ -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
@@ -0,0 +1,37 @@
/*******************************************************************
*
* 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
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);
#endif // __EULER__
@@ -0,0 +1,38 @@
/*********************************************************************
*<
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;
public:
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__
@@ -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__
@@ -0,0 +1,10 @@
#ifdef DllExport
#undef DllExport
#endif
#ifdef IMPORTING
#define DllExport __declspec( dllimport )
#else
#define DllExport __declspec( dllexport )
#endif
@@ -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_
@@ -0,0 +1,9 @@
#ifndef _EXPRLIB_H_
#define _EXPRLIB_H_
#define IMPORTING
#include "expr.h"
#undef IMPORTING
#endif // _EXPRLIB_H_
@@ -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_
@@ -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 -----------------------------------------------------------
@@ -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;
};
@@ -0,0 +1,8 @@
#ifndef __INFILTERS__
#ifndef _FLTLIB_H_
#define _FLTLIB_H_
#define FLTExport __declspec( dllimport )
#include "Filters.h"
#undef FLTExport
#endif
#endif
@@ -0,0 +1,229 @@
/*********************************************************************
*<
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
// 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
// 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__
@@ -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
@@ -0,0 +1,193 @@
//-----------------------------------------------------------------------------
// ------------------
// 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)
//-----------------------------------------------------------------------------
//-- 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. Simple 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 );
#include "tcp.h"
#endif
//-- EOF: gcomm.h -------------------------------------------------------------
@@ -0,0 +1,5 @@
#ifndef _GCOMMLIB_
#define _GCOMMLIB_
#define GCOMMEXPORT __declspec( dllimport )
#include "gcomm.h"
#endif
@@ -0,0 +1,50 @@
/**********************************************************************
*<
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
class GenCamera: public CameraObject {
public:
virtual GenCamera *NewCamera(int type)=0;
virtual void SetFOV(TimeValue t, float f)=0;
virtual float GetFOV(TimeValue t, Interval& valid = Interval(0,0))=0;
virtual void SetTDist(TimeValue t, float f)=0;
virtual float GetTDist(TimeValue t, Interval& valid = Interval(0,0))=0;
virtual void SetConeState(int s)=0;
virtual int GetConeState()=0;
virtual void SetHorzLineState(int s)=0;
virtual int GetHorzLineState()=0;
virtual int GetManualClip()=0;
virtual void SetManualClip(int onOff)=0;
virtual float GetClipDist(TimeValue t, int which, Interval &valid = Interval(0,0))=0;
virtual void SetClipDist(TimeValue t, int which, float f)=0;
virtual void SetEnvRange(TimeValue time, int which, float f)=0;
virtual float GetEnvRange(TimeValue t, int which, Interval& valid = Interval(0,0))=0;
virtual void SetEnvDisplay(BOOL b, int notify=TRUE)=0;
virtual BOOL GetEnvDisplay(void)=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;
};
#endif // __GENCAM__H__
@@ -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() { return root.children; } // 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
@@ -0,0 +1,120 @@
/**********************************************************************
*<
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
// 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 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 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;
virtual int GetAbsMapBias()=0;
virtual void SetAbsMapBias(int a)=0;
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 SetDiffuseSoft(TimeValue time, float f) {}
virtual float GetDiffuseSoft(TimeValue t, Interval& valid = Interval(0,0)) { return 0.0f; }
};
#endif // __GENLIGHT_H__
@@ -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__
@@ -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_
@@ -0,0 +1,9 @@
#ifndef _GEOMLIB_H_
#define _GEOMLIB_H_
#define IMPORTING
#include "geom.h"
#undef IMPORTING
#endif // _GEOMLIB_H_
@@ -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
@@ -0,0 +1,482 @@
/**********************************************************************
*<
FILE: gfx.h
DESCRIPTION: main graphics system include file.
CREATED BY: Don Brittain
HISTORY:
*> Copyright (c) 1994, All Rights Reserved.
**********************************************************************/
#if !defined(_GFX_H_)
#define _GFX_H_
#include "geomlib.h"
#include "export.h"
#include "mtl.h"
#define WM_SHUTDOWN (WM_USER+2001)
#define WM_INIT_COMPLETE (WM_USER+2002)
#define GW_MAX_FILE_LEN 128
#define GW_MAX_CAPTION_LEN 128
#define GW_MAX_VERTS 32
#define GFX_MAX_STRIP 100
typedef BOOL (*HitFunc)(int, int, void *);
// Rendering modes
#define GW_NO_ATTS 0x0000
#define GW_WIREFRAME 0x0001
#define GW_ILLUM 0x0002
#define GW_FLAT 0x0004
#define GW_SPECULAR 0x0008
#define GW_TEXTURE 0x0010
#define GW_Z_BUFFER 0x0020
#define GW_PERSP_CORRECT 0x0040
#define GW_POLY_EDGES 0x0080
#define GW_BACKCULL 0x0100
#define GW_TWO_SIDED 0x0200
#define GW_COLOR_VERTS 0x0400
#define GW_SHADE_CVERTS 0x0800
#define GW_PICK 0x1000
#define GW_BOX_MODE 0x2000
#define GW_ALL_EDGES 0x4000
#define GW_VERT_TICKS 0x8000
#define GW_LIGHTING (GW_ILLUM | GW_SPECULAR)
// spotlight shapes
#define GW_SHAPE_RECT 0
#define GW_SHAPE_CIRCULAR 1
// texture tiling
#define GW_TEX_NO_TILING 0
#define GW_TEX_REPEAT 1
#define GW_TEX_MIRROR 2
// View volume clip flags
#define GW_LEFT_PLANE 0x0100
#define GW_RIGHT_PLANE 0x0200
#define GW_BOTTOM_PLANE 0x0400
#define GW_TOP_PLANE 0x0800
#define GW_FRONT_PLANE 0x1000
#define GW_BACK_PLANE 0x2000
#define GW_PLANE_MASK 0x3f00
// edge styles
#define GW_EDGE_SKIP 0
#define GW_EDGE_VIS 1
#define GW_EDGE_INVIS 2
// buffer types (for dual-plane stuff)
#define BUF_F_BUFFER 0
#define BUF_Z_BUFFER 1
// support method return values
#define GW_DOES_SUPPORT TRUE
#define GW_DOES_NOT_SUPPORT FALSE
// support queries
#define GW_SPT_TXT_CORRECT 0 // allow persp correction to be toggled?
#define GW_SPT_GEOM_ACCEL 1 // do 3D xforms, clipping, lighting thru driver?
#define GW_SPT_TRI_STRIPS 2 // send down strips instead of individual triangles?
#define GW_SPT_DUAL_PLANES 3 // allow dual planes to be used?
#define GW_SPT_SWAP_MODEL 4 // update viewports with complete redraw on WM_PAINT?
#define GW_SPT_INCR_UPDATE 5 // redraw only damaged areas on object move?
#define GW_SPT_1_PASS_DECAL 6 // do decaling with only one pass?
#define GW_SPT_DRIVER_CONFIG 7 // allow driver config dialog box?
#define GW_SPT_TEXTURED_BKG 8 // is viewport background a texture?
#define GW_SPT_VIRTUAL_VPTS 9 // are viewports bigger than the window allowed?
#define GW_SPT_PAINT_DOES_BLIT 10 // does WM_PAINT cause a backbuffer blit?
#define GW_SPT_WIREFRAME_STRIPS 11 // if true, wireframe objects are sent as tristrips
#define GW_SPT_ORG_UPPER_LEFT 12 // true if device origin is at upper left, false o/w
#define GW_SPT_TOTAL 13 // always the max number of spt queries
// display state of the graphics window
#define GW_DISPLAY_MAXIMIZED 1
#define GW_DISPLAY_WINDOWED 2
#define GW_DISPLAY_INVISIBLE 3
// light types
enum LightType { OMNI_LGT, SPOT_LGT, DIRECT_LGT, AMBIENT_LGT };
// Light attenuation types -- not fully implemented
#define GW_ATTEN_NONE 0x0000
#define GW_ATTEN_START 0x0001
#define GW_ATTEN_END 0x0002
#define GW_ATTEN_LINEAR 0x0010
#define GW_ATTEN_QUAD 0x0020
// General 3D light structure
class Light {
public:
DllExport Light();
LightType type;
Point3 color;
int attenType;
float attenStart;
float attenEnd;
float intensity;
float hotSpotAngle;
float fallOffAngle;
int shape;
float aspect;
int overshoot;
BOOL affectDiffuse;
BOOL affectSpecular;
};
enum CameraType { PERSP_CAM, ORTHO_CAM };
// General camera structure
class Camera {
public:
DllExport Camera();
void setPersp(float f, float asp)
{ type = PERSP_CAM; persp.fov = f;
persp.aspect = asp; makeMatrix(); }
void setOrtho(float l, float t, float r, float b)
{ type = ORTHO_CAM; ortho.left = l; ortho.top = t;
ortho.right = r; ortho.bottom = b; makeMatrix(); }
void setClip(float h, float y)
{ hither = h; yon = y; makeMatrix(); }
CameraType getType(void) { return type; }
float getHither(void) { return hither; }
float getYon(void) { return yon; }
DllExport void reset();
void getProj(float mat[4][4])
{ memcpy(mat, proj, 16 * sizeof(float)); }
private:
DllExport void makeMatrix();
float proj[4][4];
CameraType type;
union {
struct {
float fov;
float aspect;
} persp;
struct {
float left;
float right;
float bottom;
float top;
} ortho;
};
float hither;
float yon;
};
const double pi = 3.141592653589793;
const double piOver180 = 3.141592653589793 / 180.0;
// Color types (used by setColor)
enum ColorType { LINE_COLOR, FILL_COLOR, TEXT_COLOR, CLEAR_COLOR };
// Marker types
enum MarkerType { POINT_MRKR, HOLLOW_BOX_MRKR, PLUS_SIGN_MRKR,
ASTERISK_MRKR, X_MRKR, BIG_BOX_MRKR,
CIRCLE_MRKR, TRIANGLE_MRKR, DIAMOND_MRKR,
SM_HOLLOW_BOX_MRKR, SM_CIRCLE_MRKR,
SM_TRIANGLE_MRKR, SM_DIAMOND_MRKR,
};
// Region types (for built-in hit-testing)
#define POINT_RGN 0x0001
#define RECT_RGN 0x0002
#define CIRCLE_RGN 0x0004
#define FENCE_RGN 0x0008
typedef struct tagCIRCLE
{
LONG x;
LONG y;
LONG r;
} CIRCLE;
class HitRegion {
public:
int type;
int crossing;// not used for point
int epsilon; // not used for rect or circle
union {
POINT pt;
RECT rect;
CIRCLE circle;
POINT * pts;
};
};
inline int ABS(const int x) { return (x > 0) ? x : -x; }
typedef void (*GFX_ESCAPE_FN)(void *);
// driver types for getDriver() method
#define GW_DRV_RENDERER 0
#define GW_DRV_DEVICE 1
// for possible future implementation
#define GW_HEIDI 0
#define GW_OPENGL 1
#define GW_DIRECT3D 2
#define GW_HEIDI3D 3
#define GW_NULL 4
#define GW_CUSTOM 5
// graphics window setup structure
class GWinSetup {
public:
DllExport GWinSetup();
TCHAR caption[GW_MAX_CAPTION_LEN];
TCHAR renderer[GW_MAX_FILE_LEN];
TCHAR device[GW_MAX_FILE_LEN];
DWORD winStyle;
POINT size;
POINT place;
int id;
int type;
};
// abstract graphics window class
class GraphicsWindow {
public:
virtual ~GraphicsWindow() {}
virtual void postCreate(int ct, GraphicsWindow **gw) = 0;
virtual void shutdown() = 0;
virtual int getVersion() = 0;
virtual TCHAR * getDriverString(void) = 0;
virtual void config(HWND hWnd) = 0;
virtual int querySupport(int what) = 0;
virtual HWND getHWnd(void) = 0;
virtual void setPos(int x, int y, int w, int h) = 0;
virtual void setDisplayState(int s) = 0;
virtual int getDisplayState() = 0;
virtual int getWinSizeX() = 0;
virtual int getWinSizeY() = 0;
virtual DWORD getWinDepth(void) = 0;
virtual DWORD getHitherCoord(void) = 0;
virtual DWORD getYonCoord(void) = 0;
virtual void getTextExtents(TCHAR *text, SIZE *sp) = 0;
virtual int getMaxStripLength() { return GFX_MAX_STRIP; }
virtual void resetUpdateRect() = 0;
virtual void enlargeUpdateRect(RECT *rp) = 0;
virtual int getUpdateRect(RECT *rp) = 0;
virtual void updateScreen() = 0;
virtual BOOL setBufAccess(int which, int b) = 0;
virtual BOOL getBufAccess(int which) = 0;
virtual BOOL getBufSize(int which, int *size) = 0;
virtual BOOL getBuf(int which, int size, void *buf) = 0;
virtual BOOL setBuf(int which, int size, void *buf, RECT *rp) = 0;
virtual BOOL getDIB(BITMAPINFO *bmi, int *size) = 0;
virtual BOOL setBackgroundDIB(int width, int height, BITMAPINFO *bmi) = 0;
virtual void setBackgroundOffset(int x, int y) = 0;
virtual int getTextureSize(int bkg=FALSE) = 0;
virtual DWORD getTextureHandle(BITMAPINFO *bmi) = 0;
virtual void freeTextureHandle(DWORD handle) = 0;
virtual BOOL setTextureByHandle(DWORD handle) = 0;
virtual BOOL setTextureTiling(int u, int v, int w=GW_TEX_NO_TILING) = 0;
virtual int getTextureTiling(int which) = 0;
virtual void beginFrame() = 0;
virtual void endFrame() = 0;
virtual void setViewport(int x, int y, int w, int h) = 0;
virtual void setVirtualViewportParams(float zoom, float xOffset, float yOffset) = 0;
virtual void setUseVirtualViewport(int onOff) = 0;
virtual void clearScreen(RECT *rp, int useBkg = FALSE) = 0;
virtual void setTransform(const Matrix3 &m) = 0;
virtual void outlinePass(BOOL onOff, float scaleFact = 1.005f) = 0;
virtual void setTexTransform(const Matrix3 &m) = 0;
virtual BOOL getFlipped(void)=0;
virtual void setSkipCount(int c) = 0;
virtual int getSkipCount(void) = 0;
virtual void setViewportLimits(DWORD l) = 0;
virtual DWORD getViewportLimits(void) = 0;
virtual void setRndLimits(DWORD l) = 0;
virtual DWORD getRndLimits(void) = 0;
virtual DWORD getRndMode(void) = 0;
virtual int getMaxLights(void) = 0;
virtual void setLight(int num, const Light *l) = 0;
virtual void setLightExclusion(DWORD exclVec) = 0;
virtual void setCamera(const Camera &c) = 0;
virtual void setCameraMatrix(float mat[4][4], Matrix3 *invTM, int persp, float hither, float yon) = 0;
virtual void getCameraMatrix(float mat[4][4], Matrix3 *invTM, int *persp, float *hither, float *yon) = 0;
virtual void setColor(ColorType t, float r, float g, float b) = 0;
void setColor(ColorType t, Point3 clr) { setColor(t,clr.x,clr.y,clr.z); }
virtual void setMaterial(const Material &m) = 0;
virtual Material *getMaterial(void) = 0;
virtual DWORD hTransPoint(const Point3 *in, IPoint3 *out) = 0;
virtual DWORD wTransPoint(const Point3 *in, IPoint3 *out) = 0;
virtual DWORD transPoint(const Point3 *in, Point3 *out) = 0;
virtual void lightVertex(const Point3 &pos, const Point3 &nor, Point3 &rgb) = 0;
virtual void hText(IPoint3 *xyz, TCHAR *s) = 0;
virtual void hMarker(IPoint3 *xyz, MarkerType type) = 0;
virtual void hPolyline(int ct, IPoint3 *xyz, Point3 *rgb, int closed, int *es) = 0;
void hPolyline(int ct, IPoint3 *xyz, Point3 *rgb, Point3 *uvw, int closed, int *es)
{ hPolyline(ct, xyz, rgb, closed, es); }
virtual void hPolygon(int ct, IPoint3 *xyz, Point3 *rgb, Point3 *uvw) = 0;
virtual void hTriStrip(int ct, IPoint3 *xyz, Point3 *rgb, Point3 *uvw) = 0;
virtual void wText(IPoint3 *xyz, TCHAR *s) = 0;
virtual void wMarker(IPoint3 *xyz, MarkerType type) = 0;
virtual void wPolyline(int ct, IPoint3 *xyz, Point3 *rgb, int closed, int *es) = 0;
void wPolyline(int ct, IPoint3 *xyz, Point3 *rgb, Point3 *uvw, int closed, int *es)
{ wPolyline(ct, xyz, rgb, closed, es); }
virtual void wPolygon(int ct, IPoint3 *xyz, Point3 *rgb, Point3 *uvw) = 0;
virtual void wTriStrip(int ct, IPoint3 *xyz, Point3 *rgb, Point3 *uvw) = 0;
virtual void text(Point3 *xyz, TCHAR *s) = 0;
virtual void marker(Point3 *xyz, MarkerType type) = 0;
virtual void polyline(int ct, Point3 *xyz, Point3 *rgb, int closed, int *es) = 0;
void polyline(int ct, Point3 *xyz, Point3 *rgb, Point3 *uvw, int closed, int *es)
{ polyline(ct, xyz, rgb, closed, es); }
virtual void polylineN(int ct, Point3 *xyz, Point3 *nor, int closed, int *es) = 0;
virtual void startSegments() = 0;
virtual void segment(Point3 *xyz, int vis) = 0;
virtual void endSegments() = 0;
virtual void polygon(int ct, Point3 *xyz, Point3 *rgb, Point3 *uvw) = 0;
virtual void polygonN(int ct, Point3 *xyz, Point3 *nor, Point3 *uvw) = 0;
virtual void triStrip(int ct, Point3 *xyz, Point3 *rgb, Point3 *uvw) = 0;
virtual void triStripN(int ct, Point3 *xyz, Point3 *nor, Point3 *uvw) = 0;
virtual void startTriangles() = 0;
virtual void triangle(Point3 *xyz, Point3 *rgb) = 0;
virtual void triangleN(Point3 *xyz, Point3 *nor, Point3 *uvw) = 0;
virtual void triangleNC(Point3 *xyz, Point3 *nor, Point3 *rgb) = 0;
virtual void triangleNCT(Point3 *xyz, Point3 *nor, Point3 *rgb, Point3 *uvw) = 0;
virtual void endTriangles() = 0;
virtual void setHitRegion(HitRegion *rgn) = 0;
virtual void clearHitCode(void) = 0;
virtual BOOL checkHitCode(void) = 0;
virtual DWORD getHitDistance(void) = 0;
virtual int isPerspectiveView(void) = 0;
virtual float interpWorld(Point3 *world1, Point3 *world2, float sParam, Point3 *interpPt) = 0;
virtual void escape(GFX_ESCAPE_FN fn, void *data) = 0;
};
// for Windows int coords with origin at upper-left
inline int wIsFacingBack(const IPoint3 &v0, const IPoint3 &v1, const IPoint3 &v2, int flip=0 )
{
int s = ( (v0[0]-v1[0])*(v2[1]-v1[1]) - (v2[0]-v1[0])*(v0[1]-v1[1]) ) < 0;
return flip ? !s : s;
}
// for HEIDI int coords with origin at lower-left
inline int hIsFacingBack(const IPoint3 &v0, const IPoint3 &v1, const IPoint3 &v2, int flip=0 )
{
int s = ( (v0[0]-v1[0])*(v2[1]-v1[1]) - (v2[0]-v1[0])*(v0[1]-v1[1]) );
return flip ? s < 0 : s > 0;
}
DllExport HINSTANCE GetGraphicsLibHandle(TCHAR *driverLibName);
DllExport BOOL GraphicsSystemIsAvailable(HINSTANCE drv);
DllExport BOOL GraphicsSystemCanConfigure(HINSTANCE drv);
DllExport BOOL GraphicsSystemConfigure(HWND hWnd, HINSTANCE drv);
DllExport void FreeGraphicsLibHandle(HINSTANCE drv);
DllExport GraphicsWindow *createGW(HWND hWnd, GWinSetup &gws);
DllExport void getRegionRect(HitRegion *hr, RECT *rect);
DllExport BOOL pointInRegion(int x, int y, HitRegion *hr);
DllExport int distToLine(int x, int y, int *p1, int *p2);
DllExport int lineCrossesRect(RECT *rc, int *p1, int *p2);
DllExport int segCrossesCircle(int cx, int cy, int r, int *p1, int *p2);
DllExport BOOL insideTriangle(IPoint3 &p0, IPoint3 &p1, IPoint3 &p2, IPoint3 &q);
DllExport int getZfromTriangle(IPoint3 &p0, IPoint3 &p1, IPoint3 &p2, IPoint3 &q);
// colors for drawing in viewports
#define COLOR_SELECTION 0
#define COLOR_SUBSELECTION 1
#define COLOR_FREEZE 2
#define COLOR_GRID 3
#define COLOR_GRID_INTENS 4
#define COLOR_SF_LIVE 5
#define COLOR_SF_ACTION 6
#define COLOR_SF_TITLE 7
#define COLOR_VP_LABELS 8
#define COLOR_VP_INACTIVE 9
#define COLOR_ARCBALL 10
#define COLOR_ARCBALL_HILITE 11
#define COLOR_ANIM_BUTTON 12
#define COLOR_SEL_BOXES 13
#define COLOR_LINK_LINES 14
#define COLOR_TRAJECTORY 15
#define COLOR_ACTIVE_AXIS 16
#define COLOR_INACTIVE_AXIS 17
#define COLOR_SPACE_WARPS 18
#define COLOR_DUMMY_OBJ 19
#define COLOR_POINT_OBJ 20
#define COLOR_POINT_AXES 21
#define COLOR_TAPE_OBJ 22
#define COLOR_BONES 23
#define COLOR_GIZMOS 24
#define COLOR_SEL_GIZMOS 25
#define COLOR_SPLINE_VECS 26
#define COLOR_SPLINE_HANDLES 27
#define COLOR_PATCH_LATTICE 28
#define COLOR_PARTICLE_EM 29
#define COLOR_CAMERA_OBJ 30
#define COLOR_CAMERA_CONE 31
#define COLOR_CAMERA_HORIZ 32
#define COLOR_NEAR_RANGE 33
#define COLOR_FAR_RANGE 34
#define COLOR_LIGHT_OBJ 35
#define COLOR_TARGET_LINE 36
#define COLOR_HOTSPOT 37
#define COLOR_FALLOFF 38
#define COLOR_START_RANGE 39
#define COLOR_END_RANGE 40
#define COLOR_VIEWPORT_BKG 41
#define COLOR_TRAJ_TICS_1 42
#define COLOR_TRAJ_TICS_2 43
#define COLOR_TRAJ_TICS_3 44
#define COLOR_GHOST_BEFORE 45
#define COLOR_GHOST_AFTER 46
#define COLOR_12FIELD_GRID 47
#define COLOR_START_RANGE1 48
#define COLOR_END_RANGE1 49
#define COLOR_CAMERA_CLIP 50
#define COLOR_NURBS_CV 51
#define COLOR_NURBS_LATTICE 52
#define COLOR_NURBS_CP 53
#define COLOR_NURBS_FP 54
#define COLOR_NURBS_DEP 55
#define COLOR_NURBS_ERROR 56
#define COLOR_NURBS_HILITE 57
#define COLOR_END_EFFECTOR 58
#define COLOR_END_EFFECTOR_STRING 59
#define COLOR_JOINT_LIMIT_SEL 60
#define COLOR_JOINT_LIMIT_UNSEL 61
#define COLOR_IK_TERMINATOR 62
#define COLOR_SF_USER 63
#define COLOR_TOTAL 64 // always the max number of colors
// Returns/sets color values for drawing in the viewport (selection, subsel, etc)
DllExport Point3 GetUIColor(int which);
DllExport void SetUIColor(int which, Point3 *clr);
DllExport Point3 GetDefaultUIColor(int which);
#define GetSelColor() GetUIColor(COLOR_SELECTION)
#define GetSubSelColor() GetUIColor(COLOR_SUBSELECTION)
#define GetFreezeColor() GetUIColor(COLOR_FREEZE)
#endif // _GFX_H_
@@ -0,0 +1,9 @@
#ifndef _GFXLIB_H_
#define _GFXLIB_H_
#define IMPORTING
#include "gfx.h"
#undef IMPORTING
#endif // _GFXLIB_H_
@@ -0,0 +1,68 @@
/**********************************************************************
*<
FILE: gizmo.h
DESCRIPTION: An apparatus object
CREATED BY: Rolf Berteig
HISTORY: 4-15-96
*> Copyright (c) 1996 Rolf Berteig, All Rights Reserved.
**********************************************************************/
#ifndef __GIZMO_H__
#define __GIZMO_H__
class IParamMap;
class GizmoObject : public HelperObject {
public:
IParamBlock *pblock;
static IParamMap *pmapParam;
static IObjParam *ip;
CoreExport GizmoObject();
CoreExport ~GizmoObject();
CoreExport static GizmoObject *editOb;
// From BaseObject
CoreExport void BeginEditParams( IObjParam *ip, ULONG flags,Animatable *prev);
CoreExport void EndEditParams( IObjParam *ip, ULONG flags,Animatable *next);
CoreExport int HitTest(TimeValue t, INode* inode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt);
CoreExport int Display(TimeValue t, INode* inode, ViewExp *vpt, int flags);
// From Object
ObjectState Eval(TimeValue time) {return ObjectState(this);}
void InitNodeName(TSTR& s) {s = GetObjectName();}
CoreExport int CanConvertToType(Class_ID obtype);
CoreExport Object* ConvertToType(TimeValue t, Class_ID obtype);
CoreExport void GetWorldBoundBox(TimeValue t, INode* inode, ViewExp* vpt, Box3& box );
CoreExport void GetLocalBoundBox(TimeValue t, INode* inode, ViewExp* vpt, Box3& box );
CoreExport void GetDeformBBox(TimeValue t, Box3& box, Matrix3 *tm, BOOL useSel );
// Animatable methods
//void GetClassName(TSTR& s) {s = GetObjectName();}
int NumSubs() { return 1; }
Animatable* SubAnim(int i) { return pblock; }
TSTR SubAnimName(int i) {return _T("Parameters");}
// From ref
int NumRefs() {return 1;}
RefTargetHandle GetReference(int i) {return pblock;}
void SetReference(int i, RefTargetHandle rtarg) {pblock=(IParamBlock*)rtarg;}
CoreExport RefResult NotifyRefChanged(Interval changeInt,RefTargetHandle hTarget,
PartID& partID, RefMessage message);
// Must implement...
Interval ObjectValidity(TimeValue t) {return FOREVER;}
virtual void InvalidateUI() {}
virtual ParamDimension *GetParameterDim(int pbIndex) {return defaultDim;}
virtual TSTR GetParameterName(int pbIndex) {return TSTR(_T("Parameter"));}
virtual void DrawGizmo(TimeValue t,GraphicsWindow *gw) {}
virtual Point3 WireColor() {return Point3(1,1,0);}
virtual void GetBoundBox(Matrix3 &mat,TimeValue t,Box3 &box) {}
};
#endif //__GIZMO_H__
@@ -0,0 +1,121 @@
/**********************************************************************
*<
FILE: gizmoimp.h
DESCRIPTION: General atmoshperic gizmo objects
CREATED BY: Rolf Berteig
HISTORY: 4-15-96
11-13-96 Moved into core
*> Copyright (c) 1996 Rolf Berteig, All Rights Reserved.
**********************************************************************/
#ifndef __GIZMOIMP_H__
#define __GIZMOIMP_H__
#define SPHEREGIZMO_CLASSID Class_ID(0x3bc31904, 0x67d74ec7)
#define CYLGIZMO_CLASSID Class_ID(0x3bc31904, 0x67d74ec8)
#define BOXGIZMO_CLASSID Class_ID(0x3bc31904, 0x67d74ec9)
class SphereGizmoObject : public GizmoObject {
public:
CoreExport SphereGizmoObject();
CoreExport ~SphereGizmoObject();
// From BaseObject
CoreExport CreateMouseCallBack* GetCreateMouseCallBack();
CoreExport void BeginEditParams( IObjParam *ip, ULONG flags,Animatable *prev);
CoreExport void EndEditParams( IObjParam *ip, ULONG flags,Animatable *next);
CoreExport TCHAR *GetObjectName();
CoreExport void InitNodeName(TSTR& s);
// Animatable methods
CoreExport void GetClassName(TSTR& s);
void DeleteThis() {delete this;}
Class_ID ClassID() {return SPHEREGIZMO_CLASSID;}
// From ref
CoreExport RefTargetHandle Clone(RemapDir& remap = NoRemap());
// From GizmoObject
CoreExport void InvalidateUI();
CoreExport ParamDimension *GetParameterDim(int pbIndex);
CoreExport TSTR GetParameterName(int pbIndex);
CoreExport void DrawGizmo(TimeValue t,GraphicsWindow *gw);
CoreExport void GetBoundBox(Matrix3 &mat,TimeValue t,Box3 &box);
};
#define PB_GIZMO_RADIUS 0
#define PB_GIZMO_HEMI 1
#define PB_GIZMO_SEED 2
class CylGizmoObject : public GizmoObject {
public:
CoreExport CylGizmoObject();
CoreExport ~CylGizmoObject();
// From BaseObject
CoreExport CreateMouseCallBack* GetCreateMouseCallBack();
CoreExport void BeginEditParams( IObjParam *ip, ULONG flags,Animatable *prev);
CoreExport void EndEditParams( IObjParam *ip, ULONG flags,Animatable *next);
CoreExport TCHAR *GetObjectName();
CoreExport void InitNodeName(TSTR& s);
// Animatable methods
CoreExport void GetClassName(TSTR& s);
void DeleteThis() {delete this;}
Class_ID ClassID() {return CYLGIZMO_CLASSID;}
// From ref
CoreExport RefTargetHandle Clone(RemapDir& remap = NoRemap());
// From GizmoObject
CoreExport void InvalidateUI();
CoreExport ParamDimension *GetParameterDim(int pbIndex);
CoreExport TSTR GetParameterName(int pbIndex);
CoreExport void DrawGizmo(TimeValue t,GraphicsWindow *gw);
CoreExport void GetBoundBox(Matrix3 &mat,TimeValue t,Box3 &box);
};
#define PB_CYLGIZMO_RADIUS 0
#define PB_CYLGIZMO_HEIGHT 1
#define PB_CYLGIZMO_SEED 2
class BoxGizmoObject : public GizmoObject {
public:
CoreExport BoxGizmoObject();
CoreExport ~BoxGizmoObject();
// From BaseObject
CoreExport CreateMouseCallBack* GetCreateMouseCallBack();
CoreExport void BeginEditParams( IObjParam *ip, ULONG flags,Animatable *prev);
CoreExport void EndEditParams( IObjParam *ip, ULONG flags,Animatable *next);
CoreExport TCHAR *GetObjectName();
CoreExport void InitNodeName(TSTR& s);
// Animatable methods
CoreExport void GetClassName(TSTR& s);
void DeleteThis() {delete this;}
Class_ID ClassID() {return BOXGIZMO_CLASSID;}
// From ref
CoreExport RefTargetHandle Clone(RemapDir& remap = NoRemap());
// From GizmoObject
CoreExport void InvalidateUI();
CoreExport ParamDimension *GetParameterDim(int pbIndex);
CoreExport TSTR GetParameterName(int pbIndex);
CoreExport void DrawGizmo(TimeValue t,GraphicsWindow *gw);
CoreExport void GetBoundBox(Matrix3 &mat,TimeValue t,Box3 &box);
};
#define PB_BOXGIZMO_LENGTH 0
#define PB_BOXGIZMO_WIDTH 1
#define PB_BOXGIZMO_HEIGHT 2
#define PB_BOXGIZMO_SEED 3
#endif //__GIZMOIMP_H__
@@ -0,0 +1,97 @@
/**********************************************************************
*<
FILE: gport.h
DESCRIPTION: Palette management.
CREATED BY: Dan Silva
HISTORY:
*> Copyright (c) 1994, All Rights Reserved.
**********************************************************************/
#ifndef __GPORT__H
#define __GPORT__H
class GPort {
public:
// get the palette index associated with the ith slot
virtual int AnimPalIndex(int i)=0;
// returns a slot number if available, -1 if not:
// typically called in WM_INITDIALOG processing for as
// may slots as you need (total availible is 8)
virtual int GetAnimPalSlot()=0;
// Release an animated palete slot slot
// Typically called in WM_DESTROY for each slot
// obtained with GetAnimPalSlot
virtual void ReleaseAnimPalSlot(int i)=0;
// set the color associated with the ith animated slot
virtual void SetAnimPalEntry(int i, COLORREF cr)=0;
// Stuff the standard MAX palette the palette for the HDC,
// handing back a handle to the old palette.
virtual HPALETTE PlugPalette(HDC hdc)=0;
// Create a brush for drawing with the ith animated palette slot color
virtual HBRUSH MakeAnimBrush(int slotNum, COLORREF col )=0;
// Update colors calls the Windows UpdateColors on the hdc.
// Returns 1 iff it changed screen pixel values .
// Call this when get WM_PALETTECHANGED Msg
virtual int UpdateColors(HDC hdc)=0;
// After several SetAnimPalEntry calls, call this to affect the
// HDC's palette
virtual void AnimPalette(HDC hdc)=0;
// The companion function to PlugPalette.
virtual void RestorePalette(HDC hDC,HPALETTE hOldPal)=0;
// Map an single row of pixels 24 bit color to indices into
// the current GPort palette, applying a dither pattern.
// This routine does NOT do gamma correction.
// inp points to an array of width RGB triples.
// outp is an array of width bytes. x and y are necessary to
// establish dither pattern alignment.
virtual void MapPixels(UBYTE* inp, UBYTE *outp, int x, int y, int width)=0;
// Display an array of 24bit colors in the HDC: if the current display is 8 bit
// it will display it (with dither) using in the GPort palette, otherwise it
// will just blit to the screen. Does NOT do gamma correction.
// "drect" is the destination rectangle in the hdc.
// "map" points to an array of RGB triples, with bytesPerRow bytes on each scanline.
// "xsrc" and "ysrc" are the position within this source raster of the upper left
// corner of the rectangle to be copied..
virtual void DisplayMap(HDC hdc, Rect& drect,int xsrc, int ysrc, UBYTE *map, int bytesPerRow)=0;
// This version stretches the image (if src!=dest).
// "dest" is the destination rectangle in the hdc;
// "src" is the source rectangle in map.
virtual void DisplayMap(HDC hdc, Rect& dest, Rect& src, UBYTE *map, int bytesPerRow)=0;
// DitherColorSwatch first gamma corrects Color c using the current
// display gamma. In paletted modes, it will fill rectangle "r" with
// a dithered pattern approximating Color c. In 24 bit modes it just
// fills the rectange with c.
virtual void DitherColorSwatch(HDC hdc, Rect& r, Color c)=0;
// This attempts to use the animated color slot indicated by "slot"
// to paint a rectangular color swatch.
// If slot is -1, it will uses DitherColorSwatch. It does gamma correction.
virtual void PaintAnimPalSwatch(HDC hdc, DWORD col, int slot, int left, int top, int right, int bottom)=0;
// get the current GPort palette.
virtual HPALETTE GetPalette()=0;
};
// Normally this is the only one of these, and this gets you a pointer to it.
extern CoreExport GPort* GetGPort();
#endif // __GPORT__H
@@ -0,0 +1,71 @@
/**********************************************************************
*<
FILE: gutil.h
DESCRIPTION: Geometric utility functions
CREATED BY: Dan Silva
HISTORY:
*> Copyright (c) 1994, All Rights Reserved.
**********************************************************************/
#ifndef _GUTIL_H
#define _GUTIL_H
//- BaryCoords-----------------------------------------------------
// Given three points in space forming a triangle (p0,p1,p2),
// and a fourth point in the plane of that triangle, returns the
// barycentric coords of that point relative to the triangle.
DllExport Point3 BaryCoords(Point3 p0, Point3 p1, Point3 p2, Point3 p);
// Same thing in 2D
DllExport Point3 BaryCoords(Point2 p0, Point2 p1, Point2 p2, Point2 p);
//--RayHitsBox--------------------------------------------------------
// Returns true of the ray pierces the box
DllExport BOOL RayHitsBox(Ray &ray, Box3 &b);
// DistPtToLine ---------------------------------------------------------
// find distance of q from line p0->p1
DllExport float DistPtToLine(Point2 *p0, Point2 *p1, Point2 *q );
// Dist3DPtToLine ---------------------------------------------------------
// find distance of q from line p0->p1
DllExport float Dist3DPtToLine(Point3* p0, Point3* p1, Point3* q );
//----------------------------------------------------------------------
// Computing the 3 Bump basis vectors from the UVW's at the triangle.
//
// input:
// tv: texture coordinates at 3 triangle vertices
// v: coordinates of triangle vertices (usually in camera space)
//
// output:
// bvec: the 3 bump basis vectors (normalized) corresponding to the U,V,and W axes.
//
DllExport void ComputeBumpVectors(const Point3 tv[3], const Point3 v[3], Point3 bvec[3]);
//-------------------------------------------------------------------------------
// Quick and dirty unit vector compression. Only accurate to 1 part in 512
//
ULONG DllExport CompressNormal(Point3 p);
Point3 DllExport DeCompressNormal(ULONG n);
#endif
@@ -0,0 +1,23 @@
/**********************************************************************
*<
FILE: hitdata.h
DESCRIPTION: Defines the basic Hit Data class
CREATED BY: Dan Silva
HISTORY: created 9 September 1994
*> Copyright (c) 1994, All Rights Reserved.
**********************************************************************/
#ifndef __HITDATA__
#define __HITDATA__
class HitData {
public:
virtual ~HitData() {}
};
#endif __HITDATA__
@@ -0,0 +1,83 @@
/**********************************************************************
*<
FILE: hold.h
DESCRIPTION:
CREATED BY: Dan Silva
HISTORY:
*> Copyright (c) 1994, All Rights Reserved.
**********************************************************************/
#ifndef __HOLD__H__
#define __HOLD__H__
#define RESTOBJ_DOES_REFERENCE_POINTER 1
#define RESTOBJ_GOING_TO_DELETE_POINTER 2
class HoldStore;
class RestoreObj {
friend class HoldStore;
friend class GenUndoObject;
friend class CheckForFlush;
RestoreObj *next,*prev;
public:
RestoreObj() { next = prev = NULL; }
virtual ~RestoreObj() {};
virtual void Restore(int isUndo)=0;
virtual void Redo()=0;
virtual int Size() { return 1; }
virtual void EndHold() { }
virtual TSTR Description() { return TSTR(_T("---")); }
virtual int Execute(int cmd, ULONG arg1=0, ULONG arg2=0, ULONG arg3=0) {return -1;}
};
class Hold {
HoldStore *holdStore, *holdList;
int undoEnabled;
int superLevel;
int putCount;
HoldStore *ResetStore();
void Init();
void AddOpToUndoMgr(TCHAR *name,int id);
public:
CoreExport Hold();
CoreExport ~Hold();
CoreExport void Put(RestoreObj *rob);
CoreExport void Begin();
CoreExport void Suspend(); // temporarly suspend holding
CoreExport int IsSuspended();
CoreExport void Resume(); // resume holding
CoreExport int Holding(); // are we holding?
CoreExport void DisableUndo(); // prevents Undo when Accept is called.
CoreExport void EnableUndo();
CoreExport void Restore(); // Restore changes from holdStore.
CoreExport void Release(); // Tosses out holdStore.
// 3 ways to terminate the Begin()...
CoreExport void End(); // toss holdStore.
CoreExport void Accept(int nameID); // record Undo (if enabled), End();
CoreExport void Accept(TCHAR *name);
CoreExport void Cancel(); // Restore changes, End()
//
// Group several Begin-End lists into a single Super-group.
CoreExport void SuperBegin();
CoreExport void SuperAccept(int nameID);
CoreExport void SuperAccept(TCHAR *name);
CoreExport void SuperCancel();
// Get the number of times Put() has been called in the current session of MAX
CoreExport int GetGlobalPutCount();
};
extern CoreExport Hold theHold;
void CoreExport EnableUndoDebugPrintout(BOOL onoff);
#endif //__HOLD__H__
@@ -0,0 +1,31 @@
/**********************************************************************
*<
FILE: hotcheck.h
DESCRIPTION: Video Color check utilities
CREATED BY: Dan Silva
HISTORY: created 26 December 1995
*> Copyright (c) 1995, All Rights Reserved.
**********************************************************************/
#ifndef __HOTCHECK__H
#define __HOTCHECK__H
#define VID_NTSC 0
#define VID_PAL 1
// Methods
#define HOT_FLAG 0
#define HOT_SCALE_LUM 1
#define HOT_SCALE_SAT 2
CoreExport void BuildHotTable( int video_type = VID_NTSC );
CoreExport int HotLimit(Color48 *thepix, int method = HOT_SCALE_LUM); // do video color check
#endif
@@ -0,0 +1,75 @@
/**********************************************************************
*<
FILE: hsv.h
DESCRIPTION:
CREATED BY: Dan Silva
HISTORY:
*> Copyright (c) 1994, All Rights Reserved.
**********************************************************************/
#ifndef __HSV__H
#define __HSV__H
#define MAXCOLORS 16
// This callback proc gets called after every mouse button up to tell you the
// new color, if you want to do interactive update.
class HSVCallback {
public:
virtual void ButtonDown() {}
virtual void ButtonUp(BOOL accept) {}
virtual void ColorChanged(DWORD col, BOOL buttonUp)=0;
virtual void BeingDestroyed(IPoint2 pos)=0; // gets called when picker is closed:
};
// Put up the dialog.
extern CoreExport int HSVDlg_Do(
HWND hwndOwner, // owning window
DWORD *lpc, // pointer to color to be edited
IPoint2 *spos, // starting position, set to ending position
HSVCallback *callBack, // called when color changes
TCHAR *name // name of color being edited
);
CoreExport void RGBtoHSV (DWORD rgb, int *ho, int *so, int *vo);
CoreExport DWORD HSVtoRGB (int H, int S, int V);
CoreExport void HSVtoHWBt (int h, int s, int v, int *ho, int *w, int *bt);
CoreExport void HWBttoHSV (int h, int w, int bt, int *ho, int *s, int *v);
// RB: Added floating point versions
class Color;
CoreExport Color RGBtoHSV(Color rgb);
CoreExport Color HSVtoRGB(Color hsv);
// MODELESS Version
class ColorPicker {
protected:
~ColorPicker() {}
public:
ColorPicker() {}
virtual void ModifyColor (DWORD color)=0;
virtual void SetNewColor (DWORD color, TCHAR *name)=0;
virtual DWORD GetColor()=0;
virtual IPoint2 GetPosition()=0;
virtual void Destroy()=0; // remove window and delete ColorPicker.
virtual void InstallNewCB(DWORD col, HSVCallback *pcb, TCHAR *name)=0;
};
CoreExport ColorPicker *CreateColorPicker(HWND hwndOwner, DWORD initColor,
IPoint2* spos, HSVCallback *pcallback, TCHAR *name, int objClr=0);
CoreExport void SetCPInitPos(IPoint2 &pos);
CoreExport IPoint2 GetCPInitPos(void);
#define WM_ADD_COLOR (WM_USER+2321) // wParam = color
#endif
@@ -0,0 +1,35 @@
/**********************************************************************
*<
FILE: icmdline.h
DESCRIPTION: Class definitions for command line panel interface
CREATED BY: Christer Janson
HISTORY: Created 26 September 1997
*> Copyright (c) Autodesk, 1997, All Rights Reserved.
**********************************************************************/
#if !defined(_ICMDLINE_H_)
#define _ICMDLINE_H_
class CommandLineCallback {
public:
virtual BOOL ExecuteCommand(TCHAR* szCmdLine) { return FALSE; };
virtual void GotKeyEvent(UINT message, WPARAM wParam, LPARAM lParam) {};
};
class ICommandLine {
public:
virtual BOOL RegisterCallback(CommandLineCallback* cb) = 0;
virtual BOOL UnRegisterCallback(CommandLineCallback* cb) = 0;
virtual void SetVisibility(BOOL bShow) = 0;
virtual BOOL GetVisibility() = 0;
virtual BOOL Prompt(TCHAR* szCmdLine) = 0;
// Set the actual string in the command line editor
virtual BOOL SetCommandLineText(TCHAR* szCmdLine) = 0;
};
#endif // _ICMDLINE_H_
@@ -0,0 +1,46 @@
/**********************************************************************
*<
FILE: ikctrl.h
DESCRIPTION: Inverse Kinematics Controllers
CREATED BY: Rolf Berteig
HISTORY: 3-1-97
*> Copyright (c) 1997, All Rights Reserved.
**********************************************************************/
#ifndef __IKCTRL_H__
#define __IKCTRL_H__
#define IKMASTER_CLASSID Class_ID(0xa91004be,0x9901fe83)
#define IKSLAVE_CLASSID Class_ID(0xbe380a31,0x310dc9e4)
class IKMasterControl : public ReferenceTarget {
public:
Class_ID ClassID() {return IKMASTER_CLASSID;}
SClass_ID SuperClassID() {return REF_TARGET_CLASS_ID;}
virtual void AddSlaveNode(INode *node)=0;
virtual void *GetMasterBase()=0;
};
class IKSlaveControl : public Control {
public:
Class_ID ClassID() {return IKSLAVE_CLASSID;}
SClass_ID SuperClassID() {return CTRL_MATRIX3_CLASS_ID;}
virtual IKMasterControl *GetMaster()=0;
virtual void SetDOF(int which,BOOL onOff)=0;
virtual void SetInitPos(Point3 pos)=0;
virtual void SetInitRot(Point3 rot)=0;
virtual void MakeEE(BOOL onOff,DWORD which,Point3 pos,Quat rot)=0;
};
CoreExport IKMasterControl *CreateIKMasterControl();
CoreExport IKSlaveControl *CreateIKSlaveControl(IKMasterControl *master,INode *slaveNode);
#endif //__IKCTRL_H__
@@ -0,0 +1,88 @@
/**********************************************************************
*<
FILE: impapi.h
DESCRIPTION: Geometry import/export API header
CREATED BY: Tom Hudson
HISTORY: Created 26 December 1994
*> Copyright (c) 1994, All Rights Reserved.
**********************************************************************/
#ifndef _IMPAPI_H_
#define _IMPAPI_H_
// These includes get us the general camera and light interfaces
#include "gencam.h"
#include "genlight.h"
#include "render.h"
// Import Node class
class ImpNode {
public:
virtual RefResult Reference(ObjectHandle obj) = 0;
virtual void SetTransform( TimeValue t, Matrix3 tm ) = 0;
virtual void SetName(const TCHAR *newname) = 0;
virtual void SetPivot(Point3 p) = 0;
virtual INode * GetINode()=0; // Use with care -- Always use above methods instead
// I'm stuffing these in here so that I can perhaps add API functions without recompiling
virtual int TempFunc1(void *p1=NULL, void *p2=NULL, void *p3=NULL, void *p4=NULL, void *p5=NULL, void *p6=NULL, void *p7=NULL, void *p8=NULL)=0;
virtual int TempFunc2(void *p1=NULL, void *p2=NULL, void *p3=NULL, void *p4=NULL, void *p5=NULL, void *p6=NULL, void *p7=NULL, void *p8=NULL)=0;
virtual int TempFunc3(void *p1=NULL, void *p2=NULL, void *p3=NULL, void *p4=NULL, void *p5=NULL, void *p6=NULL, void *p7=NULL, void *p8=NULL)=0;
virtual int TempFunc4(void *p1=NULL, void *p2=NULL, void *p3=NULL, void *p4=NULL, void *p5=NULL, void *p6=NULL, void *p7=NULL, void *p8=NULL)=0;
virtual int TempFunc5(void *p1=NULL, void *p2=NULL, void *p3=NULL, void *p4=NULL, void *p5=NULL, void *p6=NULL, void *p7=NULL, void *p8=NULL)=0;
virtual int TempFunc6(void *p1=NULL, void *p2=NULL, void *p3=NULL, void *p4=NULL, void *p5=NULL, void *p6=NULL, void *p7=NULL, void *p8=NULL)=0;
virtual int TempFunc7(void *p1=NULL, void *p2=NULL, void *p3=NULL, void *p4=NULL, void *p5=NULL, void *p6=NULL, void *p7=NULL, void *p8=NULL)=0;
virtual int TempFunc8(void *p1=NULL, void *p2=NULL, void *p3=NULL, void *p4=NULL, void *p5=NULL, void *p6=NULL, void *p7=NULL, void *p8=NULL)=0;
virtual int TempFunc9(void *p1=NULL, void *p2=NULL, void *p3=NULL, void *p4=NULL, void *p5=NULL, void *p6=NULL, void *p7=NULL, void *p8=NULL)=0;
virtual int TempFunc10(void *p1=NULL, void *p2=NULL, void *p3=NULL, void *p4=NULL, void *p5=NULL, void *p6=NULL, void *p7=NULL, void *p8=NULL)=0;
};
// Import Interface class
class ImpInterface {
public:
virtual ImpNode * CreateNode() = 0;
virtual void RedrawViews() = 0;
virtual GenCamera* CreateCameraObject(int type) = 0;
virtual Object * CreateTargetObject() = 0;
virtual GenLight* CreateLightObject(int type) = 0;
virtual void * Create(SClass_ID sclass, Class_ID classid)=0;
virtual int BindToTarget(ImpNode *laNode, ImpNode *targNode)=0;
virtual void AddNodeToScene(ImpNode *node)=0;
virtual void SetAnimRange(Interval& range)=0;
virtual Interval GetAnimRange()=0;
// Environment settings
virtual void SetEnvironmentMap(Texmap *txm)=0;
virtual void SetAmbient(TimeValue t, Point3 col)=0;
virtual void SetBackGround(TimeValue t,Point3 col)=0;
virtual void SetUseMap(BOOL onoff)=0;
virtual void AddAtmosphere(Atmospheric *atmos)=0;
virtual int NewScene()=0; // delete all existing geometry
// I'm stuffing these in here so that I can perhaps add API functions without recompiling
virtual int TempFunc1(void *p1=NULL, void *p2=NULL, void *p3=NULL, void *p4=NULL, void *p5=NULL, void *p6=NULL, void *p7=NULL, void *p8=NULL)=0;
virtual int TempFunc2(void *p1=NULL, void *p2=NULL, void *p3=NULL, void *p4=NULL, void *p5=NULL, void *p6=NULL, void *p7=NULL, void *p8=NULL)=0;
virtual int TempFunc3(void *p1=NULL, void *p2=NULL, void *p3=NULL, void *p4=NULL, void *p5=NULL, void *p6=NULL, void *p7=NULL, void *p8=NULL)=0;
virtual int TempFunc4(void *p1=NULL, void *p2=NULL, void *p3=NULL, void *p4=NULL, void *p5=NULL, void *p6=NULL, void *p7=NULL, void *p8=NULL)=0;
virtual int TempFunc5(void *p1=NULL, void *p2=NULL, void *p3=NULL, void *p4=NULL, void *p5=NULL, void *p6=NULL, void *p7=NULL, void *p8=NULL)=0;
virtual int TempFunc6(void *p1=NULL, void *p2=NULL, void *p3=NULL, void *p4=NULL, void *p5=NULL, void *p6=NULL, void *p7=NULL, void *p8=NULL)=0;
virtual int TempFunc7(void *p1=NULL, void *p2=NULL, void *p3=NULL, void *p4=NULL, void *p5=NULL, void *p6=NULL, void *p7=NULL, void *p8=NULL)=0;
virtual int TempFunc8(void *p1=NULL, void *p2=NULL, void *p3=NULL, void *p4=NULL, void *p5=NULL, void *p6=NULL, void *p7=NULL, void *p8=NULL)=0;
virtual int TempFunc9(void *p1=NULL, void *p2=NULL, void *p3=NULL, void *p4=NULL, void *p5=NULL, void *p6=NULL, void *p7=NULL, void *p8=NULL)=0;
virtual int TempFunc10(void *p1=NULL, void *p2=NULL, void *p3=NULL, void *p4=NULL, void *p5=NULL, void *p6=NULL, void *p7=NULL, void *p8=NULL)=0;
virtual FILE * DumpFile() = 0; // For debugging -- Stream for dumping debug messages
};
// Export Interface class
class ExpInterface {
public:
IScene * theScene; // Pointer to the scene
};
#endif // _IMPAPI_H_
@@ -0,0 +1,68 @@
/**********************************************************************
*<
FILE: impexp.h
DESCRIPTION: Includes for importing and exporting geometry files
CREATED BY: Tom Hudson
HISTORY: Created 26 December 1994
*> Copyright (c) 1994, All Rights Reserved.
**********************************************************************/
#ifndef _IMPEXP_H_
#define _IMPEXP_H_
// The following work on the specified file or bring up the browser if null
BOOL ImportFile(const TCHAR *buf = NULL, BOOL suppressPrompts=FALSE);
BOOL ExportFile(const TCHAR *buf = NULL, BOOL suppressPrompts=FALSE);
class ImpInterface;
class ExpInterface;
class Interface;
// Returned by DoImport, DoExport
#define IMPEXP_FAIL 0
#define IMPEXP_SUCCESS 1
#define IMPEXP_CANCEL 2
// The scene import/export classes. Right now, these are very similar, but this may change as things develop
class SceneImport {
public:
SceneImport() {};
virtual ~SceneImport() {};
virtual int ExtCount() = 0; // Number of extemsions supported
virtual const TCHAR * Ext(int n) = 0; // Extension #n (i.e. "3DS")
virtual const TCHAR * LongDesc() = 0; // Long ASCII description (i.e. "Autodesk 3D Studio File")
virtual const TCHAR * ShortDesc() = 0; // Short ASCII description (i.e. "3D Studio")
virtual const TCHAR * AuthorName() = 0; // ASCII Author name
virtual const TCHAR * CopyrightMessage() = 0; // ASCII Copyright message
virtual const TCHAR * OtherMessage1() = 0; // Other message #1
virtual const TCHAR * OtherMessage2() = 0; // Other message #2
virtual unsigned int Version() = 0; // Version number * 100 (i.e. v3.01 = 301)
virtual void ShowAbout(HWND hWnd) = 0; // Show DLL's "About..." box
virtual int DoImport(const TCHAR *name,ImpInterface *ii,Interface *i, BOOL suppressPrompts=FALSE) = 0; // Import file
};
class SceneExport {
public:
SceneExport() {};
virtual ~SceneExport() {};
virtual int ExtCount() = 0; // Number of extemsions supported
virtual const TCHAR * Ext(int n) = 0; // Extension #n (i.e. "3DS")
virtual const TCHAR * LongDesc() = 0; // Long ASCII description (i.e. "Autodesk 3D Studio File")
virtual const TCHAR * ShortDesc() = 0; // Short ASCII description (i.e. "3D Studio")
virtual const TCHAR * AuthorName() = 0; // ASCII Author name
virtual const TCHAR * CopyrightMessage() = 0; // ASCII Copyright message
virtual const TCHAR * OtherMessage1() = 0; // Other message #1
virtual const TCHAR * OtherMessage2() = 0; // Other message #2
virtual unsigned int Version() = 0; // Version number * 100 (i.e. v3.01 = 301)
virtual void ShowAbout(HWND hWnd) = 0; // Show DLL's "About..." box
virtual int DoExport(const TCHAR *name,ExpInterface *ei,Interface *i, BOOL suppressPrompts=FALSE) = 0; // Export file
};
#endif // _IMPEXP_H_
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,439 @@
/**********************************************************************
*<
FILE: inode.h
DESCRIPTION:
CREATED BY: Dan Silva
HISTORY:
*> Copyright (c) 1994, All Rights Reserved.
**********************************************************************/
#ifndef __INODE__H
#define __INODE__H
class ObjectState;
class Object;
class Control;
class ScaleValue;
class Mtl;
class RenderData;
class View;
class IDerivedObject;
// Transform modes -- passed to Move/Rotate/Scale
#define PIV_NONE 0
#define PIV_PIVOT_ONLY 1
#define PIV_OBJECT_ONLY 2
#define PIV_HIERARCHY_ONLY 3
// Node interface
class INode: public ReferenceTarget {
public:
// If this was a temporary INode (like an INodeTransformed) this will delete it.
virtual void DisposeTemporary() {}
// In the case of INodeTransformed, this gets a pointer to the real node.
virtual INode *GetActualINode() {return this;}
virtual TCHAR* GetName()=0;
virtual void SetName(TCHAR *s)=0;
// Get/Set node's transform ( without object-offset or WSM affect)
virtual Matrix3 GetNodeTM(TimeValue t, Interval* valid=NULL)=0;
virtual void SetNodeTM(TimeValue t, Matrix3& tm)=0;
// Invalidate node's caches
virtual void InvalidateTreeTM()=0;
virtual void InvalidateTM()=0;
virtual void InvalidateWS()=0;
// Get object's transform (including object-offset)
// and also the WSM affect when appropriate )
// This is used inside object Display and HitTest routines
virtual Matrix3 GetObjectTM(TimeValue time, Interval* valid=NULL)=0;
// Get object's transform including object-offset but not WSM affect
virtual Matrix3 GetObjTMBeforeWSM(TimeValue time, Interval* valid=NULL)=0;
// Get object's transform including object-offset and WSM affect
virtual Matrix3 GetObjTMAfterWSM(TimeValue time, Interval* valid=NULL)=0;
// evaluate the State the object after offset and WSM's applied
// if evalHidden is FALSE and the node is hidden the pipeline will not
// actually be evaluated (however the TM will).
virtual const ObjectState& EvalWorldState(TimeValue time,BOOL evalHidden=TRUE)=0;
// Hierarchy manipulation
virtual INode* GetParentNode()=0;
virtual void AttachChild(INode* node, int keepPos=1)=0; // make node a child of this one
virtual void Detach(TimeValue t, int keepPos=1)=0; // detach node
virtual int NumberOfChildren()=0;
virtual INode* GetChildNode(int i)=0;
// This will delete a node, handle removing from the hierarchy, and also handle Undo.
virtual void Delete(TimeValue t, int keepChildPosition) {}
// display attributes
virtual void Hide(BOOL onOff)=0; // set node's hide bit
virtual int IsHidden(DWORD hflags=0,BOOL forRenderer=FALSE) {return 0;}
virtual int IsNodeHidden(BOOL forRenderer=FALSE) {return 0;} // is node hidden in *any* way.
virtual void Freeze(BOOL onOff)= 0; // stop node from being pickable
virtual int IsFrozen()=0;
virtual void BoxMode(BOOL onOff)=0; // display node with a bounding box
virtual int GetBoxMode()=0;
virtual void AllEdges(BOOL onOff)=0; // display all edges, including "hidden" ones
virtual int GetAllEdges()=0;
virtual void BackCull(BOOL onOff)=0; // backcull display toggle
virtual int GetBackCull()=0;
virtual void SetCastShadows(BOOL onOff)=0;
virtual int CastShadows()=0;
virtual void SetRcvShadows(BOOL onOff)=0;
virtual int RcvShadows()=0;
virtual void SetMotBlur(int kind)=0; // kind = 0: none, 1:object blur, 2: image blur
virtual int MotBlur()=0;
virtual float GetImageBlurMultiplier(TimeValue t) { return 1.0f;}
virtual void SetImageBlurMultiplier(TimeValue t, float m){};
virtual void SetImageBlurMultController(Control *cont){}
virtual Control *GetImageBlurMultController() {return NULL; }
virtual void SetRenderable(BOOL onOff)=0;
virtual int Renderable()=0;
virtual void SetCVertMode(int onOff) {}
virtual int GetCVertMode() {return 0;}
virtual void SetShadeCVerts(int onOff) {}
virtual int GetShadeCVerts() {return 0;}
virtual int GetTrajectoryON() {return 0;}
virtual void SetTrajectoryON(BOOL onOff) {}
// bone display attributes.
virtual void ShowBone(int boneVis)=0; // 0: off, 1: show bone, 2: show bone only
virtual void BoneAsLine(int onOff)=0; // display bone as simple line
virtual BOOL IsBoneShowing()=0;
virtual BOOL IsBoneOnly() { return 0; } // don't display node when displaying bone
// used for hit-testing and selecting node and target as a single unit
virtual void SetTargetNodePair(int onOff) {}
virtual int GetTargetNodePair() { return 0; }
// Access node's wire-frame color
virtual DWORD GetWireColor()=0;
virtual void SetWireColor(DWORD newcol)=0;
// Test various flags
virtual int IsRootNode()=0;
virtual int Selected()=0;
virtual int Dependent()=0;
virtual int IsTarget()=0;
// Node transform locks
virtual BOOL GetTransformLock(int type, int axis)=0;
virtual void SetTransformLock(int type, int axis, BOOL onOff)=0;
// Get target node if any.
virtual INode* GetTarget()=0; // returns NULL if node has no target.
virtual INode* GetLookatNode()=0; // if this is a target, this finds the node that looks at it.
// This is just GetParent+GetNodeTM
virtual Matrix3 GetParentTM(TimeValue t)=0;
// This is just GetTarget+GetNodeTM
virtual int GetTargetTM(TimeValue t, Matrix3& m)=0;
// Object reference
virtual Object* GetObjectRef()=0; // skips over WSM's to the object
virtual void SetObjectRef(Object *)=0; // sets the object reference directly
virtual Object* GetObjOrWSMRef()=0; // returns the object reference directly
// TM Controller
virtual Control* GetTMController()=0;
virtual void SetTMController(Control *m3cont)=0;
// Visibility controller
virtual Control *GetVisController()=0;
virtual void SetVisController(Control *cont)=0;
virtual float GetVisibility(TimeValue t,Interval *valid=NULL)=0; // may be inherited
virtual float GetVisibility(TimeValue t,View &view,Interval *valid=NULL) {return GetVisibility(t,valid);}
virtual void SetVisibility(TimeValue t,float vis)=0;
virtual float GetLocalVisibility(TimeValue t,Interval *valid=NULL)=0; // not inherited
virtual BOOL GetInheritVisibility()=0;
virtual void SetInheritVisibility(BOOL onOff)=0;
// Renderer Materials
virtual Mtl *GetMtl()=0;
virtual void SetMtl(Mtl* matl)=0;
// GraphicsWindow Materials
virtual Material* Mtls()=0; // Array of GraphicsWindow Materials
virtual int NumMtls()=0; // number of entries in Mtls
// Object offset from node:
virtual void SetObjOffsetPos(Point3 p)=0;
virtual Point3 GetObjOffsetPos()=0;
virtual void SetObjOffsetRot(Quat q)=0;
virtual Quat GetObjOffsetRot()=0;
virtual void SetObjOffsetScale(ScaleValue sv)=0;
virtual ScaleValue GetObjOffsetScale()=0;
// Misc.
virtual void FlagForeground(TimeValue t,BOOL notify=TRUE)=0;
virtual int IsActiveGrid()=0;
// A place to hang temp data. Don't expect the data to stay around after you return control
virtual void SetNodeLong(LONG l)=0;
virtual LONG GetNodeLong()=0;
// virtual void GetMaterial(Material &mtl)=0; // Why do we need this?
// Access render data
virtual RenderData *GetRenderData()=0;
virtual void SetRenderData(RenderData *rd)=0;
//
// Access user defined property text
//
// The first two functions access the entire buffer
virtual void GetUserPropBuffer(TSTR &buf)=0;
virtual void SetUserPropBuffer(const TSTR &buf)=0;
// These get individual properties - return FALSE if the key is not found
virtual BOOL GetUserPropString(const TSTR &key,TSTR &string)=0;
virtual BOOL GetUserPropInt(const TSTR &key,int &val)=0;
virtual BOOL GetUserPropFloat(const TSTR &key,float &val)=0;
virtual BOOL GetUserPropBool(const TSTR &key,BOOL &b)=0;
// These set individual properties - create the key if it doesn't exist
virtual void SetUserPropString(const TSTR &key,const TSTR &string)=0;
virtual void SetUserPropInt(const TSTR &key,int val)=0;
virtual void SetUserPropFloat(const TSTR &key,float val)=0;
virtual void SetUserPropBool(const TSTR &key,BOOL b)=0;
// Just checks to see if a key exists
virtual BOOL UserPropExists(const TSTR &key)=0;
// G-Buffer ID's (user settable)
virtual ULONG GetGBufID()=0;
virtual void SetGBufID(ULONG id)=0;
// G-Buffer Render ID's (set by renderer)
virtual UWORD GetRenderID() { return 0xffff; }
virtual void SetRenderID(UWORD id) {}
// Transform the node about a specified axis system.
// Either the pivot point or the object or both can be transformed.
// Also, the children can be counter transformed so they don't move.
virtual void Move(TimeValue t, const Matrix3& tmAxis, const Point3& val, BOOL localOrigin=FALSE, BOOL affectKids=TRUE, int pivMode=PIV_NONE, BOOL ignoreLocks=FALSE)=0;
virtual void Rotate(TimeValue t, const Matrix3& tmAxis, const AngAxis& val, BOOL localOrigin=FALSE, BOOL affectKids=TRUE, int pivMode=PIV_NONE, BOOL ignoreLocks=FALSE)=0;
virtual void Rotate(TimeValue t, const Matrix3& tmAxis, const Quat& val, BOOL localOrigin=FALSE, BOOL affectKids=TRUE, int pivMode=PIV_NONE, BOOL ignoreLocks=FALSE)=0;
virtual void Scale(TimeValue t, const Matrix3& tmAxis, const Point3& val, BOOL localOrigin=FALSE, BOOL affectKids=TRUE, int pivMode=PIV_NONE, BOOL ignoreLocks=FALSE)=0;
virtual BOOL IsGroupMember()=0;
virtual BOOL IsGroupHead()=0;
virtual BOOL IsOpenGroupMember() {return 0; }
virtual BOOL IsOpenGroupHead() {return 0; }
virtual void SetGroupMember(BOOL b) {}
virtual void SetGroupHead(BOOL b) {}
virtual void SetGroupMemberOpen(BOOL b) {}
virtual void SetGroupHeadOpen(BOOL b) {}
// Some node IK params
virtual float GetPosTaskWeight() {return 1.0f;}
virtual float GetRotTaskWeight() {return 1.0f;}
virtual void SetPosTaskWeight(float w) {}
virtual void SetRotTaskWeight(float w) {}
virtual BOOL GetTaskAxisState(int which,int axis) {return TRUE;} // which==0:pos which==1:rot
virtual void SetTaskAxisState(int which,int axis,BOOL onOff) {}
virtual DWORD GetTaskAxisStateBits() {return 127;}
// Access to WSM Derived object. Note that there is at most one
// WSM derived object per node. Calling CreateWSMDerivedObject()
// will create a WSM derived object for the node if one doesn't
// already exist.
virtual void CreateWSMDerivedObject() {}
virtual IDerivedObject *GetWSMDerivedObject() {return NULL;}
};
// Transform lock types
#define INODE_LOCKPOS 0
#define INODE_LOCKROT 1
#define INODE_LOCKSCL 2
// Transform lock axis
#define INODE_LOCK_X 0
#define INODE_LOCK_Y 1
#define INODE_LOCK_Z 2
// Derive a class from this class, implementing the callback.
class ITreeEnumProc {
public:
virtual int callback( INode *node )=0;
};
// Return values for the TreeEnum callback:
#define TREE_CONTINUE 0 // Continue enumerating
#define TREE_IGNORECHILDREN 1 // Don't enumerate children, but continue
#define TREE_ABORT 2 // Stop enumerating
// Node properties:
#define PROPID_PINNODE PROPID_USER+1 // Returns a pointer to the node this node is pinned to
#define PROPID_PRECEDENCE PROPID_USER+2 // Returns an integer representing this node's precedence
#define PROPID_RELPOS PROPID_USER+3 // Returns a pointer to the relative vector between the node and its pin
#define PROPID_RELROT PROPID_USER+4 // Returns a pointer to the relative quaternion between the node and its pin
class INodeTransformed;
// INodeTransformed can be allocated on the stack, but if you need
// to create one dynamically, use these methods.
CoreExport void DeleteINodeTransformed(INodeTransformed *n);
CoreExport INodeTransformed *CreateINodeTransformed(INode *n,Matrix3 tm,BOOL dm=TRUE);
// This class provides a layer that will add in a transformation to the
// node's objectTM.
//
// Most methods pass through to the inode, except for the objectTM methods
// which pre-multiply in the given matrix.
//
class INodeTransformed : public INode {
public:
INode *node;
Matrix3 tm;
BOOL deleteMe;
INodeTransformed(INode *n,Matrix3 tm,BOOL dm=TRUE) {node = n;this->tm = tm;deleteMe = dm;}
void DisposeTemporary() {node->DisposeTemporary(); if (deleteMe) DeleteINodeTransformed(this);}
INode *GetActualINode() {return node->GetActualINode();}
TCHAR* GetName() {return node->GetName();}
void SetName(TCHAR *s) {node->SetName(s);}
Matrix3 GetNodeTM(TimeValue t, Interval* valid=NULL) {return node->GetNodeTM(t,valid);}
void SetNodeTM(TimeValue t, Matrix3& tm) {node->SetNodeTM(t,tm);}
void InvalidateTreeTM() {node->InvalidateTreeTM();}
void InvalidateTM() {node->InvalidateTM();}
void InvalidateWS() {node->InvalidateWS();}
Matrix3 GetObjectTM(TimeValue time, Interval* valid=NULL) {return tm*node->GetObjectTM(time,valid);}
Matrix3 GetObjTMBeforeWSM(TimeValue time, Interval* valid=NULL) {return tm*node->GetObjTMBeforeWSM(time,valid);}
Matrix3 GetObjTMAfterWSM(TimeValue time, Interval* valid=NULL) {return tm*node->GetObjTMAfterWSM(time,valid);}
const ObjectState& EvalWorldState(TimeValue time,BOOL evalHidden=TRUE) {return node->EvalWorldState(time,evalHidden);}
INode* GetParentNode() {return node->GetParentNode();}
void AttachChild(INode* node, int keepPos=1) {node->AttachChild(node,keepPos);}
void Detach(TimeValue t, int keepPos=1) {node->Detach(t,keepPos);}
int NumberOfChildren() {return node->NumberOfChildren();}
INode* GetChildNode(int i) {return node->GetChildNode(i);}
void Delete(TimeValue t, int keepChildPosition) { node->Delete(t,keepChildPosition); }
void Hide(BOOL onOff) {node->Hide(onOff);}
int IsHidden(DWORD hflags=0,BOOL forRenderer=FALSE) {return node->IsHidden(hflags,forRenderer);}
int IsNodeHidden(BOOL forRenderer=FALSE) { return node->IsNodeHidden(forRenderer); }
void Freeze(BOOL onOff) {node->Freeze(onOff);}
int IsFrozen() {return node->IsFrozen();}
void BoxMode(BOOL onOff) {node->BoxMode(onOff);}
int GetBoxMode() {return node->GetBoxMode();}
void AllEdges(BOOL onOff) {node->AllEdges(onOff);}
int GetAllEdges() {return node->GetAllEdges();}
void BackCull(BOOL onOff) {node->BackCull(onOff);}
int GetBackCull() {return node->GetBackCull();}
void SetCastShadows(BOOL onOff) { node->SetCastShadows(onOff); }
int CastShadows() { return node->CastShadows(); }
void SetRcvShadows(BOOL onOff) { node->SetRcvShadows(onOff); }
int RcvShadows() { return node->RcvShadows(); }
void SetMotBlur(BOOL onOff) { node->SetMotBlur(onOff); }
int MotBlur() { return node->MotBlur(); }
float GetImageBlurMultiplier(TimeValue t) { return node->GetImageBlurMultiplier(t);}
void SetImageBlurMultiplier(TimeValue t, float m) {node->SetImageBlurMultiplier(t,m); };
void SetImageBlurMultController(Control *cont){ node->SetImageBlurMultController(cont); }
Control *GetImageBlurMultController() {return node->GetImageBlurMultController(); }
void SetRenderable(BOOL onOff) { node->SetRenderable(onOff); }
int Renderable() { return node->Renderable(); }
void ShowBone(int boneVis) {node->ShowBone(boneVis);}
void BoneAsLine(int onOff) {node->BoneAsLine(onOff);}
BOOL IsBoneShowing() {return node->IsBoneShowing();}
BOOL IsBoneOnly() { return node->IsBoneOnly(); }
DWORD GetWireColor() {return node->GetWireColor();}
void SetWireColor(DWORD newcol) {node->SetWireColor(newcol);}
int IsRootNode() {return node->IsRootNode();}
int Selected() {return node->Selected();}
int Dependent() {return node->Dependent();}
int IsTarget() {return node->IsTarget();}
BOOL GetTransformLock(int type, int axis) {return node->GetTransformLock(type,axis);}
void SetTransformLock(int type, int axis, BOOL onOff) {node->SetTransformLock(type,axis,onOff);}
INode* GetTarget() {return node->GetTarget();}
INode* GetLookatNode() {return node->GetLookatNode();}
Matrix3 GetParentTM(TimeValue t) {return node->GetParentTM(t);}
int GetTargetTM(TimeValue t, Matrix3& m) {return node->GetTargetTM(t,m);}
Object* GetObjectRef() {return node->GetObjectRef();}
void SetObjectRef(Object *o) {node->SetObjectRef(o);}
Object* GetObjOrWSMRef() { return node->GetObjOrWSMRef();}
Control* GetTMController() {return node->GetTMController();}
void SetTMController(Control *m3cont) {node->SetTMController(m3cont);}
Control *GetVisController() {return node->GetVisController();}
void SetVisController(Control *cont) {node->SetVisController(cont);}
float GetVisibility(TimeValue t,Interval *valid=NULL) {return node->GetVisibility(t,valid);}
void SetVisibility(TimeValue t,float vis) { node->SetVisibility(t,vis); }
float GetLocalVisibility(TimeValue t,Interval *valid) { return node->GetLocalVisibility(t,valid); }
BOOL GetInheritVisibility() { return node->GetInheritVisibility(); }
void SetInheritVisibility(BOOL onOff) { node->SetInheritVisibility(onOff); }
Mtl *GetMtl() { return node->GetMtl(); }
void SetMtl(Mtl* matl) { node->SetMtl(matl); }
Material* Mtls() { return node->Mtls(); }
int NumMtls() { return node->NumMtls(); }
RenderData *GetRenderData() {return node->GetRenderData();}
void SetRenderData(RenderData *rd) {node->SetRenderData(rd);}
void SetObjOffsetPos(Point3 p) {node->SetObjOffsetPos(p);}
Point3 GetObjOffsetPos() {return node->GetObjOffsetPos();}
void SetObjOffsetRot(Quat q) {node->SetObjOffsetRot(q);}
Quat GetObjOffsetRot() {return node->GetObjOffsetRot();}
void FlagForeground(TimeValue t,BOOL notify=TRUE) {node->FlagForeground(t,notify);}
int IsActiveGrid() {return node->IsActiveGrid();}
void SetNodeLong(LONG l) {node->SetNodeLong(l);}
LONG GetNodeLong() {return node->GetNodeLong();}
void GetUserPropBuffer(TSTR &buf) {node->GetUserPropBuffer(buf);}
void SetUserPropBuffer(const TSTR &buf) {node->SetUserPropBuffer(buf);}
BOOL GetUserPropString(const TSTR &key,TSTR &string) {return node->GetUserPropString(key,string);}
BOOL GetUserPropInt(const TSTR &key,int &val) {return node->GetUserPropInt(key,val);}
BOOL GetUserPropFloat(const TSTR &key,float &val) {return node->GetUserPropFloat(key,val);}
BOOL GetUserPropBool(const TSTR &key,BOOL &b) {return node->GetUserPropBool(key,b);}
void SetUserPropString(const TSTR &key,const TSTR &string) {node->SetUserPropString(key,string);}
void SetUserPropInt(const TSTR &key,int val) {node->SetUserPropInt(key,val);}
void SetUserPropFloat(const TSTR &key,float val) {node->SetUserPropFloat(key,val);}
void SetUserPropBool(const TSTR &key,BOOL b) {node->SetUserPropBool(key,b);}
BOOL UserPropExists(const TSTR &key) {return node->UserPropExists(key);}
ULONG GetGBufID() { return node->GetGBufID(); }
void SetGBufID(ULONG id) { node->SetGBufID(id); }
UWORD GetRenderID() { return node->GetRenderID(); }
void SetRenderID(UWORD id) { node->SetRenderID(id); }
CoreExport void SetObjOffsetScale(ScaleValue sv);
CoreExport ScaleValue GetObjOffsetScale();
void Move(TimeValue t, const Matrix3& tmAxis, const Point3& val, BOOL localOrigin=FALSE, BOOL affectKids=TRUE, int pivMode=PIV_NONE, BOOL ignoreLocks=FALSE) {node->Move(t,tmAxis,val,localOrigin,pivMode,ignoreLocks);}
void Rotate(TimeValue t, const Matrix3& tmAxis, const AngAxis& val, BOOL localOrigin=FALSE, BOOL affectKids=TRUE, int pivMode=PIV_NONE, BOOL ignoreLocks=FALSE) {node->Rotate(t,tmAxis,val,localOrigin,pivMode,ignoreLocks);}
void Rotate(TimeValue t, const Matrix3& tmAxis, const Quat& val, BOOL localOrigin=FALSE, BOOL affectKids=TRUE, int pivMode=PIV_NONE, BOOL ignoreLocks=FALSE) {node->Rotate(t,tmAxis,val,localOrigin,pivMode,ignoreLocks);}
void Scale(TimeValue t, const Matrix3& tmAxis, const Point3& val, BOOL localOrigin=FALSE, BOOL affectKids=TRUE, int pivMode=PIV_NONE, BOOL ignoreLocks=FALSE) {node->Scale(t,tmAxis,val,localOrigin,pivMode,ignoreLocks);}
BOOL IsGroupMember() {return node->IsGroupMember();}
BOOL IsGroupHead() { return node->IsGroupHead();}
BOOL IsOpenGroupMember(){return node->IsOpenGroupMember();}
BOOL IsOpenGroupHead(){return node->IsOpenGroupHead();}
void SetGroupMember(BOOL b) { node->SetGroupMember(b); }
void SetGroupHead(BOOL b) { node->SetGroupHead(b); }
void SetGroupMemberOpen(BOOL b) { node->SetGroupMemberOpen(b); }
void SetGroupHeadOpen(BOOL b) { node->SetGroupHeadOpen(b); }
RefResult NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget,
PartID& partID, RefMessage message) {return REF_SUCCEED;}
};
#endif //__INODE__H
@@ -0,0 +1,211 @@
/**********************************************************************
*<
FILE: iterpik.h
DESCRIPTION: Implements IK related methods for interp controllers
CREATED BY: Rolf Berteig
HISTORY: created 6/19/95
*> Copyright (c) 1994, All Rights Reserved.
**********************************************************************/
#ifndef __INTERPIK_H__
#define __INTERPIK_H__
#define PROPID_INTERPUI (PROPID_USER+1)
#define PROPID_JOINTPARAMS (PROPID_USER+2)
#define PROPID_KEYINFO (PROPID_USER+3)
// Flags for JointParams
#define JNT_XACTIVE (1<<0)
#define JNT_YACTIVE (1<<1)
#define JNT_ZACTIVE (1<<2)
#define JNT_XLIMITED (1<<3)
#define JNT_YLIMITED (1<<4)
#define JNT_ZLIMITED (1<<5)
#define JNT_XEASE (1<<6)
#define JNT_YEASE (1<<7)
#define JNT_ZEASE (1<<8)
#define JNT_XSPRING (1<<9)
#define JNT_YSPRING (1<<10)
#define JNT_ZSPRING (1<<11)
#define JP_HELD (1<<27)
#define JNT_LIMITEXACT (1<<28)
#define JNT_ROLLOPEN (1<<29)
#define JNT_ROT (1<<30)
#define JNT_POS (1<<31)
class InterpCtrlUI : public AnimProperty {
public:
HWND hParams;
IObjParam *ip;
Control *cont;
InterpCtrlUI(HWND h,IObjParam *i,Control *c)
{hParams=h;ip=i;cont=c;}
~InterpCtrlUI() {}
DWORD ID() {return PROPID_INTERPUI;}
};
class InterpKeyInfo : public AnimProperty {
public:
DWORD ID() {return PROPID_KEYINFO;}
virtual ~InterpKeyInfo() {}
};
// IK Joint parameters
class JointParams : public AnimProperty {
public:
float *min, *max;
float *damping;
float *spring;
float *stens;
float scale;
DWORD flags;
int dofs;
CoreExport JointParams(DWORD type=JNT_POS,int dofs=3,float s=1.0f);
CoreExport JointParams(const JointParams &j);
CoreExport ~JointParams();
DWORD ID() {return PROPID_JOINTPARAMS;}
CoreExport JointParams& operator=(JointParams& j);
// Returns TRUE if the curent state is the default.
CoreExport BOOL IsDefault();
CoreExport IOResult Save(ISave *isave);
CoreExport IOResult Load(ILoad *iload);
// Applies contraints to the given delta based on parameters and the current value v.
CoreExport float ConstrainInc(int index,float v,float delta);
// Access bits
BOOL Active(int i) {return (flags&(JNT_XACTIVE<<i))?TRUE:FALSE;}
BOOL Limited(int i) {return (flags&(JNT_XLIMITED<<i))?TRUE:FALSE;}
BOOL Ease(int i) {return (flags&(JNT_XEASE<<i))?TRUE:FALSE;}
BOOL Spring(int i) {return (flags&(JNT_XSPRING<<i))?TRUE:FALSE;}
DWORD Type() {return flags & (JNT_POS|JNT_ROT);}
BOOL RollupOpen() {return (flags&JNT_ROLLOPEN)?TRUE:FALSE;}
void SetActive(int i,BOOL s) {if (s) flags|=(JNT_XACTIVE<<i); else flags&=~(JNT_XACTIVE<<i);}
void SetLimited(int i,BOOL s) {if (s) flags|=(JNT_XLIMITED<<i); else flags&=~(JNT_XLIMITED<<i);}
void SetEase(int i,BOOL s) {if (s) flags|=(JNT_XEASE<<i); else flags&=~(JNT_XEASE<<i);}
void SetSpring(int i,BOOL s) {if (s) flags|=(JNT_XSPRING<<i); else flags&=~(JNT_XSPRING<<i);}
void SetType(DWORD type) {flags&=~(JNT_POS|JNT_ROT);flags|=type;}
void SetRollOpen(BOOL open) {if (open) flags|=JNT_ROLLOPEN; else flags&= ~JNT_ROLLOPEN;}
// This is the interactive adjustment of limits
CoreExport virtual void SpinnerChange(InterpCtrlUI *ui,WORD id,ISpinnerControl *spin,BOOL interactive);
// These methods manage the joint parameters dialog.
CoreExport void InitDialog(InterpCtrlUI *ui);
CoreExport void EndDialog(InterpCtrlUI *ui,BOOL dontDel=FALSE);
CoreExport void SpinnerDown(InterpCtrlUI *ui,WORD id,ISpinnerControl *spin);
CoreExport void SpinnerUp(InterpCtrlUI *ui,WORD id,ISpinnerControl *spin,BOOL accept);
CoreExport void Command(InterpCtrlUI *ui,WORD notify, WORD id, HWND hCtrl);
CoreExport void EnableDisable(InterpCtrlUI *ui);
CoreExport void MirrorConstraints(int axis);
};
class JPLimitsRestore : public RestoreObj {
public:
JointParams *jp;
float umin[6], umax[6], uspring[6];
float rmin[6], rmax[6], rspring[6];
JPLimitsRestore(JointParams *j) {
jp = j;
for (int i=0; i<jp->dofs; i++) {
umin[i] = jp->min[i];
umax[i] = jp->max[i];
uspring[i] = jp->spring[i];
}
}
void Restore(int isUndo) {
if (isUndo) {
for (int i=0; i<jp->dofs; i++) {
rmin[i] = jp->min[i];
rmax[i] = jp->max[i];
rspring[i] = jp->spring[i];
}
}
for (int i=0; i<jp->dofs; i++) {
jp->min[i] = umin[i];
jp->max[i] = umax[i];
jp->spring[i] = uspring[i];
}
}
void Redo() {
for (int i=0; i<jp->dofs; i++) {
jp->min[i] = rmin[i];
jp->max[i] = rmax[i];
jp->spring[i] = rspring[i];
}
}
void EndHold() {
jp->flags &= ~JP_HELD;
}
};
// Just holds a couple of pointers.
class JointDlgData {
public:
InterpCtrlUI *ui;
JointParams *jp;
JointDlgData(InterpCtrlUI *ui,JointParams *jp) {this->ui=ui;this->jp=jp;}
};
// A window proc for handling joint parameters.
CoreExport BOOL CALLBACK JointParamDlgProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam);
// Handles the IK functions for all types of point3 and quat key frame controllers.
void QuatEnumIKParams(Control *cont,IKEnumCallback &callback);
BOOL QuatCompDeriv(Control *cont,TimeValue t,Matrix3& ptm,IKDeriv& derivs,DWORD flags);
float QuatIncIKParam(Control *cont,TimeValue t,int index,float delta);
CoreExport void QuatBeginIKParams(Control *cont,IObjParam *ip, ULONG flags,Animatable *prev);
void Point3EnumIKParams(Control *cont,IKEnumCallback &callback);
BOOL Point3CompDeriv(Control *cont,TimeValue t,Matrix3& ptm,IKDeriv& derivs,DWORD flags);
float Point3IncIKParam(Control *cont,TimeValue t,int index,float delta);
CoreExport void Point3BeginIKParams(Control *cont,IObjParam *ip, ULONG flags,Animatable *prev);
CoreExport BOOL CanCopyIKParams(Control *cont,int which);
CoreExport IKClipObject *CopyIKParams(Control *cont,int which);
CoreExport BOOL CanPasteIKParams(Control *cont,IKClipObject *co,int which);
CoreExport void PasteIKParams(Control *cont,IKClipObject *co,int which);
CoreExport void InitIKJointsPos(Control *cont,InitJointData *posData);
CoreExport void InitIKJointsRot(Control *cont,InitJointData *rotData);
CoreExport BOOL GetIKJointsPos(Control *cont,InitJointData *posData);
CoreExport BOOL GetIKJointsRot(Control *cont,InitJointData *rotData);
CoreExport void QuatMirrorIKConstraints(Control *cont,int axis,int which);
class StdIKClipObject : public IKClipObject {
public:
JointParams *jp;
SClass_ID sid;
Class_ID cid;
StdIKClipObject(SClass_ID s,Class_ID c,JointParams *j)
{sid=s;cid=c;jp=j;}
~StdIKClipObject() {delete jp;}
SClass_ID SuperClassID() {return sid;}
Class_ID ClassID() {return cid;}
void DeleteThis() {delete this;}
};
#define SPRINGTENS_UI (50.0f)
#define DEF_SPRINGTENS (0.02f)
#endif //__INTERPIK_H__
@@ -0,0 +1,59 @@
/**********************************************************************
*<
FILE: interval.h
DESCRIPTION: Defines TimeValue and Interval Classes
CREATED BY: Rolf Berteig
HISTORY: created 13 September 1994
950818 - Added methods for setting start/end individually (gus)
*> Copyright (c) 1994, All Rights Reserved.
**********************************************************************/
#ifndef _INTERVAL_H_
#define _INTERVAL_H_
class Interval {
private:
TimeValue start;
TimeValue end;
public:
/*
Constructors:
*/
CoreExport Interval( TimeValue s, TimeValue e );
Interval() { SetEmpty(); }
int operator==( const Interval& i ) { return( i.start==start && i.end==end ); }
CoreExport int InInterval(const TimeValue t);
int InInterval(const Interval interval) { return InInterval( interval.Start() ) && InInterval( interval.End() ); }
int Empty() { return (start == TIME_NegInfinity) && (end == TIME_NegInfinity); }
void Set ( TimeValue s, TimeValue e ) { start = s; end = e; }
void SetStart ( TimeValue s ) { start = s; }
void SetEnd ( TimeValue e ) { end = e; }
void SetEmpty() { start = TIME_NegInfinity; end = TIME_NegInfinity; }
void SetInfinite() { start = TIME_NegInfinity; end = TIME_PosInfinity; }
void SetInstant(const TimeValue t) { start = end = t; }
TimeValue Start() const { return start; }
TimeValue End() const { return end; }
TimeValue Duration() const { return end-start+TimeValue(1); } // end points included
// intersection of intervals
CoreExport Interval operator&(const Interval i) const;
Interval& operator&=(const Interval i) { return (*this = (*this&i)); }
Interval& operator+=(const TimeValue t) { if (t<start) start=t; if (t>end) end=t; return *this; }
};
#define FOREVER Interval(TIME_NegInfinity, TIME_PosInfinity)
#define NEVER Interval(TIME_NegInfinity, TIME_NegInfinity)
#endif
@@ -0,0 +1,137 @@
/**********************************************************************
*<
FILE: ioapi.h
DESCRIPTION:
CREATED BY: Dan Silva
HISTORY:
*> Copyright (c) 1994, All Rights Reserved.
**********************************************************************/
#ifndef __IOAPI__H
#define __IOAPI__H
#include "maxtypes.h"
class ILoad;
class INode;
class PostLoadCallback {
public:
virtual void proc(ILoad *iload)=0;
};
// Moved these to MAXTYPES.H
//typedef enum {IO_OK=0, IO_END=1, IO_ERROR=2} IOResult;
//typedef enum {NEW_CHUNK=0, CONTAINER_CHUNK=1, DATA_CHUNK=2} ChunkType;
//typedef enum {IOTYPE_MAX=0, IOTYPE_MATLIB=1} FileIOType;
class ISave {
public:
virtual ~ISave(){};
// Returns the index of the referenced object in the Scene stream.
virtual int GetRefID(void *ptarg)=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;
// are we saveing a MAX file or a MAT lib
virtual FileIOType DoingWhat()=0;
};
class ILoad {
public:
virtual ~ILoad(){};
// Returns the memory address of the ith object Scene stream.
virtual void* GetAddr(int imaker)=0;
// If GetAddr() returns NULL, then call this to get the address
// backpatched later, when it is known. patchThis must point at
// a valid pointer location. RecordBackpatch will patch the
// address immediately if it is available.
virtual void RecordBackpatch(int imaker, void** patchThis)=0;
// When the root of a reference hierarchy is loaded, its
// Load() can call this to store away a pointer to itself
// for later retrieval.
virtual void SetRootAddr(void *addr)=0;
virtual void* GetRootAddr()=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;
// Call this if you encounter obsolete data to cause a
// message to be displayed after loading.
virtual void SetObsolete()=0;
// Register procedure to be called after loading. These will
// be called in the order that they are registered.
// It is assumed that if the callback needs to be deleted,
// the proc will do it.
virtual void RegisterPostLoadCallback(PostLoadCallback *cb)=0;
// Gets the various directories. Constants are defined in
// JAGAPI.H
virtual TCHAR *GetDir(int which)=0;
// are we Loading a MAX file or a MAT lib
virtual FileIOType DoingWhat()=0;
// Root node to attach to when loading node with no parent
virtual INode *RootNode()=0;
};
#endif
@@ -0,0 +1,238 @@
/**********************************************************************
*<
FILE: iparamb.h
DESCRIPTION: Interface to Parameter blocks
CREATED BY: Rolf Berteig
HISTORY: created 1/25/95
*> Copyright (c) 1994, All Rights Reserved.
**********************************************************************/
#ifndef __IPARAMB__
#define __IPARAMB__
class UserType : public ReferenceTarget {
public:
virtual ~UserType() {};
virtual Control* CreateController()=0;
virtual BOOL operator==( const UserType &t )=0;
virtual UserType& operator=( const UserType &t )=0;
};
// Built in data types
enum ParamType {
TYPE_FLOAT,
TYPE_INT,
TYPE_RGBA,
TYPE_POINT3,
TYPE_BOOL,
// We can add types up to 32 total.
TYPE_USER,
};
// Chunk IDs for loading/saving
#define PB_COUNT_CHUNK 0x0001
#define PB_PARAM_CHUNK 0x0002
#define PB_INDEX_CHUNK 0x0003
#define PB_ANIMATABLE_CHUNK 0x0004
#define PB_VERSION_CHUNK 0x0005
#define PB_FLOAT_CHUNK (TYPE_FLOAT + 0x100)
#define PB_INT_CHUNK (TYPE_INT + 0x100)
#define PB_RGBA_CHUNK (TYPE_RGBA + 0x100)
#define PB_POINT3_CHUNK (TYPE_POINT3 + 0x100)
#define PB_BOOL_CHUNK (TYPE_BOOL + 0x100)
#define PB_TYPE_CHUNK 0x0200
#define PB_TYPE_FLOAT_CHUNK (PB_TYPE_CHUNK + TYPE_FLOAT)
#define PB_TYPE_INT_CHUNK (PB_TYPE_CHUNK + TYPE_INT)
#define PB_TYPE_RGBA_CHUNK (PB_TYPE_CHUNK + TYPE_RGBA)
#define PB_TYPE_POINT3_CHUNK (PB_TYPE_CHUNK + TYPE_POINT3)
#define PB_TYPE_BOOL_CHUNK (PB_TYPE_CHUNK + TYPE_BOOL)
#define PB_TYPE_USER_CHUNK (PB_TYPE_CHUNK + TYPE_USER)
// When a client of a param block receives the REFMSG_GET_PARAM_NAME
// message, the partID field is set to point at one of these structures.
// The client should fill in the parameter name.
class GetParamName {
public:
TSTR name;
int index;
GetParamName(TSTR n,int i) { name=n;index=i; }
};
// When a client of a param block receives the REFMSG_GET_PARAM_DIM
// message, the partID field is set to point at one of these structs.
// The client should set dim to point at it's dim descriptor.
class GetParamDim {
public:
ParamDimension *dim;
int index;
GetParamDim(int i) {index=i;dim=NULL;}
};
// To create a parameter block, pass an array of these descriptors
// into the Create function.
// Items in the parameter block can be refered to by index. The
// index is derived from the order in which the descriptors appear
// in the array. If a parameter is a UserType, then a pointer to a
// new UserType must be passed in. The parameter block will be responsible
// for deleting it when it is done with it.
class ParamBlockDesc {
public:
ParamType type;
UserType *user;
BOOL animatable;
};
// This version of the descriptor has an ID for each parameter.
class ParamBlockDescID {
public:
ParamType type;
UserType *user;
BOOL animatable;
DWORD id;
};
class IParamBlock;
// This class represents a virtual array of parameters.
// Parameter blocks are one such implementation of this class, but
// it can also be useful to implement a class that abstracts non-
// parameter block variables.
//
// The ParamMap class (see IParamM.h) uses this base class so that
// a ParamMap can be used to control UI for not only parameter blocks
// but variables stored outside of parameter blocks.
class IParamArray {
public:
virtual BOOL SetValue( int i, TimeValue t, float v ) {return FALSE;}
virtual BOOL SetValue( int i, TimeValue t, int v ) {return FALSE;}
virtual BOOL SetValue( int i, TimeValue t, Point3& v ) {return FALSE;}
virtual BOOL GetValue( int i, TimeValue t, float &v, Interval &ivalid ) {return FALSE;}
virtual BOOL GetValue( int i, TimeValue t, int &v, Interval &ivalid ) {return FALSE;}
virtual BOOL GetValue( int i, TimeValue t, Point3 &v, Interval &ivalid ) {return FALSE;}
// If it is a param block, this will get a pointer to it, otherwise it will return NULL.
// Note that casting won't work because of multiple iheritance.
virtual IParamBlock *GetParamBlock() {return NULL;}
// Checks to see if a keyframe exists for the given parameter at the given time
virtual BOOL KeyFrameAtTime(int i, TimeValue t) {return FALSE;}
};
class IParamBlock :
public ReferenceTarget,
public IParamArray {
public:
// Get's the super class of a parameters controller
virtual SClass_ID GetAnimParamControlType(int anim)=0;
// Get the param type
virtual ParamType GetParameterType(int i)=0;
// one for each known type
virtual BOOL SetValue( int i, TimeValue t, float v )=0;
virtual BOOL SetValue( int i, TimeValue t, int v )=0;
virtual BOOL SetValue( int i, TimeValue t, Point3& v )=0;
virtual BOOL SetValue( int i, TimeValue t, Color& v )=0; // uses Point3 controller
// one for each known type
virtual BOOL GetValue( int i, TimeValue t, float &v, Interval &ivalid )=0;
virtual BOOL GetValue( int i, TimeValue t, int &v, Interval &ivalid )=0;
virtual BOOL GetValue( int i, TimeValue t, Point3 &v, Interval &ivalid )=0;
virtual BOOL GetValue( int i, TimeValue t, Color &v, Interval &ivalid )=0; // uses Point3 Controller
virtual Color GetColor(int i, TimeValue t=0)=0;
virtual Point3 GetPoint3(int i, TimeValue t=0)=0;
virtual int GetInt(int i, TimeValue t=0)=0;
virtual float GetFloat(int i, TimeValue t=0)=0;
virtual DWORD GetVersion()=0;
virtual int NumParams()=0;
virtual void RemoveController(int i)=0;
virtual Control* GetController(int i)=0;
virtual void SetController(int i, Control *c, BOOL preserveFrame0Value=TRUE)=0;
virtual void SwapControllers(int j, int k )=0;
// Given the parameter index, what is the refNum?
virtual int GetRefNum(int paramNum)=0;
// Given the parameter index what is the animNum?
virtual int GetAnimNum(int paramNum)=0;
// Given the animNum what is the parameter index?
virtual int AnimNumToParamNum(int animNum)=0;
// Inherited from IParamArray
IParamBlock *GetParamBlock() {return this;}
// This is only for use in a RescaleWorldUnits() implementation:
// The param block implementation of RescaleWorldUnits scales only tracks
// that have dimension type = stdWorldDim. If letting the param block handle
// the rescaling is not sufficient, call this on just the parameters you need to rescale.
virtual void RescaleParam(int paramNum, float f)=0;
// When a NotifyRefChanged is received from a param block, you
// can call this method to find out which parameter generated the notify.
virtual int LastNotifyParamNum()=0;
};
CoreExport IParamBlock *CreateParameterBlock(ParamBlockDesc *pdesc, int count);
// Note: version must fit into 16 bits. (5/20/97)
CoreExport IParamBlock *CreateParameterBlock(ParamBlockDescID *pdesc, int count, DWORD version);
// This creates a new parameter block, based on an existing parameter block of
// a later version. The new parameter block inherits any parameters from
// the old parameter block whose parameter IDs match.
CoreExport IParamBlock *UpdateParameterBlock(
ParamBlockDescID *pdescOld, int oldCount, IParamBlock *oldPB,
ParamBlockDescID *pdescNew, int newCount, DWORD newVersion);
// ----------------------------------------------------------
// A handy post load call back for fixing up parameter blocks.
// This structure describes a version of the parameter block.
class ParamVersionDesc {
public:
ParamBlockDescID *desc;
int count;
DWORD version;
ParamVersionDesc(ParamBlockDescID *d,int c,int v) {desc=d;count=c;version=v;}
};
// This will look up the version of the loaded callback and
// fix it up so it matches the current version.
// NOTE: this thing deletes itself when it's done.
class ParamBlockPLCB : public PostLoadCallback {
public:
ParamVersionDesc *versions;
int count;
ParamVersionDesc *cur;
ReferenceTarget *targ;
int pbRefNum;
ParamBlockPLCB(
ParamVersionDesc *v,int cnt,ParamVersionDesc *c,
ReferenceTarget *t,int refNum)
{versions=v;count=cnt;cur=c;targ=t;pbRefNum=refNum;}
CoreExport void proc(ILoad *iload);
};
#endif
@@ -0,0 +1,188 @@
/**********************************************************************
*<
FILE: IParamM.h
DESCRIPTION: Parameter Maps
CREATED BY: Rolf Berteig
HISTORY: created 10/10/95
*> Copyright (c) 1994, All Rights Reserved.
**********************************************************************/
#ifndef __IPARAMM__
#define __IPARAMM__
class IParamMap;
class IRendParams;
// If custom handling of controls needs to be done, ParameterMap
// client can't implement one of these and set is as the ParameterMap's
// user callback.
class ParamMapUserDlgProc {
public:
virtual BOOL DlgProc(TimeValue t,IParamMap *map,HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)=0;
virtual void DeleteThis()=0;
virtual void Update(TimeValue t) {}
};
// Return this from DlgProc to get the viewports redrawn.
#define REDRAW_VIEWS 2
class IParamMap {
public:
// Mark the UI as needing to be updated.
virtual void Invalidate()=0;
// Swaps the existing parameter block with a new one and updates UI.
virtual void SetParamBlock(IParamArray *pb)=0;
// The given proc will be called _after_ default processing is done.
// The callback can then apply constraints to controls.
// Note that if the proc is non-NULL when the ParamMap is deleted
// its DeleteThis() method will be called.
virtual void SetUserDlgProc(ParamMapUserDlgProc *proc=NULL)=0;
virtual ParamMapUserDlgProc *GetUserDlgProc()=0;
// Changes a map entry to refer to a different item in the parameter block.
virtual void SetPBlockIndex(int mapIndex, int blockIndex)=0;
// Access the dialog window.
virtual HWND GetHWnd()=0;
// Access the parameter block
virtual IParamArray *GetParamBlock()=0;
// Is the dialog proc active
virtual BOOL DlgActive()=0;
};
enum ControlType {
TYPE_SPINNER,
TYPE_RADIO,
TYPE_SINGLECHEKBOX,
TYPE_MULTICHEKBOX,
TYPE_COLORSWATCH,
};
// Giving this value for scale specifies autoscale
#define SPIN_AUTOSCALE -1.0f
class ParamUIDesc {
public:
// Float or int controlled by a single spinner
CoreExport ParamUIDesc(
int index,EditSpinnerType spinType,int idEdit,int idSpin,
float lowLim,float highLim,float scale,ParamDimension *dim=defaultDim);
// int controlelled by n radio buttons
// vals[i] represents the value if ctrlIDs[i] is checked.
// if vals=NULL then ctrlIDs[i] represents a value of i.
//
// OR
//
// int controlled by multiple check boxes where each
// check boxes controlls a single bit.
// vals[i] specifies which bit ctrlIds[i] controls.
// If vals=NULL ctrlIDs[i] controls the ith bit.
CoreExport ParamUIDesc(
int index,ControlType type,int *ctrlIDs,int count,int *vals=NULL);
// int controlled by a single check box (BOOL)
// or Point3 controlled by a color swatch.
CoreExport ParamUIDesc(int index,ControlType type,int id);
// Point3 controlled by 3 spinners
CoreExport ParamUIDesc(int index,
EditSpinnerType spinType,
int idEdit1,int idSpin1,
int idEdit2,int idSpin2,
int idEdit3,int idSpin3,
float lowLim,float highLim,float scale,
ParamDimension *dim=defaultDim);
int pbIndex;
ParamType ptype;
ControlType ctype;
int id[6];
int *ids;
int *vals;
int count;
EditSpinnerType spinType;
float lowLim;
float highLim;
float scale;
ParamDimension *dim;
};
// Creates a parameter map that will handle a parameter block in a modeless
// dialog where time does not change and the viewport is not redrawn.
// Note that there is no need to destroy it. It executes the dialog and then
// destorys itself. Returns TRUE if the user selected OK, FALSE otherwise.
CoreExport BOOL CreateModalParamMap(
ParamUIDesc *desc,int count,
IParamArray *pb,
TimeValue t,
HINSTANCE hInst,
TCHAR *dlgTemplate,
HWND hParent,
ParamMapUserDlgProc *proc=NULL);
// Creates a parameter map to handle the display of parameters in the command panal.
//
// This will add a rollup page to the command panel.
// DestroyCPParamMap().
//
CoreExport IParamMap *CreateCPParamMap(
ParamUIDesc *desc,int count,
IParamArray *pb,
Interface *ip,
HINSTANCE hInst,
TCHAR *dlgTemplate,
TCHAR *title,
DWORD flags);
CoreExport void DestroyCPParamMap(IParamMap *m);
// Creates a parameter map to handle the display of render parameters or
// atmospheric plug-in parameters.
CoreExport IParamMap *CreateRParamMap(
ParamUIDesc *desc,int count,
IParamArray *pb,
IRendParams *ip,
HINSTANCE hInst,
TCHAR *dlgTemplate,
TCHAR *title,
DWORD flags);
CoreExport void DestroyRParamMap(IParamMap *m);
// Creates a parameter map to handle the display of texture map or
// material parameters in the material editor.
CoreExport IParamMap *CreateMParamMap(
ParamUIDesc *desc,int count,
IParamArray *pb,
IMtlParams *ip,
HINSTANCE hInst,
TCHAR *dlgTemplate,
TCHAR *title,
DWORD flags);
CoreExport void DestroyMParamMap(IParamMap *m);
#endif // __IPARAMM__
@@ -0,0 +1,123 @@
/**********************************************************************
*<
FILE: ipoint2.h
DESCRIPTION: Class definintion for IPoint2: Integer 2D point.
CREATED BY: Dan Silva
HISTORY:
*> Copyright (c) 1994, All Rights Reserved.
**********************************************************************/
#ifndef __IPOINT2__
#define __IPOINT2__
class ostream;
class IPoint2 {
public:
int x,y;
// Constructors
IPoint2(){}
IPoint2(int X, int Y) { x = X; y = Y; }
IPoint2(const IPoint2& a) { x = a.x; y = a.y; }
IPoint2(int af[2]) { x = af[0]; y = af[1]; }
// Access operators
int& operator[](int i) { return (&x)[i]; }
const int& operator[](int i) const { return (&x)[i]; }
// Conversion function
operator int*() { return(&x); }
// Unary operators
IPoint2 operator-() const { return(IPoint2(-x,-y)); }
IPoint2 operator+() const { return *this; }
// Assignment operators
IPoint2& operator-=(const IPoint2&);
IPoint2& operator+=(const IPoint2&);
DllExport IPoint2& operator*=(int);
DllExport IPoint2& operator/=(int);
// Binary operators
DllExport IPoint2 IPoint2::operator-(const IPoint2&) const;
DllExport IPoint2 IPoint2::operator+(const IPoint2&) const;
DllExport int DotProd(const IPoint2&) const; // DOT PRODUCT
DllExport int operator*(const IPoint2&) const; // DOT PRODUCT
// Relational operators
int operator==(const IPoint2& p) const { return (x == p.x && y == p.y); }
};
int DllExport Length(const IPoint2&);
IPoint2 DllExport Normalize(const IPoint2&); // Return a unit vector.
IPoint2 DllExport operator*(int, const IPoint2&); // multiply by scalar
IPoint2 DllExport operator*(const IPoint2&, int); // multiply by scalar
IPoint2 DllExport operator/(const IPoint2&, int); // divide by scalar
ostream DllExport &operator<<(ostream&, const IPoint2&);
// Inlines:
inline int MaxComponent(const IPoint2& p) { return(p.x>p.y?0:1); }
inline int MinComponent(const IPoint2& p) { return(p.x<p.y?0:1); }
inline int Length(const IPoint2& v) {
return (int)sqrt((double)(v.x*v.x+v.y*v.y));
}
inline IPoint2& IPoint2::operator-=(const IPoint2& a) {
x -= a.x; y -= a.y;
return *this;
}
inline IPoint2& IPoint2::operator+=(const IPoint2& a) {
x += a.x; y += a.y;
return *this;
}
inline IPoint2& IPoint2::operator*=(int f) {
x *= f; y *= f;
return *this;
}
inline IPoint2& IPoint2::operator/=(int f) {
x /= f; y /= f;
return *this;
}
inline IPoint2 IPoint2::operator-(const IPoint2& b) const{
return(IPoint2(x-b.x,y-b.y));
}
inline IPoint2 IPoint2::operator+(const IPoint2& b) const {
return(IPoint2(x+b.x,y+b.y));
}
inline int IPoint2::DotProd(const IPoint2& b) const{
return(x*b.x+y*b.y);
}
inline int IPoint2::operator*(const IPoint2& b)const {
return(x*b.x+y*b.y);
}
inline IPoint2 operator*(int f, const IPoint2& a) {
return(IPoint2(a.x*f, a.y*f));
}
inline IPoint2 operator*(const IPoint2& a, int f) {
return(IPoint2(a.x*f, a.y*f));
}
inline IPoint2 operator/(const IPoint2& a, int f) {
return(IPoint2(a.x/f, a.y/f));
}
#endif
@@ -0,0 +1,96 @@
/**********************************************************************
*<
FILE: ipoint3.h
DESCRIPTION: Class definitions for IPoint3
CREATED BY: Dan Silva
HISTORY:
*> Copyright (c) 1994, All Rights Reserved.
**********************************************************************/
#ifndef __IPOINT3__
#define __IPOINT3__
class ostream;
class IPoint3 {
public:
int x,y,z;
// Constructors
IPoint3(){}
IPoint3(int X, int Y, int Z) { x = X; y = Y; z = Z; }
IPoint3(const IPoint3& a) { x = a.x; y = a.y; z = a.z; }
IPoint3(int ai[3]) { x = ai[0]; y = ai[1]; z = ai[2]; }
// Access operators
int& operator[](int i) { return (&x)[i]; }
const int& operator[](int i) const { return (&x)[i]; }
// Conversion function
operator int*() { return(&x); }
// Unary operators
IPoint3 operator-() const { return(IPoint3(-x,-y,-z)); }
IPoint3 operator+() const { return *this; }
// Assignment operators
DllExport IPoint3& operator-=(const IPoint3&);
DllExport IPoint3& operator+=(const IPoint3&);
// Binary operators
DllExport IPoint3 operator-(const IPoint3&) const;
DllExport IPoint3 operator+(const IPoint3&) const;
DllExport int operator*(const IPoint3&) const; // DOT PRODUCT
DllExport int DotProd(const IPoint3&) const; // DOT PRODUCT
DllExport IPoint3 operator^(const IPoint3&) const; // CROSS PRODUCT
DllExport IPoint3 CrossProd(const IPoint3&) const; // CROSS PRODUCT
// Relational operators
int operator==(const IPoint3& p) const { return (x == p.x && y == p.y && z == p.z); }
};
// friends, so you can write Length(A) instead of A.Length(), etc.
int DllExport MaxComponent(const IPoint3&); // the component with the maximum abs value
int DllExport MinComponent(const IPoint3&); // the component with the minimum abs value
ostream DllExport &operator<<(ostream&, const IPoint3&);
// Inlines:
inline float Length(const IPoint3& v) {
return (float)sqrt((double)(v.x*v.x+v.y*v.y+v.z*v.z));
}
inline IPoint3& IPoint3::operator-=(const IPoint3& a) {
x -= a.x; y -= a.y; z -= a.z;
return *this;
}
inline IPoint3& IPoint3::operator+=(const IPoint3& a) {
x += a.x; y += a.y; z += a.z;
return *this;
}
inline IPoint3 IPoint3::operator-(const IPoint3& b) const {
return(IPoint3(x-b.x,y-b.y,z-b.z));
}
inline IPoint3 IPoint3::operator+(const IPoint3& b) const {
return(IPoint3(x+b.x,y+b.y,z+b.z));
}
inline int IPoint3::operator*(const IPoint3& b) const {
return(x*b.x+y*b.y+z*b.z);
}
inline int IPoint3::DotProd(const IPoint3& b) const {
return(x*b.x+y*b.y+z*b.z);
}
#endif
@@ -0,0 +1,911 @@
/**********************************************************************
*<
FILE: istdplug.h
DESCRIPTION: Interfaces into some of the standard plug-ins
that ship with MAX
CREATED BY: Rolf Berteig
HISTORY: created 20 January 1996
*> Copyright (c) 1994, All Rights Reserved.
**********************************************************************/
#ifndef __ISTDPLUG__
#define __ISTDPLUG__
//----------------------------------------------------------------
// The following are parameter block IDs for procedural objects
// Arc
#define ARC_RADIUS 0
#define ARC_FROM 1
#define ARC_TO 2
#define ARC_PIE 3
#define ARC_REVERSE 4
// Box object
#define BOXOBJ_LENGTH 0
#define BOXOBJ_WIDTH 1
#define BOXOBJ_HEIGHT 2
#define BOXOBJ_WSEGS 3
#define BOXOBJ_LSEGS 4
#define BOXOBJ_HSEGS 5
#define BOXOBJ_GENUVS 6
// Circle
#define CIRCLE_RADIUS 0
// Cone
#define CONE_RADIUS1 0
#define CONE_RADIUS2 1
#define CONE_HEIGHT 2
#define CONE_SEGMENTS 3
#define CONE_CAPSEGMENTS 4
#define CONE_SIDES 5
#define CONE_SMOOTH 6
#define CONE_SLICEON 7
#define CONE_PIESLICE1 8
#define CONE_PIESLICE2 9
#define CONE_GENUVS 10
// Cylinder
#define CYLINDER_RADIUS 0
#define CYLINDER_HEIGHT 1
#define CYLINDER_SEGMENTS 2
#define CYLINDER_CAPSEGMENTS 3
#define CYLINDER_SIDES 4
#define CYLINDER_SMOOTH 5
#define CYLINDER_SLICEON 6
#define CYLINDER_PIESLICE1 7
#define CYLINDER_PIESLICE2 8
#define CYLINDER_GENUVS 9
// Donut
#define DONUT_RADIUS1 0
#define DONUT_RADIUS2 1
// Ellipse
#define ELLIPSE_LENGTH 0
#define ELLIPSE_WIDTH 1
// Hedra
#define HEDRA_RADIUS 0
#define HEDRA_FAMILY 1
#define HEDRA_P 2
#define HEDRA_Q 3
#define HEDRA_SCALEP 4
#define HEDRA_SCALEQ 5
#define HEDRA_SCALER 6
#define HEDRA_VERTS 7
#define HEDRA_GENUVS 8
// Helix
#define HELIX_RADIUS1 0
#define HELIX_RADIUS2 1
#define HELIX_HEIGHT 2
#define HELIX_TURNS 3
#define HELIX_BIAS 4
#define HELIX_DIRECTION 5
// NGon
#define NGON_RADIUS 0
#define NGON_SIDES 1
#define NGON_CIRCULAR 2
// PatchGrid
#define PATCHGRID_LENGTH 0
#define PATCHGRID_WIDTH 1
#define PATCHGRID_WSEGS 2
#define PATCHGRID_LSEGS 3
#define PATCHGRID_TEXTURE 4
// Rain/snow
#define RSPART_VPTPARTICLES 0
#define RSPART_RNDPARTICLES 1
#define RSPART_DROPSIZE 2
#define RSPART_SPEED 3
#define RSPART_VARIATION 4
#define RSPART_DISPTYPE 5
#define RSPART_STARTTIME 6
#define RSPART_LIFETIME 7
#define RSPART_EMITTERWIDTH 8
#define RSPART_EMITTERHEIGHT 9
#define RSPART_HIDEEMITTER 10
#define RSPART_BIRTHRATE 11
#define RSPART_CONSTANT 12
#define RSPART_RENDER 13
#define RSPART_TUMBLE 14
#define RSPART_SCALE 15
// Rectangle
#define RECTANGLE_LENGTH 0
#define RECTANGLE_WIDTH 1
#define RECTANGLE_FILLET 2
// Sphere
#define SPHERE_RADIUS 0
#define SPHERE_SEGS 1
#define SPHERE_SMOOTH 2
#define SPHERE_HEMI 3
#define SPHERE_SQUASH 4
#define SPHERE_RECENTER 5
#define SPHERE_GENUVS 6
// Star
#define START_RADIUS1 0
#define START_RADIUS2 1
#define START_POINTS 2
#define START_DISTORT 3
#define START_FILLET1 4
#define START_FILLET2 5
// Tea Pot
#define TEAPOT_RADIUS 0
#define TEAPOT_SEGS 1
#define TEAPOT_SMOOTH 2
#define TEAPOT_TEAPART 3
#define TEAPOT_BODY 4
#define TEAPOT_HANDLE 5
#define TEAPOT_SPOUT 6
#define TEAPOT_LID 7
#define TEAPOT_GENUVS 8
// Text
#define TEXT_SIZE 0
#define TEXT_KERNING 1
#define TEXT_LEADING 2
// torus
#define TORUS_RADIUS 0
#define TORUS_RADIUS2 1
#define TORUS_ROTATION 2
#define TORUS_TWIST 3
#define TORUS_SEGMENTS 4
#define TORUS_SIDES 5
#define TORUS_SMOOTH 6
#define TORUS_SLICEON 7
#define TORUS_PIESLICE1 8
#define TORUS_PIESLICE2 9
#define TORUS_GENUVS 10
// Tube
#define TUBE_RADIUS 0
#define TUBE_RADIUS2 1
#define TUBE_HEIGHT 2
#define TUBE_SEGMENTS 3
#define TUBE_CAPSEGMENTS 4
#define TUBE_SIDES 5
#define TUBE_SMOOTH 6
#define TUBE_SLICEON 7
#define TUBE_PIESLICE1 8
#define TUBE_PIESLICE2 9
#define TUBE_GENUVS 10
// Grid
#define GRIDHELP_LENGTH 0
#define GRIDHELP_WIDTH 1
#define GRIDHELP_GRID 2
//----------------------------------------------------------------
// The following are parameter block IDs for modifiers
// Bend
#define BEND_ANGLE 0
#define BEND_DIR 1
#define BEND_AXIS 2
#define BEND_DOREGION 3
#define BEND_FROM 4
#define BEND_TO 5
// Bomb
#define BOMB_STRENGTH 0
#define BOMB_GRAVITY 1
#define BOMB_CHAOS 2
#define BOMB_DETONATION 3
// Deflector
#define DEFLECTOR_BOUNCE 0
#define DEFLECTOR_WIDTH 1
#define DEFLECTOR_HEIGHT 2
// Displace (modifier and space warp object)
#define DISPLACE_MAPTYPE 0
#define DISPLACE_UTILE 1
#define DISPLACE_VTILE 2
#define DISPLACE_WTILE 3
#define DISPLACE_BLUR 4
#define DISPLACE_USEMAP 5
#define DISPLACE_APPLYMAP 6
#define DISPLACE_STRENGTH 7
#define DISPLACE_DECAY 8
#define DISPLACE_CENTERLUM 9
#define DISPLACE_UFLIP 10
#define DISPLACE_VFLIP 11
#define DISPLACE_WFLIP 12
#define DISPLACE_CENTERL 13
#define DISPLACE_CAP 14
#define DISPLACE_LENGTH 15
#define DISPLACE_WIDTH 16
#define DISPLACE_HEIGHT 17
#define DISPLACE_AXIS 18
// Extrude
#define EXTRUDE_AMOUNT 0
#define EXTRUDE_SEGS 1
#define EXTRUDE_CAPSTART 2
#define EXTRUDE_CAPEND 3
#define EXTRUDE_CAPTYPE 4
#define EXTRUDE_OUTPUT 5
#define EXTRUDE_MAPPING 6
// Gravity
#define GRAVITY_STRENGTH 0
#define GRAVITY_DECAY 1
#define GRAVITY_TYPE 2
#define GRAVITY_DISPLENGTH 3
// Wind
#define WIND_STRENGTH 0
#define WIND_DECAY 1
#define WIND_TYPE 2
#define WIND_DISPLENGTH 3
#define WIND_TURBULENCE 4
#define WIND_FREQUENCY 5
#define WIND_SCALE 6
// UVW map
#define UVWMAP_MAPTYPE 0
#define UVWMAP_UTILE 1
#define UVWMAP_VTILE 2
#define UVWMAP_WTILE 3
#define UVWMAP_UFLIP 4
#define UVWMAP_VFLIP 5
#define UVWMAP_WFLIP 6
#define UVWMAP_CAP 7
#define UVWMAP_CHANNEL 8
#define UVWMAP_LENGTH 9
#define UVWMAP_WIDTH 10
#define UVWMAP_HEIGHT 11
#define UVWMAP_AXIS 12
// Noise mod
#define NOISEMOD_SEED 0
#define NOISEMOD_SCALE 1
#define NOISEMOD_FRACTAL 2
#define NOISEMOD_ROUGH 3
#define NOISEMOD_ITERATIONS 4
#define NOISEMOD_ANIMATE 5
#define NOISEMOD_FREQ 6
#define NOISEMOD_PHASE 7
#define NOISEMOD_STRENGTH 8
// Optimize
#define OPTMOD_RENDER 0
#define OPTMOD_VIEWS 1
#define OPTMOD_FACETHRESH1 2
#define OPTMOD_EDGETHRESH1 3
#define OPTMOD_BIAS1 4
#define OPTMOD_PRESERVEMAT1 5
#define OPTMOD_PRESERVESMOOTH1 6
#define OPTMOD_MAXEDGE1 7
#define OPTMOD_FACETHRESH2 8
#define OPTMOD_EDGETHRESH2 9
#define OPTMOD_BIAS2 10
#define OPTMOD_PRESERVEMAT2 11
#define OPTMOD_PRESERVESMOOTH2 12
#define OPTMOD_MAXEDGE2 13
#define OPTMOD_AUTOEDGE 14
#define OPTMOD_MANUPDATE 15
// Volume selection modifier
#define VOLSEL_LEVEL 0
#define VOLSEL_METHOD 1
#define VOLSEL_TYPE 2
#define VOLSEL_VOLUME 3
#define VOLSEL_INVERT 4
// Ripple/Wave space warp object and object space modifier
#define RWAVE_AMPLITUDE 0
#define RWAVE_AMPLITUDE2 1
#define RWAVE_WAVELEN 2
#define RWAVE_PHASE 3
#define RWAVE_DECAY 4
#define RWAVE_CIRCLES 5 // These last three are only valid for space warp objects
#define RWAVE_SEGMENTS 6
#define RWAVE_DIVISIONS 7
// Ripple/Wave binding (modifier)
#define RWAVE_FLEX 0
// Skew
#define SKEW_AMOUNT 0
#define SKEW_DIR 1
#define SKEW_AXIS 2
#define SKEW_DOREGION 3
#define SKEW_FROM 4
#define SKEW_TO 5
// Material modifier
#define MATMOD_MATID 0
// Smoothing group modifier
#define SMOOTHMOD_AUTOSMOOTH 0
#define SMOOTHMOD_THRESHOLD 1
#define SMOOTHMOD_SMOOTHBITS 2
// Normal modifier
#define NORMMOD_UNIFY 0
#define NORMMOD_FLIP 1
// SurfRev (Lathe) modifier
#define SURFREV_DEGREES 0
#define SURFREV_SEGS 1
#define SURFREV_CAPSTART 2
#define SURFREV_CAPEND 3
#define SURFREV_CAPTYPE 4
#define SURFREV_WELDCORE 5
#define SURFREV_OUTPUT 6
#define SURFREV_MAPPING 7
// Taper
#define TAPER_AMT 0
#define TAPER_CRV 1
#define TAPER_AXIS 2
#define TAPER_EFFECTAXIS 3
#define TAPER_SYMMETRY 4
#define TAPER_DOREGION 5
#define TAPER_FROM 6
#define TAPER_TO 7
// Twist
#define TWIST_ANGLE 0
#define TWIST_BIAS 1
#define TWIST_AXIS 2
#define TWIST_DOREGION 3
#define TWIST_FROM 4
#define TWIST_TO 5
// Material mod
#define MATMOD_MATID 0
// Smooth mod
#define SMOOTH_AUTOSMOOTH 0
#define SMOOTH_THRESHOLD 1
#define SMOOTH_SMOOTHBITS 2
// Normal mod
#define NORMALMOD_UNIFY 0
#define NORMALMOD_FLIP 1
// Tessellation mod
#define TESSMOD_TYPE 0
#define TESSMOD_TENSION 1
#define TESSMOD_ITERATIONS 2
#define TESSMOD_FACE_TYPE 3
// UVW xform
#define UVWXFORM_UTILE 0
#define UVWXFORM_VTILE 1
#define UVWXFORM_WTILE 2
#define UVWXFORM_UOFFSET 3
#define UVWXFORM_VOFFSET 4
#define UVWXFORM_WOFFSET 5
#define UVWXFORM_UFLIP 6
#define UVWXFORM_VFLIP 7
#define UVWXFORM_WFLIP 8
#define UVWXFORM_CHANNEL 9
//-- Text shape object interface -------------------------
// Use GetTextObjectInterface() to get a pointer to an
// ITextObject given a pointer to an Object.
// Flags passed to ChangeFont()
#define TEXTOBJ_ITALIC (1<<1)
#define TEXTOBJ_UNDERLINE (1<<2)
// Alignment types
#define TEXTOBJ_LEFT 0
#define TEXTOBJ_CENTER 1
#define TEXTOBJ_RIGHT 2
#define TEXTOBJ_JUSTIFIED 3
class ITextObject {
public:
// Returns TRUE if string is changed. Can't change string if current font is not installed
virtual BOOL ChangeText(TSTR string)=0;
// Returns TRUE if font is successfully changed.
virtual BOOL ChangeFont(TSTR name, DWORD flags)=0;
// Get fount and string
virtual TSTR GetFont()=0;
virtual TSTR GetString()=0;
// Get/Set styles
virtual BOOL GetItalic()=0;
virtual BOOL GetUnderline()=0;
virtual void SetItalic(BOOL sw)=0;
virtual void SetUnderline(BOOL sw)=0;
// Get/Set alignment
virtual BOOL SetAlignment(int type)=0;
virtual int GetAlignment()=0;
};
//-- Controller interfaces -------------------------------
// Base key class
class IKey {
public:
TimeValue time;
DWORD flags;
IKey() {time=0;flags=0;}
};
//--- TCB keys -------------
class ITCBKey : public IKey {
public:
float tens, cont, bias, easeIn, easeOut;
};
class ITCBFloatKey : public ITCBKey {
public:
float val;
};
class ITCBPoint3Key : public ITCBKey {
public:
Point3 val;
};
class ITCBRotKey : public ITCBKey {
public:
AngAxis val;
};
class ITCBScaleKey : public ITCBKey {
public:
ScaleValue val;
};
//--- Bezier keys -------------
class IBezFloatKey : public IKey {
public:
float intan, outtan;
float val;
};
class IBezPoint3Key : public IKey {
public:
Point3 intan, outtan;
Point3 val;
};
class IBezQuatKey : public IKey {
public:
Quat val;
};
class IBezScaleKey : public IKey {
public:
Point3 intan, outtan;
ScaleValue val;
};
//--- Linear Keys --------------
class ILinFloatKey : public IKey {
public:
float val;
};
class ILinPoint3Key : public IKey {
public:
Point3 val;
};
class ILinRotKey : public IKey {
public:
Quat val;
};
class ILinScaleKey : public IKey {
public:
ScaleValue val;
};
// --- Flag bits for keys -------------------------------
// General flags
#define IKEY_SELECTED (1<<0)
#define IKEY_XSEL (1<<1)
#define IKEY_YSEL (1<<2)
#define IKEY_ZSEL (1<<3)
#define IKEY_FLAGGED (1<<13)
#define IKEY_TIME_LOCK (1<<14)
// TCB specific key flags
#define TCBKEY_QUATVALID (1<<4) // When this bit is set the angle/axis is derived from the quat instead of vice/versa
// Bezier specific key flags
#define BEZKEY_XBROKEN (1<<4) // Broken means not locked
#define BEZKEY_YBROKEN (1<<5)
#define BEZKEY_ZBROKEN (1<<6)
// The in and out types are stored in bits 7-13
#define BEZKEY_NUMTYPEBITS 3
#define BEZKEY_INTYPESHIFT 7
#define BEZKEY_OUTTYPESHIFT (BEZKEY_INTYPESHIFT+BEZKEY_NUMTYPEBITS)
#define BEZKEY_TYPEMASK 7
// Bezier tangent types
#define BEZKEY_SMOOTH 0
#define BEZKEY_LINEAR 1
#define BEZKEY_STEP 2
#define BEZKEY_FAST 3
#define BEZKEY_SLOW 4
#define BEZKEY_USER 5
#define NUM_TANGENTTYPES 6
// This key is interpolated using arclength as the interpolation parameter
#define BEZKEY_CONSTVELOCITY (1<<15)
#define TangentsLocked(f,j) (!(f&(BEZKEY_XBROKEN<<j)))
#define SetTangentLock(f,j,l) {if (l) (f)=(f)&(~(BEZKEY_XBROKEN<<j)); else (f)|=(BEZKEY_XBROKEN<<j);}
// Macros to access hybrid tangent types
#define GetInTanType(f) int(((f)>>BEZKEY_INTYPESHIFT)&BEZKEY_TYPEMASK)
#define GetOutTanType(f) int(((f)>>BEZKEY_OUTTYPESHIFT)&BEZKEY_TYPEMASK)
#define SetInTanType(f,t) {(f) = ((f)&(~(BEZKEY_TYPEMASK<<BEZKEY_INTYPESHIFT)))|(t<<BEZKEY_INTYPESHIFT);}
#define SetOutTanType(f,t) {(f) = ((f)&(~(BEZKEY_TYPEMASK<<BEZKEY_OUTTYPESHIFT)))|(t<<BEZKEY_OUTTYPESHIFT);}
// Track flags
#define TFLAG_CURVESEL (1<<0)
#define TFLAG_RANGE_UNLOCKED (1<<1)
#define TFLAG_LOOPEDIN (1<<3)
#define TFLAG_LOOPEDOUT (1<<4)
#define TFLAG_COLOR (1<<5) // Set for Bezier Point3 controlers that are color controllers
#define TFLAG_HSV (1<<6) // Set for color controls that interpolate in HSV
//-------------------------------------------------------
// This is an interface into either a TCB or Bezier key
// frame controller. It is up to the client to make sure
// that the IKey* point to a key of the approriate derived
// class based on the ClassID() of the controller.
class IKeyControl {
public:
// Total number of keys.
virtual int GetNumKeys()=0;
// Sets the number of keys allocated.
// May add blank keys or delete existing keys
virtual void SetNumKeys(int n)=0;
// Fill in 'key' with the ith key
virtual void GetKey(int i,IKey *key)=0;
// Set the ith key
virtual void SetKey(int i,IKey *key)=0;
// Append a new key onto the end. Note that the
// key list will ultimately be sorted by time. Returns
// the key's index.
virtual int AppendKey(IKey *key)=0;
// If any changes are made that would require the keys to be sorted
// this method should be called.
virtual void SortKeys()=0;
// Access track flags
virtual DWORD &GetTrackFlags()=0;
};
// To get a pointer to the above interface given a pointer to a controller
// use the macro defined in animtbl.h: GetKeyControlInterface()
// Access to default key parameters
CoreExport void SetBezierDefaultTangentType(int in, int out);
CoreExport void GetBezierDefaultTangentType(int &in, int &out);
CoreExport void SetTCBDefaultParams(float t, float c, float b, float easeIn, float easeOut);
CoreExport void GetTCBDefaultParams(float &t, float &c, float &b, float &easeIn, float &easeOut);
//-----------------------------------------------------------
// A plug-in can register itself to read a particular APP_DATA
// chunk when a 3DS file is loaded. If a chunk is encountered
// that matches a registered plug-in, that plug-in will be
// asked to create an instance of itself based on the contents
// of the APP_DATA chunk.
class TriObject;
class ObjectDataReaderCallback {
public:
// Chunk name
virtual char *DataName()=0;
// Create an instance of an object based on the data and the original mesh object
virtual Object *ReadData(TriObject *obj, void *data, DWORD len)=0;
virtual void DeleteThis()=0;
};
CoreExport void RegisterObjectAppDataReader(ObjectDataReaderCallback *cb);
CoreExport Object *ObjectFromAppData(TriObject *obj, char *name, void *data, DWORD len);
// Note about 3DS App Data:
// If app data is encountered and no plug-in has registered to
// convert it, then it is just hung off the object (or INode in
// the case of KXP app data).
// For object app data, TriObject's super class and class ID are used
// to identify the chunk and the sub ID is set to 0.
// For node app data, INode's super class and class ID are used
// to identify the chunk and the sub ID is set to 0.
//
// This single MAX app data chunk will contain the entire
// 3DS app data chunk, which may have sub chunks (see IPAS SDK).
// The following routines will aid in parsing 3DS app data.
// Get the ID string out of an XDATA_ENTRY chunk and null terminates it
CoreExport void GetIDStr(char *chunk, char *idstring);
// Returns the offset into 'appd' of the specified chunk
// or -1 if it is not found
CoreExport int FindAppDataChunk(void *appd, DWORD len, char *idstring);
// Similar to Find, but actually returns a pointer to the chunk
// or NULL if it is not found
CoreExport void *GetAppDataChunk(void *appd, DWORD len, char *idstring);
// Adds the chunk to the appdata chunk, preserving existing chunks.
// 'chunk' should point to the new chunk header followed by its data.
CoreExport int SetAppDataChunk(void **pappd, DWORD &len, void *chunk);
// Deletes a chunk from the appdata while preserving other chunks.
CoreExport int DeleteAppDataChunk(void **pappd, DWORD &len, char *idstring);
// Known sub chunks inside an appdata chunk
#define XDATA_ENTRY 0x8001
#define XDATA_APPNAME 0x8002
//---------------------------------------------------------
// Interface into MAX's default WAV sound object
// use the Interface method GetSoundObject() to get a pointer
// to the current sound object and then use the
// GetWaveSoundInterface() on the result to see if it supports
// this interface.
class IWaveSound {
public:
// Retreives the name of the current sound file
virtual TSTR GetSoundFileName()=0;
// Sets the sound file. This will cause the WAV to
// be loaded into the tack view. Returns FALSE if
// the file can't be opened or no wave track exist.
virtual BOOL SetSoundFileName(TSTR name)=0;
// Set the time offset for the wave
virtual void SetStartTime(TimeValue t)=0;
// Get the time offset for the wave
virtual TimeValue GetStartTime()=0;
virtual TimeValue GetEndTime()=0;
};
//-----------------------------------------------------------
//
// Access to the boolean object's parameters. Given a pointer to
// an object whose class ID is BOOLOBJ_CLASS_ID, you can cast that
// pointer to the following class
//
#define BOOLOP_UNION 0
#define BOOLOP_INTERSECTION 1
#define BOOLOP_SUB_AB 2
#define BOOLOP_SUB_BA 3
#define BOOLUPDATE_ALWAYS 0
#define BOOLUPDATE_SELECTED 1
#define BOOLUPDATE_RENDER 2
#define BOOLUPDATE_MANUAL 3
class IBoolObject : public GeomObject {
public:
virtual BOOL GetOperandSel(int which)=0;
virtual void SetOperandSel(int which,BOOL sel)=0;
virtual int GetBoolOp()=0;
virtual void SetBoolOp(int op)=0;
virtual BOOL GetDisplayResult()=0;
virtual void SetDisplayResult(BOOL onOff)=0;
virtual BOOL GetShowHiddenOps()=0;
virtual void SetShowHiddenOps(BOOL onOff)=0;
virtual int GetUpdateMode()=0;
virtual void SetUpdateMode(int mode)=0;
virtual BOOL GetOptimize()=0;
virtual void SetOptimize(BOOL onOff)=0;
};
// The boolean object has four references. 2 references to the
// operand objects and 2 references to transform controllers
// providing a transformation matrix for the 2 operands.
#define BOOLREF_OBJECT1 0
#define BOOLREF_OBJECT2 1
#define BOOLREF_CONT1 2
#define BOOLREF_CONT2 3
//-------------------------------------------------------------
// Access to path controller's parameters.
//
class IPathPosition : public Control {
public:
virtual BOOL SetPathNode(INode *node)=0;
virtual void SetFollow(BOOL f)=0;
virtual BOOL GetFollow()=0;
virtual void SetBankAmount(float a)=0;
virtual float GetBankAmount()=0;
virtual void SetBank(BOOL b)=0;
virtual BOOL GetBank()=0;
virtual void SetTracking(float t)=0; // smoothness
virtual float GetTracking()=0;
virtual void SetAllowFlip(BOOL f)=0;
virtual BOOL GetAllowFlip()=0;
virtual void SetConstVel(BOOL cv)=0;
virtual BOOL GetConstVel()=0;
virtual void SetFlip(BOOL onOff)=0;
virtual BOOL GetFlip()=0;
virtual void SetAxis(int axis)=0;
virtual int GetAxis()=0;
};
// Bank and tracking are scaled in the UI.
#define BANKSCALE 100.0f
#define FromBankUI(a) ((a)*BANKSCALE)
#define ToBankUI(a) ((a)/BANKSCALE)
#define TRACKSCALE 0.04f
#define FromTrackUI(a) ((a)*TRACKSCALE)
#define ToTrackUI(a) ((a)/TRACKSCALE)
// percent controller and path node refs
#define PATHPOS_PERCENT_REF 0
#define PATHPOS_PATH_REF 1
//-------------------------------------------------------------
// Access to noise controller's parameters.
// All noise controllers are derived from this class
//
class INoiseControl : public StdControl {
public:
virtual void SetSeed(int seed)=0;
virtual int GetSeed()=0;
virtual void SetFrequency(float f)=0;
virtual float GetFrequency()=0;
virtual void SetFractal(BOOL f)=0;
virtual BOOL GetFractal()=0;
virtual void SetRoughness(float f)=0;
virtual float GetRoughness()=0;
virtual void SetRampIn(TimeValue in)=0;
virtual TimeValue GetRampIn()=0;
virtual void SetRampOut(TimeValue out)=0;
virtual TimeValue GetRampOut()=0;
virtual void SetPositiveOnly(int which,BOOL onOff)=0;
virtual BOOL GetPositiveOnly(int which)=0;
virtual Control *GetStrengthController()=0;
virtual void SetStrengthController(Control *c)=0;
};
//-------------------------------------------------------------
// Access to SurfPosition controller
//
class ISurfPosition : public Control {
public:
virtual void SetSurface(INode *node)=0;
virtual int GetAlign()=0;
virtual void SetAlign(int a)=0;
virtual BOOL GetFlip()=0;
virtual void SetFlip(BOOL f)=0;
};
// Surface controller references
#define SURFCONT_U_REF 0
#define SURFCONT_V_REF 1
#define SURFCONT_SURFOBJ_REF 2
//-------------------------------------------------------------
// Access to the LinkCtrl
//
class ILinkCtrl : public Control {
public:
virtual int GetParentCount()=0;
virtual TimeValue GetLinkTime(int i)=0;
virtual void SetLinkTime(int i,TimeValue t)=0;
virtual void LinkTimeChanged()=0; // call after changing link times
virtual void AddNewLink(INode *node,TimeValue t)=0;
virtual void DeleteLink(int i)=0;
};
// LinkCtrl references
#define LINKCTRL_CONTROL_REF 0 // the TM controller
#define LINKCTRL_FIRSTPARENT_REF 1 // parent nodes... refs 1-n
//-------------------------------------------------------------
// Access to LookatControl
//
class ILookatControl : public Control {
public:
virtual void SetFlip(BOOL f)=0;
virtual BOOL GetFlip()=0;
virtual void SetAxis(int a)=0;
virtual int GetAxis()=0;
};
// References for the lookat controller
#define LOOKAT_TARGET_REF 0
#define LOOKAT_POS_REF 1
#define LOOKAT_ROLL_REF 2
#define LOOKAT_SCL_REF 3
//-------------------------------------------------------------
// Access to MeshSelect modifier
//
class IMeshSelect : public Modifier {
public:
virtual DWORD GetSelLevel()=0;
virtual void SetSelLevel(DWORD level)=0;
virtual void LocalDataChanged()=0;
};
class IMeshSelectData : public LocalModData {
public:
virtual BitArray &GetVertSel()=0;
virtual BitArray &GetFaceSel()=0;
virtual BitArray &GetEdgeSel()=0;
virtual void SetVertSel(BitArray &set)=0;
virtual void SetFaceSel(BitArray &set)=0;
virtual void SetEdgeSel(BitArray &set)=0;
};
#endif //__ISTDPLUG__
@@ -0,0 +1,48 @@
/**********************************************************************
*<
FILE: keyreduc.h
DESCRIPTION: Key reduction
CREATED BY: Rolf Berteig
HISTORY: created 9/30/95
*> Copyright (c) 1994, All Rights Reserved.
**********************************************************************/
#ifndef __KEYREDUC__
#define __KEYREDUC__
#define DEFULAT_KEYREDUCE_THRESHOLD (0.5f)
// Values returned from Progress
#define KEYREDUCE_ABORT -1 // Stops processing and undoes any key reduction
#define KEYREDUCE_STOP 0 // Stops processing, but keeps any reduction done so far
#define KEYREDUCE_CONTINUE 1 // Keeps going.
// A callback so progress can be made during key reduction
class KeyReduceStatus {
public:
// Called once before reduction starts. 'total' is the number
// reduction canidate keys.
virtual void Init(int total)=0;
// Called every now and again. 'p' is the number of keys
// processed. So % done is p/total * 100.
virtual int Progress(int p)=0;
};
// Attempts to delete keys that lie within the given time range.
// The controller will be sampled within the range in 'step' size
// increments. After the key reduction, the controller's values
// at each step are gauranteed to be withen 'threshold' distance
// from their original values.
//
CoreExport int ApplyKeyReduction(
Control *cont,Interval range,float thresh,TimeValue step,
KeyReduceStatus *status);
#endif //__KEYREDUC__
@@ -0,0 +1,79 @@
/**********************************************************************
*<
FILE: linklist.cpp
DESCRIPTION: Linked-list template classes
CREATED BY: Tom Hudson
HISTORY: created 10 December 1995
*> Copyright (c) 1995, All Rights Reserved.
**********************************************************************/
#ifndef __LINKLIST_H__
#define __LINKLIST_H__
template <class T> class LinkedEntryT {
public:
T data;
void *next;
LinkedEntryT(T& d) { data = d; next = NULL; }
};
template <class T,class TE> class LinkedListT {
private:
TE* head;
TE* tail;
int count;
public:
LinkedListT() { head = tail = NULL; count = 0; }
~LinkedListT() { New(); }
void New() {
while(head) {
TE* next = (TE*)head->next;
delete head;
head = next;
}
head = tail = NULL;
count = 0;
}
int Count() { return count; }
void Append(T& item) {
TE *entry = new TE(item);
if(tail)
tail->next = entry;
tail = entry;
if(!head)
head = entry;
count++;
}
T &operator[](int index) {
TE *e = head;
while(index && e) {
e = (TE*)e->next;
index--;
}
// This should never happen, so we'll punt and return...
// the head's data
if(!e) {
assert(0);
return head->data;
}
return e->data;
}
LinkedListT &operator=(LinkedListT &from) {
New();
for(int i = 0; i < from.Count(); ++i)
Append(from[i]);
return *this;
}
};
// Handy macro for defining linked-lists
#define MakeLinkedList(TYPE) typedef LinkedEntryT<TYPE> TYPE##Entry; typedef LinkedListT<TYPE,TYPE##Entry> TYPE##List;
#endif // __LINKLIST_H__
@@ -0,0 +1,127 @@
/**********************************************************************
*<
FILE: linshape.h
DESCRIPTION: Defines a Linear Shape Object Class
CREATED BY: Tom Hudson
HISTORY: created 31 October 1995
*> Copyright (c) 1995, All Rights Reserved.
**********************************************************************/
#ifndef __LINSHAPE_H__
#define __LINSHAPE_H__
#include "polyshp.h"
extern CoreExport Class_ID linearShapeClassID;
class LinearShape : public ShapeObject {
private:
Interval geomValid;
Interval topoValid;
Interval selectValid;
DWORD validBits; // for the remaining constant channels
void CopyValidity(LinearShape *fromOb, ChannelMask channels);
protected:
// inherited virtual methods for Reference-management
RefResult NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message );
public:
PolyShape shape;
CoreExport LinearShape();
CoreExport ~LinearShape();
// 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());
// From Object
CoreExport ObjectState Eval(TimeValue time);
CoreExport Interval ObjectValidity(TimeValue t);
// The validity interval of channels necessary to do a convert to type
CoreExport Interval ConvertValidity(TimeValue t);
// get and set the validity interval for the nth channel
CoreExport Interval ChannelValidity(TimeValue t, int nchan);
CoreExport void SetChannelValidity(int i, Interval v);
CoreExport void InvalidateChannels(ChannelMask channels);
// Deformable object procs
int IsDeformable() { return 1; }
CoreExport int NumPoints();
CoreExport Point3 GetPoint(int i);
CoreExport void SetPoint(int i, const Point3& p);
CoreExport void PointsWereChanged();
CoreExport void GetDeformBBox(TimeValue t, Box3& box, Matrix3 *tm=NULL,BOOL useSel=FALSE );
CoreExport void Deform(Deformer *defProc, int useSel);
CoreExport int CanConvertToType(Class_ID obtype);
CoreExport Object* ConvertToType(TimeValue t, Class_ID obtype);
CoreExport void FreeChannels(ChannelMask chan);
CoreExport Object *MakeShallowCopy(ChannelMask channels);
CoreExport void ShallowCopy(Object* fromOb, ChannelMask channels);
CoreExport void NewAndCopyChannels(ChannelMask channels);
CoreExport DWORD GetSubselState();
// From ShapeObject
CoreExport int IntersectRay(TimeValue t, Ray& r, float& at);
CoreExport ObjectHandle CreateTriObjRep(TimeValue t); // for rendering, also for deformation
CoreExport void GetWorldBoundBox(TimeValue t, INode *inode, ViewExp* vpt, Box3& box );
CoreExport void GetLocalBoundBox(TimeValue t, INode *inode, ViewExp* vpt, Box3& box );
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);
BOOL CanMakeBezier() { return TRUE; }
CoreExport void MakeBezier(TimeValue t, BezierShape &shape);
CoreExport ShapeHierarchy &OrganizeCurves(TimeValue t, ShapeHierarchy *hier = NULL);
CoreExport void MakePolyShape(TimeValue t, PolyShape &shape, int steps = PSHAPE_BUILTIN_STEPS, BOOL optimize = FALSE);
CoreExport int MakeCap(TimeValue t, MeshCapInfo &capInfo, int capType);
CoreExport int MakeCap(TimeValue t, PatchCapInfo &capInfo);
PolyShape& GetShape() { return shape; }
// This does the job of setting all points in the PolyShape to "POLYPT_KNOT"
// types, and removing the "POLYPT_INTERPOLATED" flag. This is because the
// LinearShape knows nothing about its origin
CoreExport void SetPointFlags();
// Animatable methods
void DeleteThis() { delete this; }
void FreeCaches() { shape.InvalidateGeomCache(FALSE); }
Class_ID ClassID() { return linearShapeClassID; }
CoreExport void GetClassName(TSTR& s);
void NotifyMe(Animatable *subAnim, int message) {}
int IsKeyable() { return 0;}
int Update(TimeValue t) { return 0; }
BOOL BypassTreeView() { return TRUE; }
// This is the name that will appear in the history browser.
CoreExport TCHAR *GetObjectName();
// IO
CoreExport IOResult Save(ISave *isave);
CoreExport IOResult Load(ILoad *iload);
};
CoreExport ClassDesc* GetLinearShapeDescriptor();
#endif // __LINSHAPE_H__
@@ -0,0 +1,9 @@
#ifndef __LOCKID_H__
#define __LOCKID_H__
extern unsigned int UtilExport HardwareLockID ();
#endif
@@ -0,0 +1,100 @@
//-----------------------------------------------------------------------------
// ----------------
// File ....: log.h
// ----------------
// Author...: Gus Grubba
// Date ....: November 1996
//
// History .: Nov, 27 1996 - Started
//
//-----------------------------------------------------------------------------
#ifndef ERRORLOG_H_DEFINED
#define ERRORLOG_H_DEFINED
#define NO_DIALOG FALSE
#define DISPLAY_DIALOG TRUE
#define SYSLOG_ERROR 0x00000001
#define SYSLOG_WARN 0x00000002
#define SYSLOG_INFO 0x00000004
#define SYSLOG_DEBUG 0x00000008
#define SYSLOG_LIFE_EVER 0
#define SYSLOG_LIFE_DAYS 1
#define SYSLOG_LIFE_SIZE 2
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-- Frame Range
//
class LogSys {
DWORD valTypes;
int logLife;
DWORD logDays;
DWORD logSize;
public:
//-- Maintenance methods -----------------------------------------------
//
// Methods used internally
//-- Queries what log types are enabled
virtual DWORD LogTypes ( ) { return valTypes; }
//-- Sets what log types are enabled
virtual void SetLogTypes ( DWORD types ) { valTypes = types; }
//-- Logging methods ---------------------------------------------------
//
// "type" defines the type of log entry based on LogTypes above.
//
// "dialogue" is DISPLAY_DIALOGUE if you want the message to be displayed
// in a dialogue. The system will determine if displaying a dialogue is
// appropriate based on network rendering mode. If this is just some
// information you don't want a dialogue for, or if you are handling
// the dialogue yourself, just set dialogue to NO_DIALOGUE.
//
//
// "title" is optional. If non NULL, it will be used to define the module
// that originated the log entry (and the title bar in the dialogue).
//
//
virtual void LogEntry ( DWORD type, BOOL dialogue, TCHAR *title, TCHAR *text,... ) = 0;
//-- Long Logs
//
// For long entries, such as lists, use these methods instead. You open
// the log specifying the type of log, proceed writing the lines and
// closing it at the end.
//
virtual BOOL OpenLog ( DWORD type ) = 0;
virtual void LogEntry ( TCHAR *text,... ) = 0;
virtual void CloseLog ( ) = 0;
//-- Log File Longevity ------------------------------------------------
virtual int Longevity ( ) { return logLife; }
virtual void SetLongevity ( int type ) { logLife = type; }
virtual DWORD LogDays ( ) { return logDays; }
virtual DWORD LogSize ( ) { return logSize; }
virtual void SetLogDays ( DWORD days ) { logDays = days; }
virtual void SetLogSize ( DWORD size ) { logSize = size; }
//-- State -------------------------------------------------------------
virtual void SaveState ( void ) = 0;
virtual void LoadState ( void ) = 0;
};
#endif
//-- EOF: log.h ---------------------------------------------------------------
@@ -0,0 +1,95 @@
/**********************************************************************
*<
FILE: matrix2.h
DESCRIPTION: Class definitions for Matrix2
CREATED BY: Dan Silva
HISTORY:
*> Copyright (c) 1994, All Rights Reserved.
**********************************************************************/
#ifndef __MATRIX2__
#define __MATRIX2_
#include "ioapi.h"
#include "point2.h"
#include "point3.h"
class Matrix2 {
Point2& operator[](int i) { return((Point2&)(*m[i])); }
Point2& operator[](int i) const { return((Point2&)(*m[i])); }
public:
float m[3][2];
// Constructors
Matrix2(){} // NO INITIALIZATION done in this constructor!! (can use Zero or IdentityMatrix)
Matrix2(BOOL init) { IdentityMatrix(); } // An option to initialize
DllExport Matrix2(float (*fp)[2]);
// Assignment operators
DllExport Matrix2& operator-=( const Matrix2& M);
DllExport Matrix2& operator+=( const Matrix2& M);
DllExport Matrix2& operator*=( const Matrix2& M); // Matrix multiplication
// Conversion function
operator float*() { return(&m[0][0]); }
// Initialize matrix
DllExport void IdentityMatrix(); // Set to the Identity Matrix
DllExport void Zero(); // Set all elements to 0
Point2 GetRow(int i) const { return (*this)[i]; }
DllExport void SetRow(int i, Point2 p) { (*this)[i] = p; }
DllExport Point3 GetColumn(int i);
DllExport void SetColumn(int i, Point3 col);
DllExport Point2 GetColumn2(int i);
// Access the translation row
void SetTrans(const Point2 p) { (*this)[2] = p; }
void SetTrans(int i, float v) { (*this)[2][i] = v; }
Point2 GetTrans() { return (*this)[2]; }
// Apply Incremental transformations to this matrix
DllExport void Translate(const Point2& p);
DllExport void Rotate(float angle);
// if trans = FALSE the translation component is unaffected:
DllExport void Scale(const Point2& s, BOOL trans=FALSE);
// Apply Incremental transformations to this matrix
// Equivalent to multiplying on the LEFT by transform
DllExport void PreTranslate(const Point2& p);
DllExport void PreRotate(float angle);
DllExport void PreScale(const Point2& s, BOOL trans = FALSE);
// Binary operators
DllExport Matrix2 Matrix2::operator*(const Matrix2& B) const;
DllExport Matrix2 Matrix2::operator+(const Matrix2& B) const;
DllExport Matrix2 Matrix2::operator-(const Matrix2& B) const;
DllExport IOResult Save(ISave* isave);
DllExport IOResult Load(ILoad* iload);
};
// Build new matrices for transformations
Matrix2 DllExport RotateMatrix(float angle);
Matrix2 DllExport TransMatrix(const Point2& p);
Matrix2 DllExport ScaleMatrix(const Point2& s);
Matrix2 DllExport Inverse(const Matrix2& M);
// Transform point with matrix:
Point2 DllExport operator*(const Matrix2& A, const Point2& V);
Point2 DllExport operator*( const Point2& V, const Matrix2& A);
Point2 DllExport VectorTransform(const Matrix2& M, const Point2& V);
// Printout
ostream DllExport &operator<< (ostream& s, const Matrix2& A);
#endif
@@ -0,0 +1,158 @@
/**********************************************************************
*<
FILE: matrix3.h
DESCRIPTION: Class definitions for Matrix3
CREATED BY: Dan Silva
HISTORY:
*> Copyright (c) 1994, All Rights Reserved.
**********************************************************************/
#ifndef _MATRIX3_H
#define _MATRIX3_H
#include "ioapi.h"
#include "point3.h"
#include "point4.h"
//Flags
#define POS_IDENT 1
#define ROT_IDENT 2
#define SCL_IDENT 4
#define MAT_IDENT (POS_IDENT|ROT_IDENT|SCL_IDENT)
typedef float MRow[3];
class Quat;
class Matrix3 {
friend Matrix3 DllExport RotateXMatrix(float angle);
friend Matrix3 DllExport RotateYMatrix(float angle);
friend Matrix3 DllExport RotateZMatrix(float angle);
friend Matrix3 DllExport TransMatrix(const Point3& p);
friend Matrix3 DllExport ScaleMatrix(const Point3& s);
friend Matrix3 DllExport RotateYPRMatrix(float Yaw, float Pitch, float Roll);
friend Matrix3 DllExport RotAngleAxisMatrix(Point3& axis, float angle);
friend Matrix3 DllExport Inverse(const Matrix3& M);
friend Point3 DllExport operator*(const Matrix3& A, const Point3& V);
friend Point3 DllExport operator*(const Point3& V, const Matrix3& A);
friend Point3 DllExport VectorTransform(const Matrix3& M, const Point3& V);
friend Matrix3 DllExport XFormMat(const Matrix3& xm, const Matrix3& m);
friend class Quat;
float m[4][3];
// Access i-th row as Point3 for read or assignment:
Point3& operator[](int i) { return((Point3&)(*m[i])); }
Point3& operator[](int i) const { return((Point3&)(*m[i])); }
DWORD flags;
public:
// if change any components directly via GetAddr, must call this
void SetNotIdent() { flags &= ~MAT_IDENT; }
void SetIdentFlags(DWORD f) { flags &= ~MAT_IDENT; flags |= f; }
DWORD GetIdentFlags() const { return flags; }
void ClearIdentFlag(DWORD f) { flags &= ~f; }
BOOL IsIdentity() { return ((flags&MAT_IDENT)==MAT_IDENT); }
DllExport void ValidateFlags(); // recomputes the IDENT flags
// CAUTION: if you change the matrix via this pointer, you MUST clear the
// proper IDENT flags !!!
MRow* GetAddr() const { return (MRow *)(m); }
// Constructors
Matrix3(){ flags = 0; } // NO INITIALIZATION done in this constructor!!
Matrix3(BOOL init) {flags=0; IdentityMatrix();} // RB: An option to initialize
DllExport Matrix3(float (*fp)[3]);
// Assignment operators
DllExport Matrix3& operator-=( const Matrix3& M);
DllExport Matrix3& operator+=( const Matrix3& M);
DllExport Matrix3& operator*=( const Matrix3& M); // Matrix multiplication
// Operations on matrix
DllExport void IdentityMatrix(); // Make into the Identity Matrix
DllExport void Zero(); // set all elements to 0
Point3 GetRow(int i) const { return (*this)[i]; }
DllExport void SetRow(int i, Point3 p);
DllExport Point4 GetColumn(int i);
DllExport void SetColumn(int i, Point4 col);
DllExport Point3 GetColumn3(int i);
// zero the translation part;
DllExport void NoTrans();
// null out the rotation part;
DllExport void NoRot();
// null out the scale part;
DllExport void NoScale();
// This is an "unbiased" orthogonalization
// It seems to take a maximum of 4 iterations to converge.
DllExport void Orthogonalize();
// Access the translation row
void SetTrans(const Point3 p) { (*this)[3] = p; flags &= ~POS_IDENT; }
void SetTrans(int i, float v) { (*this)[3][i] = v; flags &= ~POS_IDENT; }
Point3 GetTrans() { return (*this)[3]; }
// Apply Incremental transformations to this matrix
// Equivalent to multiplying on the RIGHT by transform
DllExport void Translate(const Point3& p);
DllExport void RotateX(float angle);
DllExport void RotateY(float angle);
DllExport void RotateZ(float angle);
// if trans = FALSE the translation component is unaffected:
DllExport void Scale(const Point3& s, BOOL trans = FALSE);
// Apply Incremental transformations to this matrix
// Equivalent to multiplying on the LEFT by transform
DllExport void PreTranslate(const Point3& p);
DllExport void PreRotateX(float angle);
DllExport void PreRotateY(float angle);
DllExport void PreRotateZ(float angle);
// if trans = FALSE the translation component is unaffected:
DllExport void PreScale(const Point3& s, BOOL trans = FALSE);
DllExport Matrix3 operator*(const Matrix3&) const;
DllExport Matrix3 operator+(const Matrix3&) const;
DllExport Matrix3 operator-(const Matrix3&) const;
DllExport IOResult Save(ISave* isave);
DllExport IOResult Load(ILoad* iload);
// Returns FALSE if right handed (normal case) and TRUE if right handed.
DllExport BOOL Parity() const;
};
// Build new matrices for transformations
Matrix3 DllExport RotateXMatrix(float angle);
Matrix3 DllExport RotateYMatrix(float angle);
Matrix3 DllExport RotateZMatrix(float angle);
Matrix3 DllExport TransMatrix(const Point3& p);
Matrix3 DllExport ScaleMatrix(const Point3& s);
Matrix3 DllExport RotateYPRMatrix(float Yaw, float Pitch, float Roll);
Matrix3 DllExport RotAngleAxisMatrix(Point3& axis, float angle);
Matrix3 DllExport Inverse(const Matrix3& M); // return Inverse of matrix
// These two versions of transforming a point with a matrix do the same thing,
// regardless of the order of operands (linear algebra rules notwithstanding).
Point3 DllExport operator*(const Matrix3& A, const Point3& V); // Transform Point with matrix
Point3 DllExport operator*(const Point3& V, const Matrix3& A); // Transform Point with matrix
Point3 DllExport VectorTransform(const Matrix3& M, const Point3& V);
// transform a plane: this only works if M is orthogonal
Point4 DllExport TransformPlane(const Matrix3& M, const Point4& plin);
// transformats matrix m so it is applied in the space of matrix xm:
// returns xm*m*Inverse(xm)
Matrix3 DllExport XFormMat(const Matrix3& xm, const Matrix3& m);
#endif _MATRIX3_H
@@ -0,0 +1,75 @@
/**********************************************************************
*<
FILE: Max.h
DESCRIPTION: Main include file for MAX plug-ins.
CREATED BY: Rolf Berteig
HISTORY: Created 10/01/95
*> Copyright (c) 1994, All Rights Reserved.
**********************************************************************/
#define STRICT
// System includes
#include <strbasic.h>
#include <windows.h>
#include <windowsx.h>
#include <ctl3d.h>
#include <commctrl.h>
// Some standard library includes
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <time.h>
// Defines which version of MAX to build
#include "buildver.h"
// Defines basic MAX types
#include "maxtypes.h"
#include "trig.h"
// Support libraries
#include "utillib.h"
#include "geomlib.h"
#include "gfxlib.h"
#include "meshlib.h"
#include "patchlib.h"
// Core include files
#include "coreexp.h"
#include "winutil.h"
#include "custcont.h"
#include "mouseman.h"
#include "plugin.h"
#include "units.h"
#include "stack.h"
#include "interval.h"
#include "hold.h"
#include "channels.h"
#include "animtbl.h"
#include "ref.h"
#include "inode.h"
#include "control.h"
#include "object.h"
#include "objmode.h"
#include "soundobj.h"
#include "iparamb.h"
#include "triobj.h"
#include "patchobj.h"
#include "cmdmode.h"
#include "appio.h"
// interfaces into MAX executable
#include "maxapi.h"
#include "ioapi.h"
#include "impapi.h"
#include "impexp.h"
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,219 @@
/*********************************************************************
*<
FILE: #define MAXCOM.h
DESCRIPTION: Command IDs passed to Interface::Execute#define MAXCOMmand()
CREATED BY: Rolf Berteig
HISTORY: Created 3/13/96
*> Copyright (c) 1994 All Rights Reserved.
**********************************************************************/
#ifndef __MAXCOM__
#define __MAXCOM__
#define MAXCOM_RESET_FILE 0
#define MAXCOM_TIME_CONFIG 1
#define MAXCOM_UNFREEZE_BY_HIT 2
#define MAXCOM_BOX_TOGGLE 3
#define MAXCOM_CYCLE_SELECT_METHOD 4
#define MAXCOM_ZOOM_OUT_2X_ALL 5
#define MAXCOM_ZOOM_IN_2X_ALL 6
#define MAXCOM_IZOOM_OUT 7
#define MAXCOM_IZOOM_IN 8
#define MAXCOM_IPAN 9
#define MAXCOM_SHOW_LAST_IMG 10
#define MAXCOM_APPLY_IK 11
#define MAXCOM_KEY_MODE 12
#define MAXCOM_TOGGLE_IK 13
#define MAXCOM_SHADE_SELECTED 14
#define MAXCOM_SELECT_BY_COLOR 15
#define MAXCOM_ZOOMEXT_SEL 16
#define MAXCOM_ZOOMEXT_SEL_ALL 17
#define MAXCOM_CREATE_MODE 18
#define MAXCOM_MODIFY_MODE 19
#define MAXCOM_HIERARCHY_MODE 20
#define MAXCOM_MOTION_MODE 21
#define MAXCOM_DISPLAY_MODE 22
#define MAXCOM_UTILITY_MODE 23
#define MAXCOM_TEXTURE_CORRECT 24
#define MAXCOM_ZOOM_OUT_2X 25
#define MAXCOM_ZOOM_IN_2X 26
#define MAXCOM_DEF_LGT_TOGGLE 27
#define MAXCOM_VPT_SHAPE 28
#define MAXCOM_GROUP_ATTACH 29
#define MAXCOM_GROUP_DETACH 30
#define MAXCOM_PREV_MOD 31
#define MAXCOM_NEXT_MOD 32
#define MAXCOM_SAVEPLUS 33
#define MAXCOM_VIEW_FILE 34
#define MAXCOM_UNHIDE_BY_NAME 35
#define MAXCOM_UNFREEZE_BY_NAME 36
#define MAXCOM_SPINSNAP_TOGGLE 37
#define MAXCOM_HIDE_INV 38
#define MAXCOM_FREEZE_INV 39
#define MAXCOM_UNFREEZE_ALL 40
#define MAXCOM_WIRE_SMOOTH 41
#define MAXCOM_WIRE_FACET 42
#define MAXCOM_BOX_MODE 43
#define MAXCOM_BACKFACE 44
#define MAXCOM_TRAJECTORIES 45
#define MAXCOM_UNHIDE_ALL 46
#define MAXCOM_SCALE_CYCLE 47
#define MAXCOM_IK_TERMINATOR 48
#define MAXCOM_RENDER_SCENE 49
#define MAXCOM_RENDER_LAST 50
#define MAXCOM_QUICK_RENDER 51
#define MAXCOM_GRID_NUDGE_UP 52
#define MAXCOM_GRID_NUDGE_DOWN 53
#define MAXCOM_CYCLE_SUBLEVEL 54
#define MAXCOM_HIDE_SELECTION 55
#define MAXCOM_FREEZE_SELECTION 56
#define MAXCOM_SHADE_TOGGLE 57
#define MAXCOM_MIRROR 58
#define MAXCOM_ARRAY 60
#define MAXCOM_ALIGN 61
#define MAXCOM_ALIGNNORMALS 62
#define MAXCOM_HOLD 63
#define MAXCOM_FETCH 64
#define MAXCOM_SWAP_LAYOUTS 65
#define MAXCOM_SAFEFRAME_TOGGLE 66
#define MAXCOM_FILE_MERGE 67
#define MAXCOM_TIME_BACK 68
#define MAXCOM_TIME_FORWARD 69
#define MAXCOM_TIME_PLAY 70
#define MAXCOM_VIEWS_REDRAW 71
#define MAXCOM_UNITSETUP 72
#define MAXCOM_DRAWINGAIDS 73
#define MAXCOM_SHOWHOMEGRID 74
#define MAXCOM_ACTHOMEGRID 75
#define MAXCOM_ACTGRIDOBJ 76
#define MAXCOM_GRIDS_ALIGN 77
#define MAXCOM_BACKGROUND 78
#define MAXCOM_SHOWAXISICON 79
#define MAXCOM_FULLINTERACT 80
#define MAXCOM_VPTCONFIG 81
#define MAXCOM_VIDEOPOST 82
#define MAXCOM_PREVIEW 83
#define MAXCOM_VIEWPREVIEW 84
#define MAXCOM_RENAMEPREVIEW 85
#define MAXCOM_TOOL_DUALPLANES 86
#define MAXCOM_LINK 87
#define MAXCOM_UNLINK 88
#define MAXCOM_BINDWSM 89
#define MAXCOM_SELECT 90
#define MAXCOM_MOVE 91
#define MAXCOM_ROTATE 92
#define MAXCOM_SCALE 93
#define MAXCOM_TREEVIEW 94
#define MAXCOM_MTLEDIT 95
#define MAXCOM_PANVIEW 96
#define MAXCOM_DOLLY 97
#define MAXCOM_PERSP 98
#define MAXCOM_ROLL 99
#define MAXCOM_FOV 100
#define MAXCOM_TRUCK 101
#define MAXCOM_PANCAMERA 102
#define MAXCOM_ANGLE_SNAP_TOGGLE 103
#define MAXCOM_EDIT_REDO 104
#define MAXCOM_VIEW_REDO 105
#define MAXCOM_VPT_TRACK 106
#define MAXCOM_VPT_BOTTOM 107
#define MAXCOM_SUBOBJECT_SEL 108
#define MAXCOM_VPT_CAMERA 109
#define MAXCOM_VPT_SPOT 110
#define MAXCOM_HIDE_CAMERA_TOGGLE 111
#define MAXCOM_VPT_DISABLE 112
#define MAXCOM_VPT_FRONT 113
#define MAXCOM_VPT_GRID 114
#define MAXCOM_GRID_TOGGLE 115
#define MAXCOM_TOOL_HLIST 116
#define MAXCOM_HIDE_HELPER_TOGGLE 117
#define MAXCOM_VPT_ISO_USER 118
#define MAXCOM_VPT_BACK 119
#define MAXCOM_VPT_LEFT 120
#define MAXCOM_HIDE_LIGHT_TOGGLE 121
#define MAXCOM_TOOL_ANIMMODE 122
#define MAXCOM_FILE_NEW 123
#define MAXCOM_OVERRIDE 124
#define MAXCOM_FILE_OPEN 125
#define MAXCOM_HIDE_OBJECT_TOGGLE 126
#define MAXCOM_VPT_PERSP_USER 127
#define MAXCOM_ACCEL_PAN 128
#define MAXCOM_HIDE_SHAPE_TOGGLE 129
#define MAXCOM_VPT_RIGHT 130
#define MAXCOM_ROTATEVIEW 131
#define MAXCOM_SNAP_TOGGLE 132
#define MAXCOM_FILE_SAVE 133
#define MAXCOM_FILE_SAVEAS 134
#define MAXCOM_FILE_IMPORT 135
#define MAXCOM_FILE_PREFERENCES 136
#define MAXCOM_HIDE_SYSTEM_TOGGLE 137
#define MAXCOM_VPT_TOP 138
#define MAXCOM_EDIT_DELETE 139
#define MAXCOM_EDIT_SELECTALL 140
#define MAXCOM_EDIT_SELECTNONE 141
#define MAXCOM_EDIT_SELECTINVERT 142
#define MAXCOM_RNS 143
#define MAXCOM_TTI 144
#define MAXCOM_PROPERTIES 145
#define MAXCOM_GROUP_GROUP 146
#define MAXCOM_GROUP_OPEN 147
#define MAXCOM_GROUP_CLOSE 148
#define MAXCOM_GROUP_UNGROUP 149
#define MAXCOM_TIME_END 150
#define MAXCOM_HELP_ABOUT 151
#define MAXCOM_TOOL_X 152
#define MAXCOM_TOOL_Y 153
#define MAXCOM_TOOL_Z 154
#define MAXCOM_TOOL_XY 155
#define MAXCOM_TIME_START 156
#define MAXCOM_SELECT_CHILD 157
#define MAXCOM_SELECT_PARENT 158
#define MAXCOM_SPACEBAR 159
#define MAXCOM_TOOL_MAXIMIZE 160
#define MAXCOM_TOOL_ZOOMREGION 161
#define MAXCOM_HIDE_WSM_TOGGLE 162
#define MAXCOM_TOOL_CENTER 163
#define MAXCOM_TOOL_ZOOM 164
#define MAXCOM_TOOL_ZOOMALL 165
#define MAXCOM_EDIT_UNDO 166
#define MAXCOM_TOOL_ZOOMEXTENTS 167
#define MAXCOM_VIEWS_UNDO 168
#define MAXCOM_TOOL_ZOOMEXTENTS_ALL 169
#define MAXCOM_TOGGLE_SOUND 170
#define MAXCOM_VPT_TAB 171
#define MAXCOM_VPT_SHIFTTAB 172
#define MAXCOM_CONFIGURE_PATHS 173
#define MAXCOM_ADAPTIVE_PERSP_GRID_TOGGLE 174
#define MAXCOM_TOOL_EDIT_MOD_STACK 175
#define MAXCOM_TOOL_EDGES_ONLY_TOGGLE 176
#define MAXCOM_PERCENT_SNAP_TOGGLE 177
#define MAXCOM_SNAPMODE_TOGGLE 178
#define MAXCOM_RENDER_ATMOSPHERE 179
#define MAXCOM_VIEWS_SAVEACTIVEVIEW 180
#define MAXCOM_VIEWS_RESTOREACTIVEVIEW 181
#define MAXCOM_VIEWS_SHOWDEP 182
#define MAXCOM_FILE_EXPORT 183
#define MAXCOM_EDIT_PLACEHIGHLIGHT 184
#define MAXCOM_EDIT_SNAPSHOT 185
#define MAXCOM_TOOL_REGION_TOGGLE 186
#define MAXCOM_FILE_SUMMARYINFO 187
#ifdef DESIGN_VER
#define MAXCOM_PRS_VIEWS_GRIDSETUP 220
#define MAXCOM_PRS_VIEWS_UNITSETUP 221
#endif
// these commands are API extensions, not macros
#define MAXCOM_API_START 10000
#define MAXCOM_API_PVW_GRID_OFF 10000
#define MAXCOM_API_PVW_GRID_ON 10001
#define MAXCOM_API_PVW_SMOOTH_MODE 10002
#define MAXCOM_API_PVW_FACET_MODE 10003
#define MAXCOM_API_PVW_WIRE_MODE 10004
#endif

Some files were not shown because too many files have changed in this diff Show More