Tissue Forge C 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
tfCParticle.h
Go to the documentation of this file.
1/*******************************************************************************
2 * This file is part of Tissue Forge.
3 * Copyright (c) 2022-2024 T.J. Sego
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published
7 * by the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 ******************************************************************************/
19
24
25#ifndef _WRAPS_C_TFCPARTICLE_H_
26#define _WRAPS_C_TFCPARTICLE_H_
27
28#include "tf_port_c.h"
29
30#include "tfCStyle.h"
31#include "tfCStateVector.h"
32#include "tfCSpecies.h"
33
38struct CAPI_EXPORT tfMappedParticleDataEnum {
39 int MAPPEDPARTICLEDATA_NONE;
40 int MAPPEDPARTICLEDATA_POSITION_X;
41 int MAPPEDPARTICLEDATA_POSITION_Y;
42 int MAPPEDPARTICLEDATA_POSITION_Z;
43 int MAPPEDPARTICLEDATA_VELOCITY_X;
44 int MAPPEDPARTICLEDATA_VELOCITY_Y;
45 int MAPPEDPARTICLEDATA_VELOCITY_Z;
46 int MAPPEDPARTICLEDATA_VELOCITY_SPEED;
47 int MAPPEDPARTICLEDATA_SPECIES;
48 int MAPPEDPARTICLEDATA_FORCE_X;
49 int MAPPEDPARTICLEDATA_FORCE_Y;
50 int MAPPEDPARTICLEDATA_FORCE_Z;
51};
52
57struct CAPI_EXPORT tfParticleTypeStyleSpec {
58 char *color;
59 unsigned int visible;
60 char *speciesName;
61 char *mapName;
62 tfFloatP_t mapMin;
63 tfFloatP_t mapMax;
64 int mappedParticleData;
65};
66
71struct CAPI_EXPORT tfParticleTypeSpec {
72 tfFloatP_t mass;
73 tfFloatP_t charge;
74 tfFloatP_t radius;
75 tfFloatP_t *target_energy;
76 tfFloatP_t minimum_radius;
77 tfFloatP_t eps;
78 tfFloatP_t rmin;
79 unsigned char dynamics;
80 unsigned int frozen;
81 char *name;
82 char *name2;
83 struct tfParticleTypeStyleSpec *style;
84 unsigned int numSpecies;
85 char **species;
86};
87
88// Handles
89
90struct CAPI_EXPORT tfParticleDynamicsEnumHandle {
91 unsigned char PARTICLE_NEWTONIAN;
92 unsigned char PARTICLE_OVERDAMPED;
93};
94
95struct CAPI_EXPORT tfParticleFlagsHandle {
96 int PARTICLE_NONE;
97 int PARTICLE_GHOST;
98 int PARTICLE_CLUSTER;
99 int PARTICLE_BOUND;
100 int PARTICLE_FROZEN_X;
101 int PARTICLE_FROZEN_Y;
102 int PARTICLE_FROZEN_Z;
103 int PARTICLE_FROZEN;
104 int PARTICLE_LARGE;
105};
106
111struct CAPI_EXPORT tfParticleHandleHandle {
112 void *tfObj;
113};
114
119struct CAPI_EXPORT tfParticleTypeHandle {
120 void *tfObj;
121};
122
127struct CAPI_EXPORT tfParticleListHandle {
128 void *tfObj;
129};
130
135struct CAPI_EXPORT tfParticleTypeListHandle {
136 void *tfObj;
137};
138
139
141// tfMappedParticleDataEnum //
143
144
149
150
152// tfParticleTypeSpec //
154
155
161
162
164// tfParticleTypeStyleSpec //
166
167
173
174
176// ParticleDynamics //
178
179
186CAPI_FUNC(HRESULT) tfParticleDynamics_init(struct tfParticleDynamicsEnumHandle *handle);
187
188
190// ParticleFlags //
192
193
200CAPI_FUNC(HRESULT) tfParticleFlags_init(struct tfParticleFlagsHandle *handle);
201
202
204// ParticleHandle //
206
207
215CAPI_FUNC(HRESULT) tfParticleHandle_init(struct tfParticleHandleHandle *handle, unsigned int pid);
216
222CAPI_FUNC(HRESULT) tfParticleHandle_destroy(struct tfParticleHandleHandle *handle);
223
231CAPI_FUNC(HRESULT) tfParticleHandle_getType(struct tfParticleHandleHandle *handle, struct tfParticleTypeHandle *typeHandle);
232
241CAPI_FUNC(HRESULT) tfParticleHandle_str(struct tfParticleHandleHandle *handle, char **str, unsigned int *numChars);
242
266CAPI_FUNC(HRESULT) tfParticleHandle_split(struct tfParticleHandleHandle *handle, struct tfParticleHandleHandle *newParticleHandle);
267
295 struct tfParticleHandleHandle* handle,
296 struct tfParticleHandleHandle* newParticleHandle,
297 struct tfParticleTypeHandle* parentTypeHandle,
298 struct tfParticleTypeHandle* childTypeHandle
299);
300
309
317CAPI_FUNC(HRESULT) tfParticleHandle_sphericalPosition(struct tfParticleHandleHandle *handle, tfFloatP_t **position);
318
327CAPI_FUNC(HRESULT) tfParticleHandle_sphericalPositionPoint(struct tfParticleHandleHandle *handle, tfFloatP_t *origin, tfFloatP_t **position);
328
337CAPI_FUNC(HRESULT) tfParticleHandle_relativePosition(struct tfParticleHandleHandle *handle, tfFloatP_t *origin, tfFloatP_t **position);
338
351CAPI_FUNC(HRESULT) tfParticleHandle_become(struct tfParticleHandleHandle *handle, struct tfParticleTypeHandle *typeHandle);
352
363 struct tfParticleHandleHandle *handle,
364 tfFloatP_t distance,
365 struct tfParticleHandleHandle **neighbors,
366 int *numNeighbors
367);
368
380 struct tfParticleHandleHandle *handle,
381 struct tfParticleTypeHandle *ptypes,
382 int numTypes,
383 struct tfParticleHandleHandle **neighbors,
384 int *numNeighbors
385);
386
399 struct tfParticleHandleHandle *handle,
400 tfFloatP_t distance,
401 struct tfParticleTypeHandle *ptypes,
402 int numTypes,
403 struct tfParticleHandleHandle **neighbors,
404 int *numNeighbors
405);
406
416 struct tfParticleHandleHandle *handle,
417 struct tfParticleHandleHandle **neighbors,
418 int *numNeighbors
419);
420
429CAPI_FUNC(HRESULT) tfParticleHandle_distance(struct tfParticleHandleHandle *handle, struct tfParticleHandleHandle *other, tfFloatP_t *distance);
430
436CAPI_FUNC(HRESULT) tfParticleHandle_getMass(struct tfParticleHandleHandle *handle, tfFloatP_t *mass);
437
443CAPI_FUNC(HRESULT) tfParticleHandle_setMass(struct tfParticleHandleHandle *handle, tfFloatP_t mass);
444
450CAPI_FUNC(HRESULT) tfParticleHandle_getFrozen(struct tfParticleHandleHandle *handle, bool *frozen);
451
457CAPI_FUNC(HRESULT) tfParticleHandle_setFrozen(struct tfParticleHandleHandle *handle, bool frozen);
458
464CAPI_FUNC(HRESULT) tfParticleHandle_getFrozenX(struct tfParticleHandleHandle *handle, bool *frozen);
465
471CAPI_FUNC(HRESULT) tfParticleHandle_setFrozenX(struct tfParticleHandleHandle *handle, bool frozen);
472
478CAPI_FUNC(HRESULT) tfParticleHandle_getFrozenY(struct tfParticleHandleHandle *handle, bool *frozen);
479
485CAPI_FUNC(HRESULT) tfParticleHandle_setFrozenY(struct tfParticleHandleHandle *handle, bool frozen);
486
492CAPI_FUNC(HRESULT) tfParticleHandle_getFrozenZ(struct tfParticleHandleHandle *handle, bool *frozen);
493
499CAPI_FUNC(HRESULT) tfParticleHandle_setFrozenZ(struct tfParticleHandleHandle *handle, bool frozen);
500
508CAPI_FUNC(HRESULT) tfParticleHandle_getStyle(struct tfParticleHandleHandle *handle, struct tfRenderingStyleHandle *style);
509
517CAPI_FUNC(HRESULT) tfParticleHandle_hasStyle(struct tfParticleHandleHandle *handle, bool *hasStyle);
518
526CAPI_FUNC(HRESULT) tfParticleHandle_setStyle(struct tfParticleHandleHandle *handle, struct tfRenderingStyleHandle *style);
527
533CAPI_FUNC(HRESULT) tfParticleHandle_getAge(struct tfParticleHandleHandle *handle, tfFloatP_t *age);
534
540CAPI_FUNC(HRESULT) tfParticleHandle_getRadius(struct tfParticleHandleHandle *handle, tfFloatP_t *radius);
541
547CAPI_FUNC(HRESULT) tfParticleHandle_setRadius(struct tfParticleHandleHandle *handle, tfFloatP_t radius);
548
554CAPI_FUNC(HRESULT) tfParticleHandle_getName(struct tfParticleHandleHandle *handle, char **name, unsigned int *numChars);
555
561CAPI_FUNC(HRESULT) tfParticleHandle_getName2(struct tfParticleHandleHandle *handle, char **name, unsigned int *numChars);
562
568CAPI_FUNC(HRESULT) tfParticleHandle_getPosition(struct tfParticleHandleHandle *handle, tfFloatP_t **position);
569
575CAPI_FUNC(HRESULT) tfParticleHandle_setPosition(struct tfParticleHandleHandle *handle, tfFloatP_t *position);
576
582CAPI_FUNC(HRESULT) tfParticleHandle_getVelocity(struct tfParticleHandleHandle *handle, tfFloatP_t **velocity);
583
589CAPI_FUNC(HRESULT) tfParticleHandle_setVelocity(struct tfParticleHandleHandle *handle, tfFloatP_t *velocity);
590
596CAPI_FUNC(HRESULT) tfParticleHandle_getForce(struct tfParticleHandleHandle *handle, tfFloatP_t **force);
597
603CAPI_FUNC(HRESULT) tfParticleHandle_getForceInit(struct tfParticleHandleHandle *handle, tfFloatP_t **force);
604
610CAPI_FUNC(HRESULT) tfParticleHandle_setForceInit(struct tfParticleHandleHandle *handle, tfFloatP_t *force);
611
617CAPI_FUNC(HRESULT) tfParticleHandle_getId(struct tfParticleHandleHandle *handle, int *pid);
618
624CAPI_FUNC(HRESULT) tfParticleHandle_getTypeId(struct tfParticleHandleHandle *handle, int *tid);
625
631CAPI_FUNC(HRESULT) tfParticleHandle_getClusterId(struct tfParticleHandleHandle *handle, int *cid);
632
638CAPI_FUNC(HRESULT) tfParticleHandle_getFlags(struct tfParticleHandleHandle *handle, int *flags);
639
645CAPI_FUNC(HRESULT) tfParticleHandle_hasSpecies(struct tfParticleHandleHandle *handle, bool *flag);
646
652CAPI_FUNC(HRESULT) tfParticleHandle_getSpecies(struct tfParticleHandleHandle *handle, struct tfStateStateVectorHandle *svec);
653
659CAPI_FUNC(HRESULT) tfParticleHandle_setSpecies(struct tfParticleHandleHandle *handle, struct tfStateStateVectorHandle *svec);
660
666CAPI_FUNC(HRESULT) tfParticleHandle_toCluster(struct tfParticleHandleHandle *handle, struct tfClusterParticleHandleHandle *chandle);
667
676CAPI_FUNC(HRESULT) tfParticleHandle_toString(struct tfParticleHandleHandle *handle, char **str, unsigned int *numChars);
677
679CAPI_FUNC(HRESULT) tfParticleHandle_lt(struct tfParticleHandleHandle *lhs, struct tfParticleHandleHandle *rhs, bool *result);
680
682CAPI_FUNC(HRESULT) tfParticleHandle_gt(struct tfParticleHandleHandle *lhs, struct tfParticleHandleHandle *rhs, bool *result);
683
685CAPI_FUNC(HRESULT) tfParticleHandle_le(struct tfParticleHandleHandle *lhs, struct tfParticleHandleHandle *rhs, bool *result);
686
688CAPI_FUNC(HRESULT) tfParticleHandle_ge(struct tfParticleHandleHandle *lhs, struct tfParticleHandleHandle *rhs, bool *result);
689
691CAPI_FUNC(HRESULT) tfParticleHandle_eq(struct tfParticleHandleHandle *lhs, struct tfParticleHandleHandle *rhs, bool *result);
692
694CAPI_FUNC(HRESULT) tfParticleHandle_ne(struct tfParticleHandleHandle *lhs, struct tfParticleHandleHandle *rhs, bool *result);
695
696
698// ParticleType //
700
701
708CAPI_FUNC(HRESULT) tfParticleType_init(struct tfParticleTypeHandle *handle);
709
717CAPI_FUNC(HRESULT) tfParticleType_initD(struct tfParticleTypeHandle *handle, struct tfParticleTypeSpec pdef);
718
727CAPI_FUNC(HRESULT) tfParticleType_getName(struct tfParticleTypeHandle *handle, char **name, unsigned int *numChars);
728
736CAPI_FUNC(HRESULT) tfParticleType_setName(struct tfParticleTypeHandle *handle, const char *name);
737
745CAPI_FUNC(HRESULT) tfParticleType_getId(struct tfParticleTypeHandle *handle, int *id);
746
752CAPI_FUNC(HRESULT) tfParticleType_getTypeFlags(struct tfParticleTypeHandle *handle, unsigned int *flags);
753
759CAPI_FUNC(HRESULT) tfParticleType_setTypeFlags(struct tfParticleTypeHandle *handle, unsigned int flags);
760
766CAPI_FUNC(HRESULT) tfParticleType_getParticleFlags(struct tfParticleTypeHandle *handle, unsigned int *flags);
767
773CAPI_FUNC(HRESULT) tfParticleType_setParticleFlags(struct tfParticleTypeHandle *handle, unsigned int flags);
774
782CAPI_FUNC(HRESULT) tfParticleType_getStyle(struct tfParticleTypeHandle *handle, struct tfRenderingStyleHandle *style);
783
791CAPI_FUNC(HRESULT) tfParticleType_setStyle(struct tfParticleTypeHandle *handle, struct tfRenderingStyleHandle *style);
792
800CAPI_FUNC(HRESULT) tfParticleType_hasSpecies(struct tfParticleTypeHandle *handle, bool *flag);
801
809CAPI_FUNC(HRESULT) tfParticleType_getSpecies(struct tfParticleTypeHandle *handle, struct tfStateSpeciesListHandle *slist);
810
818CAPI_FUNC(HRESULT) tfParticleType_setSpecies(struct tfParticleTypeHandle *handle, struct tfStateSpeciesListHandle *slist);
819
825CAPI_FUNC(HRESULT) tfParticleType_getMass(struct tfParticleTypeHandle *handle, tfFloatP_t *mass);
826
832CAPI_FUNC(HRESULT) tfParticleType_setMass(struct tfParticleTypeHandle *handle, tfFloatP_t mass);
833
839CAPI_FUNC(HRESULT) tfParticleType_getRadius(struct tfParticleTypeHandle *handle, tfFloatP_t *radius);
840
846CAPI_FUNC(HRESULT) tfParticleType_setRadius(struct tfParticleTypeHandle *handle, tfFloatP_t radius);
847
853CAPI_FUNC(HRESULT) tfParticleType_getKineticEnergy(struct tfParticleTypeHandle *handle, tfFloatP_t *kinetic_energy);
854
860CAPI_FUNC(HRESULT) tfParticleType_getPotentialEnergy(struct tfParticleTypeHandle *handle, tfFloatP_t *potential_energy);
861
867CAPI_FUNC(HRESULT) tfParticleType_getTargetEnergy(struct tfParticleTypeHandle *handle, tfFloatP_t *target_energy);
868
874CAPI_FUNC(HRESULT) tfParticleType_setTargetEnergy(struct tfParticleTypeHandle *handle, tfFloatP_t target_energy);
875
884CAPI_FUNC(HRESULT) tfParticleType_getMinimumRadius(struct tfParticleTypeHandle *handle, tfFloatP_t *minimum_radius);
885
894CAPI_FUNC(HRESULT) tfParticleType_setMinimumRadius(struct tfParticleTypeHandle *handle, tfFloatP_t minimum_radius);
895
901CAPI_FUNC(HRESULT) tfParticleType_getDynamics(struct tfParticleTypeHandle *handle, unsigned char *dynamics);
902
908CAPI_FUNC(HRESULT) tfParticleType_setDynamics(struct tfParticleTypeHandle *handle, unsigned char dynamics);
909
917CAPI_FUNC(HRESULT) tfParticleType_getNumParts(struct tfParticleTypeHandle *handle, int *numParts);
918
927CAPI_FUNC(HRESULT) tfParticleType_getParticle(struct tfParticleTypeHandle *handle, int i, struct tfParticleHandleHandle *phandle);
928
934CAPI_FUNC(HRESULT) tfParticleType_isCluster(struct tfParticleTypeHandle *handle, bool *isCluster);
935
941CAPI_FUNC(HRESULT) tfParticleType_toCluster(struct tfParticleTypeHandle *handle, struct tfClusterParticleTypeHandle *chandle);
942
952CAPI_FUNC(HRESULT) tfParticleType_createParticle(struct tfParticleTypeHandle *handle, int *pid, tfFloatP_t *position, tfFloatP_t *velocity);
953
962CAPI_FUNC(HRESULT) tfParticleType_createParticleS(struct tfParticleTypeHandle *handle, int *pid, const char *str);
963
977CAPI_FUNC(HRESULT) tfParticleType_factory(struct tfParticleTypeHandle *handle, int **pids, unsigned int nr_parts, tfFloatP_t *positions, tfFloatP_t *velocities);
978
989CAPI_FUNC(HRESULT) tfParticleType_newType(struct tfParticleTypeHandle *handle, const char *_name, struct tfParticleTypeHandle *newTypehandle);
990
999CAPI_FUNC(HRESULT) tfParticleType_hasPartId(struct tfParticleTypeHandle *handle, int pid, bool *result);
1000
1009CAPI_FUNC(HRESULT) tfParticleType_hasPart(struct tfParticleTypeHandle *handle, struct tfParticleHandleHandle *part, bool *result);
1010
1016CAPI_FUNC(HRESULT) tfParticleType_registerType(struct tfParticleTypeHandle *handle);
1017
1023CAPI_FUNC(HRESULT) tfParticleType_isRegistered(struct tfParticleTypeHandle *handle, bool *isRegistered);
1024
1033CAPI_FUNC(HRESULT) tfParticleType_str(struct tfParticleTypeHandle *handle, char **str, unsigned int *numChars);
1034
1040CAPI_FUNC(HRESULT) tfParticleType_getFrozen(struct tfParticleTypeHandle *handle, bool *frozen);
1041
1047CAPI_FUNC(HRESULT) tfParticleType_setFrozen(struct tfParticleTypeHandle *handle, bool frozen);
1048
1054CAPI_FUNC(HRESULT) tfParticleType_getFrozenX(struct tfParticleTypeHandle *handle, bool *frozen);
1055
1061CAPI_FUNC(HRESULT) tfParticleType_setFrozenX(struct tfParticleTypeHandle *handle, bool frozen);
1062
1068CAPI_FUNC(HRESULT) tfParticleType_getFrozenY(struct tfParticleTypeHandle *handle, bool *frozen);
1069
1075CAPI_FUNC(HRESULT) tfParticleType_setFrozenY(struct tfParticleTypeHandle *handle, bool frozen);
1076
1082CAPI_FUNC(HRESULT) tfParticleType_getFrozenZ(struct tfParticleTypeHandle *handle, bool *frozen);
1083
1089CAPI_FUNC(HRESULT) tfParticleType_setFrozenZ(struct tfParticleTypeHandle *handle, bool frozen);
1090
1096CAPI_FUNC(HRESULT) tfParticleType_getTemperature(struct tfParticleTypeHandle *handle, tfFloatP_t *temperature);
1097
1103CAPI_FUNC(HRESULT) tfParticleType_getTargetTemperature(struct tfParticleTypeHandle *handle, tfFloatP_t *temperature);
1104
1110CAPI_FUNC(HRESULT) tfParticleType_setTargetTemperature(struct tfParticleTypeHandle *handle, tfFloatP_t temperature);
1111
1120CAPI_FUNC(HRESULT) tfParticleType_toString(struct tfParticleTypeHandle *handle, char **str, unsigned int *numChars);
1121
1129CAPI_FUNC(HRESULT) tfParticleType_fromString(struct tfParticleTypeHandle *handle, const char *str);
1130
1132CAPI_FUNC(HRESULT) tfParticleType_lt(struct tfParticleTypeHandle *lhs, struct tfParticleTypeHandle *rhs, bool *result);
1133
1135CAPI_FUNC(HRESULT) tfParticleType_gt(struct tfParticleTypeHandle *lhs, struct tfParticleTypeHandle *rhs, bool *result);
1136
1138CAPI_FUNC(HRESULT) tfParticleType_le(struct tfParticleTypeHandle *lhs, struct tfParticleTypeHandle *rhs, bool *result);
1139
1141CAPI_FUNC(HRESULT) tfParticleType_ge(struct tfParticleTypeHandle *lhs, struct tfParticleTypeHandle *rhs, bool *result);
1142
1144CAPI_FUNC(HRESULT) tfParticleType_eq(struct tfParticleTypeHandle *lhs, struct tfParticleTypeHandle *rhs, bool *result);
1145
1147CAPI_FUNC(HRESULT) tfParticleType_ne(struct tfParticleTypeHandle *lhs, struct tfParticleTypeHandle *rhs, bool *result);
1148
1149
1151// ParticleList //
1153
1154
1161CAPI_FUNC(HRESULT) tfParticleList_init(struct tfParticleListHandle *handle);
1162
1171CAPI_FUNC(HRESULT) tfParticleList_initP(struct tfParticleListHandle *handle, struct tfParticleHandleHandle **particles, unsigned int numParts);
1172
1181CAPI_FUNC(HRESULT) tfParticleList_initI(struct tfParticleListHandle *handle, int *parts, unsigned int numParts);
1182
1190CAPI_FUNC(HRESULT) tfParticleList_copy(struct tfParticleListHandle *source, struct tfParticleListHandle *destination);
1191
1198CAPI_FUNC(HRESULT) tfParticleList_destroy(struct tfParticleListHandle *handle);
1199
1207CAPI_FUNC(HRESULT) tfParticleList_getIds(struct tfParticleListHandle *handle, int **parts);
1208
1216CAPI_FUNC(HRESULT) tfParticleList_getNumParts(struct tfParticleListHandle *handle, unsigned int *numParts);
1217
1224CAPI_FUNC(HRESULT) tfParticleList_free(struct tfParticleListHandle *handle);
1225
1234CAPI_FUNC(HRESULT) tfParticleList_insertI(struct tfParticleListHandle *handle, int item, unsigned int *index);
1235
1244CAPI_FUNC(HRESULT) tfParticleList_insertP(struct tfParticleListHandle *handle, struct tfParticleHandleHandle *particle, unsigned int *index);
1245
1253CAPI_FUNC(HRESULT) tfParticleList_remove(struct tfParticleListHandle *handle, int id);
1254
1262CAPI_FUNC(HRESULT) tfParticleList_extend(struct tfParticleListHandle *handle, struct tfParticleListHandle *other);
1263
1272CAPI_FUNC(HRESULT) tfParticleList_hasId(struct tfParticleListHandle *handle, int pid, bool *result);
1273
1282CAPI_FUNC(HRESULT) tfParticleList_hasPart(struct tfParticleListHandle *handle, struct tfParticleHandleHandle *part, bool *result);
1283
1292CAPI_FUNC(HRESULT) tfParticleList_item(struct tfParticleListHandle *handle, unsigned int i, struct tfParticleHandleHandle *item);
1293
1300CAPI_FUNC(HRESULT) tfParticleList_getAll(struct tfParticleListHandle *handle);
1301
1309CAPI_FUNC(HRESULT) tfParticleList_getVirial(struct tfParticleListHandle *handle, tfFloatP_t **virial);
1310
1318CAPI_FUNC(HRESULT) tfParticleList_getRadiusOfGyration(struct tfParticleListHandle *handle, tfFloatP_t *rog);
1319
1327CAPI_FUNC(HRESULT) tfParticleList_getCenterOfMass(struct tfParticleListHandle *handle, tfFloatP_t **com);
1328
1336CAPI_FUNC(HRESULT) tfParticleList_getCentroid(struct tfParticleListHandle *handle, tfFloatP_t **cent);
1337
1345CAPI_FUNC(HRESULT) tfParticleList_getMomentOfInertia(struct tfParticleListHandle *handle, tfFloatP_t **moi);
1346
1354CAPI_FUNC(HRESULT) tfParticleList_getPositions(struct tfParticleListHandle *handle, tfFloatP_t **positions);
1355
1363CAPI_FUNC(HRESULT) tfParticleList_getVelocities(struct tfParticleListHandle *handle, tfFloatP_t **velocities);
1364
1372CAPI_FUNC(HRESULT) tfParticleList_getForces(struct tfParticleListHandle *handle, tfFloatP_t **forces);
1373
1381CAPI_FUNC(HRESULT) tfParticleList_sphericalPositions(struct tfParticleListHandle *handle, tfFloatP_t **coordinates);
1382
1391CAPI_FUNC(HRESULT) tfParticleList_sphericalPositionsO(struct tfParticleListHandle *handle, tfFloatP_t *origin, tfFloatP_t **coordinates);
1392
1399CAPI_FUNC(HRESULT) tfParticleList_getOwnsData(struct tfParticleListHandle *handle, bool* result);
1400
1407CAPI_FUNC(HRESULT) tfParticleList_setOwnsData(struct tfParticleListHandle *handle, bool flag);
1408
1415CAPI_FUNC(HRESULT) tfParticleList_getMutable(struct tfParticleListHandle *handle, bool* result);
1416
1423CAPI_FUNC(HRESULT) tfParticleList_setMutable(struct tfParticleListHandle *handle, bool flag);
1424
1433CAPI_FUNC(HRESULT) tfParticleList_toString(struct tfParticleListHandle *handle, char **str, unsigned int *numChars);
1434
1440CAPI_FUNC(HRESULT) tfParticleList_fromString(struct tfParticleListHandle *handle, const char *str);
1441
1442
1444// ParticleTypeList //
1446
1447
1454CAPI_FUNC(HRESULT) tfParticleTypeList_init(struct tfParticleTypeListHandle *handle);
1455
1464CAPI_FUNC(HRESULT) tfParticleTypeList_initP(struct tfParticleTypeListHandle *handle, struct tfParticleTypeHandle **parts, unsigned int numParts);
1465
1474CAPI_FUNC(HRESULT) tfParticleTypeList_initI(struct tfParticleTypeListHandle *handle, int *parts, unsigned int numParts);
1475
1483CAPI_FUNC(HRESULT) tfParticleTypeList_copy(struct tfParticleTypeListHandle *source, struct tfParticleTypeListHandle *destination);
1484
1491CAPI_FUNC(HRESULT) tfParticleTypeList_destroy(struct tfParticleTypeListHandle *handle);
1492
1500CAPI_FUNC(HRESULT) tfParticleTypeList_getIds(struct tfParticleTypeListHandle *handle, int **parts);
1501
1509CAPI_FUNC(HRESULT) tfParticleTypeList_getNumParts(struct tfParticleTypeListHandle *handle, unsigned int *numParts);
1510
1517CAPI_FUNC(HRESULT) tfParticleTypeList_free(struct tfParticleTypeListHandle *handle);
1518
1527CAPI_FUNC(HRESULT) tfParticleTypeList_insertI(struct tfParticleTypeListHandle *handle, int item, unsigned int *index);
1528
1537CAPI_FUNC(HRESULT) tfParticleTypeList_insertP(struct tfParticleTypeListHandle *handle, struct tfParticleTypeHandle *ptype, unsigned int *index);
1538
1546CAPI_FUNC(HRESULT) tfParticleTypeList_remove(struct tfParticleTypeListHandle *handle, int id);
1547
1555CAPI_FUNC(HRESULT) tfParticleTypeList_extend(struct tfParticleTypeListHandle *handle, struct tfParticleTypeListHandle *other);
1556
1565CAPI_FUNC(HRESULT) tfParticleTypeList_hasId(struct tfParticleTypeListHandle *handle, int pid, bool *result);
1566
1575CAPI_FUNC(HRESULT) tfParticleTypeList_hasType(struct tfParticleTypeListHandle *handle, struct tfParticleTypeHandle *ptype, bool *result);
1576
1585CAPI_FUNC(HRESULT) tfParticleTypeList_hasPart(struct tfParticleTypeListHandle *handle, struct tfParticleHandleHandle *part, bool *result);
1586
1595CAPI_FUNC(HRESULT) tfParticleTypeList_item(struct tfParticleTypeListHandle *handle, unsigned int i, struct tfParticleTypeHandle *item);
1596
1603CAPI_FUNC(HRESULT) tfParticleTypeList_getAll(struct tfParticleTypeListHandle *handle);
1604
1612CAPI_FUNC(HRESULT) tfParticleTypeList_getVirial(struct tfParticleTypeListHandle *handle, tfFloatP_t *virial);
1613
1621CAPI_FUNC(HRESULT) tfParticleTypeList_getRadiusOfGyration(struct tfParticleTypeListHandle *handle, tfFloatP_t *rog);
1622
1630CAPI_FUNC(HRESULT) tfParticleTypeList_getCenterOfMass(struct tfParticleTypeListHandle *handle, tfFloatP_t **com);
1631
1639CAPI_FUNC(HRESULT) tfParticleTypeList_getCentroid(struct tfParticleTypeListHandle *handle, tfFloatP_t **cent);
1640
1648CAPI_FUNC(HRESULT) tfParticleTypeList_getMomentOfInertia(struct tfParticleTypeListHandle *handle, tfFloatP_t **moi);
1649
1657CAPI_FUNC(HRESULT) tfParticleTypeList_getPositions(struct tfParticleTypeListHandle *handle, tfFloatP_t **positions);
1658
1666CAPI_FUNC(HRESULT) tfParticleTypeList_getVelocities(struct tfParticleTypeListHandle *handle, tfFloatP_t **velocities);
1667
1675CAPI_FUNC(HRESULT) tfParticleTypeList_getForces(struct tfParticleTypeListHandle *handle, tfFloatP_t **forces);
1676
1684CAPI_FUNC(HRESULT) tfParticleTypeList_sphericalPositions(struct tfParticleTypeListHandle *handle, tfFloatP_t **coordinates);
1685
1694CAPI_FUNC(HRESULT) tfParticleTypeList_sphericalPositionsO(struct tfParticleTypeListHandle *handle, tfFloatP_t *origin, tfFloatP_t **coordinates);
1695
1702CAPI_FUNC(HRESULT) tfParticleTypeList_getOwnsData(struct tfParticleTypeListHandle *handle, bool* result);
1703
1710CAPI_FUNC(HRESULT) tfParticleTypeList_setOwnsData(struct tfParticleTypeListHandle *handle, bool flag);
1711
1718CAPI_FUNC(HRESULT) tfParticleTypeList_getMutable(struct tfParticleTypeListHandle *handle, bool* result);
1719
1726CAPI_FUNC(HRESULT) tfParticleTypeList_setMutable(struct tfParticleTypeListHandle *handle, bool flag);
1727
1736
1745CAPI_FUNC(HRESULT) tfParticleTypeList_toString(struct tfParticleTypeListHandle *handle, char **str, unsigned int *numChars);
1746
1752CAPI_FUNC(HRESULT) tfParticleTypeList_fromString(struct tfParticleTypeListHandle *handle, const char *str);
1753
1754
1756// Module functions //
1758
1759
1765CAPI_FUNC(HRESULT) tfParticle_Verify();
1766
1774CAPI_FUNC(HRESULT) tfParticleType_FindFromName(struct tfParticleTypeHandle *handle, const char* name);
1775
1783CAPI_FUNC(HRESULT) tfParticleType_getFromId(struct tfParticleTypeHandle *handle, unsigned int pid);
1784
1790CAPI_FUNC(unsigned int*) tfParticle_Colors();
1791
1792#endif // _WRAPS_C_TFCPARTICLE_H_
Handle to a ClusterParticleHandle instance.
Definition tfCCluster.h:58
Handle to a ClusterParticleType instance.
Definition tfCCluster.h:66
Mapped particle data enums.
Definition tfCParticle.h:38
Definition tfCParticle.h:90
Definition tfCParticle.h:95
Handle to a ParticleHandle instance.
Definition tfCParticle.h:111
Handle to a ParticleList instance.
Definition tfCParticle.h:127
Handle to a ParticleType instance.
Definition tfCParticle.h:119
Handle to a ParticleTypeList instance.
Definition tfCParticle.h:135
Particle type definition in Tissue Forge C.
Definition tfCParticle.h:71
Particle type style definition in Tissue Forge C.
Definition tfCParticle.h:57
Handle to a rendering::Style instance.
Definition tfCStyle.h:38
Handle to a state::SpeciesList instance.
Definition tfCSpecies.h:47
Handle to a state::StateVector instance.
Definition tfCStateVector.h:36
HRESULT tfParticleTypeList_setOwnsData(struct tfParticleTypeListHandle *handle, bool flag)
Set whether the list owns its data.
HRESULT tfParticleTypeList_destroy(struct tfParticleTypeListHandle *handle)
Destroy an instance.
HRESULT tfParticleType_isCluster(struct tfParticleTypeHandle *handle, bool *isCluster)
Test whether this type is a cluster type.
HRESULT tfParticleHandle_sphericalPositionPoint(struct tfParticleHandleHandle *handle, tfFloatP_t *origin, tfFloatP_t **position)
Calculates the particle's coordinates in spherical coordinates relative to a point.
HRESULT tfParticleHandle_getVelocity(struct tfParticleHandleHandle *handle, tfFloatP_t **velocity)
Get the particle velocity.
HRESULT tfParticleHandle_setFrozenY(struct tfParticleHandleHandle *handle, bool frozen)
Set whether the particle is frozen along the y-direction.
HRESULT tfParticleHandle_sphericalPosition(struct tfParticleHandleHandle *handle, tfFloatP_t **position)
Calculates the particle's coordinates in spherical coordinates relative to the center of the universe...
HRESULT tfParticleTypeList_hasType(struct tfParticleTypeListHandle *handle, struct tfParticleTypeHandle *ptype, bool *result)
Test whether the list has a particle type.
HRESULT tfParticleType_getNumParts(struct tfParticleTypeHandle *handle, int *numParts)
Get the number of particles that are a member of this type.
HRESULT tfParticleType_setParticleFlags(struct tfParticleTypeHandle *handle, unsigned int flags)
Set the particle flags.
HRESULT tfParticleTypeList_toString(struct tfParticleTypeListHandle *handle, char **str, unsigned int *numChars)
Get a JSON string representation.
HRESULT tfParticleTypeList_hasId(struct tfParticleTypeListHandle *handle, int pid, bool *result)
Test whether the list has an id.
HRESULT tfParticleHandle_getFlags(struct tfParticleHandleHandle *handle, int *flags)
Get the particle flags.
HRESULT tfParticleHandle_getTypeId(struct tfParticleHandleHandle *handle, int *tid)
Get the particle type id.
HRESULT tfParticleTypeList_getOwnsData(struct tfParticleTypeListHandle *handle, bool *result)
Get whether the list owns its data.
HRESULT tfParticleList_insertP(struct tfParticleListHandle *handle, struct tfParticleHandleHandle *particle, unsigned int *index)
Inserts the given particle into the list, returns the index of the particle.
HRESULT tfParticleList_getAll(struct tfParticleListHandle *handle)
Initialize an instance populated with all current particles.
HRESULT tfParticleType_getMinimumRadius(struct tfParticleTypeHandle *handle, tfFloatP_t *minimum_radius)
Get the default minimum radius of this type.
HRESULT tfParticleHandle_setRadius(struct tfParticleHandleHandle *handle, tfFloatP_t radius)
Set the particle radius.
HRESULT tfParticleHandle_ge(struct tfParticleHandleHandle *lhs, struct tfParticleHandleHandle *rhs, bool *result)
HRESULT tfParticleHandle_getType(struct tfParticleHandleHandle *handle, struct tfParticleTypeHandle *typeHandle)
Gets the particle type of this handle.
HRESULT tfParticleTypeList_getMomentOfInertia(struct tfParticleTypeListHandle *handle, tfFloatP_t **moi)
Get the moment of inertia of the particles.
HRESULT tfParticleType_getPotentialEnergy(struct tfParticleTypeHandle *handle, tfFloatP_t *potential_energy)
Get the potential energy of all particles of this type.
HRESULT tfParticleType_getMass(struct tfParticleTypeHandle *handle, tfFloatP_t *mass)
Get the type mass.
HRESULT tfParticleType_initD(struct tfParticleTypeHandle *handle, struct tfParticleTypeSpec pdef)
Initialize an instance from a definition.
HRESULT tfParticleList_initP(struct tfParticleListHandle *handle, struct tfParticleHandleHandle **particles, unsigned int numParts)
Initialize an instance with an array of particles.
HRESULT tfParticleHandle_eq(struct tfParticleHandleHandle *lhs, struct tfParticleHandleHandle *rhs, bool *result)
HRESULT tfParticleHandle_getAge(struct tfParticleHandleHandle *handle, tfFloatP_t *age)
Get the particle age.
HRESULT tfParticleHandle_setForceInit(struct tfParticleHandleHandle *handle, tfFloatP_t *force)
Set the particle initial force.
HRESULT tfParticleList_copy(struct tfParticleListHandle *source, struct tfParticleListHandle *destination)
Copy an instance.
HRESULT tfParticleType_ne(struct tfParticleTypeHandle *lhs, struct tfParticleTypeHandle *rhs, bool *result)
struct tfMappedParticleDataEnum tfMappedParticleDataEnum_init()
Initialize an instance.
HRESULT tfParticleType_getId(struct tfParticleTypeHandle *handle, int *id)
Get the type id. -1 if not registered.
HRESULT tfParticleType_hasPartId(struct tfParticleTypeHandle *handle, int pid, bool *result)
Test whether the type has an id.
HRESULT tfParticleType_setTypeFlags(struct tfParticleTypeHandle *handle, unsigned int flags)
Set the type flags.
HRESULT tfParticleType_str(struct tfParticleTypeHandle *handle, char **str, unsigned int *numChars)
Get a summary string of the type.
HRESULT tfParticleList_destroy(struct tfParticleListHandle *handle)
Destroy an instance.
HRESULT tfParticleType_getFrozenY(struct tfParticleTypeHandle *handle, bool *frozen)
Test whether this type is frozen along the y-direction.
HRESULT tfParticleHandle_setFrozenZ(struct tfParticleHandleHandle *handle, bool frozen)
Set whether the particle is frozen along the z-direction.
HRESULT tfParticleHandle_getPosition(struct tfParticleHandleHandle *handle, tfFloatP_t **position)
Get the particle position.
HRESULT tfParticleList_sphericalPositions(struct tfParticleListHandle *handle, tfFloatP_t **coordinates)
Get the spherical coordinates of each particle for a coordinate system at the center of the universe.
HRESULT tfParticleTypeList_sphericalPositionsO(struct tfParticleTypeListHandle *handle, tfFloatP_t *origin, tfFloatP_t **coordinates)
Get the spherical coordinates of each particle for a coordinate system with a specified origin.
HRESULT tfParticleType_setFrozenY(struct tfParticleTypeHandle *handle, bool frozen)
Set whether this type is frozen along the y-direction.
HRESULT tfParticleList_item(struct tfParticleListHandle *handle, unsigned int i, struct tfParticleHandleHandle *item)
looks for the item at the given index and returns it if found, otherwise returns NULL
HRESULT tfParticleList_free(struct tfParticleListHandle *handle)
Free the memory associated with the parts list.
HRESULT tfParticleTypeList_getRadiusOfGyration(struct tfParticleTypeListHandle *handle, tfFloatP_t *rog)
Get the radius of gyration of the particles.
HRESULT tfParticleType_getFrozenZ(struct tfParticleTypeHandle *handle, bool *frozen)
Test whether this type is frozen along the z-direction.
HRESULT tfParticleHandle_split(struct tfParticleHandleHandle *handle, struct tfParticleHandleHandle *newParticleHandle)
Splits a single particle into two.
HRESULT tfParticleHandle_getFrozenX(struct tfParticleHandleHandle *handle, bool *frozen)
Test whether the particle is frozen along the x-direction.
HRESULT tfParticleType_getParticleFlags(struct tfParticleTypeHandle *handle, unsigned int *flags)
Get the particle flags.
HRESULT tfParticleHandle_getStyle(struct tfParticleHandleHandle *handle, struct tfRenderingStyleHandle *style)
Get the particle style. Fails if no style is set.
HRESULT tfParticleHandle_getBondedNeighbors(struct tfParticleHandleHandle *handle, struct tfParticleHandleHandle **neighbors, int *numNeighbors)
Get a list of all bonded neighbors.
HRESULT tfParticleType_hasPart(struct tfParticleTypeHandle *handle, struct tfParticleHandleHandle *part, bool *result)
Test whether the type has a particle.
HRESULT tfParticleType_getFrozenX(struct tfParticleTypeHandle *handle, bool *frozen)
Test whether this type is frozen along the x-direction.
HRESULT tfParticleHandle_neighborsD(struct tfParticleHandleHandle *handle, tfFloatP_t distance, struct tfParticleHandleHandle **neighbors, int *numNeighbors)
Get the particles within a distance of a particle.
HRESULT tfParticleTypeList_getPositions(struct tfParticleTypeListHandle *handle, tfFloatP_t **positions)
Get the particle positions.
HRESULT tfParticleList_initI(struct tfParticleListHandle *handle, int *parts, unsigned int numParts)
Initialize an instance with an array of particle ids.
HRESULT tfParticleHandle_distance(struct tfParticleHandleHandle *handle, struct tfParticleHandleHandle *other, tfFloatP_t *distance)
Calculates the distance to another particle.
HRESULT tfParticleType_getParticle(struct tfParticleTypeHandle *handle, int i, struct tfParticleHandleHandle *phandle)
Get the i'th particle that's a member of this type.
HRESULT tfParticleType_getTypeFlags(struct tfParticleTypeHandle *handle, unsigned int *flags)
Get the type flags.
HRESULT tfParticleHandle_lt(struct tfParticleHandleHandle *lhs, struct tfParticleHandleHandle *rhs, bool *result)
HRESULT tfParticleType_getFrozen(struct tfParticleTypeHandle *handle, bool *frozen)
Test whether this type is frozen.
HRESULT tfParticleHandle_setVelocity(struct tfParticleHandleHandle *handle, tfFloatP_t *velocity)
Set the particle velocity.
HRESULT tfParticleHandle_setFrozen(struct tfParticleHandleHandle *handle, bool frozen)
Set whether the particle is frozen.
HRESULT tfParticleTypeList_init(struct tfParticleTypeListHandle *handle)
Initialize an empty instance.
HRESULT tfParticleType_setFrozenZ(struct tfParticleTypeHandle *handle, bool frozen)
Set whether this type is frozen along the z-direction.
HRESULT tfParticleHandle_neighborsT(struct tfParticleHandleHandle *handle, struct tfParticleTypeHandle *ptypes, int numTypes, struct tfParticleHandleHandle **neighbors, int *numNeighbors)
Get the particles of a set of types within the global cutoff distance.
HRESULT tfParticleFlags_init(struct tfParticleFlagsHandle *handle)
Initialize an instance.
HRESULT tfParticleList_fromString(struct tfParticleListHandle *handle, const char *str)
Create from a JSON string representation.
HRESULT tfParticleHandle_getId(struct tfParticleHandleHandle *handle, int *pid)
Get the particle id.
HRESULT tfParticleList_hasPart(struct tfParticleListHandle *handle, struct tfParticleHandleHandle *part, bool *result)
Test whether the list has a particle.
HRESULT tfParticleList_getCenterOfMass(struct tfParticleListHandle *handle, tfFloatP_t **com)
Get the center of mass of the particles.
HRESULT tfParticleHandle_getClusterId(struct tfParticleHandleHandle *handle, int *cid)
Get the particle cluster id. -1 if particle is not a cluster.
HRESULT tfParticleHandle_toString(struct tfParticleHandleHandle *handle, char **str, unsigned int *numChars)
Get a JSON string representation.
HRESULT tfParticleTypeList_free(struct tfParticleTypeListHandle *handle)
Free the memory associated with the list.
HRESULT tfParticleList_sphericalPositionsO(struct tfParticleListHandle *handle, tfFloatP_t *origin, tfFloatP_t **coordinates)
Get the spherical coordinates of each particle for a coordinate system with a specified origin.
HRESULT tfParticleTypeList_insertP(struct tfParticleTypeListHandle *handle, struct tfParticleTypeHandle *ptype, unsigned int *index)
Inserts the given particle type into the list, returns the index of the particle.
HRESULT tfParticleHandle_destroy(struct tfParticleHandleHandle *handle)
Destroys the handle instance.
HRESULT tfParticleHandle_getMass(struct tfParticleHandleHandle *handle, tfFloatP_t *mass)
Get the particle mass.
unsigned int * tfParticle_Colors()
Get an array of available particle type colors.
HRESULT tfParticleType_createParticle(struct tfParticleTypeHandle *handle, int *pid, tfFloatP_t *position, tfFloatP_t *velocity)
Particle constructor.
HRESULT tfParticleType_setMass(struct tfParticleTypeHandle *handle, tfFloatP_t mass)
Set the type mass.
HRESULT tfParticleTypeList_setMutable(struct tfParticleTypeListHandle *handle, bool flag)
Set whether the list is mutable.
HRESULT tfParticleList_getMomentOfInertia(struct tfParticleListHandle *handle, tfFloatP_t **moi)
Get the moment of inertia of the particles.
HRESULT tfParticleTypeList_insertI(struct tfParticleTypeListHandle *handle, int item, unsigned int *index)
Insert the given id into the list, returns the index of the item.
HRESULT tfParticleType_lt(struct tfParticleTypeHandle *lhs, struct tfParticleTypeHandle *rhs, bool *result)
HRESULT tfParticleTypeList_getParticles(struct tfParticleTypeListHandle *handle, struct tfParticleListHandle *plist)
Get a particle list populated with particles of all current particle types.
HRESULT tfParticleList_getOwnsData(struct tfParticleListHandle *handle, bool *result)
Get whether the list owns its data.
HRESULT tfParticleDynamics_init(struct tfParticleDynamicsEnumHandle *handle)
Initialize an instance.
HRESULT tfParticleType_eq(struct tfParticleTypeHandle *lhs, struct tfParticleTypeHandle *rhs, bool *result)
HRESULT tfParticleTypeList_initP(struct tfParticleTypeListHandle *handle, struct tfParticleTypeHandle **parts, unsigned int numParts)
Initialize an instance with an array of particle types.
HRESULT tfParticleType_registerType(struct tfParticleTypeHandle *handle)
Registers a type with the engine.
HRESULT tfParticleList_getIds(struct tfParticleListHandle *handle, int **parts)
Get the particle ids in the list.
HRESULT tfParticleHandle_getForce(struct tfParticleHandleHandle *handle, tfFloatP_t **force)
Get the particle force.
HRESULT tfParticleTypeList_copy(struct tfParticleTypeListHandle *source, struct tfParticleTypeListHandle *destination)
Copy an instance.
HRESULT tfParticleHandle_ne(struct tfParticleHandleHandle *lhs, struct tfParticleHandleHandle *rhs, bool *result)
HRESULT tfParticleType_setTargetTemperature(struct tfParticleTypeHandle *handle, tfFloatP_t temperature)
Set the target temperature of this type.
HRESULT tfParticleHandle_hasSpecies(struct tfParticleHandleHandle *handle, bool *flag)
Test whether a particle has species.
HRESULT tfParticleType_setName(struct tfParticleTypeHandle *handle, const char *name)
Set the type name. Throws an error if the type is already registered.
HRESULT tfParticleList_getMutable(struct tfParticleListHandle *handle, bool *result)
Get whether the list is mutable.
HRESULT tfParticleType_setDynamics(struct tfParticleTypeHandle *handle, unsigned char dynamics)
Set the default dynamics of particles of this type.
HRESULT tfParticleList_toString(struct tfParticleListHandle *handle, char **str, unsigned int *numChars)
Get a JSON string representation.
HRESULT tfParticleType_getFromId(struct tfParticleTypeHandle *handle, unsigned int pid)
Get a registered particle type by type id.
HRESULT tfParticleType_getTargetTemperature(struct tfParticleTypeHandle *handle, tfFloatP_t *temperature)
Get the target temperature of this type.
HRESULT tfParticleHandle_getName(struct tfParticleHandleHandle *handle, char **name, unsigned int *numChars)
Get the particle name.
HRESULT tfParticleTypeList_fromString(struct tfParticleTypeListHandle *handle, const char *str)
Create from a JSON string representation.
HRESULT tfParticleType_newType(struct tfParticleTypeHandle *handle, const char *_name, struct tfParticleTypeHandle *newTypehandle)
Particle type constructor.
HRESULT tfParticleList_insertI(struct tfParticleListHandle *handle, int item, unsigned int *index)
Insert the given id into the list, returns the index of the item.
HRESULT tfParticleHandle_getRadius(struct tfParticleHandleHandle *handle, tfFloatP_t *radius)
Get the particle radius.
HRESULT tfParticleHandle_destroyParticle(struct tfParticleHandleHandle *handle)
Destroys the particle, and removes it from inventory.
HRESULT tfParticleHandle_become(struct tfParticleHandleHandle *handle, struct tfParticleTypeHandle *typeHandle)
Dynamically changes the type of an object. We can change the type of a ParticleType-derived object to...
HRESULT tfParticleHandle_setStyle(struct tfParticleHandleHandle *handle, struct tfRenderingStyleHandle *style)
Set the particle style.
HRESULT tfParticleType_factory(struct tfParticleTypeHandle *handle, int **pids, unsigned int nr_parts, tfFloatP_t *positions, tfFloatP_t *velocities)
Particle factory constructor, for making lots of particles quickly.
HRESULT tfParticleType_getRadius(struct tfParticleTypeHandle *handle, tfFloatP_t *radius)
Get the type radius.
HRESULT tfParticleTypeList_getForces(struct tfParticleTypeListHandle *handle, tfFloatP_t **forces)
Get the forces acting on the particles.
HRESULT tfParticleType_getTemperature(struct tfParticleTypeHandle *handle, tfFloatP_t *temperature)
Get the temperature of this type.
HRESULT tfParticleType_getTargetEnergy(struct tfParticleTypeHandle *handle, tfFloatP_t *target_energy)
Get the target energy of all particles of this type.
HRESULT tfParticleList_getNumParts(struct tfParticleListHandle *handle, unsigned int *numParts)
Get the number of particles.
HRESULT tfParticleList_getVirial(struct tfParticleListHandle *handle, tfFloatP_t **virial)
Get the virial tensor of the particles.
HRESULT tfParticleType_getDynamics(struct tfParticleTypeHandle *handle, unsigned char *dynamics)
Get the default dynamics of particles of this type.
HRESULT tfParticleType_getSpecies(struct tfParticleTypeHandle *handle, struct tfStateSpeciesListHandle *slist)
Get the type species. Fails if the type does not have species.
HRESULT tfParticleType_setTargetEnergy(struct tfParticleTypeHandle *handle, tfFloatP_t target_energy)
Set the target energy of all particles of this type.
HRESULT tfParticleList_getPositions(struct tfParticleListHandle *handle, tfFloatP_t **positions)
Get the particle positions.
HRESULT tfParticleHandle_setMass(struct tfParticleHandleHandle *handle, tfFloatP_t mass)
Set the particle mass.
HRESULT tfParticleTypeList_getMutable(struct tfParticleTypeListHandle *handle, bool *result)
Get whether the list is mutable.
HRESULT tfParticleList_setMutable(struct tfParticleListHandle *handle, bool flag)
Set whether the list is mutable.
HRESULT tfParticleType_getStyle(struct tfParticleTypeHandle *handle, struct tfRenderingStyleHandle *style)
Get the type style.
HRESULT tfParticleType_setRadius(struct tfParticleTypeHandle *handle, tfFloatP_t radius)
Set the type radius.
HRESULT tfParticleHandle_getFrozen(struct tfParticleHandleHandle *handle, bool *frozen)
Test whether the particle is frozen.
HRESULT tfParticleTypeList_item(struct tfParticleTypeListHandle *handle, unsigned int i, struct tfParticleTypeHandle *item)
looks for the item at the given index and returns it if found, otherwise returns NULL
HRESULT tfParticleHandle_relativePosition(struct tfParticleHandleHandle *handle, tfFloatP_t *origin, tfFloatP_t **position)
Computes the relative position with respect to an origin while.
HRESULT tfParticleHandle_splitTypes(struct tfParticleHandleHandle *handle, struct tfParticleHandleHandle *newParticleHandle, struct tfParticleTypeHandle *parentTypeHandle, struct tfParticleTypeHandle *childTypeHandle)
Splits a single particle into two and optionally with different resulting particle types.
HRESULT tfParticleHandle_neighborsDT(struct tfParticleHandleHandle *handle, tfFloatP_t distance, struct tfParticleTypeHandle *ptypes, int numTypes, struct tfParticleHandleHandle **neighbors, int *numNeighbors)
Get the particles of a set of types within a distance of a particle.
HRESULT tfParticleType_toString(struct tfParticleTypeHandle *handle, char **str, unsigned int *numChars)
Get a JSON string representation.
HRESULT tfParticleHandle_toCluster(struct tfParticleHandleHandle *handle, struct tfClusterParticleHandleHandle *chandle)
Convert the particle to a cluster; fails if particle is not a cluster.
HRESULT tfParticleList_setOwnsData(struct tfParticleListHandle *handle, bool flag)
Set whether the list owns its data.
HRESULT tfParticleType_init(struct tfParticleTypeHandle *handle)
Initialize an instance.
HRESULT tfParticleTypeList_getIds(struct tfParticleTypeListHandle *handle, int **parts)
Get the particle type ids in the list.
HRESULT tfParticleType_setFrozen(struct tfParticleTypeHandle *handle, bool frozen)
Set whether this type is frozen.
struct tfParticleTypeSpec tfParticleTypeSpec_init()
Get a default definition.
HRESULT tfParticleType_setMinimumRadius(struct tfParticleTypeHandle *handle, tfFloatP_t minimum_radius)
Set the default minimum radius of this type.
HRESULT tfParticleHandle_hasStyle(struct tfParticleHandleHandle *handle, bool *hasStyle)
Test whether the particle has a style.
HRESULT tfParticleHandle_getName2(struct tfParticleHandleHandle *handle, char **name, unsigned int *numChars)
Get the particle second name.
HRESULT tfParticleHandle_getForceInit(struct tfParticleHandleHandle *handle, tfFloatP_t **force)
Get the particle initial force.
HRESULT tfParticleType_ge(struct tfParticleTypeHandle *lhs, struct tfParticleTypeHandle *rhs, bool *result)
HRESULT tfParticleType_fromString(struct tfParticleTypeHandle *handle, const char *str)
Create from a JSON string representation.
HRESULT tfParticleType_isRegistered(struct tfParticleTypeHandle *handle, bool *isRegistered)
Tests whether this type is registered.
struct tfParticleTypeStyleSpec tfParticleTypeStyleSpec_init()
Get a default definition.
HRESULT tfParticleType_le(struct tfParticleTypeHandle *lhs, struct tfParticleTypeHandle *rhs, bool *result)
HRESULT tfParticleHandle_le(struct tfParticleHandleHandle *lhs, struct tfParticleHandleHandle *rhs, bool *result)
HRESULT tfParticleList_extend(struct tfParticleListHandle *handle, struct tfParticleListHandle *other)
inserts the contents of another list
HRESULT tfParticleTypeList_hasPart(struct tfParticleTypeListHandle *handle, struct tfParticleHandleHandle *part, bool *result)
Test whether the list has a particle.
HRESULT tfParticleHandle_init(struct tfParticleHandleHandle *handle, unsigned int pid)
Initialize an instance.
HRESULT tfParticleTypeList_getVelocities(struct tfParticleTypeListHandle *handle, tfFloatP_t **velocities)
Get the particle velocities.
HRESULT tfParticleType_setSpecies(struct tfParticleTypeHandle *handle, struct tfStateSpeciesListHandle *slist)
Set the type species.
HRESULT tfParticleType_hasSpecies(struct tfParticleTypeHandle *handle, bool *flag)
Test whether the type has species.
HRESULT tfParticleTypeList_getVirial(struct tfParticleTypeListHandle *handle, tfFloatP_t *virial)
Get the virial tensor of the particles.
HRESULT tfParticleList_getVelocities(struct tfParticleListHandle *handle, tfFloatP_t **velocities)
Get the particle velocities.
HRESULT tfParticleHandle_setSpecies(struct tfParticleHandleHandle *handle, struct tfStateStateVectorHandle *svec)
Set the state vector.
HRESULT tfParticleHandle_setPosition(struct tfParticleHandleHandle *handle, tfFloatP_t *position)
Set the particle position.
HRESULT tfParticleTypeList_extend(struct tfParticleTypeListHandle *handle, struct tfParticleTypeListHandle *other)
inserts the contents of another list
HRESULT tfParticleType_setStyle(struct tfParticleTypeHandle *handle, struct tfRenderingStyleHandle *style)
Set the type style.
HRESULT tfParticleList_getForces(struct tfParticleListHandle *handle, tfFloatP_t **forces)
Get the forces acting on the particles.
HRESULT tfParticleType_setFrozenX(struct tfParticleTypeHandle *handle, bool frozen)
Set whether this type is frozen along the x-direction.
HRESULT tfParticleTypeList_sphericalPositions(struct tfParticleTypeListHandle *handle, tfFloatP_t **coordinates)
Get the spherical coordinates of each particle for a coordinate system at the center of the universe.
HRESULT tfParticleTypeList_initI(struct tfParticleTypeListHandle *handle, int *parts, unsigned int numParts)
Initialize an instance with an array of particle type ids.
HRESULT tfParticleList_init(struct tfParticleListHandle *handle)
Initialize an empty instance.
HRESULT tfParticleHandle_getFrozenZ(struct tfParticleHandleHandle *handle, bool *frozen)
Test whether the particle is frozen along the z-direction.
HRESULT tfParticleTypeList_getAll(struct tfParticleTypeListHandle *handle)
Initialize an instance populated with all current particles.
HRESULT tfParticleTypeList_remove(struct tfParticleTypeListHandle *handle, int id)
Looks for the item with the given id and deletes it from the list.
HRESULT tfParticleList_getCentroid(struct tfParticleListHandle *handle, tfFloatP_t **cent)
Get the centroid of the particles.
HRESULT tfParticleType_toCluster(struct tfParticleTypeHandle *handle, struct tfClusterParticleTypeHandle *chandle)
Convert the type to a cluster; fails if the type is not a cluster.
HRESULT tfParticleType_FindFromName(struct tfParticleTypeHandle *handle, const char *name)
Get a registered particle type by type name.
HRESULT tfParticleHandle_setFrozenX(struct tfParticleHandleHandle *handle, bool frozen)
Set whether the particle is frozen along the x-direction.
HRESULT tfParticleType_getKineticEnergy(struct tfParticleTypeHandle *handle, tfFloatP_t *kinetic_energy)
Get the kinetic energy of all particles of this type.
HRESULT tfParticleList_hasId(struct tfParticleListHandle *handle, int pid, bool *result)
Test whether the list has an id.
HRESULT tfParticleType_createParticleS(struct tfParticleTypeHandle *handle, int *pid, const char *str)
Particle constructor.
HRESULT tfParticleTypeList_getCentroid(struct tfParticleTypeListHandle *handle, tfFloatP_t **cent)
Get the centroid of the particles.
HRESULT tfParticle_Verify()
Iterates over all parts, does a verify.
HRESULT tfParticleList_remove(struct tfParticleListHandle *handle, int id)
Looks for the item with the given id and deletes it from the list.
HRESULT tfParticleHandle_getFrozenY(struct tfParticleHandleHandle *handle, bool *frozen)
Test whether the particle is frozen along the y-direction.
HRESULT tfParticleTypeList_getNumParts(struct tfParticleTypeListHandle *handle, unsigned int *numParts)
Get the number of particle types.
HRESULT tfParticleType_getName(struct tfParticleTypeHandle *handle, char **name, unsigned int *numChars)
Get the type name.
HRESULT tfParticleHandle_gt(struct tfParticleHandleHandle *lhs, struct tfParticleHandleHandle *rhs, bool *result)
HRESULT tfParticleList_getRadiusOfGyration(struct tfParticleListHandle *handle, tfFloatP_t *rog)
Get the radius of gyration of the particles.
HRESULT tfParticleHandle_getSpecies(struct tfParticleHandleHandle *handle, struct tfStateStateVectorHandle *svec)
Get the state vector. Fails if the particle does not have a state vector.
HRESULT tfParticleType_gt(struct tfParticleTypeHandle *lhs, struct tfParticleTypeHandle *rhs, bool *result)
HRESULT tfParticleTypeList_getCenterOfMass(struct tfParticleTypeListHandle *handle, tfFloatP_t **com)
Get the center of mass of the particles.
HRESULT tfParticleHandle_str(struct tfParticleHandleHandle *handle, char **str, unsigned int *numChars)
Get a summary string of the particle.