SetDatasetMasks
Set dataset mask info
int SetDatasetMasks( LPCTSTR lpcszDatasetName, const vector<uint> & vnMaskIndices = NULL, const vector<int> & vnMaskValues = NULL )
-2 if dataset not found, -3 if both vectors given but not the same size, -4 if vnMaskIndices = NULL but vnMaskValues not, otherwise return number of masked values, which could be smaller then the input vector size if not all given indices are in the range
EX1
// set all cells that are smaller then zero to be masked void Project_SetDatasetMasks_ex1(int nCol = 0) { Worksheet wks = Project.ActiveLayer(); Column cc = wks.Columns(nCol); string str = cc.GetDatasetName(); Dataset aa(wks, nCol); vector<uint> vnInd; for(int ii = 0; ii < aa.GetSize(); ii++) { if(aa[ii] < 0) vnInd.Add(ii); } vector<int> vnVal; vnVal.SetSize(vnInd.GetSize()); vnVal = 1; // set all mask to 1 int nn = Project.SetDatasetMasks(str, vnInd, vnVal); out_int("ret = ", nn); }
Project::GetDatasetMasks
origin.h