Main Page | Namespace List | Class List | Directories | File List | Namespace Members | Class Members | File Members

iquadric_ui.h

Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 #ifndef _IQUADRIC_UI_H_
00017 #define _IQUADRIC_UI_H_
00018 
00019 // includes, graphics
00020 #include <GL/glew.h>
00021 
00022 // includes, system
00023 #include <vector>
00024 
00025 // includes, maya
00026 #include <maya/MIOStream.h>
00027 #include <maya/MPxSurfaceShape.h>
00028 #include <maya/MPxSurfaceShapeUI.h>
00029 #include <maya/MFnNumericAttribute.h>
00030 #include <maya/MFnEnumAttribute.h>
00031 #include <maya/MPoint.h>
00032 #include <maya/MPlug.h>
00033 #include <maya/MDrawData.h>
00034 #include <maya/MDrawRequest.h>
00035 #include <maya/MSelectionMask.h>
00036 #include <maya/MSelectionList.h>
00037 #include <maya/MDagPath.h>
00038 #include <maya/MMaterial.h>
00039 #include <maya/MFnTransform.h>
00040 
00041 // includes, GL
00042 #include <GL/gl.h>
00043 
00044 // includes, Cg
00045 #include <Cg/cg.h>
00046 #include <Cg/cgGL.h>
00047 
00048 
00050 class IQuadricUI : public MPxSurfaceShapeUI {
00051 
00052  public:
00053 
00055   IQuadricUI();
00056 
00058   virtual ~IQuadricUI();
00059 
00060  public:
00061 
00065   virtual void getDrawRequests( const MDrawInfo & info,
00066                                 bool objectAndActiveOnly,
00067                                 MDrawRequestQueue & requests );
00068 
00072   virtual void draw( const MDrawRequest & request,
00073                      M3dView & view ) const;  
00074 
00079   virtual bool select( MSelectInfo &select_info,
00080                        MSelectionList &selection_list,
00081                        MPointArray &world_space_pts ) const;
00082  
00083  private:
00084 
00090   void getDrawRequestsShaded( MDrawRequest& request,
00091                               const MDrawInfo& info,
00092                               MDrawRequestQueue& queue,
00093                               MDrawData& data);
00094 
00098   void getDrawRequestsWireframe( MDrawRequest& request, const MDrawInfo& info);
00099 
00100  public:
00101 
00103   static  void *  creator();
00104 
00105  private:
00106 
00109   void updateParameters( MFnTransform trans) const; 
00110 
00118   void
00119   render( const MMatrix& q_params, const MPoint& clip_infinite,                
00120           const MBoundingBox& bbox, const std::vector< MPoint>& quad_points, 
00121           M3dView view, bool draw_quad ) const;
00122 
00123  private:
00124 
00126   enum {
00127 
00128        kDrawVertices, 
00129        kDrawWireframe,
00130        kDrawWireframeOnShaded,
00131        kDrawSmoothShaded,
00132        kDrawFlatShaded
00133   };
00134 
00135  private:
00136 
00138   class IQuadricShading* shading;
00139 
00140 };
00141 
00142 // variables, exported (extern)
00143 
00144 // functions, inlined (inline)
00145   
00146 // functions, exported (extern)
00147 
00148 #endif // #ifndef _IQUADRIC_UI_H_
00149 

Generated on Sat Dec 31 18:07:49 2005 for ICaster by  doxygen 1.4.4