Changeset 973 for trunk/vizservers/nanovis/nanovis.cpp
- Timestamp:
- Mar 29, 2008 10:40:15 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/vizservers/nanovis/nanovis.cpp
r955 r973 319 319 // Creates of updates a colormap 1D texture by name. 320 320 TransferFunction* 321 NanoVis:: set_transfunc(const char *name, int nSlots, float *data)321 NanoVis::DefineTransferFunction(const char *name, size_t n, float *data) 322 322 { 323 323 int isNew; … … 327 327 hPtr = Tcl_CreateHashEntry(&tftable, name, &isNew); 328 328 if (isNew) { 329 tf = new TransferFunction(nSlots, data);330 329 tf = new TransferFunction(n, data); 330 Tcl_SetHashValue(hPtr, (ClientData)tf); 331 331 } else { 332 tf = (TransferFunction*)Tcl_GetHashValue(hPtr); 333 tf->update(data); 332 /* 333 * You can't delete the transfer function because many 334 * objects may be holding its pointer. We must update it. 335 */ 336 tf = (TransferFunction *)Tcl_GetHashValue(hPtr); 337 tf->update(n, data); 334 338 } 335 339 return tf;
Note: See TracChangeset
for help on using the changeset viewer.