Пример #1
0
  /**
   * Copies all node information from <code>originalNodeComponent</code> into the current node. This
   * method is called from the <code>duplicateNode</code> method. This routine does the actual
   * duplication of all "local data" (any data defined in this object).
   *
   * @param originalNodeComponent the original node to duplicate.
   * @param forceDuplicate when set to <code>true</code>, causes the <code>duplicateOnCloneTree
   *     </code> flag to be ignored. When <code>false</code>, the value of each node's <code>
   *     duplicateOnCloneTree</code> variable determines whether NodeComponent data is duplicated or
   *     copied.
   * @see Node#cloneTree
   * @see NodeComponent#setDuplicateOnCloneTree
   */
  void duplicateAttributes(NodeComponent originalNodeComponent, boolean forceDuplicate) {
    super.duplicateAttributes(originalNodeComponent, forceDuplicate);

    TransparencyAttributesRetained attr =
        (TransparencyAttributesRetained) originalNodeComponent.retained;
    TransparencyAttributesRetained rt = (TransparencyAttributesRetained) retained;

    rt.initTransparencyMode(attr.getTransparencyMode());
    rt.initTransparency(attr.getTransparency());
    rt.initSrcBlendFunction(attr.getSrcBlendFunction());
    rt.initDstBlendFunction(attr.getDstBlendFunction());
  }
Пример #2
0
  /** This returns whether or not this atom goes into the opaque light bin */
  boolean isOpaque() {
    AppearanceRetained app = geometryAtom.source.appearance;

    if (app == null) {
      return true;
    }

    TransparencyAttributesRetained ta = app.transparencyAttributes;

    switch (geometryAtom.geoType) {
      case GeometryRetained.GEO_TYPE_POINT_SET:
      case GeometryRetained.GEO_TYPE_INDEXED_POINT_SET:
        if ((app.pointAttributes != null) && app.pointAttributes.pointAntialiasing) {
          return false;
        }
        break;
      case GeometryRetained.GEO_TYPE_LINE_SET:
      case GeometryRetained.GEO_TYPE_LINE_STRIP_SET:
      case GeometryRetained.GEO_TYPE_INDEXED_LINE_SET:
      case GeometryRetained.GEO_TYPE_INDEXED_LINE_STRIP_SET:
        if ((app.lineAttributes != null) && app.lineAttributes.lineAntialiasing) {
          return false;
        }
        break;
      case GeometryRetained.GEO_TYPE_RASTER:
      case GeometryRetained.GEO_TYPE_COMPRESSED:
        break;
      default:
        if (app.polygonAttributes != null) {
          if ((app.polygonAttributes.polygonMode == PolygonAttributes.POLYGON_POINT)
              && (app.pointAttributes != null)
              && app.pointAttributes.pointAntialiasing) {
            return false;
          } else if ((app.polygonAttributes.polygonMode == PolygonAttributes.POLYGON_LINE)
              && (app.lineAttributes != null)
              && app.lineAttributes.lineAntialiasing) {
            return false;
          }
        }
        break;
    }

    return !TransparencyAttributesRetained.useAlpha(ta);
  }