Tissue Forge C 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
tfC_event.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
25#ifndef _WRAPS_C_TFC_EVENT_H_
26#define _WRAPS_C_TFC_EVENT_H_
27
28#include "tf_port_c.h"
29
30#include "tfCParticle.h"
31
32typedef HRESULT (*tfEventEventMethodHandleFcn)(struct tfEventEventHandle*);
33typedef HRESULT (*tfEventParticleEventMethodHandleFcn)(struct tfEventParticleEventHandle*);
34typedef HRESULT (*tfEventTimeEventMethodHandleFcn)(struct tfEventTimeEventHandle*);
35typedef HRESULT (*tfEventParticleTimeEventMethodHandleFcn)(struct tfEventParticleTimeEventHandle*);
36
37// Handles
38
40 unsigned int LARGEST;
41 unsigned int UNIFORM;
42 unsigned int DEFAULT;
43};
44
46 unsigned int DEFAULT;
47 unsigned int DETERMINISTIC;
48 unsigned int EXPONENTIAL;
49};
50
52 unsigned int LARGEST;
53 unsigned int UNIFORM;
54 unsigned int DEFAULT;
55};
56
58 unsigned int DETERMINISTIC;
59 unsigned int EXPONENTIAL;
60 unsigned int DEFAULT;
61};
62
67struct CAPI_EXPORT tfEventEventHandle {
68 void *tfObj;
69};
70
75struct CAPI_EXPORT tfEventParticleEventHandle {
76 void *tfObj;
77};
78
83struct CAPI_EXPORT tfEventTimeEventHandle {
84 void *tfObj;
85};
86
92 void *tfObj;
93};
94
95
97// event::ParticleEventParticleSelectorEnum //
99
100
108
109
111// event::TimeEventTimeSetterEnum //
113
114
122
123
125// event::ParticleTimeEventParticleSelectorEnum //
127
128
136
137
139// event::ParticleTimeEventTimeSetterEnum //
141
142
150
151
153// event::Event //
155
156
164CAPI_FUNC(HRESULT) tfEventEvent_getLastFired(struct tfEventEventHandle *handle, tfFloatP_t *last_fired);
165
173CAPI_FUNC(HRESULT) tfEventEvent_getTimesFired(struct tfEventEventHandle *handle, unsigned int *times_fired);
174
181CAPI_FUNC(HRESULT) tfEventEvent_remove(struct tfEventEventHandle *handle);
182
183
185// event::ParticleEvent //
187
188
196CAPI_FUNC(HRESULT) tfEventParticleEvent_getLastFired(struct tfEventParticleEventHandle *handle, tfFloatP_t *last_fired);
197
205CAPI_FUNC(HRESULT) tfEventParticleEvent_getTimesFired(struct tfEventParticleEventHandle *handle, unsigned int *times_fired);
206
214
222CAPI_FUNC(HRESULT) tfEventParticleEvent_getTargetType(struct tfEventParticleEventHandle *handle, struct tfParticleTypeHandle *targetType);
223
231CAPI_FUNC(HRESULT) tfEventParticleEvent_getTargetParticle(struct tfEventParticleEventHandle *handle, struct tfParticleHandleHandle *targetParticle);
232
233
235// event::TimeEvent //
237
238
246CAPI_FUNC(HRESULT) tfEventTimeEvent_getLastFired(struct tfEventTimeEventHandle *handle, tfFloatP_t *last_fired);
247
255CAPI_FUNC(HRESULT) tfEventTimeEvent_getTimesFired(struct tfEventTimeEventHandle *handle, unsigned int *times_fired);
256
263CAPI_FUNC(HRESULT) tfEventTimeEvent_remove(struct tfEventTimeEventHandle *handle);
264
272CAPI_FUNC(HRESULT) tfEventTimeEvent_getNextTime(struct tfEventTimeEventHandle *handle, tfFloatP_t *next_time);
273
281CAPI_FUNC(HRESULT) tfEventTimeEvent_getPeriod(struct tfEventTimeEventHandle *handle, tfFloatP_t *period);
282
290CAPI_FUNC(HRESULT) tfEventTimeEvent_getStartTime(struct tfEventTimeEventHandle *handle, tfFloatP_t *start_time);
291
299CAPI_FUNC(HRESULT) tfEventTimeEvent_getEndTime(struct tfEventTimeEventHandle *handle, tfFloatP_t *end_time);
300
301
303// event::ParticleTimeEvent //
305
306
314CAPI_FUNC(HRESULT) tfEventParticleTimeEvent_getLastFired(struct tfEventParticleTimeEventHandle *handle, tfFloatP_t *last_fired);
315
323CAPI_FUNC(HRESULT) tfEventParticleTimeEvent_getTimesFired(struct tfEventParticleTimeEventHandle *handle, unsigned int *times_fired);
324
332
340CAPI_FUNC(HRESULT) tfEventParticleTimeEvent_getNextTime(struct tfEventParticleTimeEventHandle *handle, tfFloatP_t *next_time);
341
349CAPI_FUNC(HRESULT) tfEventParticleTimeEvent_getPeriod(struct tfEventParticleTimeEventHandle *handle, tfFloatP_t *period);
350
358CAPI_FUNC(HRESULT) tfEventParticleTimeEvent_getStartTime(struct tfEventParticleTimeEventHandle *handle, tfFloatP_t *start_time);
359
367CAPI_FUNC(HRESULT) tfEventParticleTimeEvent_getEndTime(struct tfEventParticleTimeEventHandle *handle, tfFloatP_t *end_time);
368
377
386
387
389// Module functions //
391
392
401CAPI_FUNC(HRESULT) tfEventOnEvent(struct tfEventEventHandle *handle, tfEventEventMethodHandleFcn *invokeMethod, tfEventEventMethodHandleFcn *predicateMethod);
402
413CAPI_FUNC(HRESULT) tfEventOnParticleEvent(
414 struct tfEventParticleEventHandle *handle,
415 struct tfParticleTypeHandle *targetType,
416 unsigned int selectorEnum,
417 tfEventParticleEventMethodHandleFcn *invokeMethod,
418 tfEventParticleEventMethodHandleFcn *predicateMethod
419);
420
433CAPI_FUNC(HRESULT) tfEventOnTimeEvent(
434 struct tfEventTimeEventHandle *handle,
435 tfFloatP_t period,
436 tfEventTimeEventMethodHandleFcn *invokeMethod,
437 tfEventTimeEventMethodHandleFcn *predicateMethod,
438 unsigned int nextTimeSetterEnum,
439 tfFloatP_t start_time,
440 tfFloatP_t end_time
441);
442
457CAPI_FUNC(HRESULT) tfEventOnParticleTimeEvent(
458 struct tfEventParticleTimeEventHandle *handle,
459 struct tfParticleTypeHandle *targetType,
460 tfFloatP_t period,
461 tfEventParticleTimeEventMethodHandleFcn *invokeMethod,
462 tfEventParticleTimeEventMethodHandleFcn *predicateMethod,
463 unsigned int nextTimeSetterEnum,
464 tfFloatP_t start_time,
465 tfFloatP_t end_time,
466 unsigned int particleSelectorEnum
467);
468
469#endif // _WRAPS_C_TFC_EVENT_H_
Handle to a event::Event instance.
Definition tfC_event.h:67
Handle to a event::ParticleEvent instance.
Definition tfC_event.h:75
Handle to a event::ParticleTimeEvent instance.
Definition tfC_event.h:91
Handle to a event::TimeEvent instance.
Definition tfC_event.h:83
Definition tfC_event.h:45
Handle to a ParticleHandle instance.
Definition tfCParticle.h:111
Handle to a ParticleType instance.
Definition tfCParticle.h:119
HRESULT tfEventTimeEvent_getTimesFired(struct tfEventTimeEventHandle *handle, unsigned int *times_fired)
Get the number of times an event has fired.
HRESULT tfEventParticleTimeEventParticleSelectorEnum_init(struct tfEventParticleTimeEventParticleSelectorEnumHandle *handle)
Initialize an instance.
HRESULT tfEventParticleTimeEvent_getPeriod(struct tfEventParticleTimeEventHandle *handle, tfFloatP_t *period)
Get the period of evaluation.
HRESULT tfEventParticleEventParticleSelectorEnum_init(struct tfEventParticleEventParticleSelectorEnumHandle *handle)
Initialize an instance.
HRESULT tfEventTimeEvent_getEndTime(struct tfEventTimeEventHandle *handle, tfFloatP_t *end_time)
Get the end time of evaluations.
HRESULT tfEventTimeEvent_remove(struct tfEventTimeEventHandle *handle)
Designates event for removal.
HRESULT tfEventParticleTimeEvent_getLastFired(struct tfEventParticleTimeEventHandle *handle, tfFloatP_t *last_fired)
Get the last time an event was fired.
HRESULT tfEventEvent_getLastFired(struct tfEventEventHandle *handle, tfFloatP_t *last_fired)
Get the last time an event was fired.
HRESULT tfEventParticleTimeEvent_getEndTime(struct tfEventParticleTimeEventHandle *handle, tfFloatP_t *end_time)
Get the end time of evaluations.
HRESULT tfEventEvent_getTimesFired(struct tfEventEventHandle *handle, unsigned int *times_fired)
Get the number of times an event has fired.
HRESULT tfEventParticleEvent_getLastFired(struct tfEventParticleEventHandle *handle, tfFloatP_t *last_fired)
Get the last time an event was fired.
HRESULT tfEventParticleTimeEventTimeSetterEnum_init(struct tfEventParticleTimeEventTimeSetterEnumHandle *handle)
Initialize an instance.
HRESULT tfEventParticleTimeEvent_getStartTime(struct tfEventParticleTimeEventHandle *handle, tfFloatP_t *start_time)
Get the start time of evaluations.
HRESULT tfEventTimeEvent_getLastFired(struct tfEventTimeEventHandle *handle, tfFloatP_t *last_fired)
Get the last time an event was fired.
HRESULT tfEventParticleTimeEvent_getTargetType(struct tfEventParticleTimeEventHandle *handle, struct tfParticleTypeHandle *targetType)
Get the target particle type of this event.
HRESULT tfEventTimeEventTimeSetterEnum_init(struct tfEventTimeEventTimeSetterEnumHandle *handle)
Initialize an instance.
HRESULT tfEventTimeEvent_getNextTime(struct tfEventTimeEventHandle *handle, tfFloatP_t *next_time)
Get the next time of evaluation.
HRESULT tfEventParticleTimeEvent_remove(struct tfEventParticleTimeEventHandle *handle)
Designates event for removal.
HRESULT tfEventOnTimeEvent(struct tfEventTimeEventHandle *handle, tfFloatP_t period, tfEventTimeEventMethodHandleFcn *invokeMethod, tfEventTimeEventMethodHandleFcn *predicateMethod, unsigned int nextTimeSetterEnum, tfFloatP_t start_time, tfFloatP_t end_time)
Creates a time-dependent event using prescribed invoke and predicate functions.
HRESULT tfEventParticleTimeEvent_getTimesFired(struct tfEventParticleTimeEventHandle *handle, unsigned int *times_fired)
Get the number of times an event has fired.
HRESULT tfEventTimeEvent_getStartTime(struct tfEventTimeEventHandle *handle, tfFloatP_t *start_time)
Get the start time of evaluations.
HRESULT tfEventOnParticleEvent(struct tfEventParticleEventHandle *handle, struct tfParticleTypeHandle *targetType, unsigned int selectorEnum, tfEventParticleEventMethodHandleFcn *invokeMethod, tfEventParticleEventMethodHandleFcn *predicateMethod)
Creates a particle event using prescribed invoke and predicate functions.
HRESULT tfEventOnEvent(struct tfEventEventHandle *handle, tfEventEventMethodHandleFcn *invokeMethod, tfEventEventMethodHandleFcn *predicateMethod)
Creates an event using prescribed invoke and predicate functions.
HRESULT tfEventEvent_remove(struct tfEventEventHandle *handle)
Designates event for removal.
HRESULT tfEventParticleTimeEvent_getTargetParticle(struct tfEventParticleTimeEventHandle *handle, struct tfParticleHandleHandle *targetParticle)
Get the target particle of an event evaluation.
HRESULT tfEventParticleEvent_getTargetType(struct tfEventParticleEventHandle *handle, struct tfParticleTypeHandle *targetType)
Get the target particle type of this event.
HRESULT tfEventParticleEvent_getTargetParticle(struct tfEventParticleEventHandle *handle, struct tfParticleHandleHandle *targetParticle)
Get the target particle of an event evaluation.
HRESULT tfEventTimeEvent_getPeriod(struct tfEventTimeEventHandle *handle, tfFloatP_t *period)
Get the period of evaluation.
HRESULT tfEventParticleTimeEvent_getNextTime(struct tfEventParticleTimeEventHandle *handle, tfFloatP_t *next_time)
Get the next time of evaluation.
HRESULT tfEventOnParticleTimeEvent(struct tfEventParticleTimeEventHandle *handle, struct tfParticleTypeHandle *targetType, tfFloatP_t period, tfEventParticleTimeEventMethodHandleFcn *invokeMethod, tfEventParticleTimeEventMethodHandleFcn *predicateMethod, unsigned int nextTimeSetterEnum, tfFloatP_t start_time, tfFloatP_t end_time, unsigned int particleSelectorEnum)
Creates a time-dependent particle event using prescribed invoke and predicate functions.
HRESULT tfEventParticleEvent_remove(struct tfEventParticleEventHandle *handle)
Designates event for removal.
HRESULT tfEventParticleEvent_getTimesFired(struct tfEventParticleEventHandle *handle, unsigned int *times_fired)
Get the number of times an event has fired.