WoW Model Viewer
Your premiere tool for viewing, equipping and animating World of Warcraft models.
Loading...
Searching...
No Matches
WoWItem Class Reference

Represents an equipped item on a character model. More...

#include <WoWItem.h>

Inheritance diagram for WoWItem:
[legend]
Collaboration diagram for WoWItem:
[legend]

Public Member Functions

 WoWItem (CharSlots slot)
 
void setId (int id)
 
int id () const
 
void setDisplayId (int id)
 
void setLevel (int level)
 
void setModifierId (int id)
 
CharSlots slot () const
 
int quality () const
 
void refresh ()
 
void onParentSet (Component *) override
 Called after the parent has been set; override for custom logic.
 
void load ()
 
unsigned int nbLevels () const
 
std::map< POSITION_SLOTS, WoWModel * > models () const
 
void save (pugi::xml_node &parentNode) const
 
void load (const std::string &filepath)
 
- Public Member Functions inherited from Component
 Component ()
 
virtual ~Component ()
 
virtual bool addChild (Component *)
 Add a child component to this node.
 
virtual bool removeChild (Component *)
 Remove a child component from this node.
 
virtual void removeAllChildren ()
 
virtual unsigned int nbChildren () const
 
virtual bool findChildComponent (Component *, bool)
 
virtual ComponentgetChild (unsigned int)
 
virtual const ComponentgetChild (unsigned int) const
 
void setParentComponent (Component *)
 Set the parent of this component.
 
const Componentparent () const
 Get the parent component (const).
 
Componentparent ()
 Get the parent component.
 
template<class DataType >
const DataType * firstParentOfType ()
 Walk up the parent chain and return the first ancestor of the given type.
 
void ref ()
 Increment the reference counter.
 
void unref ()
 Decrement the reference counter; deletes this when it reaches zero.
 
void setName (const std::string &name)
 
std::string name () const
 
virtual void onNameChanged ()
 
void print (int l_depth=0)
 
virtual void doPrint ()
 
void copy (const Component &component, bool)
 

Private Member Functions

void unload ()
 
bool isCustomizableTabard () const
 
void updateItemModel (POSITION_SLOTS pos, int modelId, int textureId)
 
void mergeModel (CharSlots slot, int modelId, int textureId)
 
CharRegions getRegionForTexture (GameFile *file) const
 
int getCustomModelId (size_t index) const
 
int getCustomTextureId (size_t index) const
 

Private Attributes

WoWModelcharModel_ = nullptr
 
int id_ = -1
 
int displayId_ = -1
 
int quality_ = 0
 
int level_ = 0
 
int type_ = 0
 
int displayFlags_ = 0
 
unsigned int nbLevels_ = 0
 
CharSlots slot_
 
std::map< CharRegions, GameFile * > itemTextures_
 
std::map< CharGeosets, int > itemGeosets_
 
std::map< int, int > levelDisplayMap_
 
std::map< int, int > modifierIdDisplayMap_
 
std::map< POSITION_SLOTS, WoWModel * > itemModels_
 
WoWModelmergedModel_ = nullptr
 

Static Private Attributes

static std::map< CharSlots, int > SLOT_LAYERS_
 
static std::map< std::string, int > MODELID_OFFSETS_
 

Detailed Description

Represents an equipped item on a character model.

Handles item display lookup, model attachment, texture composition, and geoset visibility for a single equipment slot.

Definition at line 38 of file WoWItem.h.

Constructor & Destructor Documentation

◆ WoWItem()

WoWItem::WoWItem ( CharSlots  slot)

Definition at line 29 of file WoWItem.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ getCustomModelId()

int WoWItem::getCustomModelId ( size_t  index) const
private

Definition at line 1152 of file WoWItem.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCustomTextureId()

int WoWItem::getCustomTextureId ( size_t  index) const
private

Definition at line 1230 of file WoWItem.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRegionForTexture()

CharRegions WoWItem::getRegionForTexture ( GameFile file) const
private

Definition at line 998 of file WoWItem.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ id()

int WoWItem::id ( ) const
inline

Definition at line 44 of file WoWItem.h.

Here is the caller graph for this function:

◆ isCustomizableTabard()

bool WoWItem::isCustomizableTabard ( ) const
private

Definition at line 863 of file WoWItem.cpp.

Here is the caller graph for this function:

◆ load() [1/2]

void WoWItem::load ( )

Definition at line 204 of file WoWItem.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ load() [2/2]

void WoWItem::load ( const std::string &  filepath)

Definition at line 883 of file WoWItem.cpp.

Here is the call graph for this function:

◆ mergeModel()

void WoWItem::mergeModel ( CharSlots  slot,
int  modelId,
int  textureId 
)
private

Definition at line 969 of file WoWItem.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ models()

std::map< POSITION_SLOTS, WoWModel * > WoWItem::models ( ) const
inline

Definition at line 62 of file WoWItem.h.

Here is the caller graph for this function:

◆ nbLevels()

unsigned int WoWItem::nbLevels ( ) const
inline

Definition at line 60 of file WoWItem.h.

◆ onParentSet()

void WoWItem::onParentSet ( Component )
overridevirtual

Called after the parent has been set; override for custom logic.

Reimplemented from Component.

Definition at line 166 of file WoWItem.cpp.

Here is the call graph for this function:

◆ quality()

int WoWItem::quality ( ) const
inline

Definition at line 52 of file WoWItem.h.

◆ refresh()

void WoWItem::refresh ( )

Definition at line 603 of file WoWItem.cpp.

Here is the call graph for this function:

◆ save()

void WoWItem::save ( pugi::xml_node &  parentNode) const

Definition at line 870 of file WoWItem.cpp.

Here is the call graph for this function:

◆ setDisplayId()

void WoWItem::setDisplayId ( int  id)

Definition at line 112 of file WoWItem.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setId()

void WoWItem::setId ( int  id)

Definition at line 34 of file WoWItem.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setLevel()

void WoWItem::setLevel ( int  level)

Definition at line 123 of file WoWItem.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setModifierId()

void WoWItem::setModifierId ( int  id)

Definition at line 145 of file WoWItem.cpp.

Here is the call graph for this function:

◆ slot()

CharSlots WoWItem::slot ( ) const
inline

Definition at line 50 of file WoWItem.h.

Here is the caller graph for this function:

◆ unload()

void WoWItem::unload ( )
private

Definition at line 171 of file WoWItem.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateItemModel()

void WoWItem::updateItemModel ( POSITION_SLOTS  pos,
int  modelId,
int  textureId 
)
private

Definition at line 942 of file WoWItem.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ charModel_

WoWModel* WoWItem::charModel_ = nullptr
private

Definition at line 72 of file WoWItem.h.

◆ displayFlags_

int WoWItem::displayFlags_ = 0
private

Definition at line 79 of file WoWItem.h.

◆ displayId_

int WoWItem::displayId_ = -1
private

Definition at line 75 of file WoWItem.h.

◆ id_

int WoWItem::id_ = -1
private

Definition at line 74 of file WoWItem.h.

◆ itemGeosets_

std::map<CharGeosets, int> WoWItem::itemGeosets_
private

Definition at line 88 of file WoWItem.h.

◆ itemModels_

std::map<POSITION_SLOTS, WoWModel*> WoWItem::itemModels_
private

Definition at line 91 of file WoWItem.h.

◆ itemTextures_

std::map<CharRegions, GameFile*> WoWItem::itemTextures_
private

Definition at line 87 of file WoWItem.h.

◆ level_

int WoWItem::level_ = 0
private

Definition at line 77 of file WoWItem.h.

◆ levelDisplayMap_

std::map<int, int> WoWItem::levelDisplayMap_
private

Definition at line 89 of file WoWItem.h.

◆ mergedModel_

WoWModel* WoWItem::mergedModel_ = nullptr
private

Definition at line 92 of file WoWItem.h.

◆ MODELID_OFFSETS_

std::map<std::string, int> WoWItem::MODELID_OFFSETS_
staticprivate

Definition at line 85 of file WoWItem.h.

◆ modifierIdDisplayMap_

std::map<int, int> WoWItem::modifierIdDisplayMap_
private

Definition at line 90 of file WoWItem.h.

◆ nbLevels_

unsigned int WoWItem::nbLevels_ = 0
private

Definition at line 80 of file WoWItem.h.

◆ quality_

int WoWItem::quality_ = 0
private

Definition at line 76 of file WoWItem.h.

◆ slot_

CharSlots WoWItem::slot_
private

Definition at line 82 of file WoWItem.h.

◆ SLOT_LAYERS_

std::map< CharSlots, int > WoWItem::SLOT_LAYERS_
staticprivate
Initial value:
=
{
{CS_SHIRT, 10}, {CS_HEAD, 11}, {CS_SHOULDER, 13},
{CS_PANTS, 10}, {CS_BOOTS, 11}, {CS_CHEST, 13},
{CS_TABARD, 17}, {CS_BELT, 18}, {CS_BRACERS, 19},
{CS_GLOVES, 20}, {CS_HAND_RIGHT, 21}, {CS_HAND_LEFT, 22},
{CS_CAPE, 23}, {CS_QUIVER, 24}
}
@ CS_BRACERS
Definition wow_enums.h:13
@ CS_QUIVER
Definition wow_enums.h:19
@ CS_HAND_LEFT
Definition wow_enums.h:16
@ CS_BELT
Definition wow_enums.h:9
@ CS_CAPE
Definition wow_enums.h:17
@ CS_SHOULDER
Definition wow_enums.h:7
@ CS_PANTS
Definition wow_enums.h:11
@ CS_TABARD
Definition wow_enums.h:18
@ CS_CHEST
Definition wow_enums.h:12
@ CS_HAND_RIGHT
Definition wow_enums.h:15
@ CS_HEAD
Definition wow_enums.h:6
@ CS_BOOTS
Definition wow_enums.h:8
@ CS_SHIRT
Definition wow_enums.h:10
@ CS_GLOVES
Definition wow_enums.h:14

Definition at line 20 of file WoWItem.h.

◆ type_

int WoWItem::type_ = 0
private

Definition at line 78 of file WoWItem.h.


The documentation for this class was generated from the following files: