#VRML V2.0 utf8

EXTERNPROTO CurveAnimation[
 field MFFloat knot
 field SFInt32 order
 exposedField MFVec3f controlPoint
 exposedField SFInt32 tessellation
 exposedField MFFloat weight
 exposedField SFVec3f rotationAxis
 exposedField SFBool enableRotation
 exposedField SFBool hover
 eventIn SFFloat set_fraction
 eventOut SFVec3f position_changed
 eventOut SFRotation orientation_changed
 ]
[
  "CurveAnimationPROTO.wrl"
  "/usr/share/doc/whitedune/docs/scripted_Nodes/CurveAnimationPROTO.wrl"
  "http://wdune.ourproject.org//docs/scripted_Nodes/CurveAnimationPROTO.wrl"
]


DEF Transform1 Transform {
  rotation -1 -3.061269e-8 1.561565e-8 4.384388
  translation 0 -1.101159 8.743045e-2
  children 
    Shape {
      appearance Appearance {
        material Material {
        }
      }
      geometry IndexedFaceSet {
        color Color {
          color [
            0.330000 1 1
            1 0 1
            0 0 1
            1 0 0
            0 1 0.390000
            0.350000 0 0.420000
            1 1 1
            1 0.470000 0.510000
          ]
        }
        coord Coordinate {
          point [
            -0.235038 0.205064 -0.429187
            -0.179905 0.066701 -0.389502
            0.235038 0.205064 -0.429187
            0.179905 0.066701 -0.389502
            0.361294 0.261869 0.274442
            0.361294 -0.261869 0.274442
            -0.361294 0.261869 0.274442
            -0.361294 -0.261869 0.274442
          ]
        }
        texCoord TextureCoordinate {
          point [
            0 1
            0 0
            1 1
            1 0
          ]
        }
        ccw FALSE
        convex FALSE
        coordIndex [
          0 1 3 2 -1 
          4 5 7 6 -1 
          6 0 2 4 -1 
          1 7 5 3 -1 
          6 7 0 -1 
          7 1 0 -1 
          2 5 4 -1 
          2 3 5 -1 
        ]
        texCoordIndex [
          0 1 3 2 -1 
          0 1 3 2 -1 
          0 1 3 2 -1 
          0 1 3 2 -1 
          0 1 2 -1 
          1 3 2 -1 
          0 3 2 -1 
          0 1 3 -1 
        ]
      }
    }
}

DEF TimeSensor1 TimeSensor {
  cycleInterval 10
  loop TRUE
}

Viewpoint {
  orientation -0.998815 4.593294e-3 -4.844188e-2 3.726002
  position 2.009015 -5.393518 -6.997005
}

DEF CurveAnimation1 CurveAnimation {
  controlPoint [
    0 1.792409 -1.001355
    0 2.461379 6.431862
    0 0 0
    0 -3.685497 -0.176086
    0 2.309631 -2.560001
  ]
  weight [
    1
    1
    1
    1
    1
  ]
  knot [
    0
    0
    0
    1
    2
    3
    3
    3
  ]
  rotationAxis 1 0 0
}

ROUTE TimeSensor1.fraction_changed TO CurveAnimation1.set_fraction
ROUTE CurveAnimation1.position_changed TO Transform1.set_translation
ROUTE CurveAnimation1.orientation_changed TO Transform1.set_rotation

DEF Transform1_0 Transform {
  rotation 3.060120e-8 1 -1.559652e-8 4.383157
  translation -1.098691 0 8.831896e-2
  children 
    Shape {
      appearance Appearance {
        material Material {
        }
      }
      geometry IndexedFaceSet {
        color Color {
          color [
            0.330000 1 1
            1 0 1
            0 0 1
            1 0 0
            0 1 0.390000
            0.350000 0 0.420000
            1 1 1
            1 0.470000 0.510000
          ]
        }
        coord Coordinate {
          point [
            -0.235038 0.205064 -0.429187
            -0.179905 0.066701 -0.389502
            0.235038 0.205064 -0.429187
            0.179905 0.066701 -0.389502
            0.361294 0.261869 0.274442
            0.361294 -0.261869 0.274442
            -0.361294 0.261869 0.274442
            -0.361294 -0.261869 0.274442
          ]
        }
        texCoord TextureCoordinate {
          point [
            0 1
            0 0
            1 1
            1 0
          ]
        }
        ccw FALSE
        convex FALSE
        coordIndex [
          0 1 3 2 -1 
          4 5 7 6 -1 
          6 0 2 4 -1 
          1 7 5 3 -1 
          6 7 0 -1 
          7 1 0 -1 
          2 5 4 -1 
          2 3 5 -1 
        ]
        texCoordIndex [
          0 1 3 2 -1 
          0 1 3 2 -1 
          0 1 3 2 -1 
          0 1 3 2 -1 
          0 1 2 -1 
          1 3 2 -1 
          0 3 2 -1 
          0 1 3 -1 
        ]
      }
    }
}

DEF TimeSensor1_0 TimeSensor {
  cycleInterval 10
  loop TRUE
}

DEF CurveAnimation1_0 CurveAnimation {
  controlPoint [
    1.792409 0 -1.001355
    2.461379 0 6.431862
    0 0 0
    -3.685497 0 -0.176086
    2.309631 0 -2.560001
  ]
  weight [
    1
    1
    1
    1
    1
  ]
  knot [
    0
    0
    0
    1
    2
    3
    3
    3
  ]
}

ROUTE TimeSensor1_0.fraction_changed TO CurveAnimation1_0.set_fraction
ROUTE CurveAnimation1_0.position_changed TO Transform1_0.set_translation
ROUTE CurveAnimation1_0.orientation_changed TO Transform1_0.set_rotation

DEF Transform1_1 Transform {
  rotation -4.097246e-8 -4.702997e-8 -1 3.415216
  translation -0.273470 -0.746813 0.641034
  children 
    Shape {
      appearance Appearance {
        material Material {
        }
      }
      geometry IndexedFaceSet {
        color Color {
          color [
            0.330000 1 1
            1 0 1
            0 0 1
            1 0 0
            0 1 0.390000
            0.350000 0 0.420000
            1 1 1
            1 0.470000 0.510000
          ]
        }
        coord Coordinate {
          point [
            -0.235038 0.205064 -0.429187
            -0.179905 0.066701 -0.389502
            0.235038 0.205064 -0.429187
            0.179905 0.066701 -0.389502
            0.361294 0.261869 0.274442
            0.361294 -0.261869 0.274442
            -0.361294 0.261869 0.274442
            -0.361294 -0.261869 0.274442
          ]
        }
        texCoord TextureCoordinate {
          point [
            0 1
            0 0
            1 1
            1 0
          ]
        }
        ccw FALSE
        convex FALSE
        coordIndex [
          0 1 3 2 -1 
          4 5 7 6 -1 
          6 0 2 4 -1 
          1 7 5 3 -1 
          6 7 0 -1 
          7 1 0 -1 
          2 5 4 -1 
          2 3 5 -1 
        ]
        texCoordIndex [
          0 1 3 2 -1 
          0 1 3 2 -1 
          0 1 3 2 -1 
          0 1 3 2 -1 
          0 1 2 -1 
          1 3 2 -1 
          0 3 2 -1 
          0 1 3 -1 
        ]
      }
    }
}

DEF TimeSensor1_1 TimeSensor {
  cycleInterval 10
  loop TRUE
}

DEF CurveAnimation1_1 CurveAnimation {
  controlPoint [
    1.792409 -1.001355 0
    2.461379 6.431862 0
    0 0 0
    -1.051245 -2.850061 2.050870
    2.309631 -2.560001 0
  ]
  weight [
    1
    1
    1
    1
    1
  ]
  knot [
    0
    0
    0
    1
    2
    3
    3
    3
  ]
  rotationAxis 0 0 1
}

ROUTE TimeSensor1_1.fraction_changed TO CurveAnimation1_1.set_fraction
ROUTE CurveAnimation1_1.position_changed TO Transform1_1.set_translation
ROUTE CurveAnimation1_1.orientation_changed TO Transform1_1.set_rotation

DEF Script1 Script {
  eventIn SFFloat float1_in
  eventOut SFBool bool1_out
  url "javascript:

 // eventOut SFBool bool1_out //

// insert program code only into functions

 function float1_in(value)
    {
    // value  SFFloat
    if (value > 0.8)
       bool1_out = false;
    else 
       bool1_out = true;
    }

"
}

ROUTE TimeSensor1_1.fraction_changed TO Script1.float1_in
ROUTE Script1.bool1_out TO CurveAnimation1_1.set_enableRotation

