FormIt C++ API v25.0.0 (2025.0.0)
Loading...
Searching...
No Matches
FormIt::Materials::MaterialData Struct Reference

Description

#include <FormItCoreTypes.h>

Public Member Functions

FORMIT_CORE_EXPORT MaterialData (WSM::Color const &color=WSM::Color(255, 255, 255, 255), 1::vector< char > const &aTextureData={}, WSM::Vector2d const &scale={ 1.0, 1.0 }, bool bUseBitmapAlpha=true, 1::string const &sMaterialName={}, 1::string const &sMaterialIdentifier={}, 1::string const &sTextureName={}, 1::vector< AdditionalMaterialAttibute > const &aAttributes={}, 1::vector< AdditionalMaterialTexture > const &aTextures={})
 
FORMIT_CORE_EXPORT MaterialData (const MaterialData &)
 
FORMIT_CORE_EXPORT float GetAttribute (AttributeType attributeType) const
 Get the value of an attribute in the additional attributes.
 
FORMIT_CORE_EXPORT bool SetAttribute (AttributeType attributeType, float value)
 Set the value of an attribute in the additional attributes.
 
FORMIT_CORE_EXPORT const ::vector< char > & GetMap (MapType mapType) const
 Get the map from the additional textures.
 
FORMIT_CORE_EXPORT void SetMap (MapType mapType, const 1::vector< char > &map)
 Set the map int the additional attributes.
 
FORMIT_CORE_EXPORT bool GetPreviewImage (1::vector< unsigned char > &previewImage, size_t &res, bool jpg=false)
 Create the material preview.
 

Public Attributes

WSM::Color m_color
 Fields.
 
::vector< char > m_aTextureData
 
WSM::Vector2d m_scale
 
bool m_bUseBitmapAlpha = true
 
::string m_sMaterialName
 
::string m_sMaterialIdentifier
 
::string m_sTextureName
 
::vector< AdditionalMaterialAttibutem_aAttributes
 
::vector< AdditionalMaterialTexturem_aTextures
 

Constructor & Destructor Documentation

◆ MaterialData() [1/2]

FORMIT_CORE_EXPORT FormIt::Materials::MaterialData::MaterialData ( WSM::Color const &  color = WSM::Color(255, 255, 255, 255),
1::vector< char > const &  aTextureData = {},
WSM::Vector2d const &  scale = { 1.0, 1.0 },
bool  bUseBitmapAlpha = true,
1::string const &  sMaterialName = {},
1::string const &  sMaterialIdentifier = {},
1::string const &  sTextureName = {},
1::vector< AdditionalMaterialAttibute > const &  aAttributes = {},
1::vector< AdditionalMaterialTexture > const &  aTextures = {} 
)
Parameters
colorDefault white

◆ MaterialData() [2/2]

FORMIT_CORE_EXPORT FormIt::Materials::MaterialData::MaterialData ( const MaterialData )

Member Function Documentation

◆ GetAttribute()

FORMIT_CORE_EXPORT float FormIt::Materials::MaterialData::GetAttribute ( AttributeType  attributeType) const

Get the value of an attribute in the additional attributes.

The value returned is in the range 0.0 ... 1.0

Parameters
[in]attributeType

◆ GetMap()

FORMIT_CORE_EXPORT const ::vector< char > & FormIt::Materials::MaterialData::GetMap ( MapType  mapType) const

Get the map from the additional textures.

Returns an empty vector if the map does not exist.

Parameters
[in]mapType

◆ GetPreviewImage()

FORMIT_CORE_EXPORT bool FormIt::Materials::MaterialData::GetPreviewImage ( 1::vector< unsigned char > &  previewImage,
size_t &  res,
bool  jpg = false 
)

Create the material preview.

The returned vector contains png or jpg formatted rgb pixel values. The preview image is square with a resolution of kMaterialPreviewSize, which is returned via the res argument. Returns true on success.

Parameters
[out]previewImage
[out]res
[in]jpg

◆ SetAttribute()

FORMIT_CORE_EXPORT bool FormIt::Materials::MaterialData::SetAttribute ( AttributeType  attributeType,
float  value 
)

Set the value of an attribute in the additional attributes.

The value passed in must be in the range 0.0 ... 1.0 Returns false if an value is passed

Parameters
[in]attributeType
[in]value

◆ SetMap()

FORMIT_CORE_EXPORT void FormIt::Materials::MaterialData::SetMap ( MapType  mapType,
const 1::vector< char > &  map 
)

Set the map int the additional attributes.

To delete the map, an empty vector is passed in.

Parameters
[in]mapType
[in]map

Member Data Documentation

◆ m_aAttributes

::vector<AdditionalMaterialAttibute> FormIt::Materials::MaterialData::m_aAttributes

◆ m_aTextureData

::vector<char> FormIt::Materials::MaterialData::m_aTextureData

◆ m_aTextures

::vector<AdditionalMaterialTexture> FormIt::Materials::MaterialData::m_aTextures

◆ m_bUseBitmapAlpha

bool FormIt::Materials::MaterialData::m_bUseBitmapAlpha = true

◆ m_color

WSM::Color FormIt::Materials::MaterialData::m_color

Fields.

◆ m_scale

WSM::Vector2d FormIt::Materials::MaterialData::m_scale

◆ m_sMaterialIdentifier

::string FormIt::Materials::MaterialData::m_sMaterialIdentifier

◆ m_sMaterialName

::string FormIt::Materials::MaterialData::m_sMaterialName

◆ m_sTextureName

::string FormIt::Materials::MaterialData::m_sTextureName

The documentation for this struct was generated from the following file: