CPD Results

The following document contains the results of PMD's CPD 4.3.

Duplications

FileLine
org/deegree/rendering/r3d/multiresolution/SelectiveRefinement.java98
org/deegree/rendering/r3d/multiresolution/SpatialSelection.java105
    public List<MeshFragment> determineLOD() {

        List<MeshFragment> fragments = new ArrayList<MeshFragment>();

        adaptTopDown();

        for ( Arc arc : lod ) {
            for ( int fragmentId = arc.lowestPatch; fragmentId <= arc.highestPatch; fragmentId++ ) {
                MeshFragment fragment = mt.fragments[fragmentId];
                fragments.add( fragment );
            }
        }

        return fragments;
    }

    private void adaptTopDown() {

        long begin = System.currentTimeMillis();

        initializeCut();

        // initialize toDo with all arc ids in the current lod
        List<Arc> toDo = new ArrayList<Arc>( lod );

        while ( !toDo.isEmpty() ) {
            Arc region = toDo.remove( toDo.size() - 1 );
            Node modification = mt.nodes[region.destinationNode];

            // do not move the cut below the drain
            if ( modification.lowestOutgoingArc == -1 ) {
                continue;
            }

            // only process arc if it points to a node below the cut
            if ( !applied[modification.id] ) {
                if ( crit.needsRefinement( region ) ) {
                    int incomingArc = modification.lowestIncomingArc;
                    while ( incomingArc != -1 ) {
                        if ( applied[mt.arcs[incomingArc].sourceNode] ) {
                            lod.remove( mt.arcs[incomingArc] );
                        } else {
                            forceRefinement( mt.arcs[incomingArc], toDo );
                        }
                        incomingArc = mt.arcs[incomingArc].nextArcWithSameDestination;
                    }

                    if ( modification.lowestOutgoingArc > 0 ) {
                        for ( int arcId = modification.lowestOutgoingArc; arcId <= modification.highestOutgoingArc; arcId++ ) {
                            Arc arc = mt.arcs[arcId];
FileLine
org/deegree/rendering/r3d/model/WorldObject.java121
org/deegree/rendering/r3d/model/WorldObject.java262
        if ( bbox == null ) {
            throw new NullPointerException( "Bbox may not be null" );
        }
        this.bbox = bbox;
        Point p = bbox.getCentroid();
        double[] min = bbox.getMin().getAsArray();
        double[] max = bbox.getMax().getAsArray();
        position = new float[] { (float) p.get0(), (float) p.get1(),
                                (float) ( ( p.getCoordinateDimension() == 3 ) ? p.get2() : 0 ) };
        if ( bbox.getMin().getCoordinateDimension() == 2 ) {
            min = new double[] { min[0], min[1], 0 };
        }
        if ( bbox.getMax().getCoordinateDimension() == 2 ) {
            max = new double[] { max[0], max[1], 0 };
        }
FileLine
org/deegree/rendering/r3d/opengl/display/OpenGLEventHandler.java301
org/deegree/rendering/r3d/opengl/rendering/model/prototype/BOXGeometry.java125
        gl.glMaterialfv( GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, color, 0 );
        gl.glBegin( GL.GL_QUADS );
        // Top face
        gl.glNormal3f( 0, 1, 0 );
        gl.glVertex3fv( cubeData[3], 0 );
        gl.glVertex3fv( cubeData[2], 0 );
        gl.glVertex3fv( cubeData[6], 0 );
        gl.glVertex3fv( cubeData[7], 0 );
        // Bottom face
        gl.glNormal3f( 0, -1, 0 );
        gl.glVertex3fv( cubeData[4], 0 );
        gl.glVertex3fv( cubeData[5], 0 );
        gl.glVertex3fv( cubeData[1], 0 );
        gl.glVertex3fv( cubeData[0], 0 );
        gl.glEnd();
        gl.glEnable( GL.GL_BLEND );
FileLine
org/deegree/rendering/r3d/opengl/display/OpenGLEventHandler.java283
org/deegree/rendering/r3d/opengl/rendering/model/prototype/BOXGeometry.java108
        gl.glMaterialfv( GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, color, 0 );

        gl.glBegin( GL.GL_QUADS );
        // Left face
        gl.glNormal3f( -1, 0, 0 );
        gl.glVertex3fv( cubeData[4], 0 );
        gl.glVertex3fv( cubeData[0], 0 );
        gl.glVertex3fv( cubeData[3], 0 );
        gl.glVertex3fv( cubeData[7], 0 );
        // Right face
        gl.glNormal3f( 1, 0, 0 );
        gl.glVertex3fv( cubeData[1], 0 );
        gl.glVertex3fv( cubeData[5], 0 );
        gl.glVertex3fv( cubeData[6], 0 );
        gl.glVertex3fv( cubeData[2], 0 );
        gl.glEnd();
FileLine
org/deegree/rendering/r3d/opengl/rendering/dem/texturing/TextureTile.java408
org/deegree/rendering/r3d/opengl/rendering/dem/texturing/TextureTileRequest.java193
    }

    /**
     * Implementation as proposed by Joshua Block in Effective Java (Addison-Wesley 2001), which supplies an even
     * distribution and is relatively fast. It is created from field <b>f</b> as follows:
     * <ul>
     * <li>boolean -- code = (f ? 0 : 1)</li>
     * <li>byte, char, short, int -- code = (int)f</li>
     * <li>long -- code = (int)(f ^ (f &gt;&gt;&gt;32))</li>
     * <li>float -- code = Float.floatToIntBits(f);</li>
     * <li>double -- long l = Double.doubleToLongBits(f); code = (int)(l ^ (l &gt;&gt;&gt; 32))</li>
     * <li>all Objects, (where equals(&nbsp;) calls equals(&nbsp;) for this field) -- code = f.hashCode(&nbsp;)</li>
     * <li>Array -- Apply above rules to each element</li>
     * </ul>
     * <p>
     * Combining the hash code(s) computed above: result = 37 * result + code;
     * </p>
     * 
     * @return (int) ( result >>> 32 ) ^ (int) result;
     * 
     * @see java.lang.Object#hashCode()
     */
    @Override
    public int hashCode() {
        // the 2nd millionth prime, :-)
        long code = 32452843;
        long tmp = doubleToLongBits( this.minX );
        code = code * 37 + (int) ( tmp ^ ( tmp >>> 32 ) );
        tmp = doubleToLongBits( this.minY );
        code = code * 37 + (int) ( tmp ^ ( tmp >>> 32 ) );
        tmp = Double.doubleToLongBits( this.maxX );
        code = code * 37 + (int) ( tmp ^ ( tmp >>> 32 ) );
        tmp = Double.doubleToLongBits( this.maxY );
        code = code * 37 + (int) ( tmp ^ ( tmp >>> 32 ) );
        tmp = Double.doubleToLongBits( this.metersPerPixel );
FileLine
org/deegree/rendering/r3d/multiresolution/SelectiveRefinement.java173
org/deegree/rendering/r3d/multiresolution/SpatialSelection.java184
        }
        applied[0] = true;
    }

    private void forceRefinement( Arc region, List<Arc> toDo ) {

        Node modification = mt.nodes[region.sourceNode];

        int incomingArc = modification.lowestIncomingArc;
        while ( incomingArc != -1 ) {
            if ( applied[mt.arcs[incomingArc].sourceNode] ) {
                lod.remove( mt.arcs[incomingArc] );
            } else {
                forceRefinement( mt.arcs[incomingArc], toDo );
            }
            incomingArc = mt.arcs[incomingArc].nextArcWithSameDestination;
        }

        for ( int arcId = modification.lowestOutgoingArc; arcId <= modification.highestOutgoingArc; arcId++ ) {
            if ( arcId != region.id ) {
                Arc arc2 = mt.arcs[arcId];
FileLine
org/deegree/rendering/r3d/jaxb/renderable/RenderableFileStoreConfig.java115
org/deegree/rendering/r3d/jaxb/renderable/RenderableSQLStoreConfig.java143
        this.prototypeFile = value;
    }

    /**
     * Gets the value of the textureDirectory property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the textureDirectory property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getTextureDirectory().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link String }
     * 
     * 
     */
    public List<String> getTextureDirectory() {
        if (textureDirectory == null) {
            textureDirectory = new ArrayList<String>();
        }
        return this.textureDirectory;
    }

    /**
     * Gets the value of the configVersion property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getConfigVersion() {
        if (configVersion == null) {
            return "3.0.0";
        } else {
            return configVersion;
        }
    }

    /**
     * Sets the value of the configVersion property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setConfigVersion(String value) {
        this.configVersion = value;
    }

    /**
     * Gets the value of the isBillboard property.
     * 
     * @return
     *     possible object is
     *     {@link Boolean }
     *     
     */
    public boolean isIsBillboard() {
        if (isBillboard == null) {
            return false;
        } else {
            return isBillboard;
        }
    }

    /**
     * Sets the value of the isBillboard property.
     * 
     * @param value
     *     allowed object is
     *     {@link Boolean }
     *     
     */
    public void setIsBillboard(Boolean value) {
        this.isBillboard = value;
    }

}
FileLine
org/deegree/rendering/r3d/opengl/display/LODAnalyzer.java207
org/deegree/rendering/r3d/opengl/display/TextureTileAnalyzer.java177
            gl.glColor3f( 1.0f, 0.0f, 0.0f );
        }
    }

    @Override
    public void reshape( GLAutoDrawable drawable, int x, int y, int width, int height ) {
        LOG.trace( "reshape( GLAutoDrawable, " + x + ", " + y + ", " + width + ", " + height + " ) called" );

        GL gl = drawable.getGL();
        gl.glViewport( x, y, width, height );

        gl.glMatrixMode( GL.GL_PROJECTION );
        gl.glLoadIdentity();
        glu.gluOrtho2D( 0, width, 0, height );

        gl.glMatrixMode( GL.GL_MODELVIEW );
        gl.glLoadIdentity();
FileLine
org/deegree/rendering/r3d/ViewFrustum.java668
org/deegree/rendering/r3d/ViewFrustum.java682
        final Point3d getPositiveVertex( double[][] box ) {
            Point3d p = new Point3d( box[0][0], box[0][1], box[0][2] );
            if ( n.x >= 0.0 ) {
                p.x = box[1][0];
            }
            if ( n.y >= 0.0 ) {
                p.y = box[1][1];
            }
            if ( n.z >= 0.0 ) {
                p.z = box[1][2];
            }
            return p;
        }

        final Point3d getPositiveVertex( float[][] box ) {
FileLine
org/deegree/rendering/r3d/ViewFrustum.java709
org/deegree/rendering/r3d/ViewFrustum.java723
        final Point3d getNegativeVertex( double[][] box ) {
            Point3d p = new Point3d( box[1][0], box[1][1], box[1][2] );
            if ( n.x >= 0.0 ) {
                p.x = box[0][0];
            }
            if ( n.y >= 0.0 ) {
                p.y = box[0][1];
            }
            if ( n.z >= 0.0 ) {
                p.z = box[0][2];
            }
            return p;
        }

        final Point3d getNegativeVertex( float[][] box ) {