aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgoodale <goodale@bfcf8e34-485d-4d46-a995-1fd6fa6fb178>2005-01-28 22:56:02 +0000
committergoodale <goodale@bfcf8e34-485d-4d46-a995-1fd6fa6fb178>2005-01-28 22:56:02 +0000
commita6bc7ceebaf4bed1692923a3738cfc874f6d0b39 (patch)
treeb96f4e5d23388b5a5a0ac7f7c32281d5f4dab07a
parent27a9635a85be3536604f2486de9b5459df0a24ed (diff)
Slightly modified patch from Ian Wesley-Smith to send normals of
isosurfaces to client. Modification is to have this controlled by a parameter to maintain compatibility with old isoviewer. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IsoSurfacer/trunk@87 bfcf8e34-485d-4d46-a995-1fd6fa6fb178
-rw-r--r--src/IsoSurfacer.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/IsoSurfacer.c b/src/IsoSurfacer.c
index 98dca94..f9f9671 100644
--- a/src/IsoSurfacer.c
+++ b/src/IsoSurfacer.c
@@ -15,7 +15,6 @@
#include <string.h>
#include <stdlib.h>
-
#include "cctk.h"
#include "cctk_DefineThorn.h"
#include "cctk_Parameters.h"
@@ -454,12 +453,17 @@ void WriteSock(const cGH *GH, polypatch *totals, isosurfacerGH *myGH,
const char *fullname, int isoindex,
CCTK_REAL4 IsoValue)
{
+ DECLARE_CCTK_PARAMETERS;
/* Was: parms->timestep, which was callnumber from above. */
char tmpstring[128];
CCTK_INT4 *polys;
CCTK_REAL4 *verts;
+ CCTK_REAL4 *norms;
CCTK_INT4 tmppolys[3] = {0,0,0};
CCTK_REAL4 tmpverts[3] = {0.0,0.0,0.0};
+ CCTK_REAL4 tmpnorms[3] = {0.0,0.0,0.0};
+
+ int x=0;
isoindex = isoindex;
IsoValue = IsoValue;
@@ -478,6 +482,11 @@ void WriteSock(const cGH *GH, polypatch *totals, isosurfacerGH *myGH,
3*totals->nverts,
Int32,
(CCTK_INT4 *)verts);
+ /*fprintf(stderr, "nverts:%d\n", totals->nverts);
+ for(x=0;x<3*totals->nverts;x++)
+ {
+ fprintf(stderr, "vert[%d]%f\n", x, verts[x]);
+ }*/
/********Now write polygons**********/
*tmpstring='c';
polys = totals->npolys > 0 ? totals->polys : tmppolys;
@@ -485,6 +494,23 @@ void WriteSock(const cGH *GH, polypatch *totals, isosurfacerGH *myGH,
3*totals->npolys,
Float32,
(CCTK_INT4 *)polys);
+ /*fprintf(stderr, "npolys:%d\n", totals->npolys);
+ for(x=0;x<3*totals->npolys;x++)
+ {
+ fprintf(stderr, "poly[%d]%d\n", x, polys[x]);
+ }*/
+
+ /********Now write normals**********/
+
+ if(send_normals)
+ {
+ *tmpstring='n';
+ norms = totals->nnorms > 0 ? totals->norms : tmpnorms;
+ IsoWriteDataToClients(tmpstring,
+ 3*totals->nnorms,
+ Int32,
+ (CCTK_INT4 *)norms);
+ }
}
/***************************************************************************/