private static ElementType addNormalProps ( final ElementType sourceType ) { List < Property > properties = new ArrayList < Property > ( ) ; boolean foundNX = false ; boolean foundNY = false ; boolean foundNZ = false ; for ( Property property : sourceType . getProperties ( ) ) { if ( property . getName ( ) . equals ( "nx" ) ) { foundNX = true ; } if ( property . getName ( ) . equals ( "ny" ) ) { foundNY = true ; } if ( property . getName ( ) . equals ( "nz" ) ) { foundNZ = true ; } properties . add ( property ) ; } if ( foundNX && foundNY && foundNZ ) { return sourceType ; } if ( ! foundNX ) { properties . add ( new Property ( "nx" , DataType . DOUBLE ) ) ; } if ( ! foundNY ) { properties . add ( new Property ( "ny" , DataType . DOUBLE ) ) ; } if ( ! foundNZ ) { properties . add ( new Property ( "nz" , DataType . DOUBLE ) ) ; } return new ElementType ( "vertex" , properties ) ; }
Adds properties for nx ny and nz if they don t already exist .