Boxes


Boxes

There are two types of boxes in Partiview: a normal box and a clip box. A normal box is one that simply exists in space without affecting the data group it belongs to. A clip box, on the other hand, defines a box outside of which data are not drawn, thereby highlighting a portion of data within a given data group. In this section, we will discuss the normal box, leaving the discussion of clip boxes for the section on particle subsetting.

Drawing a box

Let's start by drawing a box around the data cube in the Test Data set. The data extend from -1 to +1 in all directions and, rather than draw the box on the points, let's draw one just outside these points using the boxes command. boxes takes a few arguments, namely the coordinates, the box color, and the box number. The coordinates can be entered in one of two ways. Either using the center point along with the x, y, and z half-lengths, or using the minimum and maximum values for x, y, and z. If we were to draw a box using the center point and half-lengths that encompassed the data cube, we would use

add box -n 1 -l 1 0,0,0 1.2,1.2,1.2
This produces a box that is numbered 1 (-n 1), colored blue (-l 1), and is located just outside the data cube (at x = y = z = 1.2) centered on the point x = y = z = 0. An equivalent command using the minimum and maximum pairs would be
add box -n 1 -l 1 -1.2,1.2 -1.2,1.2 -1.2,1.2
Let's set the Point of Interest marker to zero (censize 0) so that it's not in the way.

Turning Boxes on and off

Because the above command is a Data Command, we must preface it with the add command when we want to enter it in the Command Line. The boxes Control Command toggles a box on and off. Typing

box

will toggle the box between the ON state, the ONLY state, and the OFF state. The ON and OFF state are self-explanatory. The ONLY state turns the points off, leaving the box on. Note that if the polygons are on, then the they will remain displayed while the points are turned off. These states can also be toggled using the Boxes Toggle Button at the top of the GUI. Left-clicking on the button will toggle between the ON and OFF state. Right-clicking on the button will provide you with a menu to choose from one of these states. The button will appear green in the ON state and red in the ONLY state.


Displaying the Box Label

While it's usefulness may be debated, the box number can be shown as a label at the center of the box. By turning on boxlabel, the label (the number 1 since we specified a -n 1 in the box definition) will appear in the center of our box. More practical is a user-customized label that is relevant to the purpose of the box. For example, we may want to call these data the “Center Data,” in which case we can add a label manually (or in a data or config file). To do this interactively, type the following in the Command Line:

add 1.25 1.25 1.25 text Center Data
You will need to have the labels on for the label to appear.

Creating Multiple Boxes

Of course, you may create a number of boxes within one data group and multiple boxes in multiple groups. When you create a box, always be mindful of the active data group as the box will belong to that group. One of the powers of multiple boxes within one data group is that boxes can be grouped by their color. To experiment with this, let's start Partiview with the Sample Data. This provides us with a larger data set to work with. Increase the center size to 100 so that we can see our coordinate axes.

Let's create several boxes of various colors by typing the following commands.

add box -n 1 -l 10 10,10,0 10,10,10
add box -n 2 -l 15 -10,0,-10 10,5,5
add box -n 3 -l 10 -50,20,10 40,10,5
add box -n 4 -l 10 -50,-25,0 20,10,60
add box -n 5 -l 25 -20,-40,10 2.5,35,2.5

Clarify the view by turning off the points and polygons, reducing the Point of Interest axes to 10, and turning on the box labels. This is most easily accomplished using these commands:

points off
poly off
censize 10
boxlabel


Showing and Hiding Boxes

We can toggle a subset of boxes on and off by using their color index set with the -l option. Using the showbox and hidebox commands, we will turn off all boxes using the command

hidebox 10 15 25
Now, turn on the three boxes of the same color index
showbox 10
Or, turn off these boxes and show the other two
hidebox 10
showbox 15 25
This is how you can use several boxes to highlight portions of data that are related to one another.


Coloring a Box

Like coloring particles, coloring a box can take place via a color index which refers to a color map file, or the color index can be set interactively for that data group using the boxcment command. If we desire to change the color of those boxes that have the color index 10 to orange, then we would type

boxcment 10 0.7 0.4 0

(use the showbox 10 command if they are currently hidden). We can also color boxes using defined colors in a color map file. See our discussion of this in Coloring Particles and Objects.


Scaling Boxes

All boxes defined in a data group can be scaled using the boxscale command. This command takes a floating point value to describe the scale factor by which the size of the box will increase or decrease. For example, to double the size of all boxes, then return to the defined size, then quarter the size, issue these commands and see what happens.

boxscale 2
boxscale off
boxscale 0.25
boxscale 1

Note that boxscale off and boxscale 1 are the same. Also, the labels do not scale, you may want to turn them off using boxlabels off.


Changing the Point of Interest to Box Center

The Point of Interest can easily be shifted to the center of a box using the gobox command. This command takes the box number that you want to bring into focus by moving the Point of Interest to its center. If we bring the labels back, then we can shift the Point of Interest around via the commands:

gobox 4
and so on for the other boxes defined with the -n option.

© 2002-2005 American Museum of Natural History
Last Modified: 2006-04-28 by Brian Abbott