Amazon VERSION 2.0V1 Guía de usuario Pagina 65

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 264
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de 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
Vista de pagina 64
1 2 ... 60 61 62 63 64 65 66 67 68 69 70 ... 263 264

Comentarios a estos manuales

Sin comentarios