I'm looking at the DynamicScene implementation, both of the official
Cesium source code and Andre Nune's KML branch, and I'm trying to
understand the design rationale behind some of the implementation
choices I see. I have two specific questions I'd like to dig into in
Seeing from the implementation, it seems that the main point behind
DynamicScene is that 'somehow' a range of DynamicObjects are put into a
collection by various DataSources, and then a number of Visualizers
picks these objects up and visualize them. I understand the main point
of the design would be that specific DataSource implementations only
provide the data, while Visualizers only visualize them, no matter where
they came from.
One of my questions regarding visualization is the binding of data to
visualizers. In the current implementation what I see is that
visualizers look a specifically named properties of DynamicObjects, and
if properties with their expected names exist, they assume they can
visualize that object - that this, they assume the type of object from
it having a property of a particular name.
first: do I see this design correct?
second: is this really the best way to do it? say, inferring a type of
object from the fact that it has a property named 'path' seems too lax
for me at first sight, as one doesn't know the type of the 'path'
property based on this information. wouldn't a more strict object-type /
visualizer binding approach be safer? or at least, a documentation of
'reserved' properties that basically act as markers. just to make sure
that you don't inadvertently put a property named 'path' into your
object, as other visualizers will pick it up and choke on them.
regarding the efficiency of the current mechanism, I wonder if it's a
good idea to have all visualizers look at all dynamic objects on every
update() call to determine if they are interested in them? by having a
more explicit binding mechanism, this would not have to be done.
The other question I have is related to the 'level' of objects to be
created. Now I see that these are quite basic, say points, lines, etc.
but sometimes an object of higher level makes sense, which is made up of
a number of primitives: say an extruded KML LineString is made up of a
wall, a polygon, and the points in it might be spheres. moreover, it
makes sense to treat this collection of primitives as a single unit, for
the sake of selecting them with a mouse, hiding or showing them as a
single unit, etc. I wonder how such a functionality is imagined with the
current approach of 'let's collect all the primitives into a single place'
Moreover, in the current design, at what place would rendering / styling
information be stored? say, color of a particular object, transparency,
other visual information. in the dynamic object itself? at some other
place? in some style-collection, and then one can refer to a particular
I'm sorry if the above are obvious, I'm just looking at this component
now and I trying to thoroughly understand it.