InitialObjectDescriptor {
 objectDescriptorID 1
 audioProfileLevelIndication 255
 visualProfileLevelIndication 254
 sceneProfileLevelIndication 1
 graphicsProfileLevelIndication 1
 ODProfileLevelIndication 1
 esDescr [
  ES_Descriptor {
   ES_ID 1
   decConfigDescr DecoderConfigDescriptor {
    streamType 3
    decSpecificInfo BIFSConfig {
     isCommandStream true
     pixelMetric true
     pixelWidth 400
     pixelHeight 400
    }
   }
  }
 ]
}

PROTO Palette [
 exposedField SFVec2f translation 0 0
 exposedField SFVec2f scale 1 1
 eventOut SFColor selectedColor
] {
 PROTO PaletteElement [
  exposedField SFVec2f translation 0 0
  exposedField SFVec2f scale 1 1
  exposedField SFColor color 0 0 0
  eventOut SFBool isOver
 ] {
  Transform2D {
   scale IS scale
   translation IS translation
   children [
    TouchSensor {
     isOver IS isOver
    }
    Shape {
     appearance Appearance {
      material Material2D {
       emissiveColor IS color
       filled TRUE
       lineProps LineProperties {
        width 3
       }
      }
     }
     geometry IndexedFaceSet2D {
      coordIndex [0 1 2 3 4 5 -1]
      coord Coordinate2D {
       point [100 0 50 86.6 -50 86.6 -100 0 -50 -86.6 50 -86.6]
      }
     }
    }
   ]
  }
 }
 DEF TR Transform2D {
  scale IS scale
  translation IS translation
  children [
   DEF RedPaletteElement PaletteElement {
    color 1 0 0
   }
  ]
 }
 DEF ColorValuator Valuator {
  outSFColor IS selectedColor
 }
 DEF RConditional Conditional {
  buffer {
   REPLACE ColorValuator.inSFColor BY 1 0 0
  }
 }
 DEF Conditional Conditional {
  buffer {
   REPLACE ColorValuator.inSFColor BY 0.8 0.8 0.8
  }
 }
 ROUTE RedPaletteElement.isOver TO RConditional.activate
 ROUTE RedPaletteElement.isOver TO Conditional.reverseActivate
}
OrderedGroup {
 children [
  Background2D {
   backColor 1 1 1
  }
  WorldInfo {
   info ["This shows a Proto using DEF/USE Protos" "declared inside the proto itself" "" "GPAC Regression Tests" "$Date: 2007-07-27 09:46:10 $ - $Revision: 1.2 $" "(C) 2002-2004 GPAC Team"]
   title "Nested Proto test"
  }
  Transform2D {
   translation 0 100
   children [
    Shape {
     appearance Appearance {
      material DEF Material2DNode Material2D {
       filled TRUE
       lineProps LineProperties {
        width 3
       }
      }
     }
     geometry Rectangle {
      size 10 10
     }
    }
   ]
  }
  Transform2D {
   scale 0.5 0.5
   translation -100 -50
   children [
    DEF P Palette {}
   ]
  }
  Transform2D {
   scale 0.5 0.5
   translation 50 -50
   children [
    Palette {}
   ]
  }
 ]
}

ROUTE P.selectedColor TO Material2DNode.emissiveColor

