Open aliaksei135 opened 4 years ago
You're right, that it's just a matter of updating DisplayGIS3D.registerStyle and of course providing your own layers that implement AbstractRenderableLayer. The AbstractRenderableLayer class mostly just handles adding and removing agents from the model, and the subclasses provide all of the styling. The main constraint is that AbstractRenderableLayer implementations work with WWJ Renderable implementations, but I think that the WWJ Renderable is about as abstract as you can get within the API.
We'd be happy to include any improvements you share via a PR. There is a mechanism to provide implemented visualization classes to the Repast runtime without explicitly coding them in the Display classes, via the VizualizationRegistry. For example the GIS3DVisualizationRegistryData.java defines what types of style classes are available to the 3D GIS displays. We could potentially also define a map of available layers and their associated classes here as well. Please let me know if you'd like to discuss this further as it would be of benefit to the Repast community.
I think using WWJ Renderable
s is fine.
A couple of ways I have come up with:
Naively, a way that springs to mind would be to make styles specify the layer they should be applied to by adding a getRenderableLayer
method to the StyleGIS
interface. This would require some modification of the existing style classes and probably wouldn't work as AbstractRenderableLayer
specifies its the style.
Allow the user to select the layers in the wizard somewhere and select what agents and styles apply to what layer. This would be similar to how StyleClassStep
is currently and would use the VisualizationRegistry
mechanism you described, but I'm not sure where this would fit in once it is in the registry.
Currently, it seems only
PlaceMarkLayer
andSurfaceShapeLayer
are allowed as GIS layers. I would like to have my own layers (subclassing fromAbstractRenderableLayer
) associated with my own styles.Looks like this would just be changing
DisplayGIS3D.registerStyle
(and solve a TODO 😃 ). Would be happy to submit a PR