Commit 5f73ad22 authored by Tony McCrary's avatar Tony McCrary
Browse files

Initial public commit with latest geometry editor work.



Change-Id: I516583ae88727bedd318bd410d2728f80e72c9b0
Signed-off-by: default avatarTony McCrary <tmccrary@l33tlabs.com>
parent 3cfa81f0
......@@ -32,7 +32,7 @@ import org.eclipse.ui.forms.widgets.ScrolledForm;
/**
* <p>
* This class is ICEFormPage that displays the GeometryEditor powered by JME3.
* This class is ICEFormPage that displays the GeometryEditor powered by JavaFX.
* It automatically opens the ShapeTreeView and TransformationView to allow the
* user to add and edit geometry.
* </p>
......@@ -170,13 +170,15 @@ public class ICEGeometryPage extends ICEFormPage implements IUpdateableListener
// Get JME3 Geometry service from factory
IVizServiceFactory factory = ((ICEFormEditor) editor)
.getVizServiceFactory();
IVizService service = factory.get("JME3 Geometry Editor");
IVizService service = factory.get("ICE Geometry Editor");
// Create and draw geometry canvas
try {
IVizCanvas vizCanvas = service.createCanvas(geometryComp
.getGeometry().getGeometry());
vizCanvas.draw(parent);
} catch (Exception e) {
logger.error(
......
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="JCSG.jar"/>
<classpathentry exported="true" kind="lib" path="slf4j-api-1.6.1.jar"/>
<classpathentry exported="true" kind="lib" path="slf4j-simple-1.6.1.jar"/>
<classpathentry exported="true" kind="lib" path="vecmath-1.3.1.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.ice.viz.service.geometry.javafx.jcsg</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: ICE Geometry JavaFX Implementation - CSG Support
Bundle-SymbolicName: org.eclipse.ice.viz.service.geometry.javafx.jcsg
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: ECLIPSE
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ClassPath: JCSG.jar,
slf4j-api-1.6.1.jar,
slf4j-simple-1.6.1.jar,
vecmath-1.3.1.jar,
.
Export-Package: eu.mihosoft.vrl.v3d,
eu.mihosoft.vrl.v3d.ext.imagej,
eu.mihosoft.vrl.v3d.ext.openjfx.importers,
eu.mihosoft.vrl.v3d.ext.openjfx.importers.obj,
eu.mihosoft.vrl.v3d.ext.openjfx.shape3d,
eu.mihosoft.vrl.v3d.ext.openjfx.shape3d.symbolic,
eu.mihosoft.vrl.v3d.ext.openjfx.utils3d,
eu.mihosoft.vrl.v3d.ext.org.poly2tri,
eu.mihosoft.vrl.v3d.ext.quickhull3d
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
JCSG.jar,\
slf4j-api-1.6.1.jar,\
slf4j-simple-1.6.1.jar,\
vecmath-1.3.1.jar
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ICE</groupId>
<artifactId>org.eclipse.ice.build</artifactId>
<version>2.1.7.20150825</version>
<relativePath>../${pom-filename}</relativePath>
</parent>
<groupId>ICE</groupId>
<artifactId>org.eclipse.ice.viz.service.geometry.javafx.jcsg</artifactId>
<packaging>eclipse-plugin</packaging>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry excluding="org/eclipse/ice/viz/service/javafx/internal/scene/SyncShapes.java" kind="src" path="src"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.ice.viz.service.geometry.javafx</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ds.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: JavaFX Visualization Plugin
Bundle-SymbolicName: org.eclipse.ice.viz.service.geometry.javafx;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Fragment-Host: org.eclipse.ice.viz.service.geometry
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.11.0",
org.eclipse.ui
Bundle-Vendor: Oak Ridge National Laboratory
Import-Package:
javafx.scene.input;version="2.2.0",
javafx.scene.transform;version="2.2.0",
org.eclipse.ice.viz.service,
org.eclipse.ice.viz.service.datastructures,
org.eclipse.ice.viz.service.datastructures.VizObject,
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.mesh.datastructures,
org.eclipse.jface.databinding.swt,
org.slf4j;version="1.7.2"
Bundle-ClassPath: .
Export-Package: org.eclipse.ice.viz.service.geometry.viewer.factory
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml,\
OSGI-INF/,\
jcsg/JCSG.jar,\
jcsg/slf4j-api-1.6.1.jar,\
jcsg/slf4j-simple-1.6.1.jar,\
jcsg/vecmath-1.3.1.jar
source.. = src/
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ICE</groupId>
<artifactId>org.eclipse.ice.build</artifactId>
<version>2.1.7.20150825</version>
<relativePath>../${pom-filename}</relativePath>
</parent>
<groupId>ICE</groupId>
<artifactId>org.eclipse.ice.viz.service.geometry.javafx</artifactId>
<packaging>eclipse-plugin</packaging>
</project>
/*******************************************************************************
* 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.viewer.factory;
import org.eclipse.ice.viz.service.geometry.viewer.GeometryViewer;
import org.eclipse.ice.viz.service.geometry.viewer.IViewerFactory;
import org.eclipse.ice.viz.service.javafx.internal.FXGeometryViewer;
import org.eclipse.swt.widgets.Composite;
/**
* <p>
* Generates JavaFX GeometryViewer instances.
* </p>
*
* @author Tony McCrary (tmccrary@l33tlabs.com)
*
*/
public class GeometryViewerFactory implements IViewerFactory {
/**
* <p>
* Creates a JavaFX geometry viewer instance on the supplied parent
* composite.
* </p>
*/
public GeometryViewer createViewer(Composite parent) {
return new FXGeometryViewer(parent);
}
}
/*******************************************************************************
* 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.javafx.internal;
import org.eclipse.ice.viz.service.geometry.scene.base.ISceneGenerator;
import org.eclipse.ice.viz.service.geometry.scene.model.INode;
import org.eclipse.jface.viewers.IContentProvider;
import org.eclipse.jface.viewers.Viewer;
import javafx.scene.Group;
import javafx.scene.Node;
/**
* <p>
* Handles parsing the scene model input (INode, etc) and generates an internal
* JavaFX model that can be visualized in the viewer.
* </p>
*
* @author Tony McCrary (tmccrary@l33tlabs.com)
*
*/
public class FXContentProvider implements IContentProvider {
/** Used to generate the JavaFX scene from the input model. */
private ISceneGenerator sceneGenerator;
/**
* <p>
* Generates a JavaFX scene from the input model.
* </p>
*
* @see IContentProvider#inputChanged(Viewer, Object, Object)
*/
public void inputChanged(Viewer viewer, Object input, Object oldInput) {
verifyInput(viewer, input, oldInput);
FXGeometryViewer fxViewer = (FXGeometryViewer) viewer;
INode newRoot = (INode) input;
Group fxRoot = fxViewer.getRoot();
if (sceneGenerator == null) {
sceneGenerator = new FXSceneGenerator();
}
Node generatedRoot = sceneGenerator.generateScene(newRoot);
fxRoot.getChildren().setAll(generatedRoot);
}
/**
* <p>
* Verifies the model inputs for sanity.
* </p>
*
* @param viewer
* the viewer being modified
* @param input
* the new input
* @param oldInput
* the old input
*/
private void verifyInput(Viewer viewer, Object input, Object oldInput) {
if (!(viewer instanceof FXGeometryViewer)) {
throw new IllegalArgumentException(Messages.FXContentProvider_InvalidViewerType);
}
if (!(input instanceof INode)) {
throw new IllegalArgumentException(Messages.FXContentProvider_InvalidInputType);
}
if (oldInput != null && !(oldInput instanceof INode)) {
throw new IllegalArgumentException(Messages.FXContentProvider_InvalidInputNode);
}
}
/**
* <p>
* Disposes the Viewer input.
* </p>
*/
public void dispose() {
}
/**
*
*/
public ISceneGenerator getGenerator() {
return sceneGenerator;
}
/**
*
*/
public void setGenerator(ISceneGenerator generator) {
this.sceneGenerator = generator;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment