| /******************************************************************************* |
| * 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.impl; |
| |
| import javax.vecmath.Matrix4d; |
| |
| import org.eclipse.apogy.common.topology.ApogyCommonTopologyFactory; |
| import org.eclipse.apogy.common.topology.Node; |
| import org.eclipse.apogy.common.topology.TransformNode; |
| import org.eclipse.apogy.common.topology.URLNode; |
| |
| public abstract class AbstractURLNodeGeometryPlacementAtFeatureOfInterestToolCustomImpl |
| extends AbstractURLNodeGeometryPlacementAtFeatureOfInterestToolImpl { |
| |
| private TransformNode cadTransformNode; |
| private URLNode urlNode = null; |
| |
| @Override |
| public URLNode basicGetUrlNode() { |
| if (this.urlNode == null) { |
| this.urlNode = ApogyCommonTopologyFactory.eINSTANCE.createURLNode(); |
| this.urlNode.setUrl(getGeometryURL()); |
| } |
| |
| return this.urlNode; |
| } |
| |
| @Override |
| public TransformNode basicGetCadTransformNode() { |
| if (this.cadTransformNode == null) { |
| this.cadTransformNode = ApogyCommonTopologyFactory.eINSTANCE.createTransformNode(); |
| this.cadTransformNode.setNodeId(getName()); |
| if (getGeometryOffsets() != null) { |
| this.cadTransformNode.setTransformation(getGeometryOffsets().asMatrix4d()); |
| } else { |
| Matrix4d m = new Matrix4d(); |
| m.setIdentity(); |
| this.cadTransformNode.setTransformation(m); |
| } |
| } |
| return this.cadTransformNode; |
| } |
| |
| @Override |
| public Node loadGeometry() { |
| getCadTransformNode().getChildren().add(getUrlNode()); |
| return getCadTransformNode(); |
| } |
| |
| } // AbstractURLNodeGeometryPlacementAtFeatureOfInterestToolImpl |