Re: Subtyping and Subclasses

Park SungWoo (gladius@compiler.kaist.ac.kr)
Sat, 12 Apr 1997 07:43:12 +0900 (KST)

>
> Stephan Diehl wrote:
> >
> > 1) A is a subtype of B <=> A has all properties of B
> >
> > In VRML properties are events and fields. (There is also
> > another property, namely that certain nodes can only be
> > used at certain positions, e.g. only child nodes as the
> > values of the children field. But we hope, that these
> > restrictions verbally expressed in the VRML spec,
> > can be explicitly defined with the help of the type system)
> >
> As Stephan mentions here, the VRML spec is sort of object oriented,
> except it expresses that class hierarchy verbally, rather than as part
> of the grammar syntax. So once you have your parser, you still have to
> do the remaining work constructing that class hierarchy. Here is what
> I've determined is the class hierarchy:
>
> SFNode
> Material
> Texture
> ImageTexture
> MovieTexture
> PixelTexture
> TextureTransform
> Color
> Normal
> TextureCoordinate
> Appearance
> Geometry
> Box
> Cone
> Cylinder
> ElevationGrid
> Extrusion
> IndexedFaceSet
> IndexedLineSet
> PointSet
> Sphere
> Text
> Sound
> AudioClip
> MovieTexture
> Coordinate
>

1)
I think the top class should be not 'SFNode' but just 'Node.
If the top class was 'SFNode', then how can we process such as
arrays of Transform nodes.
Hence, I suggest that the top class should be just 'Node'.
Then, we can use 'SFNode' as a single 'Node', 'MFNode' as multple 'Node's.
For example, we can use such field types as follows:

SFNode
SFGrouping
SFGroup
SFTransform
SFRobot
MFNode
MFGroup
MFTransform # array of Transform nodes

2)
My addition to the class hierarchy (my opinion) .. and so on...

Common
- Grouping
- Anchor
- Billboard
- Collision
- Group
- AudioClip
- DirectionLight
- PointLight
- Script
- Shape
- Sound
- SpotLight
- WorldInfo

My sleeping time AM 8:00 has come.. I am going to bed..

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 Sungwoo Park, (Castle-Help Naive)
	homepage : http://compiler.kaist.ac.kr/~gladius
 	e-mail : gladius@compiler.kaist.ac.kr
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -