00001
00013
00014
00015 #ifndef __RENDER_ROUTINES__H__
00016 #define __RENDER_ROUTINES__H__
00017
00018 #ifdef WIN32
00019 #pragma once
00020
00021
00022 #define NT_PLUGIN
00023 #endif
00024
00025 #include <maya/MPxLocatorNode.h>
00026 #include <maya/MString.h>
00027 #include <maya/MTypeId.h>
00028 #include <maya/MVector.h>
00029 #include <maya/MDataBlock.h>
00030 #include <maya/MDataHandle.h>
00031 #include <maya/M3dView.h>
00032 #include <maya/MDistance.h>
00033 #include <maya/MFnUnitAttribute.h>
00034 #include <maya/MFnNumericAttribute.h>
00035 #include <maya/MFnMessageAttribute.h>
00036 #include <maya/MFnTypedAttribute.h>
00037 #include <maya/MPxManipContainer.h>
00038 #include <maya/MPointArray.h>
00039 #include <math.h>
00040
00042
00053 class RenderRoutines
00054 : public MPxLocatorNode {
00055 public:
00056
00057 RenderRoutines() : MPxLocatorNode() {};
00058
00059 virtual ~RenderRoutines() {};
00060
00064 virtual bool isBounded() const;
00065
00066
00067 virtual void draw( M3dView& view,
00068 const MDagPath& DGpath,
00069 M3dView::DisplayStyle style,
00070 M3dView::DisplayStatus status );
00071
00072 virtual void OnDraw( M3dView::DisplayStyle style,
00073 M3dView::DisplayStatus status ) {
00074 }
00075
00076 protected:
00077
00079 void ApplyStateColour(const float intensity,M3dView::DisplayStatus status);
00080
00081
00082
00083
00084
00085 void DrawCircleXY(const float r,const int divs);
00086 void DrawCircleXZ(const float r,const int divs);
00087 void DrawCircleYZ(const float r,const int divs);
00088
00089 void DrawFilledCircleXY(const float r,const int divs);
00090 void DrawFilledCircleXZ(const float r,const int divs);
00091 void DrawFilledCircleYZ(const float r,const int divs);
00092
00093
00094
00095
00096
00097
00098 void DrawQuadXY(const float w,const float h);
00099 void DrawQuadXZ(const float w,const float h);
00100 void DrawQuadYZ(const float w,const float h);
00101
00102 void DrawFilledQuadXY(const float w,const float h);
00103 void DrawFilledQuadXZ(const float w,const float h);
00104 void DrawFilledQuadYZ(const float w,const float h);
00105
00106
00107
00108
00109
00110
00111 void DrawCrossXY(const float w,const float h);
00112 void DrawCrossXZ(const float w,const float h);
00113 void DrawCrossYZ(const float w,const float h);
00114
00115
00116
00117
00118
00119
00120
00121 void DrawArcXY(const float r,const float sa,const float ea,const int divs);
00122 void DrawArcXZ(const float r,const float sa,const float ea,const int divs);
00123 void DrawArcYZ(const float r,const float sa,const float ea,const int divs);
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134 void DrawSpiralXY(const float sr,const float er,const float sa,const float ea,const float h,const int divs);
00135 void DrawSpiralXZ(const float sr,const float er,const float sa,const float ea,const float h,const int divs);
00136 void DrawSpiralYZ(const float sr,const float er,const float sa,const float ea,const float h,const int divs);
00137
00138
00139 void DrawSphere(const float r);
00140 void DrawCone(const float r,const float h);
00141 void DrawCube(const float w,const float h,const float d);
00142 void DrawFilledCube(const float w,const float h,const float d);
00143
00144
00145
00146
00147
00148 void DrawCylinderXY(const float r,const float h);
00149 void DrawCylinderXZ(const float r,const float h);
00150 void DrawCylinderYZ(const float r,const float h);
00151
00152
00153 };
00154
00155
00156 #endif
00157