* VFP scripts (procedures) dependent upon the class
* definitions in polyclasses.prg.  Swap in procedures
* for execution

close tables
set procedure to polyclasses
clear

* do one of the procedures listed below
do testrotate

release all
set procedure to
return

procedure rhdodecas

    * create objects
    oRD = createobject("rhdodeca")
    oCubocta = createobject("cubocta")
    oSph = createobject("sphere")
    oWritePOV  = createobject("WritePOV")

    oWritePOV.makeaxes()

    * draw shapes around the origin
    oWritePOV.writeoutput(oRD)
    oWritePOV.writeoutput(oSph)
    oWritePOV.writeoutput(oCubocta)

    * translate rh dodeca and sphere
    * and display
    oRD.translate(2,1,1,0)
    oSph.translate(2,1,1,0)
    oWritePOV.writeoutput(oRD)
    oWritePOV.writeoutput(oSph)

    * move them home, translate to another
    * corner of the cubocta, and display again
    oRD.gohome()
    oSph.gohome()
    oRD.translate(2,1,0,1)
    oSph.translate(2,1,0,1)
    oWritePOV.writeoutput(oRD)
    oWritePOV.writeoutput(oSph)
    return

procedure rhdodeca2
    oRD = createobject("rhdodeca")
    oCubocta = createobject("cubocta")
    oSph = createobject("sphere")
    oWriteVRML  = createobject("WriteVRML")
    oWriteVRML.makeaxes()
    oWriteVRML.writeoutput(oRD)
    oWriteVRML.writeoutput(oSph)
    oWriteVRML.writeoutput(oCubocta)
    oRD.translate(2,1,1,0)
    oSph.translate(2,1,1,0)
    oWriteVRML.writeoutput(oRD)
    oWriteVRML.writeoutput(oSph)
    oRD.gohome()
    oSph.gohome()
    oRD.translate(2,1,0,1)
    oSph.translate(2,1,0,1)
    oWriteVRML.writeoutput(oRD)
    oWriteVRML.writeoutput(oSph)
    return

procedure testrotate
    oTetra1 = createobject("tetrahedron")
    oTetra2 = createobject("tetrahedron")

    oWritePOV  = createobject("WritePOV")
    oWritePOV.makeaxes()
    oWritePOV.writeoutput(oTetra1)

    oTetra2.translate(2^.5,0,0)
    oTetra2.shapecolor="Black"
    oTetra2.rotate("X",90)

    oWritePOV.writeoutput(oTetra2)
    return

procedure smallbigtet
    oTetra1 = createobject("tetrahedron")
    ? oTetra1.shapevolume

    oWritePOV  = createobject("WritePOV")
    oWritePOV.makeaxes()
    oWritePOV.writeoutput(oTetra1)

    oTetra1.scale(2)
    oTetra1.shapecolor="Black"
    ? oTetra1.shapevolume

    oWritePOV.writeoutput(oTetra1)
    return

procedure rhtriac
    orhtriac = createobject("rhtriac")
    oIcosa = createobject("Icosahedron")
    oSph = createobject("sphere")
    oWriteVRML  = createobject("WriteVRML")

    oWriteVRML.writeoutput(orhtriac)
    oWriteVRML.writeoutput(oIcosa)

    orhtriac.scale(orhtriac.emodfactor)
    orhtriac.scale(orhtriac.tmodfactor)

    oWriteVRML.writeoutput(orhtriac)
    oWriteVRML.makeaxes()
    oWriteVRML.writeoutput(oSph)
    return

procedure rhtriac2
    orhtriac = createobject("rhtriac")
    oIcosa = createobject("Icosahedron")
    oSph = createobject("sphere")
    oWritePOV  = createobject("WritePOV")

    orhtriac.shapecolor = "Blue"
    oWritePOV.writeoutput(orhtriac)
    oWritePOV.writeoutput(oIcosa)
    ? orhtriac.shapevolume

    orhtriac.scale(orhtriac.emodfactor)
    ? orhtriac.shapevolume
    orhtriac.scale(orhtriac.tmodfactor)
    ? orhtriac.shapevolume

    orhtriac.shapecolor = "Magenta"
    oWritePOV.writeoutput(orhtriac)
    oWritePOV.makeaxes()
    oWritePOV.writeoutput(oSph)

    return