use of com.gempukku.libgdx.graph.ui.producer.GraphBoxProducerImpl in project gdx-graph by MarcinSc.
the class UIPipelineConfigurer method processBoxProducer.
private static void processBoxProducer(JsonValue boxProducer) {
String producerType = boxProducer.name();
String producerName = boxProducer.getString("name");
String menuLocation = boxProducer.getString("menuLocation");
NodeConfigurationImpl nodeConfiguration = new NodeConfigurationImpl(producerType, producerName, menuLocation);
JsonValue inputs = boxProducer.get("inputs");
if (inputs != null) {
for (JsonValue input : inputs) {
String id = input.getString("id");
String name = input.getString("name");
boolean required = input.getBoolean("required", false);
boolean mainConnection = input.getBoolean("mainConnection", false);
boolean acceptMultiple = input.getBoolean("acceptMultiple", false);
JsonValue type = input.get("type");
String[] types = convertToArrayOfStrings(type);
GraphNodeInputImpl nodeInput = new GraphNodeInputImpl(id, name, required, mainConnection, acceptMultiple, types);
nodeConfiguration.addNodeInput(nodeInput);
}
}
JsonValue outputs = boxProducer.get("outputs");
if (outputs != null) {
for (JsonValue output : outputs) {
String id = output.getString("id");
String name = output.getString("name");
boolean mainConnection = output.getBoolean("mainConnection", false);
JsonValue validation = output.get("validation");
Function<ObjectMap<String, Array<String>>, String> validationFunction = convertToValidationFunction(validation);
JsonValue type = output.get("type");
String[] types = convertToArrayOfStrings(type);
GraphNodeOutputImpl nodeOutput = new GraphNodeOutputImpl(id, name, mainConnection, validationFunction, types);
nodeConfiguration.addNodeOutput(nodeOutput);
}
}
final JsonValue fields = boxProducer.get("fields");
GraphBoxProducerImpl producer = new GraphBoxProducerImpl(nodeConfiguration) {
@Override
public GraphBox createPipelineGraphBox(Skin skin, String id, JsonValue data) {
GraphBoxImpl result = createGraphBox(id);
if (fields != null) {
for (JsonValue field : fields) {
String fieldType = field.getString("type");
GraphBoxPart fieldGraphBoxPart = createFieldGraphBoxPart(fieldType, field);
fieldGraphBoxPart.initialize(data);
result.addGraphBoxPart(fieldGraphBoxPart);
}
}
addConfigurationInputsAndOutputs(result);
return result;
}
};
UIPipelineConfiguration.register(producer);
}
use of com.gempukku.libgdx.graph.ui.producer.GraphBoxProducerImpl in project gdx-graph by MarcinSc.
the class Lighting3DPluginDesignInitializer method initialize.
@Override
public void initialize() {
Lighting3DPluginRuntimeInitializer.register();
UICommonShaderConfiguration.register(new PhongLightingBoxProducer());
UICommonShaderConfiguration.register(new ShadowPhongLightingBoxProducer());
UICommonShaderConfiguration.register(new BlinnPhongLightingBoxProducer());
UICommonShaderConfiguration.register(new ShadowBlinnPhongLightingBoxProducer());
UICommonShaderConfiguration.register(new GraphBoxProducerImpl(new ApplyNormalMapShaderNodeConfiguration()));
UICommonShaderConfiguration.register(new AmbientLightBoxProducer());
UICommonShaderConfiguration.register(new DirectionalLightBoxProducer());
UICommonShaderConfiguration.register(new PointLightBoxProducer());
UICommonShaderConfiguration.register(new SpotlightBoxProducer());
UIPipelineConfiguration.register(new ShadowShaderRendererBoxProducer());
}
use of com.gempukku.libgdx.graph.ui.producer.GraphBoxProducerImpl in project gdx-graph by MarcinSc.
the class BoneAnimationPluginDesignInitializer method initialize.
@Override
public void initialize() {
BoneAnimationPluginRuntimeInitializer.register();
UIModelShaderConfiguration.registerPropertyType(new BoneWeightPropertyBoxProducer());
UIModelShaderConfiguration.registerPropertyType(new BoneTransformPropertyBoxProducer());
UIModelShaderConfiguration.register(new GraphBoxProducerImpl(new SkinningShaderNodeConfiguration()));
}
Aggregations