In this tutorial we will explore the different ways of selecting data in the render window, and how the Selection Inspector is used. We will also look at how we can extract a selection to create a new dataset.
- Open the Stopes.vtu file located in the examples / Demo1 folder and apply the default parameters.
- Make sure the Selection Controls toolbar is visible, otherwise open the View menu and show the toolbar.
- There are six buttons; Interact, Select Cells On, Select Points On, Select Cells Through, Select Points Through and Select Block
- The Interact option is selected by default and allows you to use the camera controls in the render view.
- With Interact selected, click and drag the mouse in the render view and note that these actions rotate the stopes visualization.
Select Cells On
- Click the Select Cells On button or press the "S" key on the keyboard (lower case, not combined with the Shift key). The camera controls are not turned off; instead, the mouse cursor has changed to cross-hairs and clicking and dragging in the render view draws a rectangular selection window.
- Use the mouse to draw a rectangle across part of the stopes dataset.
- When you release the mouse button, all the cells within the selection are highlighted and Interact becomes the active button so camera controls are once again available. Any cell that was touched by the outside of the selection rectangle is also selected, so the resulting section will not exactly match the selection rectangle.
- Rotate the image and note that only cells on the surface facing the camera when the selection rectangle was drawn are selected.
- Click on the Select Cells On icon and click anywhere in the render view to de-select the cells.
Select Points On
- Click the Select Points On button. Once again the camera controls are turned off and the mouse cursor is changed to cross-hairs.
- Use the mouse to draw a rectangle across part of the dataset.
- When you release the mouse button, the camera controls are activated and all the points within the selection are highlighted.
- Rotate the image and note that only points on the surface visible to the camera were selected.
- Click on any of the select buttons and click in the render view to de-select the cells - it doesn't matter which type of selection was created, any select button can be used to clear the selection.
Select Cells Through
- Click the Select Cells Through button. The camera controls are turned off, and the mouse cursor changed to cross-hairs.
- Draw a rectangle across part of the dataset.
- When you release the mouse button, the camera controls are once again available and all the cells within the selection throughout the dataset are highlighted. Once again, any cell that was within or touched by the selection rectangle is now selected.
- Rotate the image and note that the cells are highlighted on all sides - a frustum was created.
Select Points Through
- Click the Select Points Through button.
- Draw a rectangle across part of the dataset.
- Note that you don't actually need to de-select to create another selection, you can draw the selection rectangle while the other cells are still highlighted.
- When the mouse is released, all the points within the section throughout the dataset are highlighted and a frustum is created.
- Rotate the image and note that the points are highlighted on all sides, then de-select the points.
- Click the Select Block button.
- Select Block only works on multi-block datasets.
- Draw the selection rectangle across a small part of the dataset.
- When you let go of the mouse, notice that the whole dataset is selected. This is because the whole stopes dataset makes up one block.
The Selection Inspector
Now we've seen how to select data, but we haven't actually done anything with it. The Selection Inspector allows you to look at your selection in more detail.
The sections of the Selection Inspector change depending on the type of selection.
- Click on the Select Cells On button and create a selection over part of the dataset.
- When you release the mouse, the Selection Inspector window shows you the details about the cells you selected, and the cell ID's appear in the Index section.
- De-select the cells, click on the Select Points Through button, and draw the selection rectangle over part of the dataset.
- This time when you release the mouse, the Selection Inspector has a Show Frustum check-box instead of the point IDs. Check the box, then rotate the dataset in the render view. Note that the outline of a frustum appears and all the selected points are within this outline.
- Click the Select Blocks button and draw the selection rectangle on the dataset.
- Once again the whole dataset is selected, and this time the Selection Inspector shows a Blocks and Roots section.
- Now that we know which cells were selected, we have several options; we can modify the selection, change how the selection is displayed, or switch to a different object to create a selection. Create a selection using the Select Cells On button before continuing.
Modifying a Selection
- The selection can be modified in the Active Selection section of the Selection Inspector.
- Selected Object shows you to which object the currently selected points / cells / blocks belong.
- You can change the Selection Type using the drop-down; points and cells on a surface use the IDs type, whereas points and cells going through the dataset default to a Frustum type. If a block is selected, the Block type appears. We will leave the type unchanged.
- With the Field Type drop-down you can toggle between a cell and point selection. Currently we have cells selected; switching to points will not select the points that make up those cells, but rather will select the points that are at the IDs listed in the Index. Note which cells are selected, switch to the Point field type and note how the highlighted selection changes.
- When a Point field type is used, the Select cells that include the selected points check-box becomes available. Check the box and note that the new selection is made up of the cells that share the selected points. Uncheck the box so we're back to our point selection.
- Place a check-mark beside the Invert selection option to highlight all except our original points, then uncheck the box again.
- Change the field type back to cells.
- You can also manually change the selection.
- Click on one of the ID's under Index to highlight the row, then double-click on the ID again so only the ID number is highlighted. You can now change the ID number to select a specific ID. Change one of the ID numbers.
- There are also four buttons at the bottom of the Index list; New Value, New Range, Delete and Delete All.
- Press the New Value button and add an ID to the list, then press the Enter key; the New Range button isn't active right now, but would allow you to add a range of values.
- The ID you just added should still be highlighted. If not, select any ID and press the Delete button; this action deletes the currently highlighted ID from the list. You can also select more than one ID using the Shift or Ctrl keys and remove them all using the Delete button.
- The Delete All key will delete all the IDs in the Index. We still want to work with our selection, so we won't click this button yet.
Changing the Display Style
- The Display Style section is located at the bottom of the Selection Inspector and allows you to change the coloring, opacity and line or point size, as well as adding labels to the visualization.
- By default, selected data appears in pink. Click on the Color button and select a different color, such as yellow. Choosing bright colors is best since they are more noticeable on the dataset.
- Since we're currently using a cell selection, click on the Cell Label tab
- To add the cell labels to the render view, place a check-mark in the Visible check-box; this also activates the Style fields below. Looking at the render view you'll see that labels have been added, though, depending on the dataset and the size of the view window, they may not be legible because the cells are close together and the label size is too big.
- Change the font size to 10; although the labels are now smaller, we still could have problems reading the green writing on the gray dataset.
- Change the font color to black, make the writing bold (the B button) and zoom in on the dataset; the labels are now legible. Note that the label size doesn't change when you zoom.
- Sometimes you will have to play with the settings until the labels can be read. We could also have reduced the number of cells in our selection to reduce the label overlap.
- Turn off the labels before moving on; you can leave the coloring or change it back to pink.
Changing the Selected Object
If you have several objects in the render view, creating a selection will only select data from one dataset at a time: the currently Selected Object.
- Open the Drifts.vtp dataset so that both the stopes and drifts are visible in the render view.
- Color the drifts in blue and zoom in on the dataset.
- Click on Select Cells On and draw your selection rectangle so it covers areas on both datasets.
- Notice that only cells from one of the datasets are highlighted; the dataset which appears as the Selected Object in the Selection Inspector.
- We can change the Selected Object to specify where the selection should be made.
- From the Current Object drop-down, select the Stopes.vtu dataset and click on the Create Selection button.
- Note that no selection is actually created; instead the previous selection disappears.
- This time when we use the Select Cells On option, the selection is made on the Stopes dataset and the Drifts are ignored.
- Sometimes, once the selection is made, the application changes the "Selected Object" again on its own and you may have to try again.
- If we want to create a selection from two or more datasets, they have to be connected using one of the Append filter before the selection is made on the filter output.
- Select both the Drifts and Stopes datasets in the pipeline, then choose the Append Datasets filter from the Filters menu (under Alphabetical) and apply the filter.
- Click on Select Cells On and draw the selection rectangle; this time cells from both areas are selected.
Creating a New Dataset
Oftentimes we select parts of a dataset so that we can further explore the data. We can actually take the selected points, cells or blocks and create a new dataset.
- Since the appended dataset is the active dataset, we will create our selection there.
- Click on the Select Cells Through button and draw the selection rectangle over part of the dataset.
- Now we need to extract the data.
- Choose the ExtractSelection filter from the Filters menu (under Alphabetical).
- Press the Copy Active Selection button in the Object Inspector; the cell references will appear in the Copied Selection section.
- Apply the filter; the new dataset is created containing only the cells that were part of the selection.
We have now covered how to create selections and how to use the Selection Inspector, as well as how we can extract part of a dataset to create a new object in the pipeline.
Click on the Disconnect icon
and choose Discard to clear the pipeline.