squareScaleManipContext.h
#include <maya/MTypeId.h>
#include <maya/MTypes.h>
#include <maya/MPxManipulatorNode.h>
#include <maya/MFnPlugin.h>
#include <maya/MObjectHandle.h>
#include <maya/MPxCommand.h>
#include <maya/MSyntax.h>
#include <maya/MDagModifier.h>
#include <maya/MVector.h>
#include <maya/M3dView.h>
#include <maya/MGLFunctionTable.h>
#include "manipulatorMath.h"
class squareScaleManipulator : public MPxManipulatorNode
{
public:
squareScaleManipulator();
~squareScaleManipulator();
virtual void postConstructor();
virtual MStatus connectToDependNode(const MObject &dependNode);
virtual void draw(M3dView &view, const MDagPath &path,
M3dView::DisplayStyle style, M3dView::DisplayStatus status);
virtual MStatus doPress( M3dView& view );
virtual MStatus doDrag( M3dView& view );
virtual MStatus doRelease( M3dView& view );
void setDrawTransformInfo( double rotation[3], MVector translation );
MStatus updateDragInformation();
static void* creator();
static MStatus initialize();
static MTypeId id;
private:
MGLuint topName, rightName, bottomName, leftName;
int topIndex, rightIndex, bottomIndex, leftIndex;
planeMath plane;
MPoint mousePointGlName;
MGLfloat rotateX,rotateY,rotateZ;
MGLfloat translateX,translateY,translateZ;
};