Esempio n. 1
0
    @Override
    public Aggregates<A> merge(Aggregates<A> left, Aggregates<A> right) {
      Aggregates<A> raw = base.merge(left, right);
      GlyphList<Shape, A> contours = new GlyphList<>();

      if (left instanceof ContourAggregates) {
        contours.addAll(((ContourAggregates<A>) left).contours);
      }
      if (right instanceof ContourAggregates) {
        contours.addAll(((ContourAggregates<A>) right).contours);
      }
      return new ContourAggregates<>(raw, contours);
    }
Esempio n. 2
0
    @Override
    public ContourAggregates<N> process(Aggregates<? extends N> aggregates, Renderer rend) {
      Aggregates<? extends N> padAggs = new PadAggregates<>(aggregates, null);

      Aggregates<Boolean> isoDivided = rend.transfer(padAggs, new ISOBelow<>(threshold));
      Aggregates<MC_TYPE> classified = rend.transfer(isoDivided, new MCClassifier());
      Shape s = Assembler.assembleContours(classified, isoDivided);
      GlyphList<Shape, N> contours = new GlyphList<>();

      contours.add(new SimpleGlyph<>(s, threshold));
      if (!fill) {
        isoDivided = rend.transfer(isoDivided, new General.Simplify<>(isoDivided.defaultValue()));
      }
      Aggregates<N> base =
          rend.transfer(
              isoDivided, new General.MapWrapper<>(true, threshold, aggregates.defaultValue()));
      return new ContourAggregates<>(base, contours);
    }