blob: e71b5fe8420d31c26dc1ea0bbb232e2518b64c8d [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2018 Agence spatiale canadienne / Canadian Space Agency
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Pierre Allard,
* Regent L'Archeveque - initial API and implementation
*
* SPDX-License-Identifier: EPL-1.0
*
*******************************************************************************/
package org.eclipse.apogy.addons.geometry.paths.impl;
import java.util.List;
import javax.vecmath.Point3d;
import org.eclipse.apogy.addons.geometry.paths.ApogyAddonsGeometryPathsFactory;
import org.eclipse.apogy.addons.geometry.paths.SplinesUtilities;
import org.eclipse.apogy.addons.geometry.paths.WayPointPath;
import org.eclipse.apogy.common.geometry.data3d.Geometry3DUtilities;
public class CatmullRomWayPointPathInterpolatorCustomImpl extends CatmullRomWayPointPathInterpolatorImpl {
@Override
public WayPointPath process(WayPointPath input) throws Exception {
WayPointPath output = ApogyAddonsGeometryPathsFactory.eINSTANCE.createWayPointPath();
List<Point3d> controlPoints = Geometry3DUtilities.getPoint3dList(input.getPoints());
List<Point3d> resultPoints = SplinesUtilities.generateCatMullSplineArcLengthParam(controlPoints,
getMaximumWayPointsDistance(), getEndControlPointGenerationMode(), getTension(), getProgressMonitor());
output.getPoints().addAll(Geometry3DUtilities.getCartesianPositionCoordinates(resultPoints));
return output;
}
} // CatmullRomWayPointPathInterpolatorImpl