Search in sources :

Example 31 with Vect3d

use of cbit.vcell.render.Vect3d in project vcell by virtualcell.

the class XmlReader method getCSGScale.

private CSGScale getCSGScale(Element param) throws XmlParseException {
    String name = unMangle(param.getAttributeValue(XMLTags.NameAttrTag));
    String scaleXStr = unMangle(param.getAttributeValue(XMLTags.CSGScaleXTag));
    String scaleYStr = unMangle(param.getAttributeValue(XMLTags.CSGScaleYTag));
    String scaleZStr = unMangle(param.getAttributeValue(XMLTags.CSGScaleZTag));
    Vect3d scaleAxis = new Vect3d(Double.parseDouble(scaleXStr), Double.parseDouble(scaleYStr), Double.parseDouble(scaleZStr));
    CSGScale csgScale = new CSGScale(name, scaleAxis);
    // Retrieve CSGNode - CSGScale element should have one child
    Object[] elements = param.getChildren().toArray();
    if (elements.length > 1) {
        throw new XmlParseException("CSGScale element cannot have more than one child element");
    }
    CSGNode csgChildNode = getCSGNode((Element) elements[0]);
    csgScale.setChild(csgChildNode);
    return csgScale;
}
Also used : CSGNode(cbit.vcell.geometry.CSGNode) VolumeRegionObject(cbit.vcell.mapping.spatial.VolumeRegionObject) PointObject(cbit.vcell.mapping.spatial.PointObject) SpatialObject(cbit.vcell.mapping.spatial.SpatialObject) SurfaceRegionObject(cbit.vcell.mapping.spatial.SurfaceRegionObject) CSGObject(cbit.vcell.geometry.CSGObject) Vect3d(cbit.vcell.render.Vect3d) CSGScale(cbit.vcell.geometry.CSGScale)

Aggregations

Vect3d (cbit.vcell.render.Vect3d)31 CSGObject (cbit.vcell.geometry.CSGObject)7 ArrayList (java.util.ArrayList)7 CSGNode (cbit.vcell.geometry.CSGNode)5 CSGScale (cbit.vcell.geometry.CSGScale)5 CSGTranslation (cbit.vcell.geometry.CSGTranslation)5 Geometry (cbit.vcell.geometry.Geometry)5 Polygon (cbit.vcell.geometry.surface.Polygon)5 VCImage (cbit.image.VCImage)4 CSGRotation (cbit.vcell.geometry.CSGRotation)4 ImageException (cbit.image.ImageException)3 AnalyticSubVolume (cbit.vcell.geometry.AnalyticSubVolume)3 CSGPrimitive (cbit.vcell.geometry.CSGPrimitive)3 GeometrySpec (cbit.vcell.geometry.GeometrySpec)3 SubVolume (cbit.vcell.geometry.SubVolume)3 GeometrySurfaceDescription (cbit.vcell.geometry.surface.GeometrySurfaceDescription)3 Surface (cbit.vcell.geometry.surface.Surface)3 SurfaceCollection (cbit.vcell.geometry.surface.SurfaceCollection)3 CompartmentSubDomain (cbit.vcell.math.CompartmentSubDomain)3 MembraneSubDomain (cbit.vcell.math.MembraneSubDomain)3