Example of Inheritance in Nodes
In general, a particular node can inherit changes made in any number of
a line of base nodes traced back to a root base node at the end. For example,
in the system shown to the left where Detector
contains an instance of Env (as well as
other things), Env contains an instance
of Seismic (and others), and Seismic contains an instance of the primitive Func_VxV (named GenNoise), the inheritance hierarchy
of the instance primitive node Detector.Env.Seismic.GenNoise
is as follows:
- Seismic.GenNoise is an
instance of Func_VxV inside the box
node Seismic. As such, it is a copy
of Func_VxV, but may also have its own
local changes.
- Next, Env.Seismic.GenNoise is
based on Seismic.GenNoise, and as such
is a copy of Func_VxV along with any changes
made in Seismic.GenNoise, and
may have its own local changes as well.
- Finally, Detector.Env.Seismic.GenNoise
is based upon Env.Seismic.GenNoise,
so it is a copy of Func_VxV, along with
the changes (if any) made in Seismic.GenNoise,
and then any changes in Env.Seismic.GenNoise
layered on top, and finally, may itself contain some local changes as well.
Furthering this example, the root primitive node Func_VxV
has a parameter called outputVectorSize_0, which has a default value of 16.
In Seismic.GenNoise, this parameter
set to a value of 8*6. It is not changed anymore further up the hierarchy
(Env.Seismic.GenNoise and then Detector.Env.Seismic.GenNoise), so the value
of outputVectorSize_0 in Detector.Env.Seismic.GenNoise
is 8*6 due to the change made in Seismic.GenNoise
(which superceded the value of 16 as set in the root base node Func_VxV.) Other than that, Detector.Env.Seismic.GenNoise is a copy
of Func_VxV.
Inheritance
in Nodes Which Have Been Copied (and Pasted)
When a node such as Detector.Env.Seismic.GenNoise
is copied via the edit Copy or Cut command, the copy cannot use the same
inheritance tree. The solution we use is to base the new copy on the root
base node and then take all changes in the originals intermediate base nodes
and copy those changes as local changes in the copy node.
As such, node Detector.Env.Seismic.GenNoise_copy
is a local addition to Detector.Env.Seismic
and is based directly on Func_VxV, except
that it also has a local change to the outputVectorSize_0 parameter, setting
it to 8*6.