From 063a091d7f67b1d6e76d0021a4c79c01bbe6a69f Mon Sep 17 00:00:00 2001 From: <> Date: Wed, 25 Apr 2018 04:55:03 -0700 Subject: [PATCH] Added example for geo component --- docs/doc-geo.txt | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/docs/doc-geo.txt b/docs/doc-geo.txt index 9b8251f..26b5085 100644 --- a/docs/doc-geo.txt +++ b/docs/doc-geo.txt @@ -98,4 +98,30 @@ Functions When file size is detected to be too small for a given i-th Mesh. - \ No newline at end of file +Example logic to interact with all meshes: + { + // After the file has been read in. + + // Need to know how many meshes are in the file. + struct Header *h = (struct Header*)filedata; + + // Need to know about a specific mesh (how many batches). + struct MeshHeader *mh = NULL; + + // Need to hold information about mesh. + struct Mesh m; + // As a precaution - empty for now. + m.b = NULL; + + unsigned int i; + for (i = 0; i < h -> numMesh; i++) { + DEVIL1GEO.getmeshheader(&mh, i, filedata); + // Allocate space to hold batch data. + m.b = (struct Batch*)malloc(sizeof(struct Batch) * (mh -> numBatch)); + if (m.b != NULL) { + DEVIL1GEO.getmesh(&m, i, filedata, filesize); + // Do whatever you want with the mesh. + free(m.b); + } + } +