Amazon VERSION 2.0V1 Guida Utente Pagina 65

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 264
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 64
65
To provide an error message the getLocalAttrNames() function can add the errorMessage name to the list of
attribute names it modifies, and the getLocalAttr() function can return a value for the errorMessage attribute,
wrapped in a StringAttribute as mentioned above.
TIP: The text of an error message can be copied to the clipboard through the context menu of the
“errorMessage” attribute in an Attributes tab.
The following code snippet shows examples of how error information can be returned from the
getLocalAttrNames() and getLocalAttr() functions. In this example, both functions check the value of a boolean
instance variable named _errorOccurred, which states whether or not an error occurred. The description of the error
is stored in an instance variable named _errorMessage of type std::string.
void CubeRootContext::getLocalAttrNames(
std::vector<std::string>* names) const
{
names->clear();
names->push_back("type");
names->push_back("xform");
if (_errorOccurred && !_errorMessage.empty())
{
names.push_back("errorMessage")
}
}
FnKat::Attribute CubeRootContext::getLocalAttr(
const std::string& name) const
{
if (name == "type")
{
return FnKat::StringAttribute(
!_errorOccurred ? "group" : "error");
}
8 SCENE GRAPH GENERATOR PLUG-INS | SGG PLUG-IN API CLASSES
Vedere la pagina 64
1 2 ... 60 61 62 63 64 65 66 67 68 69 70 ... 263 264

Commenti su questo manuale

Nessun commento