- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- File List
- File Members

# brushmask.h

Go to the documentation of this file.

    00001
    00002 //**************************************************************************/
    00003 // Copyright (c) 2008 Autodesk, Inc.
    00004 // All rights reserved.
    00005 //
    00006 // Use of this software is subject to the terms of the Autodesk license
    00007 // agreement provided at the time of installation or download, or which
    00008 // otherwise accompanies this software in either electronic or hard copy form.
    00009 //
    00010 //**************************************************************************/
    00011 // DESCRIPTION:
    00012 // CREATED: November 2009
    00013 //**************************************************************************/
    00014
    00015 #ifndef __MUDBOXSDK_BRUSHMASK_H__
    00016 #define __MUDBOXSDK_BRUSHMASK_H__
    00017
    00018 namespace mudbox {
    00019
    00021 struct MBDLL_DECL BrushMask : public TreeNode
    00022 {
    00023     Q_DECLARE_TR_FUNCTIONS(mudbox::BrushMask)
    00024     DECLARE_CLASS;
    00025
    00027     BrushMask( void );
    00029     ~BrushMask( void );
    00030
    00032     void SetState( bool b );
    00034     bool State( void );
    00035
    00037     float Factor( void );
    00039     void SetFactor( float f );
    00040
    00042     virtual void SetTransformation( const Matrix &mTransformation );
    00044     Matrix Transformation( void );
    00045
    00047     virtual class Image *Image( void );
    00048
    00050     void SetImage( class Image *pImage );
    00052     void Clear( void );
    00056     void SetFileName( const QString &sFileName );
    00058     virtual void CreateTextures( void );
    00059     QString GetFileName() const { return m_sFileName; }
    00060
    00061
    00062 protected:
    00063     Matrix        m_mTransformation;
    00064     float         m_fAspectRatio;
    00065
    00066     class Image  *m_pImage;
    00067     Texture      *m_pLuminanceTexture;
    00068
    00069     abool         m_bState;
    00070     afloatr       m_fFactor;
    00071     astring       m_sFileName;
    00072 };
    00073
    00075 struct MBDLL_DECL BrushStamp : public BrushMask
    00076 {
    00077     DECLARE_CLASS;
    00078
    00080     void SetParameters( const StampConfiguration  &config,
    00081                         const Vector              &vPosition,
    00082                         const Vector              &vNormal,
    00083                         float                     fSize,
    00084                         const Matrix             &mLocalToWorld );
    00085
    00088     void CalculateTransformation( const Vector &vPosition,
    00089                                   const Vector &vNormal,
    00090                                   const Vector &vUp,
    00091                                   float fScaleX, float fScaleY,
    00092                                   bool  bFlip,   bool  bFlop,
    00093                                   const Matrix &mLocalToWorld );
    00094 };
    00095
    00097 struct MBDLL_DECL BrushStencil : public BrushMask
    00098 {
    00099     enum
    00100     {
    00101         eColorModeUndefined = -1,
    00102         eColorModeLuminance,
    00103         eColorModeColored
    00104     };
    00105
    00106     DECLARE_CLASS;
    00107
    00109     BrushStencil( void );
    00111     ~BrushStencil( void );
    00112
    00114     void SetVisibility( float f );
    00116     float Visibility( void );
    00117
    00119     void SetUIEnabled( bool b );
    00120
    00122     void SetColorMode( unsigned int mode );
    00124     unsigned int ColorMode( void );
    00125
    00127     void SetOffset( float offset );
    00129     float Offset( void ) const;
    00130
    00132     void SetTransformation( const Matrix &mTransformation );
    00134     void UpdateMatrix( void );
    00136     const Matrix &Final( void ) const;
    00138     Matrix MirroredFinal( void ) const;
    00139
    00141     bool IsMirrored( void ) const;
    00142
    00144     void SetInverted(bool inv) { m_bInvert.SetValue(inv); }
    00145
    00147     bool IsInverted( void ) const;
    00148
    00150     bool Activate( void );
    00152     bool Deactivate( void );
    00153
    00155     void SetFromImage( class Image *pSrcImage );
    00156
    00158     virtual void CreateTextures( void );
    00159
    00160     Texture *getTexture() const { return m_pColorTexture; }
    00161
    00168     void SetFromColorTexture(Texture *pSrcTexture);
    00169
    00170 protected:
    00171     bool          m_bUIEnabled;
    00172     unsigned int  m_iColorMode;
    00173     Matrix        m_mProjector;
    00174     Matrix        m_mFinal;
    00175
    00176     Texture      *m_pColorTexture;
    00177
    00178     // attributes
    00179     afloatr       m_fVisibility;
    00180     abool         m_bInvert;
    00181     abool         m_bUseTiles;
    00182     abool         m_bShowTiles;
    00183     afloatr       m_fOffset;
    00184     abool         m_bAutoHide;
    00185     abool         m_bMirror;
    00186     abool         m_bFlipX;
    00187     abool         m_bFlipY;
    00188
    00189     aevent        m_cImport;
    00190     aevent        m_cExport;
    00191 };
    00192
    00193 }; // end of namespace mudbox
    00194
    00195 #endif