Пример #1
0
  /** @param c construction */
  public AlgoPolyhedronNet(Construction c, String[] labels, GeoPolyhedron p, NumberValue v) {
    super(c);
    this.p = p;
    this.v = v;
    vNum = ChangeableCoordParent.getGeoNumeric(v);

    outputNet =
        new OutputHandler<GeoPolyhedronNet>(
            new elementFactory<GeoPolyhedronNet>() {
              public GeoPolyhedronNet newElement() {
                GeoPolyhedronNet p = new GeoPolyhedronNet(cons);
                p.setParentAlgorithm(AlgoPolyhedronNet.this);
                return p;
              }
            });

    outputNet.adjustOutputSize(1);

    outputPointsBottom = createOutputPoints();
    outputPointsSide = createOutputPoints();
    outputPointsTop = createOutputPoints();

    outputPolygonsBottom = createOutputPolygons();
    outputPolygonsSide = createOutputPolygons();
    outputPolygonsTop = createOutputPolygons();

    outputSegmentsBottom = createOutputSegments();
    outputSegmentsSide = createOutputSegments();
    outputSegmentsTop = createOutputSegments();

    bottomPointsLength = p.getBottomFace().getPointsLength();
    createNet(bottomPointsLength);

    input = new GeoElement[] {p, (GeoElement) v};
    for (int i = 0; i < input.length; i++) {
      input[i].addAlgorithm(this);
    }

    getNet().createFaces();

    setOutput(bottomPointsLength);

    // set labels
    setLabels(labels);

    update();

    updateOutputSegmentsAndPolygonsParentAlgorithms();
  }
Пример #2
0
 final void setChangeableCoordParent(GeoPolygon3D polygon) {
   ChangeableCoordParent.setPolyhedronNet(polygon, vNum, p);
 }