Search in sources :

Example 1 with AttributeMap

use of processing.opengl.PGraphicsOpenGL.AttributeMap in project processing by processing.

the class PShapeOpenGL method collectPolyAttribs.

protected void collectPolyAttribs() {
    AttributeMap rootAttribs = root.polyAttribs;
    if (family == GROUP) {
        for (int i = 0; i < childCount; i++) {
            PShapeOpenGL child = (PShapeOpenGL) children[i];
            child.collectPolyAttribs();
        }
    } else {
        for (int i = 0; i < polyAttribs.size(); i++) {
            VertexAttribute attrib = polyAttribs.get(i);
            tessGeo.initAttrib(attrib);
            if (rootAttribs.containsKey(attrib.name)) {
                VertexAttribute rattrib = rootAttribs.get(attrib.name);
                if (rattrib.diff(attrib)) {
                    throw new RuntimeException("Children shapes cannot have different attributes with same name");
                }
            } else {
                rootAttribs.put(attrib.name, attrib);
            }
        }
    }
}
Also used : AttributeMap(processing.opengl.PGraphicsOpenGL.AttributeMap) VertexAttribute(processing.opengl.PGraphicsOpenGL.VertexAttribute)

Aggregations

AttributeMap (processing.opengl.PGraphicsOpenGL.AttributeMap)1 VertexAttribute (processing.opengl.PGraphicsOpenGL.VertexAttribute)1