The sample code bellow shows how to create a seismic volume node and insert it into the scene graph.
To create a volume node, you just have to get a valid data (an instance of cg3DSeismicVolumeData).
The class cgJOGL3DSeismicVolumeNode is a utility class which allows to handle a series of slices easily.
Sample code : volume node creation
// Creating the node with the data sources of the two files cgJOGL3DSeismicVolumeNode node = new cgJOGL3DSeismicVolumeNode(volumeData); // Add the nodes to the scene graph paent.addNode(node);
The result should be a wireframe box displaying the bounding box of the seismic volume.
The visibility and graphic attributes of this bounding box can be controlled by the methods (on the cgJOGL3DSeismicVolumeNode object) :
setOutlineVisible(boolean wantedState)
setOutlineAttribute(cgAttribute attr) where attr defines the line parameters (width, color, style).
Once the volume is created, a slice can be created simply by calling one of the following method on the volume node :
createSeismicIPlanSliceNode :
create a cross section located a the given I coordinated and aligned to the JK plane.
Parameters are :
the I position of the slice
the range along the J axis of this slice
the range along the K axis of this slice (usually the time range)
createSeismicJPlanSliceNode :
create a cross section located a the given J coordinated and aligned to the IK plane.
Parameters are :
the J position of the slice
the range along the J axis of this slice
the range along the K axis of this slice (usually the time range)
createSeismicKPlanSliceNode :
create a time section located a the given I coordinated and aligned to the JI plane.
Parameters are :
the K position of the slice
the range along the I axis of this slice
the range along the J axis of this slice
createSeismicPlanSliceNode :
create plan slice located at the given position and aligned with the axis defined in the second parameters.
Parameters are :
The position of the slice
The type of slice : SlicePlan.I, SlicePlan.J or SlicePlan.K
createSeismicTraverseSliceNode
create a cross section along a path defined by a list of IJ coordinates
Parameters are :
The list of coordinates along the I axis
The list of coordinates along the J axis
Sample code : add a slice
// Creating the node with the data sources of the two files cgJOGL3DSeismicVolumeNode node = new cgJOGL3DSeismicVolumeNode(volumeData); // Add the nodes to the scene graph paent.addNode(node); //add a slice to the node//compute I position of the futur slice double meanI = volumeData.getMinI() / 2 + volumeData.getMaxI() / 2; cgJOGL3DSeismicVolumePlanSliceNode slice = node.createSeismicIPlanSliceNode(meanI, // the position new cgDoubleRange(volumeData.getMinJ(), volumeData.getMaxJ()), //the range along the J axis new cgDoubleRange(volumeData.getMinK(), volumeData.getMaxK() / 2)); //the range along the K axis (here only the top half)//set normalization parameters slice.setNormalizationMode(cgTraceNormalization.CG_NM_LIMITS); slice.setNormalizationLimits(1500, 4500);
The code above produces a volume with a slice located at the middle of the I axis.
Sample code : add a traverse slice
// Creating the node with the data sources of the two files cgJOGL3DSeismicVolumeNode node = new cgJOGL3DSeismicVolumeNode(volumeData); // Add the nodes to the scene graph paent.addNode(node); //create a traverse slice cg3DSeismicVolumeData data = volumeData; // Creating the traverse slice node with the path x & y coordinates double[] iPath = new double[] { data.getMinI(), data.getMaxI() / 2 + data.getMinI() / 2, data.getMaxI() / 2 + data.getMinI() / 2, data.getMaxI() }; double[] jPath = new double[] { data.getMinJ(), data.getMinJ(), data.getMaxJ(), data.getMaxJ() }; //create the traverse slice from the computed path cgJOGL3DSeismicVolumeTraverseSliceNode traverseSlice = node.createSeismicTraverseSliceNode(iPath, jPath);
The code above produces a traverse slice as shown in the image below.
Moving a slice can also be done using a dedicated mouse controller : cg3DeismicDragController
This controller allow the end user to move a slice when the he press CTRL and drag the mouse over a slice.
The slice can be updated in real time or not depending on a boolean set using the updateSliceInRealTime(boolean) method on the controller.
Updating slice in real time can leads to lags in the rendering if the data access is not efficient enough.
Once the volume is created, a probe can be created simply by calling the following method on the volume node :
createSeismicProbeNode
It returns a probe node which is added to the volume structure.
Parameters :
The center of the probe (a 3D point)
The size along the I axis
The size along the J axis
The size along the K axis
Sample code : add a probe
// Creating the node with the data sources of the two files cgJOGL3DSeismicVolumeNode node = new cgJOGL3DSeismicVolumeNode(volumeData); // Add the nodes to the scene graph paent.addNode(node); // The center of the probe Point3d position = new Point3d( volumeData.getMinI() / 2 + volumeData.getMaxI() / 2, //middle of the I axis volumeData.getMinJ() / 2 + volumeData.getMaxJ() / 2, //middle of the J axis volumeData.getMinK() / 2 + volumeData.getMaxK() / 2. //middle of the K axis ); // Create the probe node with it's position (the center) and the sizes of the ranges of the different axis node.createSeismicProbeNode(position, (volumeData.getMaxI() - volumeData.getMinI()) / 2, (volumeData.getMaxJ() - volumeData.getMinJ()) / 2, (volumeData.getMaxK() - volumeData.getMinK()) / 2);
The code above produces a probe located at the volume centre and covering half of the volume in each direction.
Click on the node to see the animation.
Once the probe is created, it can be moved.
You can use the following methods on the volume node :
setProbePosition
Moves the probe center to the given coordinate
Parameters
The new center of the probe
The index of the probe to move
setProbeSizes
Changes the probe size but not its center
Parameters
The new size along the I axis
The new size along the J axis
The new size along the K axis
The index of the probe to modify
setProbe
Changes the probe center and size.
Parameters
The new center of the probe
The new size along the I axis
The new size along the J axis
The new size along the K axis
The index of the probe to modify
It is not possible to move a probe with the seismic drag controller yet.