-
-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VectorShapes are in-extensibly hard-coded everywhere #509
Comments
I could fix some of these issues in a private build, but that sort of defeats the purpose of releasing an extension. |
I agree, this isn't currently possible from an extension. In general, NetLogo's 2D and 3D rendering pipelines aren't customizable at all. We'd need a whole new API for that. It seems unlikely to happen, unless funding were involved, since most of our development effort is going into Tortoise these days. One workaround is for an extension to give up on customizing the main view, and instead just open a separate window and do all of your own rendering in it. (@cbradyatinquire is currently doing some alternative visualization work this way.) In your case in particular, consider writing an extension primitive that renders a raster shape directly to the drawing layer, a la http://evolve.lse.ac.uk/NetLogo/extensions/Simulations-NetLogo%20Extensions.php . In order to use this as a substitute for turtle shapes, you'd need to do |
Do I really need to
? |
The purpose of clear-drawing would be to erase the sprites in their previously drawn positions. |
right, that makes sense, I was forgetting that the screen area is not fully redrawn at each tick. |
The drawing layer is an offscreen bitmap that holds the marks made by such primitives as The view as a whole is fully redrawn at each tick — including transferring the current contents of the drawing layer to the screen, but also including rendering the patches, turtles, and links. (Can't tell from your wording if you were actually in need of this clarification, but, offering it just in case.) |
@elfprince13 has added a bitmap-shapes extension to https://github.com/NetLogo/NetLogo/wiki/Extensions (called “BMPSprites") |
Fair warning: the extension works fairly well, but isn't the most elegant solution in the world, largely due to the issues discussed here. Hopefully though if anyone else tries the same thing, they'll be able to make use of it. |
I started working on an extension to allow raster shapes for agents (i.e. turtles), and have run into a couple problems:
a) Even though there is a generic shape class, everything seems hard coded to use the VectorShape subclass
b) similarly, the shape-parsing code seems extensible, except that calls to VectorShape's parser also seem hard-coded
c) there's no access to the rasterization stage of the graphics layer without a Context (this seems like something Graphics2DWrapper should expose, even if GraphicsInterface doesn't).
d) none of the previous would be problematic (even if a BitmapShape that subclasses VectorShape is a little odd), except that there is also no way to pass shape references directly, because they're all stored and referenced by name, and Context also doesn't appear any to offer any handle to a ShapeManager where they could be injected
The text was updated successfully, but these errors were encountered: