Registry 配准

内容表

关于

A component (interface implementation) can be added to a registry. The component is typically registered along its implementation (see 接口实现 ).

配准

A given component can be registered at a registry using the MAXON_COMPONENT_CLASS_REGISTER macro. It is used to add the component to the registry and to define its ID:

// This example implements the given interface, registers // the component and adds it to the given registry.

// implementation

class ColorRedImpl : public maxon::Component <ColorRedImpl, ColorInterface> { MAXON_COMPONENT ();
public : MAXON_METHOD maxon::String GetName() const { return "Red" _s; } MAXON_METHOD maxon::Color32 GetRGB() const { maxon::Color32 color; color. r = 1.0; color. g = 0.0; color. b = 0.0; return color; } }; using namespace maxon ;

// register component class and add it to registry "ColorClasses" MAXON_COMPONENT_CLASS_REGISTER (ColorRedImpl, ColorClasses, "net.maxonexample.class.colors.red" )

延伸阅读

maxon::ComponentWithBase
定义: objectbase.h:2472
maxon::Col3::g
T g
定义: col.h:33
maxon
The maxon namespace contains all declarations of the MAXON API.
定义: c4d_basedocument.h:15
MAXON_COMPONENT
#define MAXON_COMPONENT(KIND,...)
定义: objectbase.h:2036
maxon::String
定义: string.h:1197
MAXON_COMPONENT_CLASS_REGISTER
#define MAXON_COMPONENT_CLASS_REGISTER(C,...)
定义: objectbase.h:2233
MAXON_METHOD
#define MAXON_METHOD
定义: interfacebase.h:855
maxon::Col3::b
T b
定义: col.h:34
maxon::Col3
A color consisting of three components R, G and B.
定义: col.h:14
maxon::Col3::r
T r
定义: col.h:32

Copyright  © 2014-2025 乐数软件    

工业和信息化部: 粤ICP备14079481号-1