int BaseFilter::hasSelectedRGB() { if (isFirstSelectedCcPointCloud() != 1) return -1; //get the cloud ccPointCloud * cloud; cloud = getSelectedEntityAsCCPointCloud(); return cloud->hasColors(); }
int BaseFilter::hasSelectedScalarField() { if (isFirstSelectedCcPointCloud() != 1) return -1; ccPointCloud* cloud = getSelectedEntityAsCCPointCloud(); if (!cloud) return -1; return (cloud->hasScalarFields() ? 1 : 0); }
int ExtractSIFT::checkSelected() { //do we have a selected cloud? int have_cloud = isFirstSelectedCcPointCloud(); if (have_cloud != 1) return -11; //do we have at least a scalar field? int have_sf = hasSelectedScalarField(); if (have_sf == 1) return 1; //also having rgb data will be enough if (hasSelectedRGB() != 0) return 1; return -51; }