Changeset 1109
- Timestamp:
- Aug 11, 2008, 8:59:06 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lang/matlab/rpLibResult.cc
r1085 r1109 3 3 * INTERFACE: Matlab Rappture Library Source 4 4 * 5 * [err] = rpLibResult(lib )5 * [err] = rpLibResult(lib,status) 6 6 * 7 7 * ====================================================================== -
trunk/packages/vizservers/nanovis/RpDX.cpp
r1028 r1109 47 47 48 48 if (filename == NULL) { 49 50 49 resultPtr->AddError("filename is NULL"); 50 return; 51 51 } 52 52 // open the file with libdx … … 56 56 _dxobj = DXImportDX((char*)filename,NULL,NULL,NULL,NULL); 57 57 if (_dxobj == NULL) { 58 59 58 resultPtr->AddError("can't import DX file \"%s\"", filename); 59 return; 60 60 } 61 61 … … 66 66 67 67 // FIXME: nanowire will need a different way to parse out the positions 68 // array since it uses a productarray to store its positions.69 // 68 // array since it uses a productarray to store its positions. 69 // Possibly use DXGetProductArray(). 70 70 dxpos = (Array) DXGetComponentValue((Field) _dxobj, (char *)"positions"); 71 71 if (dxpos == NULL) { 72 73 72 resultPtr->AddError("can't get component value of \"positions\""); 73 return; 74 74 } 75 75 DXGetArrayInfo(dxpos, &_n, &type, &category, &_rank, &_shape); … … 86 86 pos = (float*) DXGetArrayData(dxpos); 87 87 if (pos == NULL) { 88 89 88 resultPtr->AddError("DXGetArrayData failed to return positions array"); 89 return; 90 90 } 91 91 … … 95 95 // raise error, data is not a regular grid and we cannot handle it 96 96 resultPtr->AddError("DX says our grid is not regular, we cannot handle this data"); 97 97 return; 98 98 } 99 99 … … 101 101 if (_positions == NULL) { 102 102 // malloc failed, raise error 103 104 103 resultPtr->AddError("malloc of _positions array failed"); 104 return; 105 105 } 106 106 memcpy(_positions,pos,sizeof(float)*_n*_numAxis); … … 110 110 // malloc failed, raise error 111 111 resultPtr->AddError("malloc of _axisLen array failed"); 112 112 return; 113 113 } 114 114 memset(_axisLen, 0, _numAxis); … … 117 117 if (_delta == NULL) { 118 118 resultPtr->AddError("malloc of _delta array failed"); 119 119 return; 120 120 } 121 121 memset(_delta, 0, _numAxis*_numAxis); … … 124 124 if (_origin == NULL) { 125 125 resultPtr->AddError("malloc of _origin array failed"); 126 126 return; 127 127 } 128 128 memset(_origin, 0, _numAxis); … … 131 131 if (_max == NULL) { 132 132 resultPtr->AddError("malloc of _max array failed"); 133 133 return; 134 134 } 135 135 memset(_max, 0, _numAxis); … … 155 155 if (_data == NULL) { 156 156 resultPtr->AddError("malloc of _data array failed"); 157 157 return; 158 158 } 159 159 … … 173 173 default: 174 174 resultPtr->AddError("don't know how to handle data of type %d\n", type); 175 175 return; 176 176 } 177 177 -
trunk/src/core/RpDXWriter.h
r1086 r1109 55 55 56 56 size_t* _positions; // array holding the number of x,y,z points 57 double* _delta; // array holding deltas of the uniform mesh58 double* _origin; // array holding coord of origin57 double* _delta; // array holding deltas of the uniform mesh 58 double* _origin; // array holding coord of origin 59 59 60 60 DXWriter& _writeDxToBuffer(SimpleCharBuffer *dxfile);
Note: See TracChangeset
for help on using the changeset viewer.