BaseChannel Class Reference

#include <c4d_basechannel.h>

Inheritance diagram for BaseChannel:

详细描述

Represents a channel in a material. Call BaseMaterial::GetChannel() to retrieve an instance.

注意
Has to be created with Alloc() and destroyed with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

私有成员函数

  BaseChannel ()
  ~BaseChannel ()

Alloc/Free

static BaseChannel Alloc (void)
static void  Free ( BaseChannel *&bc)

Init/Free Texture

INITRENDERRESULT   InitTexture (const InitRenderStruct &irs)
void  FreeTexture (void)

Get/Set Data

BaseContainer   GetData (void)
void  SetData (const BaseContainer &ct)

Shader/Bitmap Access

Int32   GetShaderID (void)
BaseShader GetShader (void)
BaseBitmap GetBitmap (void)

采样

向量   Sample ( VolumeData *vd, 向量 *p, 向量 *delta, 向量 *n, Float t, Int32 tflag, Float off, Float scale)

杂项

Bool   比较 ( BaseChannel *dst)
Bool   Attach ( GeListNode *element)

Additional Inherited Members

-  Public Member Functions inherited from C4DAtom
Int32   GetType () const
Int32   GetRealType () const
Int32   GetDiskType () const
Bool   IsInstanceOf ( Int32 id) const
Int32   GetClassification () const
Bool   消息 ( Int32 type, void *data=nullptr)
Bool   MultiMessage ( MULTIMSG_ROUTE flags, Int32 type, void *data)
C4DAtom GetClone ( COPYFLAGS flags, AliasTrans *trn)
Bool   CopyTo ( C4DAtom *dst, COPYFLAGS flags, AliasTrans *trn)
Bool   读取 ( HyperFile *hf, Int32 id, Int32 level)
Bool   Write ( HyperFile *hf)
Bool   ReadObject ( HyperFile *hf, Bool readheader)
Bool   WriteObject ( HyperFile *hf)
Bool   GetDescription ( 描述 *description, DESCFLAGS_DESC flags)
Bool   GetParameter (const DescID &id, GeData &t_data, DESCFLAGS_GET flags)
Bool   SetParameter (const DescID &id, const GeData &t_data, DESCFLAGS_SET flags)
DynamicDescription GetDynamicDescription ()
Bool   GetEnabling (const DescID &id, const GeData &t_data, DESCFLAGS_ENABLE flags, const BaseContainer *itemdesc)
Bool   TranslateDescID (const DescID &id, DescID &res_id, C4DAtom *&res_at)
UInt32   GetDirty ( DIRTYFLAGS flags) const
void  SetDirty ( DIRTYFLAGS flags)
UInt32   GetHDirty ( HDIRTYFLAGS mask) const
void  SetHDirty ( HDIRTYFLAGS mask)

构造函数 & 析构函数文档编制

◆  BaseChannel()

BaseChannel () private

◆  ~BaseChannel()

~ BaseChannel () private

成员函数文档编制

◆  Alloc()

static BaseChannel * Alloc ( void  )
static

Allocates a channel. Destroy the allocated channel with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

返回
The allocated channel, or nullptr if the allocation failed.

◆  Free()

static void Free ( BaseChannel *&  bc )
static

Destructs channels allocated with Alloc() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

参数
[in] bc The channel to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆  InitTexture()

INITRENDERRESULT InitTexture ( const InitRenderStruct irs )

Initializes the channel texture, loading any files required.

注意
InitTexture() can only be called once before releasing it with FreeTexture() , this includes using it from multiple threads.
参数
[in] irs A structure with information about the upcoming rendering.
返回
The result of the initialization: INITRENDERRESULT

◆  FreeTexture()

void FreeTexture ( void  )

Frees all resources used by this channel.

注意
The texture itself might still be in memory, only the lock to the texture or the data required by a shader is freed. The texture will only be flushed if no other channel holds a lock.
The texture may also be flushed at certain times such as a call to FlushUnusedTextures() , after starting the renderer, when opening a new document or during low memory conditions.

◆  GetData()

BaseContainer GetData ( void  )

Gets the settings container for the channel with these IDs: BASECHANNEL

返回
The container with the settings for this channel.

◆  SetData()

void SetData ( const BaseContainer ct )

Sets the settings for this channel.

注意
The container is always merged.
参数
[in] ct The settings container for the channel with these IDs: BASECHANNEL

◆  GetShaderID()

Int32 GetShaderID ( void  )

Gets the ID of the shader.

返回
The shader ID, or nullptr if it is a texture.

◆  GetShader()

BaseShader * GetShader ( void  )

Retrieves the shader of a channel.

返回
The shader, or nullptr if the channel does not contain a shader. The channel owns the pointed shader.

◆  GetBitmap()

BaseBitmap * GetBitmap ( void  )

Retrieves the bitmap of a texture image.

注意
This method has to be called within a pair of InitTexture() / FreeTexture() calls.
返回
The bitmap, or nullptr if no bitmap is used. The channel owns the pointed bitmap.

◆  Sample()

向量 Sample ( VolumeData vd ,
向量 p ,
向量 delta ,
向量 n ,
Float   t ,
Int32   tflag ,
Float   off ,
Float   scale  
)

Retrieves the color vector for a position in the texture.

注意
This method has to be called within a pair of InitTexture() / FreeTexture() calls.
参数
[in] vd A pointer to the structure containing information for volumetric shaders. This can be nullptr for evaluation of a preview image. The caller owns the pointed VolumeData .
[in] p The UVW coordinate to sample the color value for in world coordinates. The caller owns the pointed Vector.
[in] delta The MIP sample radius in UVW coordinates. The caller owns the pointed Vector.
[in] n The surface normal at the UVW coordinate for the sample. The caller owns the pointed Vector.
[in] t The current time in seconds.
[in] tflag The texture flags: TEX
[in] off The MIP blur offset.
[in] scale The MIP blur scale.
返回
The color at the given point.

◆  Compare()

Bool 比较 ( BaseChannel dst )

Checks if *this 类似 *dst . For plugin shaders this means an automatic comparison of container values.

参数
[in] dst The channel to compare with. The caller owns the pointed channel.
返回
true if the channels have the same settings, otherwise false .

◆  Attach()

Bool Attach ( GeListNode element )

Private .