Search in sources :

Example 1 with MembraneDataInfo

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;
}
Also used : SampledCurve(cbit.vcell.geometry.SampledCurve) Coordinate(org.vcell.util.Coordinate) ControlPointCurve(cbit.vcell.geometry.ControlPointCurve) Curve(cbit.vcell.geometry.Curve) SampledCurve(cbit.vcell.geometry.SampledCurve) CurveSelectionCurve(cbit.vcell.geometry.CurveSelectionCurve) StructureMetricsEntry(cbit.vcell.solvers.CartesianMeshChombo.StructureMetricsEntry) MembraneDataInfo(cbit.vcell.simdata.MembraneDataInfo) CartesianMeshChombo(cbit.vcell.solvers.CartesianMeshChombo)

Aggregations

ControlPointCurve (cbit.vcell.geometry.ControlPointCurve)1 Curve (cbit.vcell.geometry.Curve)1 CurveSelectionCurve (cbit.vcell.geometry.CurveSelectionCurve)1 SampledCurve (cbit.vcell.geometry.SampledCurve)1 MembraneDataInfo (cbit.vcell.simdata.MembraneDataInfo)1 CartesianMeshChombo (cbit.vcell.solvers.CartesianMeshChombo)1 StructureMetricsEntry (cbit.vcell.solvers.CartesianMeshChombo.StructureMetricsEntry)1 Coordinate (org.vcell.util.Coordinate)1