TP_PShapeInterface Struct Reference

#include <c4d_particles.h>

详细描述

Callback interface for nodes that register shapes.
The easiest way to create this is to implement the TP_BaseShape class:
This class is only forward-declared in c4d_particles.h , so as long as the linker approves this is fine.
范例:

class TP_BaseShape { public : TP_PShapeInterface si; TP_BaseShape () { si. base = this ; }
TP_PShape* GetShapeClone ( TP_PShapePtr &shape, TP_MasterSystem *msys, Int32 pid, Int32 flags, AliasTrans *trn) { // ... } TP_PShape* GetShape ( TP_PShapePtr &shape, TP_MasterSystem *msys, Int32 pid, Int32 owner_id) { // ... } BaseObject * GetShapeVirtualObjects ( TP_PShapePtr &shape, TP_MasterSystem *msys, Int32 pid, BaseDocument *doc, HierarchyHelp *hh) { // ... } Float GetShapeScale ( TP_PShapePtr &shape, TP_MasterSystem *msys, Int32 pid) { // ... } void FreeShape ( TP_PShapePtr &shape, TP_MasterSystem *msys, Int32 pid) { // ... } };

TP_MSG_GET_PSHAPEINTERFACE message then simply set the passed pointer TP_PShapeInterface to &baseshape.si , for a global TP_BaseShape baseshape object that was previously created.
Thinking Particles will then call the shape functions as needed.

Public Attributes

TP_BaseShape base
TP_PShapePtr (TP_BaseShape::*  GetShapeClone )(const TP_PShapePtr &shape, TP_MasterSystem *msys, Int32 pid, COPYFLAGS flags, AliasTrans *trn)
TP_PShapePtr (TP_BaseShape::*  GetShape )(const TP_PShapePtr &shape, TP_MasterSystem *msys, Int32 pid, Int32 owner_id)
BaseObject *(TP_BaseShape::*  GetShapeVirtualObjects )(const TP_PShapePtr &shape, TP_MasterSystem *msys, Int32 pid, BaseDocument *doc, HierarchyHelp *hh)
Float (TP_BaseShape::*  GetShapeScale )(const TP_PShapePtr &shape, TP_MasterSystem *msys, Int32 pid)
void(TP_BaseShape::*  FreeShape )( TP_PShapePtr &shape, TP_MasterSystem *msys, Int32 pid)

Member Data Documentation

◆  base

TP_BaseShape * base

Base class pointer.

◆  GetShapeClone

TP_PShapePtr (TP_BaseShape::* GetShapeClone(const TP_PShapePtr &shape, TP_MasterSystem *msys, Int32 pid, COPYFLAGS flags, AliasTrans *trn)

Return a clone of shape .

参数
[in] shape The particle shape pointer structure of the particle shape handle.
[in] msys The master system. The caller owns the pointed TP_MasterSystem .
[in] pid The particle ID: 0 <= pid < msys -> NumParticles()
[in] flags The flags: COPYFLAGS
[in] trn An alias translator for the operation. Can be nullptr . The caller owns the pointed AliasTrans .
返回
The particle shape pointer structure of the cloned particle shape. The caller owns the pointed TP_PShapePtr .

◆  GetShape

TP_PShapePtr (TP_BaseShape::* GetShape(const TP_PShapePtr &shape, TP_MasterSystem *msys, Int32 pid, Int32 owner_id)

Return the shape associated with shape . Normally this is the same object, so a typical implementation would be:

TP_PShapePtr GetShape ( TP_PShapePtr &shape, TP_MasterSystem *msys, Int32 pid, Int32 owner_id) { if (shape-> Get ()-> owner_id == owner_id) return TP_ShapePtr(shape); return nullptr ; }
参数
[in] shape The particle shape pointer structure of the particle shape handle.
[in] msys The master system. The caller owns the pointed TP_MasterSystem .
[in] pid The particle ID: 0 <= pid < msys -> NumParticles()
[in] owner_id The owner ID.
返回
The particle shape pointer structure. The shape handler owns the pointed shape.

◆  GetShapeVirtualObjects

BaseObject *(TP_BaseShape::* GetShapeVirtualObjects(const TP_PShapePtr &shape, TP_MasterSystem *msys, Int32 pid, BaseDocument *doc, HierarchyHelp *hh)

Return a real BaseObject for shape .

参数
[in] shape The particle shape pointer structure of the particle shape handle.
[in] msys The master system. The caller owns the pointed TP_MasterSystem .
[in] pid The particle ID: 0 <= pid < msys -> NumParticles()
[in] doc The current document. The caller owns the pointed BaseDocument .
[in] hh A hierarchy helper for the operation. The caller owns the pointed HierarchyHelp .
返回
The particle shape object. The particle shape handler owns the pointed object.

◆  GetShapeScale

Float (TP_BaseShape::* GetShapeScale(const TP_PShapePtr &shape, TP_MasterSystem *msys, Int32 pid)

Return the scale of the particle shape.

参数
[in] shape The particle shape pointer structure of the particle shape handle.
[in] msys The master system. The caller owns the pointed TP_MasterSystem .
[in] pid The particle ID: 0 <= pid < msys -> NumParticles()
返回
The particle shape scale.

◆  FreeShape

void(TP_BaseShape::* FreeShape( TP_PShapePtr &shape, TP_MasterSystem *msys, Int32 pid)

Free the particle shape.

参数
[in] shape The particle shape pointer structure of the particle shape handle.
[in] msys The master system. The caller owns the pointed TP_MasterSystem .
[in] pid The particle ID: 0 <= pid < msys -> NumParticles()
HierarchyHelp
定义: c4d_baseobject.h:179
TP_PShapeInterface::base
TP_BaseShape * base
Base class pointer.
定义: c4d_particles.h:439
TP_BaseShape
定义: c4d_particles.h:394
BaseObject
定义: c4d_baseobject.h:224
Float
maxon::Float Float
定义: ge_sys_math.h:64
TP_PShapeInterface
定义: c4d_particles.h:437
AliasTrans
定义: c4d_baselist.h:2977
TP_PShapeInterface::GetShapeVirtualObjects
BaseObject *(TP_BaseShape::* GetShapeVirtualObjects)(const TP_PShapePtr &shape, TP_MasterSystem *msys, Int32 pid, BaseDocument *doc, HierarchyHelp *hh)
定义: c4d_particles.h:480
TP_PShapeInterface::GetShapeScale
Float(TP_BaseShape::* GetShapeScale)(const TP_PShapePtr &shape, TP_MasterSystem *msys, Int32 pid)
定义: c4d_particles.h:489
TP_PShapeInterface::FreeShape
void(TP_BaseShape::* FreeShape)(TP_PShapePtr &shape, TP_MasterSystem *msys, Int32 pid)
定义: c4d_particles.h:497
TP_PShapePtr
Wrapper around a TP_PShapeI pointer.
定义: c4d_particles.h:267
Int32
maxon::Int32 Int32
定义: ge_sys_math.h:58
TP_PShapeI::owner_id
Int32 owner_id
Owner ID of the shape. This is TP_MasterSystem::GetOperatorID() for the node responsible for the shap...
定义: c4d_particles.h:248
TP_PShapeInterface::GetShapeClone
TP_PShapePtr(TP_BaseShape::* GetShapeClone)(const TP_PShapePtr &shape, TP_MasterSystem *msys, Int32 pid, COPYFLAGS flags, AliasTrans *trn)
定义: c4d_particles.h:450
TP_PShapePtr::Get
TP_PShapeI * Get() const
定义: c4d_particles.h:369
TP_MasterSystem
定义: c4d_particles.h:739
TP_PShapeInterface::GetShape
TP_PShapePtr(TP_BaseShape::* GetShape)(const TP_PShapePtr &shape, TP_MasterSystem *msys, Int32 pid, Int32 owner_id)
定义: c4d_particles.h:469
BaseDocument
定义: c4d_basedocument.h:490