sisl / AutoViz.jl

Provides visualization tools for AutomotiveDrivingModels. Built on Cairo
Other
33 stars 9 forks source link

Should keywords be regular arguments with default value instead in rendering function? #6

Open MaximeBouton opened 7 years ago

MaximeBouton commented 7 years ago

Some of the rendering function have keywords arguments, render_vehicle for example has color_arrow. When implementing a custom render function, we must use add_instruction!(rm::RenderModel, f::Function, arr::Tuple; incameraframe::Bool=true ).

The current implementation does not allow for passing keyword arguments for f. My suggestion is that we replace the keywords by regular arguments with default values.

Another possibility is to change add_instruction! method to add_instruction!(rm::RenderModel, f::Function, arr::Tuple, kwarr::Dict{Any, Any}; incameraframe::Bool=true) but it might be complicated.

tawheeler commented 7 years ago

Yeah - we could change add_instruction! to add_instruction!(rm::RenderModel, f::Function, arr::Tuple; incameraframe::Bool=true, kwargs...) and then change all of the rendering functions.