Hi all,
The GNU Triangulated Surface Library is a c library used to create 3D
meshed surfaces.
http://gts.sourceforge.net/
They are able to create meshed surfaces based on a mathematical
description of the surface desired. This is important to me as I can
take a meshed shape and get a good approximation for its aerodynamics.
The library should also allow me to examine more arbitrary shapes for
reentering spacecraft.
I have generated a dll of the library and am now trying to set up JNA
to access it.
One of the functions I need to have access to is:
GtsSurface* gts_surface_new (GtsSurfaceClass *klass,
GtsFaceClass *face_class,
GtsEdgeClass *edge_class,
GtsVertexClass *vertex_class);
-------Example of use-------------------
GtsSurface * surface;
surface = gts_surface_new (gts_surface_class (),
gts_face_class (),
gts_edge_class (),
gts_vertex_class ());
-------------------------------------------
I believe that I would have to create classes that extend Structure
for GtsSurface, GtsSurfaceClass, GtsFaceClass, GtsEdgeClass,
GtsVertexClass and onwards recursively until I get to inputs such as
double, int, char, etc. Wanted to make sure of this before I got too
deep.
To take one example from the classes above, GtsSurfaceClass, the
function I would be using to create the first argument "klass" is:
GtsSurfaceClass* gts_surface_class(void);
---------- GtsSurfaceClass is a struct defined as ---------------
typedef struct {
GtsObjectClass parent_class;
void (* add_face) (GtsSurface *, GtsFace *);
void (* remove_face) (GtsSurface *, GtsFace *);
} GtsSurfaceClass;
---------------------------------------------------------------------
I don't need to access the functions within GtsSurfaceClass so would I
just create a class called GtsSurfaceClass that extends Structure like
so?
public class GtsSurfaceClass extends Structure { }
Do I have to include the functions that I believe I would need a Callback for?
thanks,
Richard