private void generateDiagram() {
        if (mViewWidth == 0 || mViewHeight == 0) {
            return;
        }

        double[] arrayX = new double[mRegionsCount];
        double[] arrayY = new double[mRegionsCount];

        switch (mGenerationType) {
            case GENERATION_TYPE_RANDOM:
                generateRandomPoints(arrayX, arrayY);
                break;
            case GENERATION_TYPE_ORDERED:
                generateOrderedPoints(arrayX, arrayY);
                break;
            case GENERATION_TYPE_CUSTOM:
                generateCustomPoints(arrayX, arrayY);
                break;
            default:
                generateRandomPoints(arrayX, arrayY);
                break;
        }


        mVoronoi.generateVoronoi(arrayX, arrayY, 0, mViewWidth, 0, mViewHeight);
        mRegions = mVoronoi.getRegions();
    }
Set layer-type HARDWARE or SOFTWARE for the view (true/false).

@param enabled True if should be hardware acceleration, false if should be software
vorolay/src/main/java/quatja/com/vorolay/VoronoiView.java