lldriverparam.h

Go to the documentation of this file.
00001 
00032 #ifndef LL_LLDRIVERPARAM_H
00033 #define LL_LLDRIVERPARAM_H
00034 
00035 #include "llvoavatar.h"
00036 #include "llviewervisualparam.h"
00037 
00038 //-----------------------------------------------------------------------------
00039 
00040 struct LLDrivenEntryInfo
00041 {
00042         LLDrivenEntryInfo( S32 id, F32 min1, F32 max1, F32 max2, F32 min2 )
00043                 : mDrivenID( id ), mMin1( min1 ), mMax1( max1 ), mMax2( max2 ), mMin2( min2 ) {}
00044         S32                                     mDrivenID;
00045         F32                                     mMin1;
00046         F32                                     mMax1;
00047         F32                                     mMax2;
00048         F32                                     mMin2;
00049 };
00050 
00051 struct LLDrivenEntry
00052 {
00053         LLDrivenEntry( LLViewerVisualParam* param, LLDrivenEntryInfo *info )
00054                 : mParam( param ), mInfo( info ) {}
00055         LLViewerVisualParam* mParam;
00056         LLDrivenEntryInfo*       mInfo;
00057 };
00058 
00059 //-----------------------------------------------------------------------------
00060 
00061 class LLDriverParamInfo : public LLViewerVisualParamInfo
00062 {
00063         friend class LLDriverParam;
00064 public:
00065         LLDriverParamInfo();
00066         /*virtual*/ ~LLDriverParamInfo() {};
00067         
00068         /*virtual*/ BOOL parseXml(LLXmlTreeNode* node);
00069 
00070 protected:
00071         typedef std::deque<LLDrivenEntryInfo> entry_info_list_t;
00072         entry_info_list_t mDrivenInfoList;
00073 };
00074 
00075 //-----------------------------------------------------------------------------
00076 
00077 class LLDriverParam : public LLViewerVisualParam
00078 {
00079 public:
00080         LLDriverParam(LLVOAvatar *avatarp);
00081         ~LLDriverParam();
00082 
00083         // Special: These functions are overridden by child classes
00084         LLDriverParamInfo*              getInfo() const { return (LLDriverParamInfo*)mInfo; }
00085         //   This sets mInfo and calls initialization functions
00086         BOOL                                    setInfo(LLDriverParamInfo *info);
00087 
00088         // LLVisualParam Virtual functions
00090         /*virtual*/ void                                apply( ESex sex ) {} // apply is called separately for each driven param.
00091         /*virtual*/ void                                setWeight(F32 weight, BOOL set_by_user);
00092         /*virtual*/ void                                setAnimationTarget( F32 target_value, BOOL set_by_user );
00093         /*virtual*/ void                                stopAnimating(BOOL set_by_user);
00094         
00095         // LLViewerVisualParam Virtual functions
00096         /*virtual*/ F32                                 getTotalDistortion();
00097         /*virtual*/ const LLVector3&    getAvgDistortion();
00098         /*virtual*/ F32                                 getMaxDistortion();
00099         /*virtual*/ LLVector3                   getVertexDistortion(S32 index, LLPolyMesh *poly_mesh);
00100         /*virtual*/ const LLVector3*    getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh);
00101         /*virtual*/ const LLVector3*    getNextDistortion(U32 *index, LLPolyMesh **poly_mesh);
00102 protected:
00103         F32 getDrivenWeight(const LLDrivenEntry* driven, F32 input_weight);
00104 
00105 
00106         LLVector3       mDefaultVec; // temp holder
00107         typedef std::vector<LLDrivenEntry> entry_list_t;
00108         entry_list_t mDriven;
00109         LLViewerVisualParam* mCurrentDistortionParam;
00110         // Backlink only; don't make this an LLPointer.
00111         LLVOAvatar* mAvatarp;
00112 };
00113 
00114 #endif  // LL_LLDRIVERPARAM_H

Generated on Thu Jul 1 06:08:27 2010 for Second Life Viewer by  doxygen 1.4.7