Data Description Categories and Keys

About

Data descriptions are separated into three different categories:

The information of a data description is stored as a maxon::DataDictionary. The settings stored in these dictionaries is accessed with pre-defined resource IDs (see Resource IDs).

// This example loads the description of the given data type and prints the attributes to the console.
// data type ID
const maxon::Id dataType { "net.maxonexample.class.descriptionElement" };
// load description data
const maxon::DataDescription descriptionData = maxon::DataDescriptionDatabaseInterface::LoadDescription(category, maxon::LanguageRef(), dataType) iferr_return;
// load description string data
const maxon::LanguageRef language = maxon::Resource::GetDefaultLanguage();
const maxon::DataDescription descriptionStrings = maxon::DataDescriptionDatabaseInterface::LoadDescription(category, language, dataType) iferr_return;
// list all attributes
const auto attributes = descriptionData.GetEntries() iferr_return;
for (const maxon::DataDictionary& attribute : attributes)
{
// get attribute settings
const maxon::InternedId ID = attribute.Get(maxon::DESCRIPTION::BASE::IDENTIFIER) iferr_return;
const maxon::Id attributeDataType = attribute.Get(maxon::DESCRIPTION::DATA::BASE::DATATYPE) iferr_return;
DiagnosticOutput("Attribute \"@\" of type @. Default value: @", ID, attributeDataType, defaultData);
// get localized attribute name
ifnoerr (const maxon::DataDictionary attributeString = descriptionStrings.GetEntry(ID))
{
const maxon::String translatedString = attributeString.Get(maxon::DESCRIPTION::STRING::BASE::TRANSLATEDSTRING) iferr_return;
DiagnosticOutput("Name: \"@\" (@)", translatedString, language.GetName());
}
}
@ DEFAULTVALUE
Dummy value for the default value GeData constructor.
Definition: c4d_gedata.h:65
static MAXON_METHOD Result< DataDescription > LoadDescription(const Id &category, const LanguageRef &language, const Id &dataType)
Definition: datatypebase.h:1204
Result< typename std::conditional< GetCollectionKind< T >::value==COLLECTION_KIND::ARRAY, T, typename ByValueParam< T >::type >::type > Get() const
Definition: datatypebase.h:1364
Definition: apibaseid.h:237
Definition: datatypelib.h:31
const Id & Get() const
Definition: datatypelib.h:164
const Id & Get() const
Definition: apibaseid.h:159
static MAXON_METHOD LanguageRef GetDefaultLanguage()
Definition: string.h:1235
#define DiagnosticOutput(formatString,...)
Definition: debugdiagnostics.h:176
#define ifnoerr(...)
The opposite of iferr.
Definition: errorbase.h:393
static constexpr LiteralId DATADESCRIPTION_CATEGORY_STRING
Definition: datadescriptiondatabase.h:17
static constexpr LiteralId DATADESCRIPTION_CATEGORY_DATA
Definition: datadescriptiondatabase.h:15
#define iferr_return
Definition: resultbase.h:1521

Categories

Data

The resource IDs for basic data description settings are define in these namespaces:

  • maxon::DESCRIPTION::BASE: Basic settings like the attribute identifier.
    • maxon::DESCRIPTION::BASE::COMMAND: Attribute type.
    • maxon::DESCRIPTION::BASE::IDENTIFIER: Attribute ID.
  • maxon::DESCRIPTION::DATA::BASE: Base information like type, default value, units etc.
    • maxon::DESCRIPTION::BASE::DATATYPE
    • maxon::DESCRIPTION::BASE::CLASSIFICATION
    • maxon::DESCRIPTION::BASE::UNIT
    • maxon::DESCRIPTION::BASE::DEFAULTVALUE
    • maxon::DESCRIPTION::BASE::LIMITVALUE
    • maxon::DESCRIPTION::BASE::MINVALUE
    • maxon::DESCRIPTION::BASE::MAXVALUE
    • maxon::DESCRIPTION::BASE::INCLUDE
    • maxon::DESCRIPTION::BASE::INCLUDERENAME
    • maxon::DESCRIPTION::BASE::INCLUDEFILTER
    • maxon::DESCRIPTION::BASE::ENUM
    • maxon::DESCRIPTION::BASE::DATABASEID
    • maxon::DESCRIPTION::BASE::OVERWRITABLE
    • maxon::DESCRIPTION::BASE::COMMENT
    • maxon::DESCRIPTION::BASE::GENERATEIGNOREHEADER
    • maxon::DESCRIPTION::BASE::ISVARIADIC
    • maxon::DESCRIPTION::BASE::VARIADICCOUNT
    • maxon::DESCRIPTION::BASE::VARIADICCOMMANDS
    • maxon::DESCRIPTION::BASE::VARIADICIDS
    • maxon::DESCRIPTION::BASE::INHERITSTRING
    • maxon::DESCRIPTION::BASE::OPTIONALSTRING
    • maxon::DESCRIPTION::BASE::NAMESPACE
    • maxon::DESCRIPTION::BASE::INCLUDEDFROM
    • maxon::DESCRIPTION::BASE::ORIGIN
  • maxon::DESCRIPTION::DATA::INFO: General info.
    • maxon::DESCRIPTION::DATA::INFO::CLASSIFICATION
    • maxon::DESCRIPTION::DATA::INFO::SUBCLASSIFICATION
    • maxon::DESCRIPTION::DATA::INFO::INCLUDEFILE
    • maxon::DESCRIPTION::DATA::INFO::COMMENT
    • maxon::DESCRIPTION::DATA::INFO::HIDDEN

For convenience one can use maxon::GetDefaultValueKey() to get the ID of maxon::DESCRIPTION::DATA::BASE::DEFAULTVALUE

String

String resource IDs are in defined in maxon::DESCRIPTION::STRING::BASE:

  • maxon::DESCRIPTION::STRING::BASE::TRANSLATEDSTRING
  • maxon::DESCRIPTION::STRING::BASE::REFERENCESTRING
  • maxon::DESCRIPTION::STRING::BASE::TRANSLATEDREFERENCESTRING
  • maxon::DESCRIPTION::STRING::BASE::TRANSLATEDCHILDREN
  • maxon::DESCRIPTION::STRING::BASE::GOTONEXT
  • maxon::DESCRIPTION::STRING::BASE::SUGGESTIONS
  • maxon::DESCRIPTION::STRING::BASE::OPENEXTERNALCOMPARETOOL
  • maxon::DESCRIPTION::STRING::BASE::APPROVECOMMAND

UI

UI resource IDs are in defined in these namespaces:

Further Reading