| /******************************************************************************* |
| * 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, |
| * Sebastien Gemme - initial API and implementation |
| * |
| * SPDX-License-Identifier: EPL-1.0 |
| * |
| *******************************************************************************/ |
| package org.eclipse.apogy.addons.mobility.pathplanners.ui.impl; |
| |
| import javax.vecmath.Point3d; |
| |
| import org.eclipse.apogy.addons.mobility.pathplanners.ui.ApogyAddonsMobilityPathplannersUIPackage; |
| import org.eclipse.apogy.addons.mobility.pathplanners.ui.CircularExclusionZonePresentation; |
| import org.eclipse.apogy.addons.mobility.pathplanners.ui.scene_objects.CircularExclusionZoneSceneObject; |
| import org.eclipse.apogy.common.math.ApogyCommonMathFacade; |
| import org.eclipse.apogy.common.math.Tuple3d; |
| import org.eclipse.emf.common.notify.Notification; |
| |
| public class CircularExclusionZonePresentationCustomImpl extends CircularExclusionZonePresentationImpl { |
| |
| @Override |
| protected void updateSceneObject(Notification notification) { |
| if (this.sceneObject != null) { |
| CircularExclusionZoneSceneObject j3dObject = (CircularExclusionZoneSceneObject) this.sceneObject; |
| |
| if (notification.getFeatureID( |
| CircularExclusionZonePresentation.class) == ApogyAddonsMobilityPathplannersUIPackage.CIRCULAR_EXCLUSION_ZONE_PRESENTATION__TRANSPARENCY) { |
| j3dObject.setTransparency(getTransparency()); |
| } else if (notification.getFeatureID( |
| CircularExclusionZonePresentation.class) == ApogyAddonsMobilityPathplannersUIPackage.CIRCULAR_EXCLUSION_ZONE_PRESENTATION__PRESENTATION_MODE) { |
| j3dObject.setPresentationMode(this.getPresentationMode()); |
| } else if (notification.getFeatureID( |
| CircularExclusionZonePresentation.class) == ApogyAddonsMobilityPathplannersUIPackage.CIRCULAR_EXCLUSION_ZONE_PRESENTATION__HEIGHT) { |
| j3dObject.setHeight(this.getHeight()); |
| } |
| } |
| super.updateSceneObject(notification); |
| } |
| |
| @Override |
| protected void initialSceneObject() { |
| CircularExclusionZoneSceneObject obj = (CircularExclusionZoneSceneObject) this.sceneObject; |
| obj.setHeight(this.getHeight()); |
| obj.setTransparency(this.getTransparency()); |
| obj.setPresentationMode(this.presentationMode); |
| super.initialSceneObject(); |
| } |
| |
| @Override |
| public Tuple3d basicGetCentroid() { |
| Point3d point3d = new Point3d(); |
| if (this.sceneObject != null) { |
| point3d = this.sceneObject.getCentroid(); |
| } |
| |
| return ApogyCommonMathFacade.INSTANCE.createTuple3d(point3d); |
| } |
| } // CircularExclusionZonePresentationImpl |