[seek-dev] change signature for convex hull actor

Matt Jones jones at nceas.ucsb.edu
Wed Nov 24 15:25:13 PST 2004

Hi Jianting,

I took a look at your convex hull cpp code and I think we should make a 
slight change to make the actor easier to use.  Right now the actor 
requires the number of points as input which is not necessary.  Could 
you change the function in HullMain.cpp:

int GISHull (char *pointDataFile, int numSitePoints, char *hullDataFile)


int GISHull (char *pointDataFile, char *hullDataFile)

This can be implemented by opening the file and reading it, allocating 
memory for the points as you go andy dynamically resizing the space for 
the Points structure. I would probably allocate space for 100 points at 
a time, and then truncate once you know the total number of points read 
when you reach EOF (fscanf will return the EOF when it encoutners it).   
You can track the number of points as you read them in a counter and if 
the points < 3 then return your error value (as you do now).  This will 
simplify calling the actor, and will make the GISHull function more 
robust (because it current is fragile if the numSitePoints is greater 
than the actual number of points in the file.

Could you make these changes?  If there are analogous simplifications in 
the rasterization and buffering actors it would be good to make those 
too, but they are less important.  Thanks,


More information about the Seek-dev mailing list