| 131 | {} |
| 132 | |
| 133 | bool CommandRasterize::process(ccCommandLineInterface &cmd) |
| 134 | { |
| 135 | cmd.print("[RASTERIZE]"); |
| 136 | |
| 137 | //look for local options |
| 138 | double gridStep = 0; |
| 139 | bool outputCloud = false; |
| 140 | bool outputRasterZ = false; |
| 141 | bool outputRasterSFs = false; |
| 142 | bool outputRasterRGB = false; |
| 143 | bool outputMesh = false; |
| 144 | bool resample = false; |
| 145 | double customHeight = std::numeric_limits<double>::quiet_NaN(); |
| 146 | int vertDir = 2; |
| 147 | ccRasterGrid::ProjectionType projectionType = ccRasterGrid::PROJ_AVERAGE_VALUE; |
| 148 | ccRasterGrid::ProjectionType sfProjectionType = ccRasterGrid::PROJ_AVERAGE_VALUE; |
| 149 | ccRasterGrid::EmptyCellFillOption emptyCellFillStrategy = ccRasterGrid::LEAVE_EMPTY; |
| 150 | ccRasterGrid::DelaunayInterpolationParams dInterpParams; |
| 151 | ccRasterGrid::KrigingParams krigingParams; |
| 152 | { |
| 153 | // force auto-guess |
| 154 | krigingParams.autoGuess = true; |
| 155 | } |
| 156 | QString projStdDevSFDesc, sfProjStdDevSFDesc; |
| 157 | |
| 158 | while (!cmd.arguments().empty()) |
| 159 | { |
| 160 | QString argument = cmd.arguments().front(); |
| 161 | if (ccCommandLineInterface::IsCommand(argument, COMMAND_GRID_OUTPUT_CLOUD)) |
| 162 | { |
| 163 | //local option confirmed, we can move on |
| 164 | cmd.arguments().pop_front(); |
| 165 | |
| 166 | if (outputMesh) |
| 167 | { |
| 168 | cmd.warning("Can't output the grid as a mesh AND a cloud at the same time"); |
| 169 | } |
| 170 | else |
| 171 | { |
| 172 | outputCloud = true; |
| 173 | } |
| 174 | } |
| 175 | else if (ccCommandLineInterface::IsCommand(argument, COMMAND_GRID_OUTPUT_MESH)) |
| 176 | { |
| 177 | //local option confirmed, we can move on |
| 178 | cmd.arguments().pop_front(); |
| 179 | |
| 180 | if (outputCloud) |
| 181 | { |
| 182 | cmd.warning("Can't output the grid as a mesh AND a cloud at the same time"); |
| 183 | } |
| 184 | else |
| 185 | { |
| 186 | outputMesh = true; |
| 187 | } |
| 188 | } |
| 189 | else if (ccCommandLineInterface::IsCommand(argument, COMMAND_GRID_OUTPUT_RASTER_Z)) |
| 190 | { |
no test coverage detected