private static ElementType addTextureProps ( final ElementType sourceType ) { List < Property > properties = new ArrayList < Property > ( ) ; boolean foundU = false ; boolean foundV = false ; for ( Property property : sourceType . getProperties ( ) ) { if ( property . getName ( ) . equals ( "u" ) ) { foundU = true ; } if ( property . getName ( ) . equals ( "v" ) ) { foundV = true ; } properties . add ( property ) ; } if ( foundU && foundV ) { return sourceType ; } if ( ! foundU ) { properties . add ( new Property ( "u" , DataType . DOUBLE ) ) ; } if ( ! foundV ) { properties . add ( new Property ( "v" , DataType . DOUBLE ) ) ; } return new ElementType ( "vertex" , properties ) ; }
Adds properties for u and v if they don t already exist .