return listOfCSGObjects;
}
} else if (contextObject instanceof CSGObject) {
CSGObject cso = (CSGObject) contextObject;
if (elementName.equals(SpatialConstants.csgPrimitive)){
CSGPrimitive csgNode = new CSGPrimitive();
cso.setCSGNode(csgNode);
return csgNode;
} else if (elementName.equals(SpatialConstants.csgPseudoPrimitive)){
CSGPseudoPrimitive csgNode = new CSGPseudoPrimitive();
cso.setCSGNode(csgNode);
return csgNode;
} else if (elementName.equals(SpatialConstants.csgSetOperator)){
CSGSetOperator csgNode = new CSGSetOperator();
cso.setCSGNode(csgNode);
return csgNode;
} else if (elementName.equals(SpatialConstants.csgTranslation)){
CSGTranslation csgNode = new CSGTranslation();
cso.setCSGNode(csgNode);
return csgNode;
} else if (elementName.equals(SpatialConstants.csgRotation)){
CSGRotation csgNode = new CSGRotation();
cso.setCSGNode(csgNode);
return csgNode;
} else if (elementName.equals(SpatialConstants.csgScale)){
CSGScale csgNode = new CSGScale();
cso.setCSGNode(csgNode);
return csgNode;
} else if (elementName.equals(SpatialConstants.csgHomogeneousTransformation)){
CSGHomogeneousTransformation csgNode = new CSGHomogeneousTransformation();
cso.setCSGNode(csgNode);
return csgNode;
}
} else if (contextObject instanceof CSGSetOperator) {
CSGSetOperator csgso = (CSGSetOperator) contextObject;
if (elementName.equals(SpatialConstants.listOfCSGNodes)) {
ListOf<CSGNode> listOfCSGNodes = csgso.getListOfCSGNodes();
return listOfCSGNodes;
}
} else if (contextObject instanceof CSGHomogeneousTransformation) {
CSGHomogeneousTransformation csght = (CSGHomogeneousTransformation) contextObject;
if (elementName.equals(SpatialConstants.forwardTransformation)) {
TransformationComponent tc = new TransformationComponent();
csght.setForwardTransformation(tc);
return tc;
} else if (elementName.equals(SpatialConstants.reverseTransformation)) {
TransformationComponent tc = new TransformationComponent();
csght.setReverseTransformation(tc);
return tc;
}
} else if (contextObject instanceof ParametricGeometry) {
ParametricGeometry pg = (ParametricGeometry) contextObject;
if (elementName.equals(SpatialConstants.listOfSpatialPoints)){
ListOf<SpatialPoint> listOfSpatialPoints = pg.getListOfSpatialPoints();
return listOfSpatialPoints;
} else if (elementName.equals(SpatialConstants.listOfParametricObjects)){
ListOf<ParametricObject> listOfParametricObjects = pg.getListOfParametricObjects();
return listOfParametricObjects;
}
} else if (contextObject instanceof ParametricObject) {
ParametricObject po = (ParametricObject) contextObject;
if (elementName.equals(SpatialConstants.imageData)){
PolygonObject polygonObject = new PolygonObject();
po.setPolygonObject(polygonObject);
return polygonObject;
}
}
else if (contextObject instanceof ListOf<?>) {
ListOf<SBase> listOf = (ListOf<SBase>) contextObject;
if (elementName.equals(SpatialConstants.coordinateComponent)) {
Geometry geo = (Geometry) listOf.getParentSBMLObject();
CoordinateComponent elem = new CoordinateComponent();
geo.addCoordinateComponent(elem);
return elem;
} else if (elementName.equals(SpatialConstants.domainType)) {
Geometry geo = (Geometry) listOf.getParentSBMLObject();
DomainType elem = new DomainType();
geo.addDomainType(elem);
return elem;
} else if (elementName.equals(SpatialConstants.domain)) {
Geometry geo = (Geometry) listOf.getParentSBMLObject();
Domain elem = new Domain();
geo.addDomain(elem);
return elem;
} else if (elementName.equals(SpatialConstants.adjacentDomains)) {
Geometry geo = (Geometry) listOf.getParentSBMLObject();
AdjacentDomains elem = new AdjacentDomains();
geo.addAdjacentDomain(elem);
return elem;
} else if (elementName.equals(SpatialConstants.sampledFieldGeometry)) {
Geometry geo = (Geometry) listOf.getParentSBMLObject();
SampledFieldGeometry elem = new SampledFieldGeometry();
geo.addGeometryDefinition(elem);
return elem;
} else if (elementName.equals(SpatialConstants.analyticGeometry)) {
Geometry geo = (Geometry) listOf.getParentSBMLObject();
AnalyticGeometry elem = new AnalyticGeometry();
geo.addGeometryDefinition(elem);
return elem;
} else if (elementName.equals(SpatialConstants.analyticGeometry)) {
Geometry geo = (Geometry) listOf.getParentSBMLObject();
AnalyticGeometry elem = new AnalyticGeometry();
geo.addGeometryDefinition(elem);
return elem;
} else if (elementName.equals(SpatialConstants.csGeometry)) {
Geometry geo = (Geometry) listOf.getParentSBMLObject();
CSGeometry elem = new CSGeometry();
geo.addGeometryDefinition(elem);
return elem;
} else if (elementName.equals(SpatialConstants.parametricGeometry)) {
Geometry geo = (Geometry) listOf.getParentSBMLObject();
ParametricGeometry elem = new ParametricGeometry();
geo.addGeometryDefinition(elem);
return elem;
} else if (elementName.equals(SpatialConstants.interiorPoint)) {
Domain domain = (Domain) listOf.getParentSBMLObject();
InteriorPoint elem = new InteriorPoint();
domain.addInteriorPoint(elem);
return elem;
} else if (elementName.equals(SpatialConstants.analyticVolume)) {
AnalyticGeometry av = (AnalyticGeometry) listOf.getParentSBMLObject();
AnalyticVolume elem = new AnalyticVolume();
av.addAnalyticVolume(elem);
return elem;
} else if (elementName.equals(SpatialConstants.sampledVolume)) {
SampledFieldGeometry sfg = (SampledFieldGeometry) listOf.getParentSBMLObject();
SampledVolume elem = new SampledVolume();
sfg.addSampledVolume(elem);
return elem;
} else if (elementName.equals(SpatialConstants.csgPrimitive)) {
CSGSetOperator csgso = (CSGSetOperator) listOf.getParentSBMLObject();
CSGPrimitive elem = new CSGPrimitive();
csgso.addCSGNode(elem);
return elem;
} else if (elementName.equals(SpatialConstants.csgPseudoPrimitive)) {
CSGSetOperator csgso = (CSGSetOperator) listOf.getParentSBMLObject();
CSGPseudoPrimitive elem = new CSGPseudoPrimitive();