Re: SPEC : isA

Chris Marrin ([email protected])
Thu, 15 Jun 1995 10:26:47 -0700


> my question of some time ago (which got no reply) was along a similar
> line ; by
> from (multiple) parents. Theessore, should these be declared
> (again) in the fields definition within the new node? I say they
> should not<- the whole point is that by
> on some standard type, any parser/run-time not
> understanding the new type can take ome gui> as how to interpret
> the node
>
> blueGlass {
> isA "Material"
> fields [ MFFloat refractiveIndex ]
>
> diffuse 0 0 1
> refractiveIndex 1.1
> }
>
> could be rendered opaque if a renderer cannot support refraction -
> the Material fields are implied from the "isA" statement.
>...

The problem here is that the isA field can have several strings,
representing several alternative representations of the node. These need
not be nodes understood by understood by alternative representation you are parsing for bssore reading the
remaining fields. Just imagine how complex thi But if you fully specify any field that will appear in this node "fields" field the parser's job is much easier. Noti that you need only
specify the fields used in thi example you would still not have to include emissiveColor, ambientColor,
etc., because you're not setting those. So the proper format for the
above is:

blueGlass {
fields [ MFString isA,
MFFloat refractiveIndex,
MFColor diffuseColor ]

isA "Material"
refractiveIndex 1.1
diffuseColor 0 0 1
}

The above is not an unreasonable requirement for defining new nodes.

-- 
chris marrin      Silicon      http://www.sgi.com/Products/WebFORCE/WebSpace
(415) 390-5367    Graphics     http://reality.sgi.com/employees/cmarrin/
[email protected]   Inc.         
         "A