Annotation of /trunk/linden/indra/newview/llwearable.h
Parent Directory
|
Revision Log
Revision 57 -
(view)
(download)
Original Path: linden_release/linden/indra/newview/llwearable.h
| 1 : | mjm | 57 | /** |
| 2 : | * @file llwearable.h | ||
| 3 : | * @brief LLWearable class header file | ||
| 4 : | * | ||
| 5 : | * $LicenseInfo:firstyear=2002&license=viewergpl$ | ||
| 6 : | * | ||
| 7 : | * Copyright (c) 2002-2008, Linden Research, Inc. | ||
| 8 : | * | ||
| 9 : | * Second Life Viewer Source Code | ||
| 10 : | * The source code in this file ("Source Code") is provided by Linden Lab | ||
| 11 : | * to you under the terms of the GNU General Public License, version 2.0 | ||
| 12 : | * ("GPL"), unless you have obtained a separate licensing agreement | ||
| 13 : | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
| 14 : | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
| 15 : | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 | ||
| 16 : | * | ||
| 17 : | * There are special exceptions to the terms and conditions of the GPL as | ||
| 18 : | * it is applied to this Source Code. View the full text of the exception | ||
| 19 : | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
| 20 : | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
| 21 : | * | ||
| 22 : | * By copying, modifying or distributing this software, you acknowledge | ||
| 23 : | * that you have read and understood your obligations described above, | ||
| 24 : | * and agree to abide by those obligations. | ||
| 25 : | * | ||
| 26 : | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
| 27 : | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
| 28 : | * COMPLETENESS OR PERFORMANCE. | ||
| 29 : | * $/LicenseInfo$ | ||
| 30 : | */ | ||
| 31 : | |||
| 32 : | #ifndef LL_LLWEARABLE_H | ||
| 33 : | #define LL_LLWEARABLE_H | ||
| 34 : | |||
| 35 : | #include "lluuid.h" | ||
| 36 : | #include "llstring.h" | ||
| 37 : | #include "llpermissions.h" | ||
| 38 : | #include "llsaleinfo.h" | ||
| 39 : | #include "llassetstorage.h" | ||
| 40 : | |||
| 41 : | class LLViewerInventoryItem; | ||
| 42 : | |||
| 43 : | enum EWearableType // If you change this, update LLWearable::getTypeName(), getTypeLabel(), and LLVOAvatar::getTEWearableType() | ||
| 44 : | { | ||
| 45 : | WT_SHAPE = 0, | ||
| 46 : | WT_SKIN = 1, | ||
| 47 : | WT_HAIR = 2, | ||
| 48 : | WT_EYES = 3, | ||
| 49 : | WT_SHIRT = 4, | ||
| 50 : | WT_PANTS = 5, | ||
| 51 : | WT_SHOES = 6, | ||
| 52 : | WT_SOCKS = 7, | ||
| 53 : | WT_JACKET = 8, | ||
| 54 : | WT_GLOVES = 9, | ||
| 55 : | WT_UNDERSHIRT = 10, | ||
| 56 : | WT_UNDERPANTS = 11, | ||
| 57 : | WT_SKIRT = 12, | ||
| 58 : | WT_COUNT = 13, | ||
| 59 : | WT_INVALID = 255 | ||
| 60 : | }; | ||
| 61 : | |||
| 62 : | class LLWearable | ||
| 63 : | { | ||
| 64 : | friend class LLWearableList; | ||
| 65 : | public: | ||
| 66 : | ~LLWearable(); | ||
| 67 : | |||
| 68 : | const LLAssetID& getID() { return mAssetID; } | ||
| 69 : | const LLTransactionID& getTransactionID() { return mTransactionID; } | ||
| 70 : | |||
| 71 : | BOOL isDirty(); | ||
| 72 : | BOOL isOldVersion(); | ||
| 73 : | |||
| 74 : | void writeToAvatar( BOOL set_by_user ); | ||
| 75 : | void readFromAvatar(); | ||
| 76 : | void removeFromAvatar( BOOL set_by_user ) { LLWearable::removeFromAvatar( mType, set_by_user ); } | ||
| 77 : | static void removeFromAvatar( EWearableType type, BOOL set_by_user ); | ||
| 78 : | |||
| 79 : | BOOL exportFile(LLFILE* file); | ||
| 80 : | BOOL importFile(LLFILE* file); | ||
| 81 : | |||
| 82 : | EWearableType getType() const { return mType; } | ||
| 83 : | void setType( EWearableType type ) { mType = type; } | ||
| 84 : | |||
| 85 : | void setName( const std::string& name ) { mName = name; } | ||
| 86 : | const std::string& getName() { return mName; } | ||
| 87 : | |||
| 88 : | void setDescription( const std::string& desc ) { mDescription = desc; } | ||
| 89 : | const std::string& getDescription() { return mDescription; } | ||
| 90 : | |||
| 91 : | void setPermissions( const LLPermissions& p ) { mPermissions = p; } | ||
| 92 : | const LLPermissions& getPermissions() { return mPermissions; } | ||
| 93 : | |||
| 94 : | void setSaleInfo( const LLSaleInfo& info ) { mSaleInfo = info; } | ||
| 95 : | const LLSaleInfo& getSaleInfo() { return mSaleInfo; } | ||
| 96 : | |||
| 97 : | const std::string& getTypeLabel() const { return LLWearable::sTypeLabel[ mType ]; } | ||
| 98 : | const std::string& getTypeName() const { return LLWearable::sTypeName[ mType ]; } | ||
| 99 : | |||
| 100 : | void setParamsToDefaults(); | ||
| 101 : | void setTexturesToDefaults(); | ||
| 102 : | |||
| 103 : | LLAssetType::EType getAssetType() const { return LLWearable::typeToAssetType( mType ); } | ||
| 104 : | |||
| 105 : | static EWearableType typeNameToType( const std::string& type_name ); | ||
| 106 : | static const std::string& typeToTypeName( EWearableType type ) { return LLWearable::sTypeName[llmin(type,WT_COUNT)]; } | ||
| 107 : | static const std::string& typeToTypeLabel( EWearableType type ) { return LLWearable::sTypeLabel[llmin(type,WT_COUNT)]; } | ||
| 108 : | static LLAssetType::EType typeToAssetType( EWearableType wearable_type ); | ||
| 109 : | |||
| 110 : | void saveNewAsset(); | ||
| 111 : | static void onSaveNewAssetComplete( const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status ); | ||
| 112 : | |||
| 113 : | BOOL isMatchedToInventoryItem( LLViewerInventoryItem* item ); | ||
| 114 : | |||
| 115 : | void copyDataFrom( LLWearable* src ); | ||
| 116 : | |||
| 117 : | static void setCurrentDefinitionVersion( S32 version ) { LLWearable::sCurrentDefinitionVersion = version; } | ||
| 118 : | |||
| 119 : | friend std::ostream& operator<<(std::ostream &s, const LLWearable &w); | ||
| 120 : | |||
| 121 : | private: | ||
| 122 : | // Private constructor used by LLWearableList | ||
| 123 : | LLWearable(const LLTransactionID& transactionID); | ||
| 124 : | LLWearable(const LLAssetID& assetID); | ||
| 125 : | |||
| 126 : | static S32 sCurrentDefinitionVersion; // Depends on the current state of the avatar_lad.xml. | ||
| 127 : | S32 mDefinitionVersion; // Depends on the state of the avatar_lad.xml when this asset was created. | ||
| 128 : | std::string mName; | ||
| 129 : | std::string mDescription; | ||
| 130 : | LLPermissions mPermissions; | ||
| 131 : | LLSaleInfo mSaleInfo; | ||
| 132 : | LLAssetID mAssetID; | ||
| 133 : | LLTransactionID mTransactionID; | ||
| 134 : | EWearableType mType; | ||
| 135 : | |||
| 136 : | typedef std::map<S32, F32> param_map_t; | ||
| 137 : | param_map_t mVisualParamMap; // maps visual param id to weight | ||
| 138 : | typedef std::map<S32, LLUUID> te_map_t; | ||
| 139 : | te_map_t mTEMap; // maps TE to Image ID | ||
| 140 : | |||
| 141 : | static const std::string sTypeName[ WT_COUNT+1 ]; | ||
| 142 : | static const std::string sTypeLabel[ WT_COUNT+1 ]; | ||
| 143 : | }; | ||
| 144 : | |||
| 145 : | #endif // LL_LLWEARABLE_H |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |

