Note: you will need to include WellData and Well2D in your Module Dependencies list in addition to Viewer2D.
Well layers can only be added to a XSection window if that window already contains a seismic layer. In this example, we assume you have already created a well dataset wellData and a XSection window xsectionWindow.
NamedProps layerProperties = new NamedProps();
layerProperties.putProperty(IWellLayer.TRAJECTORY_IN_PLANE_COLOR, Color.RED);IWellLayer layer = IWellLayer.factory.createLayer(xsectionWindow, wellData, layerProperties, false);
Notes: The axis seismic layer query must have a fixed inline or xline that is near the well for the track to be visible.
layerProperties.putProperty(IWellLayer.SHOW_WELL_LOG_TRACKS, true); layer.setProperties(layerProperties); layerProperties.putProperty(IWellLayer.TRACKS_OPAQUE, true); layer.setProperties(layerProperties); layerProperties.putProperty(IWellLayer.WELL_TRACK_WIDTH, 10d); layer.setProperties(layerProperties);There are two track types: Linear and Logarithmic, they are both added the same way.
ITrack newTrack = layer.addTrack(TrackType.LINEAR);We assume there is at least one track currently in the layer for this example
ITrack track = layer.getAllTracks()[0];Using the track we got from the previous example and assuming the well data has a curve named "KLOG":
IWellData wellData = layer.getWellData(); ILogCurve logCurve = wellData.getCurve("KLOG"); ILogCurveShape logCurveShape = ILogCurveShape.Factory.createLogCurveShape(track, logCurve);Using the track we got from the previous example and assuming the well data has a curve named "Maker1":
IWellData wellData = layer.getWellData(); IMarker marker = wellData.getMarker("Marker1"); IMarkerShape markerShape = IMarkerShape.Factory.createMarkerShape(track, marker);In this example, we assume you have already created a well dataset wellData and a Map window mapWindow.
NamedProps layerProperties = new NamedProps();layerProperties.putProperty(IMapWellLayer.TRAJECTORY_LINE_COLOR, Color.RED);IMapWellLayer layer = IMapWellLayer.factory.createLayer(mapWindow, wellData, layerProperties, false);