- Timestamp:
- Jul 16, 2014 4:40:32 PM (10 years ago)
- Location:
- branches/1.3/gui/src
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3/gui/src/Makefile.in
r3658 r4515 27 27 CFLAGS = @CFLAGS@ -fPIC 28 28 TCL_VERSION = @TCL_VERSION@ 29 TCLTK_SRCS = -I../../../runtime/tcl8.4.19/generic -I../../../runtime/tk8.4.19/generic -I../../../runtime/tk8.4.19/unix 29 30 TCL_LIB_SPEC = @TCL_LIB_SPEC@ 30 31 TK_LIB_SPEC = @TK_LIB_SPEC@ 31 32 TK_XLIBSW = @TK_XLIBSW@ 33 VTK_VERSION = @VTK_VERSION@ 34 VTK_TCL_DIR = @VTK_TCL_DIR@ 35 ENABLE_VTK = @ENABLE_VTK@ 36 ENABLE_VTK_DICOM= @ENABLE_VTK_DICOM@ 37 VTK_LIB_SPEC = 32 38 33 39 CC_SWITCHES = $(SHLIB_CFLAGS) $(CFLAGS) $(CFLAGS_DEBUG) $(INCLUDES) $(DEFINES) … … 37 43 -I$(includedir) 38 44 version = @PACKAGE_VERSION@ 39 DEFINES = -DPACKAGE_VERSION=\"$(version)\" 45 DEFINES = -DPACKAGE_VERSION=\"$(version)\" 40 46 41 47 RANLIB = @RANLIB@ … … 47 53 48 54 LIBS = \ 49 -L$(libdir) $( TCL_LIB_SPEC) $(TK_LIB_SPEC) $(TK_XLIBSW) -lm55 -L$(libdir) $(VTK_LIB_SPEC) $(TCL_LIB_SPEC) $(TK_LIB_SPEC) $(TK_XLIBSW) -lm 50 56 51 57 OBJS = \ … … 54 60 RpCanvPlacard.o \ 55 61 RpDiffview.o \ 62 RpDxToVtk.o \ 63 RpPdbToVtk.o \ 56 64 RpReadPoints.o \ 57 RpDxToVtk.o \ 58 RpPdbToVtk.o 65 RpListbox.o \ 66 RpSqueezer.o 67 68 ifeq ($(ENABLE_VTK),yes) 69 INCLUDES += -I$(includedir)/vtk-$(VTK_VERSION) 70 OBJS += RpDicomToVtk.o 71 VTK_LIB_SPEC += -lvtkIOCore-$(VTK_VERSION) -lvtkIOLegacy-$(VTK_VERSION) -lvtkIOImage-$(VTK_VERSION) -lvtkCommonCore-$(VTK_VERSION) 72 DEFINES += -DENABLE_VTK 73 74 ifeq ($(ENABLE_VTK_DICOM),yes) 75 VTK_LIB_SPEC += -lvtkDICOM 76 DEFINES += -DENABLE_VTK_DICOM -DUSE_VTK_DICOM_PACKAGE 77 endif 78 endif 79 59 80 60 81 name = RapptureGUI$(version) … … 73 94 $(INSTALL) -m 555 $(lib) $(destdir) 74 95 96 RpListbox.o: RpListbox.c 97 $(CC) $(CC_SWITCHES) $(TCLTK_SRCS) -c $? 75 98 .cc.o: 76 99 $(CXX) $(CXX_SWITCHES) -c $? 77 100 .c.o: 78 $(CC) $(CC_SWITCHES) -c $?101 $(CC) $(CC_SWITCHES) -c $? 79 102 80 103 clean: -
branches/1.3/gui/src/RapptureGUI_Init.c
r3658 r4515 25 25 extern Tcl_AppInitProc RpCanvHotspot_Init; 26 26 extern Tcl_AppInitProc RpCanvPlacard_Init; 27 extern Tcl_AppInitProc RpDiffview_Init; 28 extern Tcl_AppInitProc RpListbox_Init; 29 extern Tcl_AppInitProc RpReadPoints_Init; 30 extern Tcl_AppInitProc RpSqueezer_Init; 31 27 32 extern Tcl_AppInitProc RpDxToVtk_Init; 28 33 extern Tcl_AppInitProc RpPdbToVtk_Init; 29 extern Tcl_AppInitProc RpDiffview_Init; 30 extern Tcl_AppInitProc RpReadPoints_Init; 34 #ifdef ENABLE_VTK 35 extern Tcl_AppInitProc RpDicomToVtk_Init; 36 #endif 31 37 32 38 #ifdef BUILD_Rappture … … 49 55 return TCL_ERROR; 50 56 } 57 if (RpListbox_Init(interp) != TCL_OK) { 58 return TCL_ERROR; 59 } 60 if (RpReadPoints_Init(interp) != TCL_OK) { 61 return TCL_ERROR; 62 } 63 if (RpSqueezer_Init(interp) != TCL_OK) { 64 return TCL_ERROR; 65 } 66 if (RpCanvHotspot_Init(interp) != TCL_OK) { 67 return TCL_ERROR; 68 } 51 69 if (RpDxToVtk_Init(interp) != TCL_OK) { 52 70 return TCL_ERROR; … … 55 73 return TCL_ERROR; 56 74 } 57 if (RpReadPoints_Init(interp) != TCL_OK) { 75 #ifdef ENABLE_VTK 76 if (RpDicomToVtk_Init(interp) != TCL_OK) { 58 77 return TCL_ERROR; 59 78 } 60 if (RpCanvHotspot_Init(interp) != TCL_OK) { 61 return TCL_ERROR; 62 } 79 #endif 63 80 return TCL_OK; 64 81 } -
branches/1.3/gui/src/RpDxToVtk.c
r3895 r4515 73 73 74 74 if (p >= endPtr) { 75 Tcl_AppendResult(interp, "unexpected EOF in reading points", 76 (char *)NULL); 75 Tcl_AppendResult(interp, "unexpected EOF in reading field values", 76 (char *)NULL); 77 free(array); 77 78 return TCL_ERROR; 78 79 } 79 80 value = strtod(p, &nextPtr); 80 81 if (nextPtr == p) { 81 Tcl_AppendResult(interp, "bad value found in reading points", 82 (char *)NULL); 82 Tcl_AppendResult(interp, "bad value found in reading field values", 83 (char *)NULL); 84 free(array); 83 85 return TCL_ERROR; 84 86 } … … 122 124 123 125 if (p >= endPtr) { 124 Tcl_AppendResult(interp, "unexpected EOF in reading points", 125 (char *)NULL); 126 Tcl_AppendResult(interp, "unexpected EOF in reading field values", 127 (char *)NULL); 128 free(array); 126 129 return TCL_ERROR; 127 130 } 128 131 value = strtod(p, &nextPtr); 129 132 if (nextPtr == p) { 130 Tcl_AppendResult(interp, "bad value found in reading points", 131 (char *)NULL); 133 Tcl_AppendResult(interp, "bad value found in reading field values", 134 (char *)NULL); 135 free(array); 132 136 return TCL_ERROR; 133 137 } … … 169 173 170 174 if (p >= endPtr) { 171 Tcl_AppendResult(interp, "unexpected EOF in reading points", 172 (char *)NULL); 175 Tcl_AppendResult(interp, "unexpected EOF in reading field values", 176 (char *)NULL); 177 free(array); 173 178 return TCL_ERROR; 174 179 } 175 180 value = strtod(p, &nextPtr); 176 181 if (nextPtr == p) { 177 Tcl_AppendResult(interp, "bad value found in reading points", 178 (char *)NULL); 182 Tcl_AppendResult(interp, "bad value found in reading field values", 183 (char *)NULL); 184 free(array); 179 185 return TCL_ERROR; 180 186 } … … 246 252 return TCL_OK; 247 253 } 254 255 static int 256 GetUniformFieldVectors(Tcl_Interp *interp, int nPoints, int *counts, 257 char **stringPtr, const char *endPtr, Tcl_Obj *objPtr) 258 { 259 int i; 260 const char *p; 261 char mesg[2000]; 262 double *array; 263 int iX, iY, iZ; 264 265 p = *stringPtr; 266 array = malloc(sizeof(double) * nPoints * 3); 267 if (array == NULL) { 268 return TCL_ERROR; 269 } 270 iX = iY = iZ = 0; 271 for (i = 0; i < nPoints; i++) { 272 double x, y, z; 273 char *nextPtr; 274 int loc; 275 276 if (p >= endPtr) { 277 Tcl_AppendResult(interp, "unexpected EOF in reading vectors", 278 (char *)NULL); 279 free(array); 280 return TCL_ERROR; 281 } 282 x = strtod(p, &nextPtr); 283 if (nextPtr == p) { 284 Tcl_AppendResult(interp, "bad value found in reading vectors", 285 (char *)NULL); 286 free(array); 287 return TCL_ERROR; 288 } 289 p = nextPtr; 290 y = strtod(p, &nextPtr); 291 if (nextPtr == p) { 292 Tcl_AppendResult(interp, "bad value found in reading vectors", 293 (char *)NULL); 294 free(array); 295 return TCL_ERROR; 296 } 297 p = nextPtr; 298 z = strtod(p, &nextPtr); 299 if (nextPtr == p) { 300 Tcl_AppendResult(interp, "bad value found in reading vectors", 301 (char *)NULL); 302 free(array); 303 return TCL_ERROR; 304 } 305 p = nextPtr; 306 loc = iZ*counts[0]*counts[1] + iY*counts[0] + iX; 307 if (++iZ >= counts[2]) { 308 iZ = 0; 309 if (++iY >= counts[1]) { 310 iY = 0; 311 ++iX; 312 } 313 } 314 array[loc*3 ] = x; 315 array[loc*3+1] = y; 316 array[loc*3+2] = z; 317 } 318 for (i = 0; i < nPoints; i++) { 319 sprintf(mesg, "%g %g %g\n", array[i*3], array[i*3+1], array[i*3+2]); 320 Tcl_AppendToObj(objPtr, mesg, -1); 321 } 322 free(array); 323 *stringPtr = (char *)p; 324 return TCL_OK; 325 } 326 248 327 #if defined(DO_WEDGES) && defined(CHECK_WINDINGS) 249 328 static void … … 301 380 int isUniform; 302 381 int isStructuredGrid; 382 int hasVectors; 303 383 int i, ix, iy, iz; 304 384 … … 312 392 dv2[0] = dv2[1] = dv2[2] = 0.0; 313 393 count[0] = count[1] = count[2] = 0; /* Suppress compiler warning. */ 314 isUniform = 1; /* Default to expecting uniform grid */394 isUniform = 0; 315 395 isStructuredGrid = 0; 396 hasVectors = 0; 316 397 317 398 if (objc != 2) { … … 324 405 string += 5; 325 406 length -= 5; 407 } else if (strncmp("<DX>", string, 4) == 0) { 408 string += 4; 409 length -= 4; 326 410 } 327 411 pointsObjPtr = Tcl_NewStringObj("", -1); … … 414 498 &count[2]) == 1) { 415 499 // Z grid 500 isUniform = 0; 501 } else if (sscanf(line, "object %*d class array type %*s shape 3 rank 1" 502 " items %d data follows", &nPoints) == 1) { 503 #ifdef notdef 504 fprintf(stderr, "found class array type shape 3 nPoints=%d\n", 505 nPoints); 506 #endif 507 if (isUniform) { 508 hasVectors = 1; 509 if (GetUniformFieldVectors(interp, nPoints, count, &p, pend, fieldObjPtr) 510 != TCL_OK) { 511 return TCL_ERROR; 512 } 513 } else { 514 // This is a 2D point cloud in xy with a uniform zgrid 515 isUniform = 0; 516 nXYPoints = nPoints; 517 if (nXYPoints < 0) { 518 sprintf(mesg, "bad # points %d", nXYPoints); 519 Tcl_AppendResult(interp, mesg, (char *)NULL); 520 return TCL_ERROR; 521 } 522 points = malloc(sizeof(double) * nXYPoints * 2); 523 if (GetPoints(interp, points, nXYPoints, &p, pend) != TCL_OK) { 524 return TCL_ERROR; 525 } 526 } 416 527 } else if (sscanf(line, "object %*d class array type %*s rank 1 shape 3" 417 " items %d data follows", &nXYPoints) == 1) { 418 // This is a 2D point cloud in xy with a uniform zgrid 419 isUniform = 0; 528 " items %d data follows", &nPoints) == 1) { 420 529 #ifdef notdef 421 fprintf(stderr, "found class array type shape 3 nPoints=%d\n", 422 nPoints); 423 #endif 424 if (nXYPoints < 0) { 425 sprintf(mesg, "bad # points %d", nXYPoints); 426 Tcl_AppendResult(interp, mesg, (char *)NULL); 427 return TCL_ERROR; 428 } 429 points = malloc(sizeof(double) * nXYPoints * 2); 430 if (GetPoints(interp, points, nXYPoints, &p, pend) != TCL_OK) { 431 return TCL_ERROR; 530 fprintf(stderr, "found class array type shape 3 nPoints=%d\n", 531 nPoints); 532 #endif 533 if (isUniform) { 534 hasVectors = 1; 535 if (GetUniformFieldVectors(interp, nPoints, count, &p, pend, fieldObjPtr) 536 != TCL_OK) { 537 return TCL_ERROR; 538 } 539 } else { 540 // This is a 2D point cloud in xy with a uniform zgrid 541 isUniform = 0; 542 nXYPoints = nPoints; 543 if (nXYPoints < 0) { 544 sprintf(mesg, "bad # points %d", nXYPoints); 545 Tcl_AppendResult(interp, mesg, (char *)NULL); 546 return TCL_ERROR; 547 } 548 points = malloc(sizeof(double) * nXYPoints * 2); 549 if (GetPoints(interp, points, nXYPoints, &p, pend) != TCL_OK) { 550 return TCL_ERROR; 551 } 432 552 } 433 553 } else if (sscanf(line, "object %*d class array type %*s rank 0" … … 488 608 sprintf(mesg, "POINT_DATA %d\n", nPoints); 489 609 Tcl_AppendToObj(objPtr, mesg, -1); 490 sprintf(mesg, "SCALARS %s double 1\n", name); 491 Tcl_AppendToObj(objPtr, mesg, -1); 492 sprintf(mesg, "LOOKUP_TABLE default\n"); 493 Tcl_AppendToObj(objPtr, mesg, -1); 610 if (hasVectors) { 611 sprintf(mesg, "VECTORS %s double\n", name); 612 Tcl_AppendToObj(objPtr, mesg, -1); 613 } else { 614 sprintf(mesg, "SCALARS %s double 1\n", name); 615 Tcl_AppendToObj(objPtr, mesg, -1); 616 sprintf(mesg, "LOOKUP_TABLE default\n"); 617 Tcl_AppendToObj(objPtr, mesg, -1); 618 } 494 619 Tcl_AppendObjToObj(objPtr, fieldObjPtr); 495 620 } else if (isStructuredGrid) {
Note: See TracChangeset
for help on using the changeset viewer.