| /** |
| * Copyright (c) 2016 Canadian Space Agency (CSA) / Agence spatiale canadienne (ASC). |
| * 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 (Pierre.Allard@canada.ca), |
| * Regent L'Archeveque (Regent.Larcheveque@canada.ca), |
| * Sebastien Gemme (Sebastien.Gemme@canada.ca), |
| * Canadian Space Agency (CSA) - Initial API and implementation |
| */ |
| package ca.gc.asc_csa.apogy.addons.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.notify.NotificationChain; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import ca.gc.asc_csa.apogy.addons.ApogyAddonsPackage; |
| import ca.gc.asc_csa.apogy.addons.URLNodeGeometryPlacementAtFeatureOfInterestTool; |
| import ca.gc.asc_csa.apogy.common.math.Matrix4x4; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>URL Node Geometry Placement At Feature Of Interest Tool</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link ca.gc.asc_csa.apogy.addons.impl.URLNodeGeometryPlacementAtFeatureOfInterestToolImpl#getURL <em>URL</em>}</li> |
| * <li>{@link ca.gc.asc_csa.apogy.addons.impl.URLNodeGeometryPlacementAtFeatureOfInterestToolImpl#getCadToToolTransform <em>Cad To Tool Transform</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class URLNodeGeometryPlacementAtFeatureOfInterestToolImpl extends AbstractURLNodeGeometryPlacementAtFeatureOfInterestToolImpl implements URLNodeGeometryPlacementAtFeatureOfInterestTool |
| { |
| /** |
| * The default value of the '{@link #getURL() <em>URL</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getURL() |
| * @generated |
| * @ordered |
| */ |
| protected static final String URL_EDEFAULT = null; |
| /** |
| * The cached value of the '{@link #getURL() <em>URL</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getURL() |
| * @generated |
| * @ordered |
| */ |
| protected String url = URL_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getCadToToolTransform() <em>Cad To Tool Transform</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getCadToToolTransform() |
| * @generated |
| * @ordered |
| */ |
| protected Matrix4x4 cadToToolTransform; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected URLNodeGeometryPlacementAtFeatureOfInterestToolImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return ApogyAddonsPackage.Literals.URL_NODE_GEOMETRY_PLACEMENT_AT_FEATURE_OF_INTEREST_TOOL; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getURL() { |
| return url; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated_NOT |
| */ |
| public void setURL(String newURL) |
| { |
| setURLGen(newURL); |
| getUrlNode().setUrl(newURL); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setURLGen(String newURL) { |
| String oldURL = url; |
| url = newURL; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ApogyAddonsPackage.URL_NODE_GEOMETRY_PLACEMENT_AT_FEATURE_OF_INTEREST_TOOL__URL, oldURL, url)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Matrix4x4 getCadToToolTransform() { |
| return cadToToolTransform; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetCadToToolTransform(Matrix4x4 newCadToToolTransform, NotificationChain msgs) { |
| Matrix4x4 oldCadToToolTransform = cadToToolTransform; |
| cadToToolTransform = newCadToToolTransform; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ApogyAddonsPackage.URL_NODE_GEOMETRY_PLACEMENT_AT_FEATURE_OF_INTEREST_TOOL__CAD_TO_TOOL_TRANSFORM, oldCadToToolTransform, newCadToToolTransform); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated_NOT |
| */ |
| public void setCadToToolTransform(Matrix4x4 newCadToToolTransform) |
| { |
| setCadToToolTransformGen(newCadToToolTransform); |
| |
| if(newCadToToolTransform != null) |
| { |
| getCadTransformNode().setTransformation(newCadToToolTransform.asMatrix4d()); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setCadToToolTransformGen(Matrix4x4 newCadToToolTransform) { |
| if (newCadToToolTransform != cadToToolTransform) { |
| NotificationChain msgs = null; |
| if (cadToToolTransform != null) |
| msgs = ((InternalEObject)cadToToolTransform).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ApogyAddonsPackage.URL_NODE_GEOMETRY_PLACEMENT_AT_FEATURE_OF_INTEREST_TOOL__CAD_TO_TOOL_TRANSFORM, null, msgs); |
| if (newCadToToolTransform != null) |
| msgs = ((InternalEObject)newCadToToolTransform).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ApogyAddonsPackage.URL_NODE_GEOMETRY_PLACEMENT_AT_FEATURE_OF_INTEREST_TOOL__CAD_TO_TOOL_TRANSFORM, null, msgs); |
| msgs = basicSetCadToToolTransform(newCadToToolTransform, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ApogyAddonsPackage.URL_NODE_GEOMETRY_PLACEMENT_AT_FEATURE_OF_INTEREST_TOOL__CAD_TO_TOOL_TRANSFORM, newCadToToolTransform, newCadToToolTransform)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case ApogyAddonsPackage.URL_NODE_GEOMETRY_PLACEMENT_AT_FEATURE_OF_INTEREST_TOOL__CAD_TO_TOOL_TRANSFORM: |
| return basicSetCadToToolTransform(null, msgs); |
| } |
| return super.eInverseRemove(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case ApogyAddonsPackage.URL_NODE_GEOMETRY_PLACEMENT_AT_FEATURE_OF_INTEREST_TOOL__URL: |
| return getURL(); |
| case ApogyAddonsPackage.URL_NODE_GEOMETRY_PLACEMENT_AT_FEATURE_OF_INTEREST_TOOL__CAD_TO_TOOL_TRANSFORM: |
| return getCadToToolTransform(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case ApogyAddonsPackage.URL_NODE_GEOMETRY_PLACEMENT_AT_FEATURE_OF_INTEREST_TOOL__URL: |
| setURL((String)newValue); |
| return; |
| case ApogyAddonsPackage.URL_NODE_GEOMETRY_PLACEMENT_AT_FEATURE_OF_INTEREST_TOOL__CAD_TO_TOOL_TRANSFORM: |
| setCadToToolTransform((Matrix4x4)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case ApogyAddonsPackage.URL_NODE_GEOMETRY_PLACEMENT_AT_FEATURE_OF_INTEREST_TOOL__URL: |
| setURL(URL_EDEFAULT); |
| return; |
| case ApogyAddonsPackage.URL_NODE_GEOMETRY_PLACEMENT_AT_FEATURE_OF_INTEREST_TOOL__CAD_TO_TOOL_TRANSFORM: |
| setCadToToolTransform((Matrix4x4)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case ApogyAddonsPackage.URL_NODE_GEOMETRY_PLACEMENT_AT_FEATURE_OF_INTEREST_TOOL__URL: |
| return URL_EDEFAULT == null ? url != null : !URL_EDEFAULT.equals(url); |
| case ApogyAddonsPackage.URL_NODE_GEOMETRY_PLACEMENT_AT_FEATURE_OF_INTEREST_TOOL__CAD_TO_TOOL_TRANSFORM: |
| return cadToToolTransform != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (URL: "); |
| result.append(url); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| @Override |
| public String getGeometryURL() |
| { |
| return getURL(); |
| } |
| |
| @Override |
| public Matrix4x4 getGeometryOffsets() |
| { |
| return getCadToToolTransform(); |
| } |
| } //URLNodeGeometryPlacementAtFeatureOfInterestToolImpl |