public

Inheritance Graph

graph BT
	ResourceFormat
	VertexDescription --> ResourceFormat
	click ResourceFormat "classUtil_1_1ResourceFormat"
	click VertexDescription "classRendering_1_1VertexDescription"

Description

ResourceFormat

Public Types

   
   
typedef AttributeFormat Attribute
   
typedef std::deque< Attribute > AttributeContainer_t

Public Functions

   
   
  ResourceFormat(size_t _attributeAlignment)
   
  ~ResourceFormat()
   
const Attribute & appendAttribute(const StringIdentifier & nameId, TypeConstant type, uint32_t numValues, bool normalized, uint32_t internalType)
   
const Attribute & _appendAttribute(const StringIdentifier & nameId, TypeConstant type, uint32_t numValues, bool normalized, uint32_t internalType, size_t offset)
directly appends the attribute without recalculating offsets
   
const Attribute & appendFloat(const Util::StringIdentifier & nameId, uint32_t numValues, bool normalized)
Add an attribute with the given name and the given number of float values.
   
const Attribute & appendUInt(const Util::StringIdentifier & nameId, uint32_t numValues)
Add an attribute with the given name and the given number of unsigned int values.
   
const Attribute & appendInt(const Util::StringIdentifier & nameId, uint32_t numValues)
Add an attribute with the given name and the given number of int values.
   
const Attribute & getAttribute(const StringIdentifier & nameId) const
   
const Attribute & getAttribute(const std::string & name) const
   
const Attribute & getAttribute(uint32_t location) const
   
bool hasAttribute(const StringIdentifier & nameId) const
   
bool hasAttribute(const std::string & name) const
   
const uint32_t getAttributeLocation(const StringIdentifier & nameId) const
Returns the location index of the attribute within the the resource format.
   
const uint32_t getAttributeLocation(const std::string & name) const
   
void updateAttribute(const Attribute & attr)
   
void merge(const ResourceFormat & other)
Merges this resource format with another.
   
uint32_t getNumAttributes() const
Returns the number of attributes.
   
const AttributeContainer_t & getAttributes() const
   
void setSize(size_t value)
   
size_t getSize() const
   
size_t getAlignment() const
   
std::string toString(bool formatted) const
   
bool operator==(const ResourceFormat & other) const
   
bool operator!=(const ResourceFormat & other) const
   
bool operator<(const ResourceFormat & other) const

Documentation

typedef
Util::ResourceFormat::Attribute

public
 
 
typedef AttributeFormat Attribute

Defined in Util/Resources/ResourceFormat.h:31


typedef
Util::ResourceFormat::AttributeContainer_t

public
 
 
typedef std::deque< Attribute > AttributeContainer_t

Defined in Util/Resources/ResourceFormat.h:32


function
Util::ResourceFormat::ResourceFormat

public inline
     
     
ResourceFormat( size_t _attributeAlignment )

Defined in Util/Resources/ResourceFormat.h:34


function
Util::ResourceFormat::~ResourceFormat

public virtual
   
   
~ResourceFormat( )

Defined in Util/Resources/ResourceFormat.h:35


function
Util::ResourceFormat::appendAttribute

public
     
     
const Attribute & appendAttribute( const StringIdentifier & nameId,
  TypeConstant type,
  uint32_t numValues,
  bool normalized,
  uint32_t internalType
)    

Create and add a new attribute to the ResourceFormat .

Parameters

nameId
The name of the attribute.
type
The base type of the attribute.
numValue
The number of channels the attribute has (e.g., 3 for RGB)
normalized
Specifies that the underlying type is automatically converted to/from float value in the range [-1.0,1.0] or [0.0,1.0]
internalType
User defined internal type id (e.g., for compressed data).

Returns

the new attribute

Note: the owner of the attribute is the ResourceFormat

Note: Before using this function, check a default method can be used instead (e.g.appendFloat)

Note: WheninternalTypeis set, thetypeandnumValuesare still used for size calculation, e.g., if a R10G10B10A2 attribute is packed into a single 32 bit integer, the numValues should be 1.

Defined in Util/Resources/ResourceFormat.h:49


function
Util::ResourceFormat::_appendAttribute

public
     
     
const Attribute & _appendAttribute( const StringIdentifier & nameId,
  TypeConstant type,
  uint32_t numValues,
  bool normalized,
  uint32_t internalType,
  size_t offset
)    

directly appends the attribute without recalculating offsets

Defined in Util/Resources/ResourceFormat.h:52


function
Util::ResourceFormat::appendFloat

public inline
     
     
const Attribute & appendFloat( const Util::StringIdentifier & nameId,
  uint32_t numValues,
  bool normalized
)    

Add an attribute with the given name and the given number of float values.

Defined in Util/Resources/ResourceFormat.h:55


function
Util::ResourceFormat::appendUInt

public inline
     
     
const Attribute & appendUInt( const Util::StringIdentifier & nameId,
  uint32_t numValues
)    

Add an attribute with the given name and the given number of unsigned int values.

Defined in Util/Resources/ResourceFormat.h:60


function
Util::ResourceFormat::appendInt

public inline
     
     
const Attribute & appendInt( const Util::StringIdentifier & nameId,
  uint32_t numValues
)    

Add an attribute with the given name and the given number of int values.

Defined in Util/Resources/ResourceFormat.h:65


function
Util::ResourceFormat::getAttribute

public const
     
     
const Attribute & getAttribute( const StringIdentifier & nameId ) const

Get a reference to the attribute with the corresponding name.

Returns

Always returns an attribute. If the attribute is not present in the vertex description, it is empty.

Note: The owner of the attribute is the ResourceFormat , so be careful if the ResourceFormat is deleted or reassigned.

Defined in Util/Resources/ResourceFormat.h:74


function
Util::ResourceFormat::getAttribute

public const inline
     
     
const Attribute & getAttribute( const std::string & name ) const

Defined in Util/Resources/ResourceFormat.h:75


function
Util::ResourceFormat::getAttribute

public const inline
     
     
const Attribute & getAttribute( uint32_t location ) const

Defined in Util/Resources/ResourceFormat.h:78


function
Util::ResourceFormat::hasAttribute

public const
     
     
bool hasAttribute( const StringIdentifier & nameId ) const

Defined in Util/Resources/ResourceFormat.h:82


function
Util::ResourceFormat::hasAttribute

public const inline
     
     
bool hasAttribute( const std::string & name ) const

Defined in Util/Resources/ResourceFormat.h:83


function
Util::ResourceFormat::getAttributeLocation

public const
     
     
const uint32_t getAttributeLocation( const StringIdentifier & nameId ) const

Returns the location index of the attribute within the the resource format.

Defined in Util/Resources/ResourceFormat.h:88


function
Util::ResourceFormat::getAttributeLocation

public const inline
     
     
const uint32_t getAttributeLocation( const std::string & name ) const

Defined in Util/Resources/ResourceFormat.h:89


function
Util::ResourceFormat::updateAttribute

public
     
     
void updateAttribute( const Attribute & attr )

Update an existing attribute of or append a new attribute to the ResourceFormat .

Parameters

attr
Attribute that contains the new data.
recalculateOffsets
Iftrue, the offsets of all attributes will be recalculated (The size will be recalculated either way).

Warning: When manually setting the offsets, make sure that they fit within the sizes and offsets of the other attributes. Otherwise, unpredictable side effects can occur.

Defined in Util/Resources/ResourceFormat.h:101


function
Util::ResourceFormat::merge

public
     
     
void merge( const ResourceFormat & other )

Merges this resource format with another.

Defined in Util/Resources/ResourceFormat.h:104


function
Util::ResourceFormat::getNumAttributes

public const inline
   
   
uint32_t getNumAttributes( ) const

Returns the number of attributes.

Defined in Util/Resources/ResourceFormat.h:107


function
Util::ResourceFormat::getAttributes

public const inline
   
   
const AttributeContainer_t & getAttributes( ) const

Defined in Util/Resources/ResourceFormat.h:108


function
Util::ResourceFormat::setSize

public inline
     
     
void setSize( size_t value )

Forcefully set the size of the resource format. This can be useful when requiring specific alignments.

Note: When adding/updating an attribute, the size gets recalculated.

Parameters

value
The size.

Defined in Util/Resources/ResourceFormat.h:117


function
Util::ResourceFormat::getSize

public const inline
   
   
size_t getSize( ) const

Defined in Util/Resources/ResourceFormat.h:118


function
Util::ResourceFormat::getAlignment

public const inline
   
   
size_t getAlignment( ) const

Defined in Util/Resources/ResourceFormat.h:120


function
Util::ResourceFormat::toString

public const
     
     
std::string toString( bool formatted ) const

Defined in Util/Resources/ResourceFormat.h:122


function
Util::ResourceFormat::operator==

public const
     
     
bool operator==( const ResourceFormat & other ) const

Defined in Util/Resources/ResourceFormat.h:123


function
Util::ResourceFormat::operator!=

public const
     
     
bool operator!=( const ResourceFormat & other ) const

Defined in Util/Resources/ResourceFormat.h:124


function
Util::ResourceFormat::operator<

public const
     
     
bool operator<( const ResourceFormat & other ) const

Defined in Util/Resources/ResourceFormat.h:125