| 1956 | } |
| 1957 | |
| 1958 | static bool ReadDensityType(ccCommandLineInterface& cmd, CCCoreLib::GeometricalAnalysisTools::Density& density) |
| 1959 | { |
| 1960 | if (cmd.arguments().empty()) |
| 1961 | { |
| 1962 | return cmd.error(QObject::tr("Missing parameter: density type after \"-%1\" (KNN/SURFACE/VOLUME)").arg(COMMAND_DENSITY_TYPE)); |
| 1963 | } |
| 1964 | |
| 1965 | //read option confirmed, we can move on |
| 1966 | QString typeArg = cmd.arguments().takeFirst().toUpper(); |
| 1967 | if (typeArg == "KNN") |
| 1968 | { |
| 1969 | density = CCCoreLib::GeometricalAnalysisTools::DENSITY_KNN; |
| 1970 | } |
| 1971 | else if (typeArg == "SURFACE") |
| 1972 | { |
| 1973 | density = CCCoreLib::GeometricalAnalysisTools::DENSITY_2D; |
| 1974 | } |
| 1975 | else if (typeArg == "VOLUME") |
| 1976 | { |
| 1977 | density = CCCoreLib::GeometricalAnalysisTools::DENSITY_3D; |
| 1978 | } |
| 1979 | else |
| 1980 | { |
| 1981 | return cmd.error(QObject::tr("Invalid parameter: density type is expected after \"-%1\" (KNN/SURFACE/VOLUME)").arg(COMMAND_DENSITY_TYPE)); |
| 1982 | } |
| 1983 | |
| 1984 | return true; |
| 1985 | } |
| 1986 | |
| 1987 | CommandApproxDensity::CommandApproxDensity() |
| 1988 | : ccCommandLineInterface::Command(QObject::tr("Approx Density"), COMMAND_APPROX_DENSITY) |