FormIt C++ API  v23.0.0 (2023.0.0)
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. More...
 
FORMIT_CORE_EXPORT bool SetAttribute (AttributeType attributeType, float value)
 Set the value of an attribute in the additional attributes. More...
 
FORMIT_CORE_EXPORT const ::vector< char > & GetMap (MapType mapType) const
 Get the map from the additional textures. More...
 
FORMIT_CORE_EXPORT void SetMap (MapType mapType, const 1::vector< char > &map)
 Set the map int the additional attributes. More...
 
FORMIT_CORE_EXPORT bool GetPreviewImage (1::vector< unsigned char > &previewImage, size_t &res, bool jpg=false)
 Create the material preview. More...
 

Public Attributes

WSM::Color m_color
 Fields. More...
 
::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

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
FORMIT_CORE_EXPORT FormIt::Materials::MaterialData::MaterialData ( const MaterialData )

Member Function Documentation

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

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.

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.

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

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.

Member Data Documentation

::vector<AdditionalMaterialAttibute> FormIt::Materials::MaterialData::m_aAttributes
::vector<char> FormIt::Materials::MaterialData::m_aTextureData
::vector<AdditionalMaterialTexture> FormIt::Materials::MaterialData::m_aTextures
bool FormIt::Materials::MaterialData::m_bUseBitmapAlpha = true
WSM::Color FormIt::Materials::MaterialData::m_color

Fields.

WSM::Vector2d FormIt::Materials::MaterialData::m_scale
::string FormIt::Materials::MaterialData::m_sMaterialIdentifier
::string FormIt::Materials::MaterialData::m_sMaterialName
::string FormIt::Materials::MaterialData::m_sTextureName

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