summaryrefslogtreecommitdiffstats
path: root/tools/trackeditor/code/contexts/bvcontext.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/trackeditor/code/contexts/bvcontext.h')
-rw-r--r--tools/trackeditor/code/contexts/bvcontext.h98
1 files changed, 98 insertions, 0 deletions
diff --git a/tools/trackeditor/code/contexts/bvcontext.h b/tools/trackeditor/code/contexts/bvcontext.h
new file mode 100644
index 0000000..e444cd5
--- /dev/null
+++ b/tools/trackeditor/code/contexts/bvcontext.h
@@ -0,0 +1,98 @@
+#include "precompiled/PCH.h"
+
+#ifndef BVCONTEXT
+#define BVCONTEXT
+
+//----------------------------------------
+// System Includes
+//----------------------------------------
+
+
+//----------------------------------------
+// Forward References
+//----------------------------------------
+
+//-----------------------------------------------------------------------------
+//
+// B o u n d i n g v o l u m e C o n t e x t
+//
+//-----------------------------------------------------------------------------
+class BVContext : public MPxContext
+{
+ public:
+
+ enum Stimulus // Maskable values.
+ {
+ BUTTONDOWN = 0x0001,
+ BUTTONUP = 0x0002,
+ MOUSEDRAG = 0x0004,
+ COMPLETED = 0x0008,
+ DELETED = 0x0010,
+ ABORTED = 0x0020
+ };
+
+
+ BVContext();
+ virtual ~BVContext();
+
+ static const char* stringId;
+
+ virtual void toolOnSetup( MEvent& );
+ virtual void toolOffCleanup();
+ virtual MStatus doPress( MEvent& );
+ virtual MStatus doDrag( MEvent& );
+ virtual MStatus doRelease( MEvent& event );
+ virtual MStatus doHold( MEvent& event );
+ virtual MStatus doEnterRegion( MEvent& event );
+ virtual void deleteAction();
+ virtual void completeAction();
+ virtual void abortAction();
+
+ static int sLeftSide;
+ static const MString DEFAULT_GROUP_NAME;
+ static MObject sCurrentGroup;
+
+ private:
+ void ProcessState( Stimulus stimulus );
+ void AddPoint( MObject obj );
+ void DeleteLast();
+ void CloseLoop();
+ void SetHelpString();
+
+ MObjectArray mPoints;
+ MString mHelp;
+
+ short mXCurrent, mYCurrent;
+};
+
+//-----------------------------------------------------------------------------
+//
+// B o u n d i n g v o l u m e C o n t e x t C m d
+//
+//-----------------------------------------------------------------------------
+class BVContextCmd : public MPxContextCommand
+{
+ public:
+ BVContextCmd();
+ virtual ~BVContextCmd();
+
+ static void* creator();
+
+ virtual MPxContext* makeObj();
+
+ private:
+};
+
+class BVSplitCmd : public MPxCommand
+{
+public:
+ MStatus doIt( const MArgList& args );
+ static void* creator();
+
+ static const char* stringId;
+
+private:
+ void Split( MObject& node1, MObject& node2 );
+};
+
+#endif