gizmo.h

Go to the documentation of this file.
00001 /**********************************************************************
00002  *<
00003     FILE: gizmo.h
00004 
00005     DESCRIPTION: An apparatus object
00006 
00007     CREATED BY: Rolf Berteig
00008 
00009     HISTORY: 4-15-96
00010 
00011  *> Copyright (c) 1996 Rolf Berteig, All Rights Reserved.
00012  **********************************************************************/
00013 #pragma once
00014 #include "object.h"
00015 #include "GraphicsViewportColorConstants.h"
00016 #include "gfx.h"
00017 
00043 #pragma warning(push)
00044 #pragma warning(disable:4100)
00045 class GizmoObject : public HelperObject {
00046     public:
00047         IParamBlock *pblock;        
00048         static IParamMap *pmapParam;
00049         static IObjParam *ip;
00050 
00053         CoreExport GizmoObject();
00056         CoreExport ~GizmoObject();
00057 
00058         CoreExport static GizmoObject *editOb;
00059 
00060         // From BaseObject
00061         CoreExport void BeginEditParams( IObjParam  *ip, ULONG flags,Animatable *prev);
00062         CoreExport void EndEditParams( IObjParam *ip, ULONG flags,Animatable *next);
00063         CoreExport int HitTest(TimeValue t, INode* inode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt);     
00064         CoreExport int Display(TimeValue t, INode* inode, ViewExp *vpt, int flags);     
00065 
00066         // From Object
00067         ObjectState Eval(TimeValue time) {return ObjectState(this);}
00068         void InitNodeName(MSTR& s) {s = GetObjectName();}       
00069         CoreExport int CanConvertToType(Class_ID obtype);
00070         CoreExport Object* ConvertToType(TimeValue t, Class_ID obtype);     
00071         CoreExport void GetWorldBoundBox(TimeValue t, INode* inode, ViewExp* vpt, Box3& box );
00072         CoreExport void GetLocalBoundBox(TimeValue t, INode* inode, ViewExp* vpt, Box3& box );
00073         CoreExport void GetDeformBBox(TimeValue t, Box3& box, Matrix3 *tm, BOOL useSel );       
00074 
00075         // Animatable methods       
00076         int NumSubs() { return 1; }
00077         // Gets the Sub Animatable parameter block. Upcasts a Parameter block to an Animatable
00078         Animatable* SubAnim(int i) { return (Animatable*) pblock; }
00079         MSTR SubAnimName(int i) {return _M("Parameters");}
00080 
00081         // From ref
00082         int NumRefs() {return 1;}
00083         RefTargetHandle GetReference(int i) {return (ReferenceTarget*)pblock;}
00084 protected:
00085         virtual void SetReference(int i, RefTargetHandle rtarg) {pblock=(IParamBlock*)rtarg;}       
00086 public:
00087         CoreExport RefResult NotifyRefChanged(Interval changeInt,RefTargetHandle hTarget, 
00088            PartID& partID, RefMessage message);
00089         
00090         // Must implement...
00098         Interval ObjectValidity(TimeValue t) {return FOREVER;}      
00112         virtual void InvalidateUI() {}
00130         virtual ParamDimension *GetParameterDim(int pbIndex) {return defaultDim;}
00137         virtual MSTR GetParameterName(int pbIndex) {return MSTR(_M("Parameter"));}
00147         virtual void DrawGizmo(TimeValue t,GraphicsWindow *gw) {}
00151         virtual Point3 WireColor() { return GetUIColor(COLOR_ATMOS_APPARATUS); } // mjm - 4.20.99
00177         virtual void GetBoundBox(Matrix3 &mat,TimeValue t,Box3 &box) {}
00178     };
00179 #pragma warning(pop)
00180 
00181