Changeset 2922 for trunk/packages/vizservers
- Timestamp:
- Apr 1, 2012 10:34:01 PM (12 years ago)
- Location:
- trunk/packages/vizservers/nanovis
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/nanovis/Command.cpp
r2880 r2922 1670 1670 } 1671 1671 Rappture::Unirect2d data(1); 1672 if (data. ParseBuffer(interp, buf) != TCL_OK) {1672 if (data.parseBuffer(interp, buf) != TCL_OK) { 1673 1673 return TCL_ERROR; 1674 1674 } … … 2299 2299 Rappture::Unirect2d *dataPtr = (Rappture::Unirect2d *)clientData; 2300 2300 2301 return dataPtr-> LoadData(interp, objc, objv);2301 return dataPtr->loadData(interp, objc, objv); 2302 2302 } 2303 2303 … … 2320 2320 Rappture::Unirect3d *dataPtr = (Rappture::Unirect3d *)clientData; 2321 2321 2322 return dataPtr-> LoadData(interp, objc, objv);2322 return dataPtr->loadData(interp, objc, objv); 2323 2323 } 2324 2324 -
trunk/packages/vizservers/nanovis/FlowCmd.cpp
r2920 r2922 732 732 char *bytes = (char *)buf.bytes(); 733 733 if ((length > 4) && (strncmp(bytes, "<DX>", 4) == 0)) { 734 if (!dataPtr-> ImportDx(result, nComponents, length-4, bytes+4)) {734 if (!dataPtr->importDx(result, nComponents, length-4, bytes+4)) { 735 735 Tcl_AppendResult(interp, result.remark(), (char *)NULL); 736 736 delete dataPtr; … … 738 738 } 739 739 } else if ((length > 10) && (strncmp(bytes, "unirect3d ", 10) == 0)) { 740 if (dataPtr-> ParseBuffer(interp, buf) != TCL_OK) {740 if (dataPtr->parseBuffer(interp, buf) != TCL_OK) { 741 741 delete dataPtr; 742 742 return TCL_ERROR; … … 745 745 Rappture::Unirect2d *u2dPtr; 746 746 u2dPtr = new Rappture::Unirect2d(nComponents); 747 if (u2dPtr-> ParseBuffer(interp, buf) != TCL_OK) {747 if (u2dPtr->parseBuffer(interp, buf) != TCL_OK) { 748 748 delete u2dPtr; 749 749 return TCL_ERROR; 750 750 } 751 dataPtr-> Convert(u2dPtr);751 dataPtr->convert(u2dPtr); 752 752 delete u2dPtr; 753 753 } else { 754 754 TRACE("header is %.14s\n", buf.bytes()); 755 if (!dataPtr-> ImportDx(result, nComponents, length, bytes)) {755 if (!dataPtr->importDx(result, nComponents, length, bytes)) { 756 756 Tcl_AppendResult(interp, result.remark(), (char *)NULL); 757 757 delete dataPtr; … … 815 815 char *bytes = (char *)buf.bytes(); 816 816 if ((length > 4) && (strncmp(bytes, "<DX>", 4) == 0)) { 817 if (!dataPtr-> ImportDx(result, nComponents, length - 4, bytes + 4)) {817 if (!dataPtr->importDx(result, nComponents, length - 4, bytes + 4)) { 818 818 Tcl_AppendResult(interp, result.remark(), (char *)NULL); 819 819 delete dataPtr; … … 821 821 } 822 822 } else if ((length > 10) && (strncmp(bytes, "unirect3d ", 10) == 0)) { 823 if (dataPtr-> ParseBuffer(interp, buf) != TCL_OK) {823 if (dataPtr->parseBuffer(interp, buf) != TCL_OK) { 824 824 delete dataPtr; 825 825 return TCL_ERROR; … … 828 828 Rappture::Unirect2d *u2dPtr; 829 829 u2dPtr = new Rappture::Unirect2d(nComponents); 830 if (u2dPtr-> ParseBuffer(interp, buf) != TCL_OK) {830 if (u2dPtr->parseBuffer(interp, buf) != TCL_OK) { 831 831 delete u2dPtr; 832 832 return TCL_ERROR; 833 833 } 834 dataPtr-> Convert(u2dPtr);834 dataPtr->convert(u2dPtr); 835 835 delete u2dPtr; 836 836 } else { 837 837 TRACE("header is %.14s\n", buf.bytes()); 838 if (!dataPtr-> ImportDx(result, nComponents, length, bytes)) {838 if (!dataPtr->importDx(result, nComponents, length, bytes)) { 839 839 Tcl_AppendResult(interp, result.remark(), (char *)NULL); 840 840 delete dataPtr; -
trunk/packages/vizservers/nanovis/Unirect.cpp
r2882 r2922 41 41 42 42 int 43 Rappture::Unirect2d:: ParseBuffer(Tcl_Interp *interp, Rappture::Buffer &buf)43 Rappture::Unirect2d::parseBuffer(Tcl_Interp *interp, Rappture::Buffer &buf) 44 44 { 45 45 Tcl_Obj *objPtr; … … 51 51 } 52 52 int result; 53 result = LoadData(interp, objc, objv);53 result = loadData(interp, objc, objv); 54 54 Tcl_DecrRefCount(objPtr); 55 55 if ((result != TCL_OK) || (!isInitialized())) { … … 60 60 61 61 int 62 Rappture::Unirect3d:: ParseBuffer(Tcl_Interp *interp, Rappture::Buffer &buf)62 Rappture::Unirect3d::parseBuffer(Tcl_Interp *interp, Rappture::Buffer &buf) 63 63 { 64 64 Tcl_Obj *objPtr; … … 70 70 } 71 71 int result; 72 result = LoadData(interp, objc, objv);72 result = loadData(interp, objc, objv); 73 73 Tcl_DecrRefCount(objPtr); 74 74 if ((result != TCL_OK) || (!isInitialized())) { … … 79 79 80 80 int 81 Rappture::Unirect3d:: LoadData(Tcl_Interp *interp, int objc,81 Rappture::Unirect3d::loadData(Tcl_Interp *interp, int objc, 82 82 Tcl_Obj *const *objv) 83 83 { … … 316 316 317 317 int 318 Rappture::Unirect2d:: LoadData(Tcl_Interp *interp, int objc,318 Rappture::Unirect2d::loadData(Tcl_Interp *interp, int objc, 319 319 Tcl_Obj *const *objv) 320 320 { … … 491 491 492 492 bool 493 Rappture::Unirect3d:: ImportDx(Rappture::Outcome &result, size_t nComponents,493 Rappture::Unirect3d::importDx(Rappture::Outcome &result, size_t nComponents, 494 494 size_t length, char *string) 495 495 { … … 636 636 637 637 bool 638 Rappture::Unirect3d:: Resample(Rappture::Outcome &result, size_t nSamples)638 Rappture::Unirect3d::resample(Rappture::Outcome &result, size_t nSamples) 639 639 { 640 640 Rappture::Mesh1D xgrid(_xMin, _xMax, _xNum); … … 714 714 715 715 void 716 Rappture::Unirect3d:: GetVectorRange()716 Rappture::Unirect3d::getVectorRange() 717 717 { 718 718 assert(_nComponents == 3); 719 TRACE("GetVectorRange\n");720 719 _magMax = -DBL_MAX, _magMin = DBL_MAX; 721 720 size_t i; … … 735 734 } 736 735 } 736 TRACE("GetVectorRange %g %g\n", _magMin, _magMax); 737 737 } 738 738 739 739 bool 740 Rappture::Unirect3d:: Convert(Rappture::Unirect2d *dataPtr)740 Rappture::Unirect3d::convert(Rappture::Unirect2d *dataPtr) 741 741 { 742 742 _initialized = false; -
trunk/packages/vizservers/nanovis/Unirect.h
r2887 r2922 1 1 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ 2 #ifndef _UNIRECT_H3 #define _UNIRECT_H2 #ifndef UNIRECT_H 3 #define UNIRECT_H 4 4 5 5 #include <float.h> … … 55 55 if (_values != NULL) { 56 56 free(_values); 57 58 57 } 58 if (_xUnits != NULL) { 59 59 free(_xUnits); 60 61 60 } 61 if (_yUnits != NULL) { 62 62 free(_yUnits); 63 64 63 } 64 if (_zUnits != NULL) { 65 65 free(_zUnits); 66 67 66 } 67 if (_vUnits != NULL) { 68 68 free(_vUnits); 69 69 } 70 70 } 71 71 … … 177 177 { 178 178 if (_magMin == DBL_MAX) { 179 GetVectorRange();179 getVectorRange(); 180 180 } 181 181 return _magMin; … … 185 185 { 186 186 if (_magMax == -DBL_MAX) { 187 GetVectorRange();187 getVectorRange(); 188 188 } 189 189 return _magMax; … … 204 204 } 205 205 206 int LoadData(Tcl_Interp *interp, int objc, Tcl_Obj *const *objv);207 208 int ParseBuffer(Tcl_Interp *interp, Rappture::Buffer &buf);209 210 bool ImportDx(Rappture::Outcome &result, size_t nComponents,211 212 213 bool Convert(Unirect2d *dataPtr);214 215 bool Resample(Rappture::Outcome &context, size_t nSamples = 30);206 int loadData(Tcl_Interp *interp, int objc, Tcl_Obj *const *objv); 207 208 int parseBuffer(Tcl_Interp *interp, Rappture::Buffer &buf); 209 210 bool importDx(Rappture::Outcome &result, size_t nComponents, 211 size_t length, char *string); 212 213 bool convert(Unirect2d *dataPtr); 214 215 bool resample(Rappture::Outcome &context, size_t nSamples = 30); 216 216 217 217 bool isInitialized() … … 221 221 222 222 private: 223 void GetVectorRange();223 void getVectorRange(); 224 224 225 225 size_t _xNum, _yNum, _zNum; … … 230 230 float _yValueMin, _yValueMax; 231 231 float _zValueMin, _zValueMax; 232 double _magMin, _magMax; 233 232 double _magMin, _magMax; /* Range of magnitudes of vector 233 * data. */ 234 234 char *_xUnits; 235 235 char *_yUnits; … … 258 258 if (_values != NULL) { 259 259 free(_values); 260 260 } 261 261 if (_xUnits != NULL) { 262 262 free(_xUnits); 263 263 } 264 264 if (_yUnits != NULL) { 265 265 free(_yUnits); 266 266 } 267 267 if (_vUnits != NULL) { 268 268 free(_vUnits); … … 359 359 } 360 360 361 int LoadData(Tcl_Interp *interp, int objc, Tcl_Obj *const *objv);362 363 int ParseBuffer(Tcl_Interp *interp, Rappture::Buffer &buf);364 361 int loadData(Tcl_Interp *interp, int objc, Tcl_Obj *const *objv); 362 363 int parseBuffer(Tcl_Interp *interp, Rappture::Buffer &buf); 364 365 365 bool isInitialized() 366 366 { … … 389 389 390 390 #endif 391
Note: See TracChangeset
for help on using the changeset viewer.