/**
   * draw surfaces to pick them
   *
   * @param renderer opengl context
   */
  public void drawForPickingSurfaces(Renderer renderer) {

    renderer.disableCulling();

    drawListForPickingSurface(renderer, lists[Drawable3D.DRAW_TYPE_SURFACES]);
    drawListForPickingSurface(renderer, lists[Drawable3D.DRAW_TYPE_CLOSED_SURFACES_NOT_CURVED]);

    renderer.enableCulling();

    renderer.setCullFaceFront();
    drawListForPickingSurface(renderer, lists[Drawable3D.DRAW_TYPE_CLOSED_SURFACES_CURVED]);
    renderer.setCullFaceBack();
    drawListForPickingSurface(renderer, lists[Drawable3D.DRAW_TYPE_CLOSED_SURFACES_CURVED]);

    renderer.disableCulling();

    if (containsClippedSurfacesInclLists()) {
      renderer.enableClipPlanesIfNeeded();
      drawListForPickingSurface(renderer, lists[Drawable3D.DRAW_TYPE_CLIPPED_SURFACES]);
      renderer.disableClipPlanesIfNeeded();
    }

    renderer.enableCulling();

    // lists
    for (Iterator<Drawable3D> d = lists[Drawable3D.DRAW_TYPE_LISTS].iterator(); d.hasNext(); ) {
      ((DrawList3D) d.next()).getDrawable3DLists().drawForPickingSurfaces(renderer);
    }
  }
  /**
   * draw the not hidden (solid) parts of curves and points
   *
   * @param renderer opengl context
   */
  public void draw(Renderer renderer) {

    // curves
    for (Iterator<Drawable3D> d = lists[Drawable3D.DRAW_TYPE_CURVES].iterator(); d.hasNext(); ) {
      d.next().drawOutline(renderer);
    }

    if (containsClippedCurves()) {
      renderer.enableClipPlanesIfNeeded();
      for (Iterator<Drawable3D> d = lists[Drawable3D.DRAW_TYPE_CLIPPED_CURVES].iterator();
          d.hasNext(); ) d.next().drawOutline(renderer);
      renderer.disableClipPlanesIfNeeded();
    }

    // lists
    for (Iterator<Drawable3D> d = lists[Drawable3D.DRAW_TYPE_LISTS].iterator(); d.hasNext(); ) {
      ((DrawList3D) d.next()).getDrawable3DLists().draw(renderer);
    }
  }
  /**
   * draw the hidden (dashed) parts of curves and points
   *
   * @param renderer opengl context
   */
  public void drawHiddenTextured(Renderer renderer) {

    // curves
    // TODO if there's no surfaces, no hidden part has to be drawn
    // if(!lists[Drawable3D.DRAW_TYPE_SURFACES].isEmpty())
    for (Iterator<Drawable3D> d = lists[Drawable3D.DRAW_TYPE_CURVES].iterator(); d.hasNext(); )
      d.next().drawHidden(renderer);

    if (containsClippedCurves()) {
      renderer.enableClipPlanesIfNeeded();
      for (Iterator<Drawable3D> d = lists[Drawable3D.DRAW_TYPE_CLIPPED_CURVES].iterator();
          d.hasNext(); ) d.next().drawHidden(renderer);
      renderer.disableClipPlanesIfNeeded();
    }

    // lists
    for (Iterator<Drawable3D> d = lists[Drawable3D.DRAW_TYPE_LISTS].iterator(); d.hasNext(); ) {
      ((DrawList3D) d.next()).getDrawable3DLists().drawHiddenTextured(renderer);
    }
  }
  private void drawForPickingPointsAndCurves(Renderer renderer, DrawList3D parent) {

    renderer.disableCulling();

    drawListForPickingPointOrCurve(renderer, lists[Drawable3D.DRAW_TYPE_DEFAULT]);
    drawListForPickingPointOrCurve(renderer, lists[Drawable3D.DRAW_TYPE_POINTS]);
    drawListForPickingPointOrCurve(renderer, lists[Drawable3D.DRAW_TYPE_CURVES]);

    if (containsClippedCurves()) {
      renderer.enableClipPlanesIfNeeded();
      drawListForPickingPointOrCurve(renderer, lists[Drawable3D.DRAW_TYPE_CLIPPED_CURVES]);
      renderer.disableClipPlanesIfNeeded();
    }

    renderer.enableCulling();
    renderer.setCullFaceBack();

    // lists
    for (Iterator<Drawable3D> d = lists[Drawable3D.DRAW_TYPE_LISTS].iterator(); d.hasNext(); ) {
      ((DrawList3D) d.next()).getDrawable3DLists().drawForPickingPointsAndCurves(renderer);
    }
  }