Beispiel #1
0
def writeMaterials(dfile, materials, excludeProps={}):
    # Make sure to save each property only once, even if it's in more
    # than one Material.  Properties in excludeProps have already been
    # written, and should be omitted. excludeProps is a dictionary
    # whose keys are property paths.
    props = {}  # dictionary of all properties used in the Materials
    for material in materials:
        for prop in material.properties():
            props[prop.registration().name()] = prop
    # Sort the properties by name.
    paths = props.keys()
    paths.sort()
    # Write the properties.
    for path in paths:
        if path not in excludeProps:
            props[path].registration().writeData(dfile)
    # Write the materials.
    for material in materials:
        dfile.startCmd(mainmenu.OOF.LoadData.MaterialandType)
        dfile.argument('name', material.name())
        dfile.argument(
            'properties',
            [prop.registration().name() for prop in material.properties()])
        #Interface branch
        dfile.argument('materialtype', material.type())
        dfile.endCmd()
Beispiel #2
0
def writeMaterials(dfile, materials, excludeProps={}):
    # Make sure to save each property only once, even if it's in more
    # than one Material.  Properties in excludeProps have already been
    # written, and should be omitted. excludeProps is a dictionary
    # whose keys are property paths.
    props = {}           # dictionary of all properties used in the Materials
    for material in materials:
        for prop in material.properties():
            props[prop.registration().name()] = prop
    # Sort the properties by name.
    paths = props.keys()
    paths.sort()
    # Write the properties.
    for path in paths:
        if path not in excludeProps:
            props[path].registration().writeData(dfile)
    # Write the materials.
    for material in materials:
        dfile.startCmd(mainmenu.OOF.LoadData.MaterialandType)
        dfile.argument('name', material.name())
        dfile.argument('properties', [prop.registration().name()
                                      for prop in material.properties()])
        #Interface branch
        dfile.argument('materialtype',material.type())
        dfile.endCmd()
Beispiel #3
0
def _writeData(self, dfile, microstructure, pixel):
    material = ooflib.SWIG.engine.material.getMaterialFromPoint(
        microstructure, pixel)
    if material is not None:
        dfile.argument('material', material.name())
        return 1
    return 0
Beispiel #4
0
def _writeData(self, dfile, microstructure, pixel):
    material = ooflib.SWIG.engine.material.getMaterialFromPoint(microstructure,
                                                                pixel)
    if material is not None:
        dfile.argument('material', material.name())
        return 1
    return 0