Tissue Forge C 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
tfCSurface.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 and Tien Comlekoglu
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_VERTEX_SOLVER_TFCSURFACE_H_
26#define _WRAPS_C_VERTEX_SOLVER_TFCSURFACE_H_
27
28#include <tf_port_c.h>
29
30#include <tfC_io.h>
31#include <tfCStyle.h>
32
33
39 char *color;
40 unsigned int visible;
41};
42
48 tfFloatP_t *edgeTensionLam;
49 unsigned int edgeTensionOrder;
50 tfFloatP_t *normalStressMag;
51 tfFloatP_t *surfaceAreaLam;
52 tfFloatP_t *surfaceAreaVal;
53 tfFloatP_t **surfaceTractionComps;
54 char *name;
56 char **adhesionNames;
57 tfFloatP_t *adhesionValues;
58 unsigned int numAdhesionValues;
59};
60
61
62// Handles
63
69 void *tfObj;
70};
71
77 void *tfObj;
78};
79
80
82// tfVertexSolverSurfaceTypeSpec //
84
85
91
92
94// tfVertexSolverSurfaceTypeStyleSpec //
96
97
103
104
106// SurfaceHandle //
108
109
117
124CAPI_FUNC(HRESULT) tfVertexSolverSurfaceHandle_fromString(struct tfVertexSolverSurfaceHandleHandle *handle, const char *s);
125
132
139CAPI_FUNC(HRESULT) tfVertexSolverSurfaceHandle_getId(struct tfVertexSolverSurfaceHandleHandle *handle, int *objId);
140
149 struct tfVertexSolverSurfaceHandleHandle *handle,
151 bool *result
152);
153
162 struct tfVertexSolverSurfaceHandleHandle *handle,
164 bool *result
165);
166
173CAPI_FUNC(HRESULT) tfVertexSolverSurfaceHandle_objType(struct tfVertexSolverSurfaceHandleHandle *handle, unsigned int *label);
174
181
188CAPI_FUNC(HRESULT) tfVertexSolverSurfaceHandle_destroySurfaces(struct tfVertexSolverSurfaceHandleHandle **handles, unsigned int numObjs);
189
198
205CAPI_FUNC(HRESULT) tfVertexSolverSurfaceHandle_validate(struct tfVertexSolverSurfaceHandleHandle *handle, bool *result);
206
213
222 struct tfVertexSolverSurfaceHandleHandle *handle,
223 char **str,
224 unsigned int *numChars
225);
226
235 struct tfVertexSolverSurfaceHandleHandle *handle,
236 char **str,
237 unsigned int *numChars
238);
239
247
256 struct tfVertexSolverSurfaceHandleHandle *handle,
258 const int &idx
259);
260
269 struct tfVertexSolverSurfaceHandleHandle *handle,
272);
273
283 struct tfVertexSolverSurfaceHandleHandle *handle,
284 struct tfVertexSolverVertexHandleHandle *toInsert,
287);
288
296
305 struct tfVertexSolverSurfaceHandleHandle *handle,
306 struct tfVertexSolverVertexHandleHandle *toInsert,
307 const int &idx
308);
309
318 struct tfVertexSolverSurfaceHandleHandle *handle,
319 struct tfVertexSolverVertexHandleHandle *toInsert,
320 struct tfVertexSolverVertexHandleHandle *toRemove
321);
322
330
338
347 struct tfVertexSolverSurfaceHandleHandle *handle,
348 struct tfVertexSolverBodyHandleHandle *toInsert,
349 const int &idx
350);
351
360 struct tfVertexSolverSurfaceHandleHandle *handle,
361 struct tfVertexSolverBodyHandleHandle *toInsert,
362 struct tfVertexSolverBodyHandleHandle *toRemove
363);
364
371
379
387
396 struct tfVertexSolverSurfaceHandleHandle *handle,
397 struct tfVertexSolverBodyHandleHandle **objs,
398 int *numObjs
399);
400
409 struct tfVertexSolverSurfaceHandleHandle *handle,
411 int *numObjs
412);
413
422 struct tfVertexSolverSurfaceHandleHandle *handle,
423 tfFloatP_t *dir,
425);
426
435 struct tfVertexSolverSurfaceHandleHandle *handle,
436 tfFloatP_t *dir,
437 struct tfVertexSolverBodyHandleHandle *result
438);
439
449 struct tfVertexSolverSurfaceHandleHandle *handle,
453);
454
463 struct tfVertexSolverSurfaceHandleHandle *handle,
465 int *numObjs
466);
467
478 struct tfVertexSolverSurfaceHandleHandle *handle,
479 struct tfVertexSolverVertexHandleHandle **verts,
480 unsigned int numVerts,
482 int *numObjs
483);
484
493 struct tfVertexSolverSurfaceHandleHandle *handle,
495 int *numObjs
496);
497
507 struct tfVertexSolverSurfaceHandleHandle *handle,
510 int *numObjs
511);
512
522 struct tfVertexSolverSurfaceHandleHandle *handle,
524 unsigned int **labels,
525 int *numLabels
526);
527
542 struct tfVertexSolverSurfaceHandleHandle *handle,
544 unsigned int edgeLabel,
546 int *numObjs
547);
548
555CAPI_FUNC(HRESULT) tfVertexSolverSurfaceHandle_getNormal(struct tfVertexSolverSurfaceHandleHandle *handle, tfFloatP_t **result);
556
563CAPI_FUNC(HRESULT) tfVertexSolverSurfaceHandle_getUnnormalizedNormal(struct tfVertexSolverSurfaceHandleHandle *handle, tfFloatP_t **result);
564
571CAPI_FUNC(HRESULT) tfVertexSolverSurfaceHandle_getCentroid(struct tfVertexSolverSurfaceHandleHandle *handle, tfFloatP_t **result);
572
579CAPI_FUNC(HRESULT) tfVertexSolverSurfaceHandle_getVelocity(struct tfVertexSolverSurfaceHandleHandle *handle, tfFloatP_t **result);
580
587CAPI_FUNC(HRESULT) tfVertexSolverSurfaceHandle_getArea(struct tfVertexSolverSurfaceHandleHandle *handle, tfFloatP_t *result);
588
595CAPI_FUNC(HRESULT) tfVertexSolverSurfaceHandle_getPerimeter(struct tfVertexSolverSurfaceHandleHandle *handle, tfFloatP_t *result);
596
603CAPI_FUNC(HRESULT) tfVertexSolverSurfaceHandle_getDensity(struct tfVertexSolverSurfaceHandleHandle *handle, tfFloatP_t *result);
604
611CAPI_FUNC(HRESULT) tfVertexSolverSurfaceHandle_setDensity(struct tfVertexSolverSurfaceHandleHandle *handle, tfFloatP_t density);
612
619CAPI_FUNC(HRESULT) tfVertexSolverSurfaceHandle_getMass(struct tfVertexSolverSurfaceHandleHandle *handle, tfFloatP_t *result);
620
629 struct tfVertexSolverSurfaceHandleHandle *handle,
630 struct tfVertexSolverBodyHandleHandle *body,
631 tfFloatP_t *result
632);
633
642 struct tfVertexSolverSurfaceHandleHandle *handle,
643 struct tfVertexSolverBodyHandleHandle *body,
644 tfFloatP_t *result
645);
646
655 struct tfVertexSolverSurfaceHandleHandle *handle,
656 struct tfVertexSolverBodyHandleHandle *body,
657 tfFloatP_t **result
658);
659
668 struct tfVertexSolverSurfaceHandleHandle *handle,
670 tfFloatP_t *result
671);
672
681 struct tfVertexSolverSurfaceHandleHandle *handle,
683 tfFloatP_t *result
684);
685
692CAPI_FUNC(HRESULT) tfVertexSolverSurfaceHandle_hasStyle(struct tfVertexSolverSurfaceHandleHandle *handle, bool *result);
693
701
709
718 struct tfVertexSolverSurfaceHandleHandle *handle,
719 tfFloatP_t *pos,
720 tfFloatP_t *result
721);
722
731 struct tfVertexSolverSurfaceHandleHandle *handle,
732 tfFloatP_t *pos,
733 bool *result
734);
735
746 struct tfVertexSolverSurfaceHandleHandle *handle,
747 tfFloatP_t *pos,
748 bool *result,
751);
752
764 struct tfVertexSolverSurfaceHandleHandle *handle,
765 struct tfVertexSolverSurfaceHandleHandle *toRemove,
766 tfFloatP_t *lenCfs,
767 unsigned int numLenCfs
768);
769
779 struct tfVertexSolverSurfaceHandleHandle *handle,
780 unsigned int vertIdxStart,
781 tfFloatP_t *pos,
783);
784
794 struct tfVertexSolverSurfaceHandleHandle *handle,
795 unsigned int vertIdxStart,
796 tfFloatP_t normLen,
798);
799
815 struct tfVertexSolverSurfaceHandleHandle *handle,
819);
820
832 struct tfVertexSolverSurfaceHandleHandle *handle,
833 tfFloatP_t *cp_pos,
834 tfFloatP_t *cp_norm,
836);
837
838
840// SurfaceType //
842
843
850
858
867CAPI_FUNC(HRESULT) tfVertexSolverSurfaceType_fromString(struct tfVertexSolverSurfaceTypeHandle *handle, const char *str);
868
875CAPI_FUNC(HRESULT) tfVertexSolverSurfaceType_objType(struct tfVertexSolverSurfaceTypeHandle *handle, unsigned int *label);
876
885 struct tfVertexSolverSurfaceTypeHandle *handle,
886 char **str,
887 unsigned int *numChars
888);
889
898 struct tfVertexSolverSurfaceTypeHandle *handle,
899 char **str,
900 unsigned int *numChars
901);
902
909
916CAPI_FUNC(HRESULT) tfVertexSolverSurfaceType_isRegistered(struct tfVertexSolverSurfaceTypeHandle *handle, bool *result);
917
926 struct tfVertexSolverSurfaceTypeHandle *handle,
927 char **str,
928 unsigned int *numChars
929);
930
937CAPI_FUNC(HRESULT) tfVertexSolverSurfaceType_setName(struct tfVertexSolverSurfaceTypeHandle *handle, const char *str);
938
946
953CAPI_FUNC(HRESULT) tfVertexSolverSurfaceType_getDensity(struct tfVertexSolverSurfaceTypeHandle *handle, tfFloatP_t *result);
954
961CAPI_FUNC(HRESULT) tfVertexSolverSurfaceType_setDensity(struct tfVertexSolverSurfaceTypeHandle *handle, tfFloatP_t result);
962
971 struct tfVertexSolverSurfaceTypeHandle *handle,
973 unsigned int *numObjs
974);
975
984 struct tfVertexSolverSurfaceTypeHandle *handle,
985 int **ids,
986 unsigned int *numObjs
987);
988
998 struct tfVertexSolverSurfaceTypeHandle *handle,
999 struct tfVertexSolverVertexHandleHandle **vertices,
1000 unsigned int numVerts,
1002);
1003
1013 struct tfVertexSolverSurfaceTypeHandle *handle,
1014 tfFloatP_t **positions,
1015 unsigned int numPositions,
1017);
1018
1027 struct tfVertexSolverSurfaceTypeHandle *handle,
1028 struct tfIoThreeDFFaceDataHandle *face,
1030);
1031
1042 struct tfVertexSolverSurfaceTypeHandle *handle,
1043 struct tfVertexSolverVertexHandleHandle ***vertices,
1044 unsigned int numSurfaces,
1045 unsigned int *numVerts,
1046 struct tfVertexSolverSurfaceHandleHandle **newObjs
1047);
1048
1059 struct tfVertexSolverSurfaceTypeHandle *handle,
1060 tfFloatP_t ***spositions,
1061 unsigned int numSurfaces,
1062 unsigned int *numPositions,
1063 struct tfVertexSolverSurfaceHandleHandle **newObjs
1064);
1065
1075 struct tfVertexSolverSurfaceTypeHandle *handle,
1076 struct tfIoThreeDFFaceDataHandle **faces,
1077 unsigned int numSurfaces,
1078 struct tfVertexSolverSurfaceHandleHandle **newObjs
1079);
1080
1093 struct tfVertexSolverSurfaceTypeHandle *handle,
1094 unsigned int n,
1095 tfFloatP_t *center,
1096 tfFloatP_t radius,
1097 tfFloatP_t *ax1,
1098 tfFloatP_t *ax2,
1100);
1101
1112 struct tfVertexSolverSurfaceTypeHandle *handle,
1113 struct tfVertexSolverVertexHandleHandle *toReplace,
1114 tfFloatP_t *lenCfs,
1115 unsigned int numLenCfs,
1117);
1118
1119
1121// Module functions //
1123
1124
1133 struct tfVertexSolverVertexHandleHandle **verts,
1134 unsigned int numVerts,
1136);
1137
1145 struct tfIoThreeDFFaceDataHandle *face,
1147);
1148
1155CAPI_FUNC(HRESULT) tfVertexSolverFindSurfaceTypeFromName(const char *name, struct tfVertexSolverSurfaceTypeHandle *result);
1156
1165 struct tfVertexSolverSurfaceTypeHandle **stypes,
1166 struct tfVertexSolverSurfaceTypeSpec *sdefs,
1167 unsigned int numTypes
1168);
1169
1170#endif // _WRAPS_C_VERTEX_SOLVER_TFCSURFACE_H_
Handle to a io::ThreeDFFaceData instance.
Definition tfC_io.h:86
Handle to a rendering::Style instance.
Definition tfCStyle.h:38
Handle to a models::vertex::BodyHandle instance.
Definition tfCBody.h:57
Handle to a models::vertex::SurfaceHandle instance.
Definition tfCSurface.h:68
Handle to a models::vertex::SurfaceType instance.
Definition tfCSurface.h:76
Surface type definition in Tissue Forge C.
Definition tfCSurface.h:47
Surface type style definition in Tissue Forge C.
Definition tfCSurface.h:38
Handle to a models::vertex::VertexHandle instance.
Definition tfCVertex.h:39
HRESULT tfVertexSolverSurfaceHandle_contains(struct tfVertexSolverSurfaceHandleHandle *handle, tfFloatP_t *pos, bool *result, struct tfVertexSolverVertexHandleHandle *v0, struct tfVertexSolverVertexHandleHandle *v1)
Test whether the surface contains a point.
HRESULT tfVertexSolverSurfaceHandle_getOutwardNormal(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverBodyHandleHandle *body, tfFloatP_t **result)
Get the outward facing normal w.r.t. a body.
HRESULT tfVertexSolverSurfaceType_registerType(struct tfVertexSolverSurfaceTypeHandle *handle)
Registers a type with the engine.
HRESULT tfVertexSolverSurfaceHandle_getDensity(struct tfVertexSolverSurfaceHandleHandle *handle, tfFloatP_t *result)
Get the mass density; only used in 2D simulation.
HRESULT tfVertexSolverSurfaceHandle_setDensity(struct tfVertexSolverSurfaceHandleHandle *handle, tfFloatP_t density)
Set the mass density; only used in 2D simulation.
HRESULT tfVertexSolverSurfaceType_createSurfaceIOA(struct tfVertexSolverSurfaceTypeHandle *handle, struct tfIoThreeDFFaceDataHandle **faces, unsigned int numSurfaces, struct tfVertexSolverSurfaceHandleHandle **newObjs)
Construct a surface of this type from a face.
HRESULT tfVertexSolverSurfaceHandle_destroy(struct tfVertexSolverSurfaceHandleHandle *handle)
Destroy an instance.
HRESULT tfVertexSolverSurfaceType_toString(struct tfVertexSolverSurfaceTypeHandle *handle, char **str, unsigned int *numChars)
Get a JSON string representation.
HRESULT tfVertexSolverSurfaceHandle_hasStyle(struct tfVertexSolverSurfaceHandleHandle *handle, bool *result)
Test whether the surface has a style.
HRESULT tfVertexSolverSurfaceHandle_removeBody(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverBodyHandleHandle *b)
Remove a body.
HRESULT tfVertexSolverSurfaceHandle_getId(struct tfVertexSolverSurfaceHandleHandle *handle, int *objId)
Get the id.
HRESULT tfVertexSolverSurfaceHandle_replaceBodyWith(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverBodyHandleHandle *toInsert, struct tfVertexSolverBodyHandleHandle *toRemove)
Replace a body with another body.
HRESULT tfVertexSolverSurfaceHandle_getStyle(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfRenderingStyleHandle *result)
Get the surface style.
HRESULT tfVertexSolverSurfaceHandle_getMass(struct tfVertexSolverSurfaceHandleHandle *handle, tfFloatP_t *result)
Get the mass; only used in 2D simulation.
HRESULT tfVertexSolverSurfaceHandle_connectingVertices(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverSurfaceHandleHandle *other, struct tfVertexSolverVertexHandleHandle **objs, int *numObjs)
Vertices defining this and another surface.
HRESULT tfVertexSolverSurfaceHandle_become(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverSurfaceTypeHandle *stype)
Become a different type.
HRESULT tfVertexSolverSurfaceHandle_getCentroid(struct tfVertexSolverSurfaceHandleHandle *handle, tfFloatP_t **result)
Get the centroid.
HRESULT tfVertexSolverSurfaceType_getName(struct tfVertexSolverSurfaceTypeHandle *handle, char **str, unsigned int *numChars)
Name of this surface type.
HRESULT tfVertexSolverSurfaceHandle_definedByVertex(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverVertexHandleHandle *v, bool *result)
Test whether a surface is defined by a vertex.
struct tfVertexSolverSurfaceTypeStyleSpec tfVertexSolverSurfaceTypeStyleSpec_init()
Get a default definition.
HRESULT tfVertexSolverSurfaceHandle_getType(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverSurfaceTypeHandle *stype)
Get the surface type.
HRESULT tfVertexSolverSurfaceType_createSurfacePA(struct tfVertexSolverSurfaceTypeHandle *handle, tfFloatP_t ***spositions, unsigned int numSurfaces, unsigned int *numPositions, struct tfVertexSolverSurfaceHandleHandle **newObjs)
Construct a surface of this type from a set of positions.
HRESULT tfVertexSolverSurfaceHandle_positionChanged(struct tfVertexSolverSurfaceHandleHandle *handle)
Update internal data due to a change in position.
HRESULT tfVertexSolverSurfaceHandle_getBodies(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverBodyHandleHandle **objs, int *numObjs)
Get the bodies defined by the surface.
HRESULT tfVertexSolverSurfaceHandle_splitHow(struct tfVertexSolverSurfaceHandleHandle *handle, tfFloatP_t *cp_pos, tfFloatP_t *cp_norm, struct tfVertexSolverSurfaceHandleHandle *newObj)
Split into two surfaces.
HRESULT tfVertexSolverSurfaceHandle_getVertexArea(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverVertexHandleHandle *v, tfFloatP_t *result)
Get the area that a vertex contributes to this surface.
HRESULT tfVertexSolverSurfaceType_fromString(struct tfVertexSolverSurfaceTypeHandle *handle, const char *str)
Create from a JSON string representation.
HRESULT tfVertexSolverSurfaceType_getStyle(struct tfVertexSolverSurfaceTypeHandle *handle, struct tfRenderingStyleHandle *style)
Get the style of the surface type.
HRESULT tfVertexSolverSurfaceType_setDensity(struct tfVertexSolverSurfaceTypeHandle *handle, tfFloatP_t result)
Set the density of the surface type; only used in 2D simulation.
HRESULT tfVertexSolverSurfaceHandle_definesBody(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverBodyHandleHandle *b, bool *result)
Test whether a surface defines a body.
HRESULT tfVertexSolverSurfaceHandle_volumeSense(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverBodyHandleHandle *body, tfFloatP_t *result)
Get the sign of the volume contribution to a body that this surface contributes.
HRESULT tfVertexSolverSurfaceHandle_toString(struct tfVertexSolverSurfaceHandleHandle *handle, char **str, unsigned int *numChars)
Get a JSON string representation.
HRESULT tfVertexSolverCreateSurfaceByVertices(struct tfVertexSolverVertexHandleHandle **verts, unsigned int numVerts, struct tfVertexSolverSurfaceHandleHandle *newObj)
Construct a surface from a set of vertices.
HRESULT tfVertexSolverSurfaceType_getInstanceIds(struct tfVertexSolverSurfaceTypeHandle *handle, int **ids, unsigned int *numObjs)
Get the list of instances ids that belong to this type.
HRESULT tfVertexSolverSurfaceHandle_removeVertex(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverVertexHandleHandle *v)
Remove a vertex.
HRESULT tfVertexSolverSurfaceHandle_contiguousVertexLabels(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverSurfaceHandleHandle *other, unsigned int **labels, int *numLabels)
Get the integer labels of the contiguous vertices that this surface shares with another surface.
HRESULT tfVertexSolverSurfaceType_setName(struct tfVertexSolverSurfaceTypeHandle *handle, const char *str)
Set the name of this surface type.
HRESULT tfVertexSolverSurfaceHandle_isOutside(struct tfVertexSolverSurfaceHandleHandle *handle, tfFloatP_t *pos, bool *result)
Test whether a point is on the outer side.
HRESULT tfVertexSolverSurfaceHandle_getArea(struct tfVertexSolverSurfaceHandleHandle *handle, tfFloatP_t *result)
Get the area.
HRESULT tfVertexSolverSurfaceHandle_extend(struct tfVertexSolverSurfaceHandleHandle *handle, unsigned int vertIdxStart, tfFloatP_t *pos, struct tfVertexSolverSurfaceHandleHandle *newObj)
Create a surface from two vertices and a position.
HRESULT tfVertexSolverSurfaceHandle_neighborVertices(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverVertexHandleHandle *v, struct tfVertexSolverVertexHandleHandle *v1, struct tfVertexSolverVertexHandleHandle *v2)
Connected vertices on the same surface.
HRESULT tfVertexSolverSurfaceHandle_destroySurface(struct tfVertexSolverSurfaceHandleHandle *handle)
Destroy the surface.
HRESULT tfVertexSolverSurfaceHandle_destroySurfaceC(struct tfVertexSolverSurfaceHandleHandle *handle)
Destroy an instance.
HRESULT tfVertexSolverSurfaceType_init(struct tfVertexSolverSurfaceTypeHandle *handle)
Initialize a new instance.
HRESULT tfVertexSolverSurfaceType_isRegistered(struct tfVertexSolverSurfaceTypeHandle *handle, bool *result)
Tests whether this type is registered.
HRESULT tfVertexSolverSurfaceHandle_splitBy(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverVertexHandleHandle *v1, struct tfVertexSolverVertexHandleHandle *v2, struct tfVertexSolverSurfaceHandleHandle *newObj)
Split into two surfaces.
HRESULT tfVertexSolverSurfaceHandle_str(struct tfVertexSolverSurfaceHandleHandle *handle, char **str, unsigned int *numChars)
Get a summary string.
HRESULT tfVertexSolverSurfaceType_replace(struct tfVertexSolverSurfaceTypeHandle *handle, struct tfVertexSolverVertexHandleHandle *toReplace, tfFloatP_t *lenCfs, unsigned int numLenCfs, struct tfVertexSolverSurfaceHandleHandle *newObj)
Replace a vertex with a surface. Vertices are created for the surface along every destroyed edge.
HRESULT tfVertexSolverSurfaceHandle_insertVertexAt(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverVertexHandleHandle *v, const int &idx)
Insert a vertex at a location in the list of vertices.
HRESULT tfVertexSolverSurfaceHandle_getVolumeContr(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverBodyHandleHandle *body, tfFloatP_t *result)
Get the volume that this surface contributes to a body.
HRESULT tfVertexSolverSurfaceHandle_getUnnormalizedNormal(struct tfVertexSolverSurfaceHandleHandle *handle, tfFloatP_t **result)
Get the surface unnormalized normal.
HRESULT tfVertexSolverSurfaceHandle_connectedSurfaces(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverSurfaceHandleHandle **objs, int *numObjs)
Surfaces that share at least one vertex.
HRESULT tfVertexSolverSurfaceHandle_fromString(struct tfVertexSolverSurfaceHandleHandle *handle, const char *s)
Create an instance from a JSON string representation.
HRESULT tfVertexSolverSurfaceHandle_findVertex(struct tfVertexSolverSurfaceHandleHandle *handle, tfFloatP_t *dir, struct tfVertexSolverVertexHandleHandle *result)
Find a vertex that defines this surface.
HRESULT tfVertexSolverSurfaceType_getInstances(struct tfVertexSolverSurfaceTypeHandle *handle, struct tfVertexSolverSurfaceHandleHandle **objs, unsigned int *numObjs)
Get the list of instances that belong to this type.
HRESULT tfVertexSolverSurfaceHandle_getVertexMass(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverVertexHandleHandle *v, tfFloatP_t *result)
Get the mass contribution of a vertex to this surface; only used in 2D simulation.
HRESULT tfVertexSolverSurfaceType_initD(struct tfVertexSolverSurfaceTypeHandle *handle, struct tfVertexSolverSurfaceTypeSpec sdef)
Initialize an instance from a definition.
HRESULT tfVertexSolverSurfaceHandle_replaceVertexAt(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverVertexHandleHandle *toInsert, const int &idx)
Replace a vertex at a location in the list of vertices.
HRESULT tfVertexSolverBindSurfaceTypeAdhesion(struct tfVertexSolverSurfaceTypeHandle **stypes, struct tfVertexSolverSurfaceTypeSpec *sdefs, unsigned int numTypes)
Bind adhesion for all types with matching specification.
HRESULT tfVertexSolverSurfaceHandle_extrude(struct tfVertexSolverSurfaceHandleHandle *handle, unsigned int vertIdxStart, tfFloatP_t normLen, struct tfVertexSolverSurfaceHandleHandle *newObj)
Create a surface from two vertices of a surface in a mesh by extruding along the normal of the surfac...
HRESULT tfVertexSolverSurfaceHandle_replaceBodyAt(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverBodyHandleHandle *toInsert, const int &idx)
Replace a body at a location in the list of bodies.
HRESULT tfVertexSolverSurfaceType_createSurfaceVA(struct tfVertexSolverSurfaceTypeHandle *handle, struct tfVertexSolverVertexHandleHandle ***vertices, unsigned int numSurfaces, unsigned int *numVerts, struct tfVertexSolverSurfaceHandleHandle **newObjs)
Construct a surface of this type from a set of vertices.
HRESULT tfVertexSolverSurfaceHandle_connectedSurfacesS(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverVertexHandleHandle **verts, unsigned int numVerts, struct tfVertexSolverSurfaceHandleHandle **objs, int *numObjs)
Surfaces that share at least one vertex in a set of vertices.
HRESULT tfVertexSolverSurfaceHandle_getNormal(struct tfVertexSolverSurfaceHandleHandle *handle, tfFloatP_t **result)
Get the surface normal.
HRESULT tfVertexSolverSurfaceHandle_insertVertexBetween(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverVertexHandleHandle *toInsert, struct tfVertexSolverVertexHandleHandle *v1, struct tfVertexSolverVertexHandleHandle *v2)
Insert a vertex between two vertices.
HRESULT tfVertexSolverSurfaceHandle_addBody(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverBodyHandleHandle *b)
Add a body.
HRESULT tfVertexSolverSurfaceHandle_insertVertexBefore(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverVertexHandleHandle *v, struct tfVertexSolverVertexHandleHandle *before)
Insert a vertex before another vertex.
HRESULT tfVertexSolverSurfaceType_objType(struct tfVertexSolverSurfaceTypeHandle *handle, unsigned int *label)
Get the mesh object type.
HRESULT tfVertexSolverSurfaceHandle_init(struct tfVertexSolverSurfaceHandleHandle *handle, int id)
Initialize an instance.
HRESULT tfVertexSolverSurfaceHandle_objType(struct tfVertexSolverSurfaceHandleHandle *handle, unsigned int *label)
Get the mesh object type.
HRESULT tfVertexSolverFindSurfaceTypeFromName(const char *name, struct tfVertexSolverSurfaceTypeHandle *result)
Get a registered type by name.
HRESULT tfVertexSolverSurfaceType_createSurfaceIO(struct tfVertexSolverSurfaceTypeHandle *handle, struct tfIoThreeDFFaceDataHandle *face, struct tfVertexSolverSurfaceHandleHandle *newObj)
Construct a surface of this type from a face.
HRESULT tfVertexSolverSurfaceHandle_getVelocity(struct tfVertexSolverSurfaceHandleHandle *handle, tfFloatP_t **result)
Get the velocity, calculated as the velocity of the centroid.
HRESULT tfVertexSolverSurfaceHandle_merge(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverSurfaceHandleHandle *toRemove, tfFloatP_t *lenCfs, unsigned int numLenCfs)
Merge with a surface. The passed surface is destroyed.
HRESULT tfVertexSolverSurfaceType_getDensity(struct tfVertexSolverSurfaceTypeHandle *handle, tfFloatP_t *result)
Get the density of the surface type; only used in 2D simulation.
HRESULT tfVertexSolverSurfaceHandle_refreshBodies(struct tfVertexSolverSurfaceHandleHandle *handle)
Refresh internal ordering of defined bodies.
struct tfVertexSolverSurfaceTypeSpec tfVertexSolverSurfaceTypeSpec_init()
Get a default definition.
HRESULT tfVertexSolverSurfaceType_str(struct tfVertexSolverSurfaceTypeHandle *handle, char **str, unsigned int *numChars)
Get a summary string.
HRESULT tfVertexSolverSurfaceHandle_validate(struct tfVertexSolverSurfaceHandleHandle *handle, bool *result)
Validate the body.
HRESULT tfVertexSolverSurfaceHandle_findBody(struct tfVertexSolverSurfaceHandleHandle *handle, tfFloatP_t *dir, struct tfVertexSolverBodyHandleHandle *result)
Find a body that this surface defines.
HRESULT tfVertexSolverSurfaceType_createSurfaceV(struct tfVertexSolverSurfaceTypeHandle *handle, struct tfVertexSolverVertexHandleHandle **vertices, unsigned int numVerts, struct tfVertexSolverSurfaceHandleHandle *newObj)
Construct a surface of this type from a set of vertices.
HRESULT tfVertexSolverSurfaceType_createSurfaceP(struct tfVertexSolverSurfaceTypeHandle *handle, tfFloatP_t **positions, unsigned int numPositions, struct tfVertexSolverSurfaceHandleHandle *newObj)
Construct a surface of this type from a set of positions.
HRESULT tfVertexSolverSurfaceHandle_destroySurfaces(struct tfVertexSolverSurfaceHandleHandle **handles, unsigned int numObjs)
Destroy surfaces.
HRESULT tfVertexSolverCreateSurfaceByIOData(struct tfIoThreeDFFaceDataHandle *face, struct tfVertexSolverSurfaceHandleHandle *newObj)
Construct a surface from a face.
HRESULT tfVertexSolverSurfaceHandle_neighborSurfaces(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverSurfaceHandleHandle **objs, int *numObjs)
Connected surfaces on the same body.
HRESULT tfVertexSolverSurfaceHandle_getVertices(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverVertexHandleHandle **objs, int *numObjs)
Get the vertices that define the surface.
HRESULT tfVertexSolverSurfaceHandle_setStyle(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfRenderingStyleHandle *s)
Set the surface style.
HRESULT tfVertexSolverSurfaceHandle_addVertex(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverVertexHandleHandle *v)
Add a vertex.
HRESULT tfVertexSolverSurfaceType_nPolygon(struct tfVertexSolverSurfaceTypeHandle *handle, unsigned int n, tfFloatP_t *center, tfFloatP_t radius, tfFloatP_t *ax1, tfFloatP_t *ax2, struct tfVertexSolverSurfaceHandleHandle *newObj)
Construct a polygon with n vertices circumscribed on a circle.
HRESULT tfVertexSolverSurfaceHandle_normalDistance(struct tfVertexSolverSurfaceHandleHandle *handle, tfFloatP_t *pos, tfFloatP_t *result)
Get the normal distance to a point; negative distance means that the point is on the inner side.
HRESULT tfVertexSolverSurfaceHandle_getPerimeter(struct tfVertexSolverSurfaceHandleHandle *handle, tfFloatP_t *result)
Get the perimeter.
HRESULT tfVertexSolverSurfaceHandle_replaceVertexWith(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverVertexHandleHandle *toInsert, struct tfVertexSolverVertexHandleHandle *toRemove)
Replace a vertex with another vertex.
HRESULT tfVertexSolverSurfaceHandle_sharedContiguousVertices(struct tfVertexSolverSurfaceHandleHandle *handle, struct tfVertexSolverSurfaceHandleHandle *other, unsigned int edgeLabel, struct tfVertexSolverVertexHandleHandle **objs, int *numObjs)
Get the vertices of a contiguous shared edge with another surface.