Tissue Forge C 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
tfCCluster.h File Reference
#include "tf_port_c.h"
#include "tfCParticle.h"
Include dependency graph for tfCCluster.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  tfClusterTypeSpec
 Cluster type definition in Tissue Forge C. More...
 
struct  tfClusterParticleHandleHandle
 Handle to a ClusterParticleHandle instance. More...
 
struct  tfClusterParticleTypeHandle
 Handle to a ClusterParticleType instance. More...
 

Functions

struct tfClusterTypeSpec tfClusterTypeSpec_init ()
 Get a default definition.
 
HRESULT tfClusterParticleHandle_init (struct tfClusterParticleHandleHandle *handle, int id)
 Initialize an instance.
 
HRESULT tfClusterParticleHandle_destroy (struct tfClusterParticleHandleHandle *handle)
 Destroy an instance.
 
HRESULT tfClusterParticleHandle_createParticle (struct tfClusterParticleHandleHandle *handle, struct tfParticleTypeHandle *partTypeHandle, int *pid, tfFloatP_t **position, tfFloatP_t **velocity)
 Constituent particle constructor.
 
HRESULT tfClusterParticleHandle_createParticleS (struct tfClusterParticleHandleHandle *handle, struct tfParticleTypeHandle *partTypeHandle, int *pid, const char *str)
 Constituent particle constructor.
 
HRESULT tfClusterParticleHandle_hasPartId (struct tfClusterParticleHandleHandle *handle, int pid, bool *result)
 Test whether the cluster has an id.
 
HRESULT tfClusterParticleHandle_hasPart (struct tfClusterParticleHandleHandle *handle, struct tfParticleHandleHandle *part, bool *result)
 Test whether the cluster has a particle.
 
HRESULT tfClusterParticleHandle_splitAxis (struct tfClusterParticleHandleHandle *handle, int *cid, tfFloatP_t *axis, tfFloatP_t time)
 Split the cluster along an axis.
 
HRESULT tfClusterParticleHandle_splitRand (struct tfClusterParticleHandleHandle *handle, int *cid, tfFloatP_t time)
 Split the cluster randomly.
 
HRESULT tfClusterParticleHandle_split (struct tfClusterParticleHandleHandle *handle, int *cid, tfFloatP_t time, tfFloatP_t *normal, tfFloatP_t *point)
 Split the cluster along a point and normal.
 
HRESULT tfClusterParticleHandle_getNumParts (struct tfClusterParticleHandleHandle *handle, int *numParts)
 Get the number of particles that are a member of this cluster.
 
HRESULT tfClusterParticleHandle_getParts (struct tfClusterParticleHandleHandle *handle, struct tfParticleListHandle *parts)
 Get the particles that are a member of this cluster.
 
HRESULT tfClusterParticleHandle_getParticle (struct tfClusterParticleHandleHandle *handle, int i, struct tfParticleHandleHandle *parthandle)
 Get the i'th particle that's a member of this cluster.
 
HRESULT tfClusterParticleHandle_str (struct tfClusterParticleHandleHandle *handle, char **str, unsigned int *numChars)
 Get a summary string of the cluster.
 
HRESULT tfClusterParticleHandle_getRadiusOfGyration (struct tfClusterParticleHandleHandle *handle, tfFloatP_t *radiusOfGyration)
 Get the radius of gyration.
 
HRESULT tfClusterParticleHandle_getCenterOfMass (struct tfClusterParticleHandleHandle *handle, tfFloatP_t **com)
 Get the center of mass.
 
HRESULT tfClusterParticleHandle_getCentroid (struct tfClusterParticleHandleHandle *handle, tfFloatP_t **cent)
 Get the centroid.
 
HRESULT tfClusterParticleHandle_getMomentOfInertia (struct tfClusterParticleHandleHandle *handle, tfFloatP_t **moi)
 Get the moment of inertia.
 
HRESULT tfClusterParticleType_init (struct tfClusterParticleTypeHandle *handle)
 Initialize an instance.
 
HRESULT tfClusterParticleType_initD (struct tfClusterParticleTypeHandle *handle, struct tfClusterTypeSpec pdef)
 Initialize an instance from a definition.
 
HRESULT tfClusterParticleType_addType (struct tfClusterParticleTypeHandle *handle, struct tfParticleTypeHandle *phandle)
 Add a particle type to the types of a cluster.
 
HRESULT tfClusterParticleType_str (struct tfClusterParticleTypeHandle *handle, char **str, unsigned int *numChars)
 Get a summary string of the type.
 
HRESULT tfClusterParticleType_hasType (struct tfClusterParticleTypeHandle *handle, struct tfParticleTypeHandle *phandle, bool *hasType)
 Tests where this cluster has a particle type.
 
HRESULT tfClusterParticleType_hasTypeId (struct tfClusterParticleTypeHandle *handle, int pid, bool *result)
 Test whether the type has a type id.
 
HRESULT tfClusterParticleType_hasTypeML (struct tfClusterParticleTypeHandle *handle, struct tfParticleTypeHandle *ptype, bool *result)
 Test whether the type has a type.
 
HRESULT tfClusterParticleType_hasPart (struct tfClusterParticleTypeHandle *handle, struct tfParticleHandleHandle *part, bool *result)
 Test whether the type has a particle.
 
HRESULT tfClusterParticleType_registerType (struct tfClusterParticleTypeHandle *handle)
 Registers a type with the engine.
 
HRESULT tfClusterParticleType_createParticle (struct tfClusterParticleTypeHandle *handle, int *pid, tfFloatP_t *position, tfFloatP_t *velocity)
 Cluster particle constructor.
 
HRESULT tfClusterParticleType_FindFromName (struct tfClusterParticleTypeHandle *handle, const char *name)
 Get a registered cluster type by type name.
 
HRESULT tfClusterParticleType_getFromId (struct tfClusterParticleTypeHandle *handle, unsigned int pid)
 Get a registered cluster type by id.
 

Function Documentation

◆ tfClusterParticleHandle_createParticle()

HRESULT tfClusterParticleHandle_createParticle ( struct tfClusterParticleHandleHandle * handle,
struct tfParticleTypeHandle * partTypeHandle,
int * pid,
tfFloatP_t ** position,
tfFloatP_t ** velocity )

Constituent particle constructor.

The created particle will belong to this cluster.

Automatically updates when running on a CUDA device.

Parameters
handlepopulated handle
partTypeHandletype of particle to create
pidid of created particle
positionpointer to 3-element array, or NULL for a random position
velocitypointer to 3-element array, or NULL for a random velocity
Returns
S_OK on success

◆ tfClusterParticleHandle_createParticleS()

HRESULT tfClusterParticleHandle_createParticleS ( struct tfClusterParticleHandleHandle * handle,
struct tfParticleTypeHandle * partTypeHandle,
int * pid,
const char * str )

Constituent particle constructor.

The created particle will belong to this cluster.

Automatically updates when running on a CUDA device.

Parameters
handlepopulated handle
partTypeHandletype of particle to create
pidid of created particle
strJSON string defining a particle
Returns
S_OK on success

◆ tfClusterParticleHandle_destroy()

HRESULT tfClusterParticleHandle_destroy ( struct tfClusterParticleHandleHandle * handle)

Destroy an instance.

Parameters
handlepopulated handle
Returns
S_OK on success

◆ tfClusterParticleHandle_getCenterOfMass()

HRESULT tfClusterParticleHandle_getCenterOfMass ( struct tfClusterParticleHandleHandle * handle,
tfFloatP_t ** com )

Get the center of mass.

Returns
S_OK on success

◆ tfClusterParticleHandle_getCentroid()

HRESULT tfClusterParticleHandle_getCentroid ( struct tfClusterParticleHandleHandle * handle,
tfFloatP_t ** cent )

Get the centroid.

Returns
S_OK on success

◆ tfClusterParticleHandle_getMomentOfInertia()

HRESULT tfClusterParticleHandle_getMomentOfInertia ( struct tfClusterParticleHandleHandle * handle,
tfFloatP_t ** moi )

Get the moment of inertia.

Returns
S_OK on success

◆ tfClusterParticleHandle_getNumParts()

HRESULT tfClusterParticleHandle_getNumParts ( struct tfClusterParticleHandleHandle * handle,
int * numParts )

Get the number of particles that are a member of this cluster.

Parameters
handlepopulated handle
numPartsnumber of particles
Returns
S_OK on success

◆ tfClusterParticleHandle_getParticle()

HRESULT tfClusterParticleHandle_getParticle ( struct tfClusterParticleHandleHandle * handle,
int i,
struct tfParticleHandleHandle * parthandle )

Get the i'th particle that's a member of this cluster.

Parameters
handlepopulated handle
iindex of particle to get
parthandleparticle handle to populate
Returns
S_OK on success

◆ tfClusterParticleHandle_getParts()

HRESULT tfClusterParticleHandle_getParts ( struct tfClusterParticleHandleHandle * handle,
struct tfParticleListHandle * parts )

Get the particles that are a member of this cluster.

Parameters
handlepopulated handle
partsparticles
Returns
S_OK on success

◆ tfClusterParticleHandle_getRadiusOfGyration()

HRESULT tfClusterParticleHandle_getRadiusOfGyration ( struct tfClusterParticleHandleHandle * handle,
tfFloatP_t * radiusOfGyration )

Get the radius of gyration.

Returns
S_OK on success

◆ tfClusterParticleHandle_hasPart()

HRESULT tfClusterParticleHandle_hasPart ( struct tfClusterParticleHandleHandle * handle,
struct tfParticleHandleHandle * part,
bool * result )

Test whether the cluster has a particle.

Parameters
handlepopulated handle
partparticle to test
resultresult of test
Returns
S_OK on success

◆ tfClusterParticleHandle_hasPartId()

HRESULT tfClusterParticleHandle_hasPartId ( struct tfClusterParticleHandleHandle * handle,
int pid,
bool * result )

Test whether the cluster has an id.

Parameters
handlepopulated handle
pidparticle id to test
resultresult of test
Returns
S_OK on success

◆ tfClusterParticleHandle_init()

HRESULT tfClusterParticleHandle_init ( struct tfClusterParticleHandleHandle * handle,
int id )

Initialize an instance.

Parameters
handlehandle to populate
idparticle id
Returns
S_OK on success

◆ tfClusterParticleHandle_split()

HRESULT tfClusterParticleHandle_split ( struct tfClusterParticleHandleHandle * handle,
int * cid,
tfFloatP_t time,
tfFloatP_t * normal,
tfFloatP_t * point )

Split the cluster along a point and normal.

Parameters
handlepopulated handle
cidid of created cluster
timetime at which to implement the split; currently not supported
normal3-component normal vector of cleavage plane
point3-component point on cleavage plane
Returns
S_OK on success

◆ tfClusterParticleHandle_splitAxis()

HRESULT tfClusterParticleHandle_splitAxis ( struct tfClusterParticleHandleHandle * handle,
int * cid,
tfFloatP_t * axis,
tfFloatP_t time )

Split the cluster along an axis.

Parameters
handlepopulated handle
cidid of created cluster
axis3-component allocated axis of split
timetime at which to implement the split; currently not supported
Returns
S_OK on success

◆ tfClusterParticleHandle_splitRand()

HRESULT tfClusterParticleHandle_splitRand ( struct tfClusterParticleHandleHandle * handle,
int * cid,
tfFloatP_t time )

Split the cluster randomly.

Parameters
handlepopulated handle
cidid of created cluster
timetime at which to implement the split; currently not supported
Returns
S_OK on success

◆ tfClusterParticleHandle_str()

HRESULT tfClusterParticleHandle_str ( struct tfClusterParticleHandleHandle * handle,
char ** str,
unsigned int * numChars )

Get a summary string of the cluster.

Parameters
handlepopulated handle
strarray to populate
numCharsnumber of array characters
Returns
S_OK on success

◆ tfClusterParticleType_addType()

HRESULT tfClusterParticleType_addType ( struct tfClusterParticleTypeHandle * handle,
struct tfParticleTypeHandle * phandle )

Add a particle type to the types of a cluster.

Parameters
handlepopulated handle
phandlehandle to add
Returns
S_OK on success

◆ tfClusterParticleType_createParticle()

HRESULT tfClusterParticleType_createParticle ( struct tfClusterParticleTypeHandle * handle,
int * pid,
tfFloatP_t * position,
tfFloatP_t * velocity )

Cluster particle constructor.

Parameters
handlepopulated handle
pidid of created particle
positionpointer to 3-element array, or NULL for a random position
velocitypointer to 3-element array, or NULL for a random velocity
Returns
S_OK on success

◆ tfClusterParticleType_FindFromName()

HRESULT tfClusterParticleType_FindFromName ( struct tfClusterParticleTypeHandle * handle,
const char * name )

Get a registered cluster type by type name.

Parameters
handlehandle to populate
namename of cluster type
Returns
S_OK on success

◆ tfClusterParticleType_getFromId()

HRESULT tfClusterParticleType_getFromId ( struct tfClusterParticleTypeHandle * handle,
unsigned int pid )

Get a registered cluster type by id.

Parameters
handlehandle to populate
pidid of type
Returns
S_OK on success

◆ tfClusterParticleType_hasPart()

HRESULT tfClusterParticleType_hasPart ( struct tfClusterParticleTypeHandle * handle,
struct tfParticleHandleHandle * part,
bool * result )

Test whether the type has a particle.

Parameters
handlepopulated handle
partparticle to test
resultresult of test
Returns
S_OK on success

◆ tfClusterParticleType_hasType()

HRESULT tfClusterParticleType_hasType ( struct tfClusterParticleTypeHandle * handle,
struct tfParticleTypeHandle * phandle,
bool * hasType )

Tests where this cluster has a particle type.

Only tests for immediate ownership and ignores multi-level clusters.

Returns
S_OK on success

◆ tfClusterParticleType_hasTypeId()

HRESULT tfClusterParticleType_hasTypeId ( struct tfClusterParticleTypeHandle * handle,
int pid,
bool * result )

Test whether the type has a type id.

Parameters
handlepopulated handle
pidid to test
resultresult of test
Returns
S_OK on success

◆ tfClusterParticleType_hasTypeML()

HRESULT tfClusterParticleType_hasTypeML ( struct tfClusterParticleTypeHandle * handle,
struct tfParticleTypeHandle * ptype,
bool * result )

Test whether the type has a type.

Parameters
handlepopulated handle
ptypetype to test
resultresult of test
Returns
S_OK on success

◆ tfClusterParticleType_init()

HRESULT tfClusterParticleType_init ( struct tfClusterParticleTypeHandle * handle)

Initialize an instance.

Parameters
handlehandle to populate
Returns
S_OK on success

◆ tfClusterParticleType_initD()

HRESULT tfClusterParticleType_initD ( struct tfClusterParticleTypeHandle * handle,
struct tfClusterTypeSpec pdef )

Initialize an instance from a definition.

Parameters
handlehandle to populate
pdefdefinition
Returns
S_OK on success

◆ tfClusterParticleType_registerType()

HRESULT tfClusterParticleType_registerType ( struct tfClusterParticleTypeHandle * handle)

Registers a type with the engine.

Also registers all unregistered constituent types.

Returns
S_OK on success

◆ tfClusterParticleType_str()

HRESULT tfClusterParticleType_str ( struct tfClusterParticleTypeHandle * handle,
char ** str,
unsigned int * numChars )

Get a summary string of the type.

Parameters
handlepopulated handle
strarray to populate
numCharsnumber of array characters
Returns
S_OK on success