use of cbit.vcell.simdata.MembraneDataInfo in project vcell by virtualcell.
the class PDEDataContextPanel method getCurveValue.
/**
* Insert the method's description here.
* Creation date: (3/13/2001 12:53:10 PM)
* @return java.lang.String
* @param csi cbit.vcell.geometry.CurveSelectionInfo
*/
public String getCurveValue(CurveSelectionInfo csi) {
String infoS = null;
if (csi.getType() == CurveSelectionInfo.TYPE_SEGMENT) {
if (membranesAndIndexes != null) {
java.util.Enumeration<SampledCurve> keysEnum = membranesAndIndexes.keys();
while (keysEnum.hasMoreElements()) {
Curve curve = (Curve) keysEnum.nextElement();
if (csi.getCurve() == curve) {
int[] membraneIndexes = (int[]) membranesAndIndexes.get(curve);
if (meshDisplayAdapter != null) {
double[] membraneValues = meshDisplayAdapter.getDataValuesForMembraneIndexes(membraneIndexes, getPdeDataContext().getDataValues(), getPdeDataContext().getDataIdentifier().getVariableType());
if (membraneValues != null) {
Coordinate segmentWC = getPdeDataContext().getCartesianMesh().getCoordinateFromMembraneIndex(membraneIndexes[csi.getSegment()]);
String xCoordString = NumberUtils.formatNumber(segmentWC.getX());
String yCoordString = NumberUtils.formatNumber(segmentWC.getY());
String zCoordString = NumberUtils.formatNumber(segmentWC.getZ());
boolean bDefined = getDataInfoProvider() == null || getDataInfoProvider().isDefined(membraneIndexes[csi.getSegment()]);
infoS = "(" + xCoordString + "," + yCoordString + "," + zCoordString + ") [" + membraneIndexes[csi.getSegment()] + "] Value = " + (bDefined ? membraneValues[csi.getSegment()] : "Undefined");
if (getPdeDataContext().getCartesianMesh() != null && getPdeDataContext().getCartesianMesh().isChomboMesh()) {
if (bDefined && getDataInfoProvider() != null) {
StructureMetricsEntry structure = ((CartesianMeshChombo) getDataInfoProvider().getPDEDataContext().getCartesianMesh()).getStructureInfo(getDataInfoProvider().getPDEDataContext().getDataIdentifier());
if (structure != null) {
infoS += " || " + structure.getDisplayLabel();
}
}
} else {
if (getDataInfoProvider() != null) {
MembraneDataInfo membraneDataInfo = getDataInfoProvider().getMembraneDataInfo(membraneIndexes[csi.getSegment()]);
infoS += " ";
infoS += " \"" + membraneDataInfo.membraneName + "\"";
infoS += " mrID=" + membraneDataInfo.membraneRegionID;
}
String curveDescr = CurveRenderer.getROIDescriptions(segmentWC, getImagePlaneManagerPanel().getCurveRenderer());
if (curveDescr != null) {
infoS += " " + curveDescr;
}
}
break;
}
}
}
}
}
}
return infoS;
}
Aggregations