Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

RmMFCTextureEditCtrl.h

00001 //=================================================================================================//
00002 // filename: RmMFCTextureEditCtrl.h                                                                //
00003 //                                                                                                 //
00004 //           ATI Research, Inc.                                                                    //
00005 //           3D Application Research Group                                                         //
00006 //                                                                                                 //
00007 // description: Defines the CRmTextureEditCtrl class.                                              //
00008 //                                                                                                 //
00009 //=================================================================================================//
00010 //   (C) 2004 ATI Research, Inc.  All rights reserved.                                             //
00011 //=================================================================================================//
00012 
00013 #ifndef _RM_MFC_UTILITIES_TEXTURE_EDIT_CTRL_H_
00014 #define _RM_MFC_UTILITIES_TEXTURE_EDIT_CTRL_H_
00015 
00016 #if _MSC_VER > 1000
00017 #pragma once
00018 #endif // _MSC_VER > 1000
00019 // RmMFCTextureEditCtrl.h : header file
00020 //
00021 
00022 #include <Utilities/RmUtilControlPlacement.h>
00023 #include <MFCUtilities/RmMFCTypes.h>
00024 #include <MFCUtilities/RmMFCUtilitiesResource.h>
00025 #include <MFCUtilities/RmMFCScrollWnd.h>
00026 
00027 //=================================================================================================//
00028 // Class:         CRmTextureEditCtrl                                                               //
00029 //                                                                                                 //
00030 // Description:   Definition for CRmTextureEditCtrl control                                        //
00031 //=================================================================================================//
00032 class RMMFCUTIL_API CRmTextureEditCtrl : public CDialog
00033 {      
00034 protected: // Protected Member Definitions
00035 
00036    // Enumeration of texture preview sizes
00037    enum RmTexturePreviewSize
00038    {
00039       TextureSizeThumbnail = 0,
00040       TextureSize25,
00041       TextureSize50,
00042       TextureSize100,
00043       TextureSize200,
00044       TextureSize400,
00045       TextureSize800,
00046       
00047    }; // end enum RmTextureThumbnailSize
00048 
00049    //==============================================================================================//
00050    // Class:         CRmTextureButton                                                              //
00051    //                                                                                              //
00052    // Description:   Class definition for CRmTextureButton                                         //
00053    //                Derived from CButton, this class                                              //
00054    //                creates a simple texture static control                                       //
00055    //==============================================================================================//
00056    class CRmTextureButton : public CButton
00057    {
00058       public: // Public member functions
00059       
00060          // Constructor
00061          CRmTextureButton()
00062          {
00063             m_hBitmap      = NULL;
00064             m_bLButtonDown = false;
00065            
00066             m_mousePoint.x = 0;
00067             m_mousePoint.y = 0;
00068             
00069          } // end CRmTextureButton()
00070          
00071          // Called to draw the control
00072          virtual void DrawItem( LPDRAWITEMSTRUCT lpDrawItemStruct );
00073          
00074          // Called to set the bitmap handle
00075          void SetBitmap( HBITMAP hBitmap )
00076          {
00077             m_hBitmap = hBitmap;
00078             InvalidateRect( NULL, TRUE );
00079             
00080          } // end void SetTextureBitmap( HBITMAP hBitmap )
00081                
00082       protected: // Protected member functions
00083       
00084               // Generated message map functions
00085               //{{AFX_MSG(CRmTextureEditCtrl::CRmTextureButton)
00086          afx_msg void OnCaptureChanged(CWnd *pWnd);
00087          afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00088          afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
00089          afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00090               //}}AFX_MSG       
00091         
00092          DECLARE_MESSAGE_MAP()
00093       
00094       protected: // Protected member variables
00095       
00096          HBITMAP  m_hBitmap;
00097          CPoint   m_mousePoint;
00098          bool     m_bLButtonDown;
00099           
00100    }; // end class CRmTextureButton : public CButton
00101    
00102 public: // Public Member Functions
00103 
00104    // Construction / Destruction
00105         CRmTextureEditCtrl();
00106    virtual ~CRmTextureEditCtrl();
00107 
00108    // Called to create a texture edit control
00109    BOOL Create(   HWND              hwndParent,
00110                   RmTextureVariable *pRmTextureVariable,
00111                   RmPlugInID        *pRmPlugInID = NULL );
00112 
00113    // Called to update the texture control
00114    void UpdateTexture( bool bRepositionControls );
00115    
00116    // Called to update the texture origin
00117    void UpdateOrigin();
00118    
00119         //{{AFX_DATA(CRmTextureEditCtrl)
00120         enum { IDD = IDD_RM_TEXTURE_EDITOR_DIALOG };
00121         
00122         CComboBox         m_fileNameCombo;
00123         
00124    CButton           m_textureOptionsCheck;
00125    CButton           m_textureOptionsGroup;
00126         CButton           m_textureBrowseButton;      
00127    CStatic           m_textureFormatStatic;
00128    CStatic           m_textureDimensionsStatic;
00129    CStatic           m_textureMipMapLevelsStatic;
00130    CButton           m_textureOriginGroup;
00131         CButton           m_originTopLeftRadio;
00132         CButton           m_originBottomLeftRadio;
00133                 
00134    CButton           m_viewOptionsCheck;
00135    CButton           m_viewOptionsGroup;
00136    CStatic           m_viewThumbnailSizeStatic;
00137         CComboBox         m_viewThumbnailSizeCombo;
00138    CStatic           m_viewMipMapLevelStatic;
00139         CEdit             m_viewMipMapLevelEdit;
00140         CSpinButtonCtrl   m_viewMipMapLevelSpin;
00141    CStatic           m_viewVolumeDepthStatic;
00142         CEdit             m_viewVolumeDepthEdit;
00143         CSpinButtonCtrl   m_viewVolumeDepthSpin;
00144    CButton           m_viewAlphaCheck;
00145 
00146         CRmTextureButton  m_textureButton;
00147         
00148         //}}AFX_DATA
00149 
00150         // ClassWizard generated virtual function overrides
00151         //{{AFX_VIRTUAL(CRmTextureEditCtrl)
00152         protected:
00153         virtual void   DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00154         virtual BOOL   OnInitDialog();
00155    virtual BOOL   PreTranslateMessage(MSG* pMsg);
00156         //}}AFX_VIRTUAL
00157 
00158 protected: // Protected Member Functions
00159 
00160    // Called to get the texture info   
00161    void CalculateTextureBitmapInfo( RmTextureVariable *pRmTextureVariable,
00162                                     int &nWidth,
00163                                     int &nHeight,
00164                                     int nMipMapLevel );
00165 
00166    // Called to reposition the controls
00167    void RepositionControls();
00168    
00169         // Generated message map functions
00170         //{{AFX_MSG(CRmTextureEditCtrl)
00171         afx_msg void OnSelchangeFileNameCombo();
00172    afx_msg void OnBnClickedRmBrowseButton();
00173         afx_msg void OnSize(UINT nType, int cx, int cy);
00174    afx_msg void OnBnClickedRmTextureOptionsCheck();
00175    afx_msg void OnBnClickedRmTextureViewOptionsCheck();
00176    afx_msg void OnBnClickedRmTextureOriginTopLeftRadio();
00177    afx_msg void OnBnClickedRmTextureOriginBottomLeftRadio();
00178    afx_msg void OnCbnSelchangeRmTextureViewThumbnailSizeCombo();
00179    afx_msg void OnEnKillfocusRmTextureViewMipMapLevelEdit();
00180    afx_msg void OnDeltaposRmTextureViewMipMapLevelSpin(NMHDR *pNMHDR, LRESULT *pResult);
00181    afx_msg void OnEnKillfocusRmTextureViewVolumeDepthEdit();
00182    afx_msg void OnDeltaposRmTextureViewVolumeDepthSpin(NMHDR *pNMHDR, LRESULT *pResult);
00183    afx_msg void OnBnClickedRmTextureViewAlphaCheck();
00184    afx_msg void OnDropFiles(HDROP hDropInfo);
00185    afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI);
00186         //}}AFX_MSG
00187 
00188         DECLARE_MESSAGE_MAP()
00189 
00190 private: // Private Member Variables
00191 
00192    RmTextureVariable    *m_pRmTextureVariable;     // Associated node
00193    RmPlugInID           *m_pRmPlugInID;            // Parent Plug-in ID
00194    HWND                 m_hwndParent;              // Parent HWND
00195    
00196    bool                 m_bInitialized;            // Initialization flag
00197    bool                 m_bInternalResize;         // Internal resizing flag
00198    
00199    HBITMAP              m_hTextureBitmap;          // Texture bitmap handle
00200    CRmScrollWnd         m_textureScrollWindow;     // Texture scroll window
00201    
00202    bool                 m_bShowTextureOptions;     // Show Texture Options Flag
00203    bool                 m_bShowViewOptions;        // Show View Options flag
00204    
00205    RmTexturePreviewSize m_rmTexturePreviewSize;    // Size of the texture preview
00206    int                  m_nMaxNumMipMapLevels;     // Max number of mip map levels
00207    int                  m_nMipMapLevel;            // Current mip map level
00208    int                  m_nMaxVolumeDepth;         // Max volume depth
00209    int                  m_nVolumeDepth;            // Current volume depth
00210    int                  m_nMipMapVolumeDepth;      // Current  mip map volume depth
00211    bool                 m_bShowAlphaControl;       // Show Alpha control flag
00212    bool                 m_bShowVolumeDepthControl; // Show Volume Depth control flag
00213    
00214    RmControlPlacementContainer   m_showTextureOptionsControlPlacementContainer;
00215    RmControlPlacementContainer   m_hideTextureOptionsControlPlacementContainer;
00216    RmControlPlacementContainer   m_showViewOptionsControlPlacementContainer;
00217    RmControlPlacementContainer   m_hideViewOptionsControlPlacementContainer;
00218 
00219 }; // end class RMMFCUTIL_API CRmTextureEditCtrl : public CDialog
00220 
00221 #endif // _RM_MFC_UTILITIES_TEXTURE_EDIT_CTRL_H_

Generated on Fri Feb 25 16:08:39 2005 for RenderMonkey SDK by doxygen 1.3.6