Project::GetDatasetMasks

Description

Get dataset mask info

Syntax

int GetDatasetMasks( LPCTSTR lpcszDatasetName, vector<uint> & vnMaskIndices, vector<int> & vnMaskValues )

Parameters

lpcszDatasetName
[input]name of the Dataset object
vnMaskIndices
[output] array of indices where masks were found
vnMaskValues
[output] array of mask values at corresponding indices as vnMaskIndices, all entries should be >0

Return

-2 if dataset not found, otherwise return number of masked values found, 0 indicat the dataset has no masked points

Examples

EX1

// test each cells in nColMask and if ture, put mask value into corresponding cell in nColShow
void Project_GetDatasetMasks_ex1(int nColMask = 0, int nColShow = 1)
{
   Worksheet wks = Project.ActiveLayer();
   Column cm = wks.Columns(nColMask);
   Column cs = wks.Columns(nColShow);
   
   string strM = cm.GetDatasetName();
   string strS = cs.GetDatasetName();
   
   Dataset am(wks, nColMask);
   Dataset as(wks, nColShow);
   
   vector<uint> vnInd;
   vector<int> vnVal;
   int nn = Project.GetDatasetMasks(strM, vnInd, vnVal);
   if(nn > 0)
   {
       as.SetSize(am.GetSize());
       as = 0; // first fill with 0
       for(int ii = 0; ii < vnInd.GetSize(); ii++)
       {
           as[vnInd[ii]] = vnVal[ii];
       }
   }
}

Remark

See Also

Project::GetDatasetInfo, Project::GetDatasetPlotList, Project::SetDatasetMasks

Header to Include

origin.h