ug4
ug::SubsetInfo Struct Reference

a struct that holds information associated with subsets. More...

#include <subset_handler_interface.h>

Public Types

typedef std::map< std::string, VariantPropertyMap
 

Public Member Functions

 SubsetInfo ()
 
void set_property (const char *name, Variant prop)
 associate a property with the given name More...
 
void set_property (const std::string &name, Variant prop)
 associate a property with the given name More...
 
Variant get_property (const char *name, Variant defaultValue=Variant()) const
 retrieve the property with the given name More...
 
Variant get_property (const std::string &name, Variant defaultValue=Variant()) const
 retrieve the property with the given name More...
 

Public Attributes

vector4 color
 
PropertyMap m_propertyMap
 custom properties can be stored in this map. More...
 
int materialIndex
 mostly ignored. More...
 
std::string name
 
uint subsetState
 an or-combination of SubsetState flags. More...
 

Detailed Description

a struct that holds information associated with subsets.

The subset info can be used to store additional information with each subset. On the one hand it features some often used entries like name and color, on the other hand it features a property system, which allows to associate custom properties with each subset. Note that the property system isn't that fast, that it should be frequently used in performance critical sections of the code.

Member Typedef Documentation

◆ PropertyMap

typedef std::map<std::string, Variant> ug::SubsetInfo::PropertyMap

Constructor & Destructor Documentation

◆ SubsetInfo()

ug::SubsetInfo::SubsetInfo ( )

References name, and ug::SS_NONE.

Member Function Documentation

◆ get_property() [1/2]

Variant ug::SubsetInfo::get_property ( const char *  name,
Variant  defaultValue = Variant() 
) const

retrieve the property with the given name

You may optionally specify a default value, which will be returned if the entry is not found.

References name.

Referenced by ug::DimensionOfSubset().

◆ get_property() [2/2]

Variant ug::SubsetInfo::get_property ( const std::string &  name,
Variant  defaultValue = Variant() 
) const

retrieve the property with the given name

You may optionally specify a default value, which will be returned if the entry is not found.

References name.

◆ set_property() [1/2]

void ug::SubsetInfo::set_property ( const char *  name,
Variant  prop 
)

associate a property with the given name

References name.

◆ set_property() [2/2]

void ug::SubsetInfo::set_property ( const std::string &  name,
Variant  prop 
)

associate a property with the given name

References name.

Member Data Documentation

◆ color

◆ m_propertyMap

PropertyMap ug::SubsetInfo::m_propertyMap

custom properties can be stored in this map.

One should access it through set_property and get_property.

Referenced by ug::DeserializeSubsetHandler(), ug::SubsetHandlerSerializer::read_info(), ug::SerializeSubsetHandler(), and ug::SubsetHandlerSerializer::write_info().

◆ materialIndex

◆ name

◆ subsetState


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