Commit 8644e75d authored by Robert Smith's avatar Robert Smith
Browse files

Geometry Editor tutorial and bug fixes



Added a tutorial for the Geometry Editor to the documentation, and fixed
various bugs in the Geometry Editor, including problems with Tubes not
displaying or cloning properly. 
Signed-off-by: Robert Smith's avatarRobert Smith <SmithRW@ornl.gov>
parent 80e065a3
/documen.synctex.gz
/tmp/
/bin/
/OutputVisualizationTutorial.aux
/OutputVisualizationTutorial.log
/OutputVisualizationTutorial.out
/document.pdf
\documentclass{article}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{url}
\setlength{\parskip}{1em}
\begin{document}
\title{Editing Geometries}
This article is designed to outline the basic controls of ICE's Geometry Editor.
\section{Getting Started}
Once ICE is installed on your computer, there are no further dependencies or
preparation required to use the Geometry Editor.
\section{Opening a Geometry Editor}
To open a Geometry Editor in ICE, you have three options:
\begin{center}
\includegraphics[height=5cm]{images/CreateNewMeshOptions.jpg}
\end{center}
Top to bottom, they are:
1) Click the File menu, then New, then Other\ldots and select the Create Item
Wizard in the new dialog and press next. Then select Geometry Editor from the
list and press Finish.
2) Click the New button and select Create Item Wizard in the new dialog and
press next. Then select Geometry Editor from the list and press Finish.
3) Enter the ICE Perspective by clicking the Open Perspective button in the
upper right corder of the screen, selecting ICE from the dialog that pops up,
and clicking OK. Afterwords, click the Create an Item button, select
Geometry Editor, and click OK.
\section{Working with the Geometry Editor}
\section{Camera}
You can change the perspecive of the camera by clicking and dragging inside the
Geometry Editor. You can see this initially by the way the three axes and the
reference plane move as you rotate the camera about the origin. Scrolling the
mouse wheel will zoom the camera in or out.
\section{Primitive Shapes}
\begin{center}
\includegraphics[height=5cm]{images/GeometryAddPrimitive.jpg}
\end{center}
Simple shapes can be added with the Add Primitives dropdown menu in the Shapes
view. Simply select an object from the menu to add it to the scene
\begin{center}
\includegraphics[height=5cm]{images/GeometryAddCube.jpg}
\end{center}
Clicking on the shape's name in the Shapes view will cause that shape to turn
red in the editor.
\begin{center}
\includegraphics[height=5cm]{images/GeometrySelectCube.jpg}
\end{center}
It will also activate the Transformation View in the lower left corder. Editing
the values here will change the displayed shape accordingly.
\begin{center}
\includegraphics[height=5cm]{images/GeometryCubeSize.jpg}
\end{center}
\textbm{Size} - Controls the overall size of the shape. Setting size to X is
equivalent to setting the shape's three scales to X times their current value.
\begin{center}
\includegraphics[height=5cm]{images/GeometryCubeTranslate.jpg}
\end{center}
\textbm{Translate} - Controls the position of the shape. Setting one of the
translations will move the shape that many units along the given axis.
\begin{center}
\includegraphics[height=5cm]{images/GeometryCubeRotate.jpg}
\end{center}
\textbm{Rotation} - Controls the orientation of the shape. Setting one of the
rotations will rotate that shape the given number of degrees about that axis.
\begin{center}
\includegraphics[height=5cm]{images/GeometryCubeScale.jpg}
\end{center}
\textbm{Scale} - Controls the size of the shape in three directions. Setting one
of the scales will stretch or compress the shape in that direction by a factor
of the scale's new setting.
\Section{Complex Shapes}
Multiple primitive shapes can be combined withing a single grouping for easier
editing. First, create a complex shape using the Add Complex button.
\begin{center}
\includegraphics[height=5cm]{images/GeometryAddComplex.jpg}
\end{center}
Currently, only unions are supported. The union will appear in the Shapes view
with an empty spot for a child shape.
\begin{center}
\includegraphics[height=5cm]{images/GeometryUnionAddShape.jpg}
\end{center}
Select <add shape> and add a primitive shape as before to add the shape as a
child of the union. To add additional shapes, select the child shape and add
another as normal.
Selecting the union will select all its child shapes, and changes to the
transformation view will affect the entire complex shape.
You can add a complex shape as a child to a complex shape in the same way as a
primitive shape, allowing for nested unions
\begin{center}
\includegraphics[height=5cm]{images/GeometryStackedUnions.jpg}
\end{center}
\Section{Copying}
Once you have a shape created, you can automatically create copies of that
shape.
\begin{center}
\includegraphics[height=5cm]{images/GeometryStackedUnions.jpg}
\end{center}
\begin{center}
\includegraphics[height=5cm]{images/GeometryDuplicateShape.jpg}
\end{center}
Press the Duplicate Shape button, highlighted above, to create an exact copy of
the highlighted primitive shape. The copy will appear as the child of the same
complex shape as the original, if any, and can be modified independently after
creation.
\begin{center}
\includegraphics[height=5cm]{images/GeometryReplicateShape.jpg}
\end{center}
You can systematically create many copies of a shape with the Replicate Shape
button highlighted above. This will open a new dialog.
\begin{center}
\includegraphics[height=5cm]{images/GeometryReplicateDialog.jpg}
\end{center}
The quantity is the number of desired copies of the shape which should be in the
replication. This includes the orignal (ie setting quantity to 2 will result in
2 shapes, the original and a copy).
The Shift boxes allow you to specify an offset to be placed between each copy.
For example, if you set X to 100 and Y to 50, then each copy will be 100 units
along the X axis and 50 along the Y away from the previous copy.
The original shape and all copies will be placed in a new complex shape, which
will take the original shape's position in the tree.
\section{Deletion}
You may remove a shape and all its children by selecting it in the Shapes view
and clicking the Delete button, highlighted below.
\begin{center}
\includegraphics[height=5cm]{images/GeometryDeleteButton.jpg}
\end{center}
......@@ -31,17 +31,22 @@ highlighted. Instruction for how to use each one, from top to bottom, left to
right, are given below.
1) Click the File menu, then New, then Create Item Wizard.
1) Click the File menu, then New, then Other\ldots and select the Create Item
Wizard in the new dialog and press next. Then select Mesh Editor from the list
and press Finish.
2) Click the New Item Button and select Create Item Wizard.
2) Click the New button and select Create Item Wizard in the new dialog and
press next. Then select Mesh Editor from the list and press Finish.
3) Click the Mesh Editor button.
4) In the ICE Perspective, click the Create an Item button, select Mesh Editor,
and click OK.
4) Enter the ICE Perspective by clicking the Open Perspective button in the
upper right corder of the screen, selecting ICE from the dialog that pops up,
and clicking OK. Afterwords, click the Create an Item button, select
Mesh Editor, and click OK.
\section{Working With the Mesh Editor}
......
......@@ -71,7 +71,7 @@ connection, change this to the hostname of that machine.
\textbf{Path:} Enter the full path to the directory containing the VisIt
executable, not the executable itself. The VisIt executable is named
\testem{visit} on Linux and Mac OS X. On Windows, \textem{VisIt.exe} is the
\textit{visit} on Linux and Mac OS X. On Windows, \textit{VisIt.exe} is the
appropriate file.
Once finished editing the cells in the new row, press Apply, then OK. ICE will
......
......@@ -2,5 +2,6 @@ output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml,\
OSGI-INF/
OSGI-INF/,\
icons/
source.. = src/
......@@ -22,6 +22,7 @@ import org.eclipse.ice.viz.service.geometry.widgets.ShapeTreeContentProvider.Bla
import org.eclipse.ice.viz.service.modeling.AbstractController;
import org.eclipse.ice.viz.service.modeling.ShapeController;
import org.eclipse.ice.viz.service.modeling.ShapeMesh;
import org.eclipse.ice.viz.service.modeling.TubeMesh;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ITreeSelection;
......@@ -296,9 +297,20 @@ public class ActionAddShape extends Action {
if (shapeType != null && operatorType == null) {
// Instantiate a PrimitiveShape and set its name and ID
ShapeMesh shapeComponent = new ShapeMesh();
shape = (ShapeController) view.getFactory().createController(shapeComponent);
ShapeMesh shapeComponent;
// Tubes require a tubemesh instead of a generic shapemesh
if (shapeType != ShapeType.Tube) {
shapeComponent = new ShapeMesh();
} else {
shapeComponent = new TubeMesh();
((TubeMesh) shapeComponent).setAxialSamples(3);
((TubeMesh) shapeComponent).setInnerRadius(40);
((TubeMesh) shapeComponent).setLength(50);
((TubeMesh) shapeComponent).setRadius(50);
}
shape = (ShapeController) view.getFactory()
.createController(shapeComponent);
shape.setProperty("Type", shapeType.toString());
......@@ -312,7 +324,8 @@ public class ActionAddShape extends Action {
// Instantiate a ComplexShape and set its name
ShapeMesh shapeComponent = new ShapeMesh();
shape = (ShapeController) view.getFactory().createController(shapeComponent);
shape = (ShapeController) view.getFactory()
.createController(shapeComponent);
shape.setProperty("Operator", operatorType.toString());
......
......@@ -75,11 +75,13 @@ public class ActionDuplicateShape extends Action {
@Override
public void run() {
AbstractController geometry = (AbstractController) view.treeViewer.getInput();
AbstractController geometry = (AbstractController) view.treeViewer
.getInput();
// Get selection
ITreeSelection selection = (ITreeSelection) view.treeViewer.getSelection();
ITreeSelection selection = (ITreeSelection) view.treeViewer
.getSelection();
TreePath[] paths = selection.getPaths();
// Iterate through the paths
......@@ -92,7 +94,8 @@ public class ActionDuplicateShape extends Action {
// Clone the shape
ShapeController clonedShape = (ShapeController) selectedShape.clone();
ShapeController clonedShape = (ShapeController) selectedShape
.clone();
// Remove the selected state from the cloned shape
......@@ -101,14 +104,16 @@ public class ActionDuplicateShape extends Action {
// Try to get the selected shape's parent shape
// We can assume that if the parent exists, it is a ComplexShape
ShapeController parentShape = (ShapeController) selectedShape.getEntitiesByCategory("Parent").get(0);
ShapeController parentShape = (ShapeController) selectedShape
.getEntitiesByCategory("Parent").get(0);
if (parentShape != null) {
// Find the index of the selected shape in the list of its
// siblings
List<AbstractController> childShapes = parentShape.getEntitiesByCategory("Children");
List<AbstractController> childShapes = parentShape
.getEntitiesByCategory("Children");
int selectedShapeIndex = childShapes.indexOf(selectedShape);
if (selectedShapeIndex < 0) {
......@@ -126,7 +131,8 @@ public class ActionDuplicateShape extends Action {
// Find the index of the selected shape in the list of its
// siblings
List<AbstractController> childShapes = geometry.getEntitiesByCategory("Children");
List<AbstractController> childShapes = geometry
.getEntitiesByCategory("Children");
int selectedShapeIndex = childShapes.indexOf(selectedShape);
// Add the cloned shape to the root GeometryComponent
......@@ -144,7 +150,8 @@ public class ActionDuplicateShape extends Action {
// Change the current selection to the new duplicated shape
TreePath clonedPath = path.getParentPath().createChildPath(clonedShape);
TreePath clonedPath = path.getParentPath()
.createChildPath(clonedShape);
TreeSelection clonedSelection = new TreeSelection(clonedPath);
view.treeViewer.setSelection(clonedSelection);
}
......
......@@ -17,6 +17,7 @@ import org.eclipse.ice.viz.service.datastructures.VizObject.IManagedUpdateable;
import org.eclipse.ice.viz.service.datastructures.VizObject.SubscriptionType;
import org.eclipse.ice.viz.service.geometry.shapes.OperatorType;
import org.eclipse.ice.viz.service.modeling.AbstractController;
import org.eclipse.ice.viz.service.modeling.AbstractMesh;
import org.eclipse.ice.viz.service.modeling.AbstractView;
import org.eclipse.ice.viz.service.modeling.IWireFramePart;
import org.eclipse.ice.viz.service.modeling.ShapeController;
......@@ -164,14 +165,6 @@ public class FXShapeController extends ShapeController
// Copy any other data into the clone
clone.copy(this);
// Add each child shape's JavaFX node as a child to the clone's JavaFX
// node
for (AbstractController child : clone
.getEntitiesByCategory("Children")) {
((Group) clone.getRepresentation()).getChildren()
.add((Group) child.getRepresentation());
}
return clone;
}
......@@ -185,25 +178,14 @@ public class FXShapeController extends ShapeController
@Override
public void copy(AbstractController source) {
// Create the model and give it a reference to this
model = new ShapeMesh();
model.setController(this);
// Create the model and view
model = (AbstractMesh) source.getModel().clone();
view = new FXShapeView((ShapeMesh) model);
view.copy(source.getView());
view.refresh(model);
// For simple objects, copy the model and create a new view based on the
// copy
if (source.getProperty("Operator") == null) {
model.copy(source.getModel());
view = new FXShapeView((ShapeMesh) model);
view.copy(source.getView());
}
// If the object is complex, create the view first so that cloned
// children can be collected under this object's JavaFX node.
else {
view = new FXShapeView();
model.copy(source.getModel());
view.copy(source.getView());
}
// Give the model a reference to this
model.setController(this);
// Register as a listener to the model and view
model.register(this);
......
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