Copyright (C) 1994, Digital Equipment Corp.
Created by Marc Najork
A ConeGO.T is a geometric object describing a cone.
INTERFACEConeGO ; IMPORT GO, Point3, PointProp, RealProp, SurfaceGO; TYPE T <: Public; Public = SurfaceGO.T OBJECT METHODS init (prec := 30) : T; END;
cone.init(prec)initializes a new conecone, whose surface is composed ofprectriangles, and returns it. The location and radius of the cone is determined by the three propertiesBase,Tip, andRadius.
VAR Base : PointProp.Name; Tip : PointProp.Name; Radius : RealProp.Name;
In addition to the properties observed by all \type{GO}{T}'s and \type{SurfaceGO}{T}'s, there are three additional properties that are observed byConeGO.T's:
Baseis the name of a property that describes the center of the base of the cone. It associates with a \type{PointProp}{Val}. If noBaseproperty is specified, the base of the cone lies at the origin.
Tipis the name of a property that describes the tip of the cone. It associates with a \type{PointProp}{Val}. If noTipproperty is specified, the tip of the cone is at point (1,0,0).
Radiusis the name of a property that describes the radius of the cone. It associates with a \type{RealProp}{Val}. If noRadiusproperty is specified, the cone has a radius of 1.Assume that in a given context and at a given point in time, the property mapping is such that
Basemaps to a point property value which evaluates tobase,Tipmaps to a point property value which evaluates totip, andRadiusmaps to a real property value which evaluates tor.base,tip, andrdefine the position and shape of the cone in this c ontext and at this time as shown below: \begin{center} \begin{tabular}{c} \psfig{figure=images/ConeGO.ps,silent=} \end{tabular} \end{center}
PROCEDURE New (base, tip : Point3.T; r : REAL; prec := 30) : T;
New(base,tip,r,prec)creates a new cone, whose surface is composed ofprectriangles, and returns it. It also attaches the following properties to the new cone: \begin{verbatim} (Base,PointProp.NewConst(base)) (Tip,PointProp.NewConst(tip)) (Radius,RealProp.NewConst(r)) \end{verbatim}
The following three procedures provide sugaring to attach
Base, Tip, and Radius properties with non-animated
property values to geometric objects:
PROCEDURE SetBase (o : GO.T; p : Point3.T);
The expressionSetBase(o,p)is equivalent too.setProp(Base.bind(PointProp.NewConst(p))).
PROCEDURE SetTip (o : GO.T; p : Point3.T);
The expressionSetTip(o,p)is equivalent too.setProp(Tip.bind(PointProp.NewConst(p))).
PROCEDURE SetRadius (o : GO.T; r : REAL);
The expressionSetRadius(o,r)is equivalent too.setProp(Radius.bind(RealProp.NewConst(r))).
END ConeGO.