use of com.gempukku.libgdx.graph.plugin.models.GraphModel in project gdx-graph by MarcinSc.
the class CommonPropertiesModelInstanceModelAdapter method registerNodeForTag.
private void registerNodeForTag(ObjectSet<GraphModel> models, Node node, String tag) {
if (node.parts.size > 0) {
for (NodePart nodePart : node.parts) {
NodePartRenderableModel renderableModel = new NodePartRenderableModel(node, nodePart);
GraphModel graphModel = graphModels.addModel(tag, renderableModel);
models.add(graphModel);
}
}
for (Node child : node.getChildren()) {
registerNodeForTag(models, child, tag);
}
}
use of com.gempukku.libgdx.graph.plugin.models.GraphModel in project gdx-graph by MarcinSc.
the class CommonPropertiesModelInstanceModelAdapter method removeTag.
public void removeTag(String tag) {
if (!hasTag(tag))
throw new IllegalArgumentException("This model instance does not have this tag");
ObjectSet<GraphModel> models = graphModelsByTag.get(tag);
for (GraphModel graphModel : models) {
graphModels.removeModel(graphModel);
}
graphModelsByTag.remove(tag);
}
use of com.gempukku.libgdx.graph.plugin.models.GraphModel in project gdx-graph by MarcinSc.
the class CommonPropertiesModelInstanceModelAdapter method addTag.
public void addTag(String tag) {
if (graphModelsByTag.containsKey(tag))
throw new IllegalArgumentException("This model instance is already registered for this tag");
ObjectSet<GraphModel> models = new ObjectSet<>();
for (Node node : modelInstance.nodes) {
registerNodeForTag(models, node, tag);
}
graphModelsByTag.put(tag, models);
}
use of com.gempukku.libgdx.graph.plugin.models.GraphModel in project gdx-graph by MarcinSc.
the class MaterialModelInstanceModelAdapter method registerNodeForTag.
private void registerNodeForTag(ObjectSet<GraphModel> models, Node node, String tag) {
if (node.parts.size > 0) {
for (NodePart nodePart : node.parts) {
NodePartRenderableModel renderableModel = new NodePartRenderableModel(node, nodePart);
GraphModel graphModel = graphModels.addModel(tag, renderableModel);
models.add(graphModel);
}
}
for (Node child : node.getChildren()) {
registerNodeForTag(models, child, tag);
}
}
use of com.gempukku.libgdx.graph.plugin.models.GraphModel in project gdx-graph by MarcinSc.
the class MaterialModelInstanceModelAdapter method addTag.
public void addTag(String tag) {
if (graphModelsByTag.containsKey(tag))
throw new IllegalArgumentException("This model instance is already registered for this tag");
ObjectSet<GraphModel> models = new ObjectSet<>();
for (Node node : modelInstance.nodes) {
registerNodeForTag(models, node, tag);
}
graphModelsByTag.put(tag, models);
}
Aggregations