Tissue Forge C 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
tfC_util.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_TFC_UTIL_H_
26#define _WRAPS_C_TFC_UTIL_H_
27
28#include "tf_port_c.h"
29
30// Handles
31
32struct CAPI_EXPORT tfPointsTypeHandle {
33 unsigned int Sphere;
34 unsigned int SolidSphere;
35 unsigned int Disk;
36 unsigned int SolidCube;
37 unsigned int Cube;
38 unsigned int Ring;
39};
40
41
43// PointsType //
45
46
53CAPI_FUNC(HRESULT) tfPointsType_init(struct tfPointsTypeHandle *handle);
54
55
57// Module functions //
59
60
65CAPI_FUNC(HRESULT) tfGetSeed(unsigned int *seed);
66
73CAPI_FUNC(HRESULT) tfSetSeed(unsigned int seed);
74
80CAPI_FUNC(HRESULT) tfColor3Names(char ***names, unsigned int *numNames);
81
90CAPI_FUNC(HRESULT) tfPlaneEquationFPN(tfFloatP_t *point, tfFloatP_t *normal, tfFloatP_t **planeEq);
91
100CAPI_FUNC(HRESULT) tfPlaneEquationTPN(tfFloatP_t *planeEq, tfFloatP_t **point, tfFloatP_t **normal);
101
116CAPI_FUNC(HRESULT) tfRandomPoint(unsigned int kind, tfFloatP_t dr, tfFloatP_t phi0, tfFloatP_t phi1, tfFloatP_t *x, tfFloatP_t *y, tfFloatP_t *z);
117
131CAPI_FUNC(HRESULT) tfRandomPoints(unsigned int kind, int n, tfFloatP_t dr, tfFloatP_t phi0, tfFloatP_t phi1, tfFloatP_t **x);
132
143CAPI_FUNC(HRESULT) tfPoints(unsigned int kind, int n, tfFloatP_t **x);
144
156CAPI_FUNC(HRESULT) tfFilledCubeUniform(
157 tfFloatP_t *corner1,
158 tfFloatP_t *corner2,
159 unsigned int nParticlesX,
160 unsigned int nParticlesY,
161 unsigned int nParticlesZ,
162 tfFloatP_t **x
163);
164
174CAPI_FUNC(HRESULT) tfFilledCubeRandom(tfFloatP_t *corner1, tfFloatP_t *corner2, int nParticles, tfFloatP_t **x);
175
188CAPI_FUNC(HRESULT) tfIcosphere(
189 unsigned int subdivisions,
190 tfFloatP_t phi0,
191 tfFloatP_t phi1,
192 tfFloatP_t **verts,
193 unsigned int *numVerts,
194 int **inds,
195 unsigned int *numInds
196);
197
210CAPI_FUNC(HRESULT) tfRandomVector(tfFloatP_t mean, tfFloatP_t std, tfFloatP_t *x, tfFloatP_t *y, tfFloatP_t *z);
211
220CAPI_FUNC(HRESULT) tfRandomUnitVector(tfFloatP_t *x, tfFloatP_t *y, tfFloatP_t *z);
221
230CAPI_FUNC(HRESULT) tfUtilGetFeaturesMap(char ***names, bool **flags, unsigned int *numFeatures);
231
238CAPI_FUNC(HRESULT) tfUtilWallTime(double *wtime);
239
246CAPI_FUNC(HRESULT) tfUtilCPUTime(double *cputime);
247
248#endif // _WRAPS_C_TFC_UTIL_H_
Definition tfC_util.h:32
HRESULT tfUtilCPUTime(double *cputime)
Get the current CPU time.
HRESULT tfPlaneEquationFPN(tfFloatP_t *point, tfFloatP_t *normal, tfFloatP_t **planeEq)
Calculate the coefficients of a plane equation from a point and normal of the plane.
HRESULT tfFilledCubeRandom(tfFloatP_t *corner1, tfFloatP_t *corner2, int nParticles, tfFloatP_t **x)
Get the coordinates of a randomly filled cube.
HRESULT tfFilledCubeUniform(tfFloatP_t *corner1, tfFloatP_t *corner2, unsigned int nParticlesX, unsigned int nParticlesY, unsigned int nParticlesZ, tfFloatP_t **x)
Get the coordinates of a uniformly filled cube.
HRESULT tfRandomPoint(unsigned int kind, tfFloatP_t dr, tfFloatP_t phi0, tfFloatP_t phi1, tfFloatP_t *x, tfFloatP_t *y, tfFloatP_t *z)
Get the coordinates of a random point in a kind of shape.
HRESULT tfPointsType_init(struct tfPointsTypeHandle *handle)
Initialize an instance.
HRESULT tfPoints(unsigned int kind, int n, tfFloatP_t **x)
Get the coordinates of uniform points in a kind of shape.
HRESULT tfGetSeed(unsigned int *seed)
Get the current seed for the pseudo-random number generator.
HRESULT tfColor3Names(char ***names, unsigned int *numNames)
Get the names of all available colors.
HRESULT tfSetSeed(unsigned int seed)
Set the current seed for the pseudo-random number generator.
HRESULT tfPlaneEquationTPN(tfFloatP_t *planeEq, tfFloatP_t **point, tfFloatP_t **normal)
Calculate a point and normal of a plane equation.
HRESULT tfRandomVector(tfFloatP_t mean, tfFloatP_t std, tfFloatP_t *x, tfFloatP_t *y, tfFloatP_t *z)
Generates a randomly oriented vector with random magnitude with given mean and standard deviation acc...
HRESULT tfUtilWallTime(double *wtime)
Get the current wall time.
HRESULT tfRandomUnitVector(tfFloatP_t *x, tfFloatP_t *y, tfFloatP_t *z)
Generates a randomly oriented unit vector.
HRESULT tfRandomPoints(unsigned int kind, int n, tfFloatP_t dr, tfFloatP_t phi0, tfFloatP_t phi1, tfFloatP_t **x)
Get the coordinates of random points in a kind of shape.
HRESULT tfIcosphere(unsigned int subdivisions, tfFloatP_t phi0, tfFloatP_t phi1, tfFloatP_t **verts, unsigned int *numVerts, int **inds, unsigned int *numInds)
Get the coordinates of an icosphere.
HRESULT tfUtilGetFeaturesMap(char ***names, bool **flags, unsigned int *numFeatures)
Get the compiler features names and flags.