Commit 4d12264a authored by Robert Smith's avatar Robert Smith
Browse files

Removed redundant classes



Classes which had been copied between bundles which were being
refactored for the new package structure have had the versions left at
their old locations removed.
Signed-off-by: Robert Smith's avatarRobert Smith <SmithRW@ornl.gov>
parent 9555a069
......@@ -18,8 +18,6 @@ import org.eclipse.ice.datastructures.form.GeometryComponent;
import org.eclipse.ice.viz.service.IVizCanvas;
import org.eclipse.ice.viz.service.IVizService;
import org.eclipse.ice.viz.service.IVizServiceFactory;
import org.eclipse.ice.viz.service.geometry.widgets.ShapeTreeView;
import org.eclipse.ice.viz.service.geometry.widgets.TransformationView;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
......
......@@ -20,7 +20,6 @@ import org.eclipse.ice.client.common.ActionTree;
import org.eclipse.ice.datastructures.ICEObject.ICEObject;
import org.eclipse.ice.datastructures.form.MeshComponent;
import org.eclipse.ice.viz.service.IVizService;
import org.eclipse.ice.viz.service.geometry.widgets.TransformationView;
import org.eclipse.ice.viz.service.jme3.mesh.IMeshSelectionListener;
import org.eclipse.ice.viz.service.mesh.datastructures.IMeshVizCanvas;
import org.eclipse.ice.viz.service.mesh.javafx.FXMeshVizService;
......
......@@ -11,6 +11,7 @@ Import-Package: org.eclipse.ice.datastructures.ICEObject,
org.eclipse.ice.viz.service.datastructures,
org.eclipse.ice.viz.service.datastructures.VizObject,
org.eclipse.ice.viz.service.geometry.shapes,
org.eclipse.ice.viz.service.javafx.geometry.datatypes,
org.eclipse.ice.viz.service.mesh.datastructures,
org.eclipse.ice.viz.service.modeling,
org.slf4j;version="1.7.2"
......
......@@ -25,13 +25,14 @@ import org.eclipse.ice.datastructures.form.AllowedValueType;
import org.eclipse.ice.datastructures.form.DataComponent;
import org.eclipse.ice.datastructures.form.Entry;
import org.eclipse.ice.datastructures.form.MeshComponent;
import org.eclipse.ice.viz.service.geometry.shapes.FXShapeControllerFactory;
import org.eclipse.ice.viz.service.javafx.geometry.datatypes.FXShapeControllerFactory;
import org.eclipse.ice.viz.service.mesh.datastructures.BoundaryCondition;
import org.eclipse.ice.viz.service.mesh.datastructures.BoundaryConditionType;
import org.eclipse.ice.viz.service.mesh.datastructures.NekPolygon;
import org.eclipse.ice.viz.service.modeling.Edge;
import org.eclipse.ice.viz.service.modeling.EdgeComponent;
import org.eclipse.ice.viz.service.modeling.FaceComponent;
import org.eclipse.ice.viz.service.modeling.IControllerFactory;
import org.eclipse.ice.viz.service.modeling.Vertex;
import org.eclipse.ice.viz.service.modeling.VertexComponent;
......@@ -113,7 +114,7 @@ public class NekReader {
// TODO Replace this hardcoded factory with one chosen by the user to
// genereate the correct views
private FXShapeControllerFactory factory = new FXShapeControllerFactory();
private IControllerFactory factory = new FXShapeControllerFactory();
/**
* Nullary constructor.
......
......@@ -31,19 +31,10 @@ Import-Package: com.jme3.app,
org.eclipse.jface.databinding.swt,
org.slf4j;version="1.7.2",
visit.java.client
Export-Package: org.eclipse.ice.viz.service.geometry,
org.eclipse.ice.viz.service.geometry.scene.base,
org.eclipse.ice.viz.service.geometry.scene.model,
org.eclipse.ice.viz.service.geometry.shapes,
org.eclipse.ice.viz.service.geometry.viewer,
org.eclipse.ice.viz.service.geometry.widgets,
org.eclipse.ice.viz.service.javafx.internal,
org.eclipse.ice.viz.service.javafx.internal.model,
org.eclipse.ice.viz.service.javafx.internal.model.geometry,
org.eclipse.ice.viz.service.javafx.internal.scene,
org.eclipse.ice.viz.service.javafx.internal.scene.camera
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.ui
Bundle-Vendor: Oak Ridge National Laboratory
Eclipse-ExtensibleAPI: true
Export-Package: org.eclipse.ice.viz.service.geometry.shapes,
org.eclipse.ice.viz.service.geometry.widgets
/*******************************************************************************
* Copyright (c) 2015 UT-Battelle, LLC.
* 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:
* Tony McCrary (tmccrary@l33tlabs.com)
*******************************************************************************/
package org.eclipse.ice.viz.service.geometry;
import java.net.URI;
import java.util.Collections;
import java.util.Map;
import org.eclipse.ice.viz.service.IVizCanvas;
import org.eclipse.ice.viz.service.datastructures.VizObject.IVizUpdateable;
import org.eclipse.ice.viz.service.datastructures.VizObject.IVizUpdateableListener;
import org.eclipse.ice.viz.service.geometry.scene.base.GNode;
import org.eclipse.ice.viz.service.geometry.scene.base.GeometryAttachment;
import org.eclipse.ice.viz.service.geometry.scene.model.INode;
import org.eclipse.ice.viz.service.geometry.viewer.GeometryViewer;
import org.eclipse.ice.viz.service.geometry.viewer.IRenderer;
import org.eclipse.ice.viz.service.geometry.widgets.TransformationView;
import org.eclipse.ice.viz.service.javafx.internal.FXGeometryViewer;
import org.eclipse.ice.viz.service.modeling.Shape;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.PlatformUI;
/**
* <p>
* GeometryCanvas provides the ability to visualize and manipulate 3D geometry
* data.
* </p>
*
* @author Tony McCrary (tmccrary@l33tlabs.com)
*
*/
public class GeometryCanvas implements IVizCanvas, IVizUpdateableListener {
/** Factory class to be implemented by renderer implementations. */
private static final String GEOMETRY_VIEWER_FACTORY = "org.eclipse.ice.viz.service.geometry.viewer.factory.GeometryViewerFactory";
/**
* Number of dimensions supported for visualization. GeometryCanvas supports
* 3D views.
*/
private static final int SUPPORTED_AXES = 3;
/** The JFace viewer for displaying viz geometry. */
private GeometryViewer viewer;
/** The geometry object that is currently set on the viewer. */
private Shape geometry;
/** The active rootnode in the scene. */
private INode rootNode;
/** The active root geometry. */
private GeometryAttachment rootGeometry;
/** ICE properties. */
private Map<String, String> properties;
/**
* <p>
* Creates a canvas for the supplied geometry.
* </p>
*
* @param geometry
* ICE Geometry instance to visualizer in the canvas.
*/
public GeometryCanvas(Shape geometry) {
this.geometry = geometry;
}
/**
* @see IVizCanvas#draw(Composite)
*/
@Override
public Composite draw(Composite parent) throws Exception {
Composite viewerParent = new Composite(parent, SWT.NONE);
viewerParent.setLayout(new FillLayout());
this.viewer = materializeViewer(viewerParent);
if (viewer == null) {
throw new Exception(Messages.GeometryCanvas_ErrorCreatingViewer);
}
viewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
IViewPart view = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage()
.findView(TransformationView.ID);
if (view == null || !(view instanceof TransformationView)) {
return;
}
TransformationView transformView = (TransformationView) view;
GeometrySelection selection = (GeometrySelection) event
.getSelection();
transformView.setShape((Shape) selection.getShape());
}
});
loadGeometry(geometry);
return parent;
}
/**
* <p>
* Fix for Eclipse/PDE's wonky fragment support. Creates a GeometryViewer
* supplied by an implementation fragment.
* </p>
*
* @param viewerParent
* the parent widget
*
* @return a concrete implementation of GeometryViewer
*
* @throws Exception
* throws an exception if a concrete implementation cannot be
* found
*/
private GeometryViewer materializeViewer(Composite viewerParent)
throws Exception {
try {
return new FXGeometryViewer(viewerParent);
} catch (Exception e) {
throw new Exception("", e); //$NON-NLS-1$
}
}
/**
* <p>
* Handles the processing and setting up the canvas' supplied geometry for
* visualization.
* </p>
*
* @param geometry
* the geometry to visualize
*/
private void loadGeometry(Shape geometry) {
if (geometry == null) {
return;
}
this.geometry = geometry;
rootNode = new GNode();
IRenderer renderer = viewer.getRenderer();
rootGeometry = (GeometryAttachment) renderer
.createAttachment(GeometryAttachment.class);
rootGeometry.addGeometry(geometry);
rootNode.attach(rootGeometry);
viewer.setInput(rootNode);
// geometry.register(this);
}
/**
* <p>
* Returns the underlying GeometryViewer.
* </p>
*
* @return a GeometryViewer instance that is used to visualize scenes
*/
public GeometryViewer getViewer() {
return viewer;
}
/**
* <p>
* Listens for updates coming in from the geometry provider.
* </p>
*
* @see IVizUpdateable#update
*/
@Override
public void update(final IVizUpdateable component) {
// Invoke this on the JavaFX UI thread
javafx.application.Platform.runLater(new Runnable() {
@Override
public void run() {
if (component == geometry) {
// rootGeometry.addGeometry(geometry);
}
}
});
}
/**
* @see IVizCanvas#getDataSource()
*/
@Override
public URI getDataSource() {
return null;
}
/**
* @see IVizCanvas#getNumberOfAxes()
*/
@Override
public int getNumberOfAxes() {
return SUPPORTED_AXES;
}
/**
* @see IVizCanvas#getProperties()
*/
@Override
public Map<String, String> getProperties() {
if (properties == null) {
return Collections.emptyMap();
} else {
return properties;
}
}
/**
* @see IVizCanvas#getSourceHost()
*/
@Override
public String getSourceHost() {
return null;
}
/**
* @see IVizCanvas#isSourceRemote()
*/
@Override
public boolean isSourceRemote() {
return false;
}
/**
* @see IVizCanvas#redraw()
*/
@Override
public void redraw() {
}
/**
* @see IVizCanvas#setProperties()
*/
@Override
public void setProperties(Map<String, String> props) throws Exception {
this.properties = props;
}
}
/*******************************************************************************
* Copyright (c) 2015 UT-Battelle, LLC.
* 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:
* Tony McCrary (tmccrary@l33tlabs.com)
*******************************************************************************/
package org.eclipse.ice.viz.service.geometry;
import org.eclipse.ice.viz.service.modeling.AbstractController;
import org.eclipse.jface.viewers.StructuredSelection;
/**
*
* @author Tony McCrary (tmccrary@l33tlabs.com)
*
*/
public class GeometrySelection extends StructuredSelection {
/** */
private final AbstractController shape;
/**
*
* @param modelShape
*/
public GeometrySelection(AbstractController modelShape) {
super(modelShape);
this.shape = modelShape;
}
public AbstractController getShape() {
return shape;
}
}
/*******************************************************************************
* Copyright (c) 2015 UT-Battelle, LLC.
* 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:
* Tony McCrary (tmccrary@l33tlabs.com)
*******************************************************************************/
package org.eclipse.ice.viz.service.geometry;
import java.util.Collections;
import java.util.Set;
import org.eclipse.ice.viz.service.AbstractVizService;
import org.eclipse.ice.viz.service.IVizCanvas;
import org.eclipse.ice.viz.service.IVizService;
import org.eclipse.ice.viz.service.datastructures.VizObject.IVizObject;
import org.eclipse.ice.viz.service.geometry.shapes.FXShapeControllerFactory;
import org.eclipse.ice.viz.service.modeling.AbstractController;
import org.eclipse.ice.viz.service.modeling.IControllerFactory;
import org.eclipse.ice.viz.service.modeling.Shape;
/**
* <p>
* Implements an ICE viz service for geometry modeling.
* </p>
*
* @author Tony McCrary (tmccrary@l33tlabs.com)
*
*/
public class GeometryVizService extends AbstractVizService {
/** The name used to lookup this service. */
private static final String VIZ_SERVICE_NAME = "ICE Geometry Editor"; //$NON-NLS-1$
/** The version of the service. */
private static final String CURRENT_VERSION = "1.0";
/**
* <p>
* Creates a GeometryCanvas.
* </p>
*
* @see IVizService#createCanvas(IVizObject)
*/
@Override
public IVizCanvas createCanvas(AbstractController geometry) throws Exception {
if (geometry instanceof Shape) {
GeometryCanvas canvas = new GeometryCanvas((Shape) geometry);
return canvas;
} else {
throw new IllegalArgumentException(Messages.GeometryVizService_InvalidInput);
}
}
/**
* @see IVizService#getName()
*/
@Override
public String getName() {
return VIZ_SERVICE_NAME;
}
/**
* @see IVizService#getVersion()
*/
@Override
public String getVersion() {
return CURRENT_VERSION; // $NON-NLS-1$
}
/**
* @see AbstractVizService#findSupportedExtensions()
*/
@Override
protected Set<String> findSupportedExtensions() {
return Collections.emptySet();
}
@Override
public IControllerFactory getFactory() {
return new FXShapeControllerFactory();
}
}
/*******************************************************************************
* Copyright (c) 2015 UT-Battelle, LLC.
* 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:
* Tony McCrary (tmccrary@l33tlabs.com)
*******************************************************************************/
package org.eclipse.ice.viz.service.geometry;
import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.ice.viz.service.javafx.geometry.messages"; //$NON-NLS-1$
public static String GeometryCanvas_ErrorCreatingViewer;
public static String GeometryVizService_InvalidInput;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
private Messages() {
}
}
GeometryCanvas_ErrorCreatingViewer=Could not create GeometryViewer.
JavaFXGeometryVizService_InvalidInput=Invalid GeometryService can only render geometry viz objects.
/*******************************************************************************
* Copyright (c) 2015 UT-Battelle, LLC.
* 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:
* Tony McCrary (tmccrary@l33tlabs.com)
*******************************************************************************/
package org.eclipse.ice.viz.service.geometry.scene.base;
import org.eclipse.ice.viz.service.geometry.scene.model.IAttachment;
import org.eclipse.ice.viz.service.geometry.scene.model.INode;
/**
* <p>
* Base for IAttachment implementations.
* </p>
*
* @author Tony McCrary (tmccrary@l33tlabs.com)
*
*/
public abstract class Attachment implements IAttachment {
/** The node that owns this attachment (is attached). */
protected INode owner;
/**
* @see IAttachment#getOwner()
*/
public INode getOwner() {
return owner;
}
/**
* @see IAttachment#attach(INode)
*/
public void attach(INode owner) {
this.owner = owner;
}
/**
* @see IAttachment#detach(INode)
*/
public void detach(INode owner) {
this.owner = null;
}
/**
* @see IAttachment#isSingleton()
*/
public boolean isSingleton() {
return false;
}
}
/*******************************************************************************
* Copyright (c) 2015 UT-Battelle, LLC.
* 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
*