llvlcomposition.h

Go to the documentation of this file.
00001 
00032 #ifndef LL_LLVLCOMPOSITION_H
00033 #define LL_LLVLCOMPOSITION_H
00034 
00035 #include "llviewerlayer.h"
00036 #include "llviewerimage.h"
00037 
00038 class LLSurface;
00039 
00040 class LLVLComposition : public LLViewerLayer
00041 {
00042 public:
00043         LLVLComposition(LLSurface *surfacep, const U32 width, const F32 scale);
00044         /*virtual*/ ~LLVLComposition();
00045 
00046         void setSurface(LLSurface *surfacep);
00047 
00048         // Viewer side hack to generate composition values
00049         BOOL generateHeights(const F32 x, const F32 y, const F32 width, const F32 height);
00050         BOOL generateComposition();
00051         // Generate texture from composition values.
00052         BOOL generateTexture(const F32 x, const F32 y, const F32 width, const F32 height);              
00053 
00054         // Use these as indeces ito the get/setters below that use 'corner'
00055         enum ECorner
00056         {
00057                 SOUTHWEST = 0,
00058                 SOUTHEAST = 1,
00059                 NORTHWEST = 2,
00060                 NORTHEAST = 3,
00061                 CORNER_COUNT = 4
00062         };
00063         LLUUID getDetailTextureID(S32 corner);
00064         LLViewerImage* getDetailTexture(S32 corner);
00065         F32 getStartHeight(S32 corner);
00066         F32 getHeightRange(S32 corner);
00067 
00068         void setDetailTextureID(S32 corner, const LLUUID& id);
00069         void setStartHeight(S32 corner, F32 start_height);
00070         void setHeightRange(S32 corner, F32 range);
00071 
00072         friend class LLVOSurfacePatch;
00073         friend class LLDrawPoolTerrain;
00074         void setParamsReady()           { mParamsReady = TRUE; }
00075         BOOL getParamsReady() const     { return mParamsReady; }
00076 protected:
00077         BOOL mParamsReady;
00078         LLSurface *mSurfacep;
00079         BOOL mTexturesLoaded;
00080 
00081         LLPointer<LLViewerImage> mDetailTextures[CORNER_COUNT];
00082         LLPointer<LLImageRaw> mRawImages[CORNER_COUNT];
00083 
00084         F32 mStartHeight[CORNER_COUNT];
00085         F32 mHeightRange[CORNER_COUNT];
00086 
00087         F32 mTexScaleX;
00088         F32 mTexScaleY;
00089 };
00090 
00091 #endif //LL_LLVLCOMPOSITION_H

Generated on Thu Jul 1 06:09:35 2010 for Second Life Viewer by  doxygen 1.4.7