Package de.lmu.ifi.dbs.elki.result

Examples of de.lmu.ifi.dbs.elki.result.DBIDSelection


    super.destroy();
  }

  @Override
  protected void redraw() {
    DBIDSelection selContext = context.getSelection();
    if(selContext != null) {
      DBIDs selection = selContext.getSelectedIds();

      for(DBID objId : selection) {
        double[] yPos = proj.fastProjectDataToRenderSpace(relation.get(objId));

        SVGPath path = new SVGPath();
View Full Code Here


    }
  }

  @Override
  protected void redraw() {
    DBIDSelection selContext = context.getSelection();
    if(selContext == null || !(selContext instanceof RangeSelection)) {
      return;
    }
    DoubleDoublePair[] ranges = ((RangeSelection) selContext).getRanges();
    if(ranges == null) {
View Full Code Here

   * @param proj The projection
   * @param p1 First Point of the selected rectangle
   * @param p2 Second Point of the selected rectangle
   */
  private void updateSelection(Projection proj, SVGPoint p1, SVGPoint p2) {
    DBIDSelection selContext = context.getSelection();
    ModifiableDBIDs selection;
    if(selContext != null) {
      selection = DBIDUtil.newHashSet(selContext.getSelectedIds());
    }
    else {
      selection = DBIDUtil.newHashSet();
    }
    DoubleDoublePair[] ranges;
View Full Code Here

   * @param mode Input mode
   * @param p1 first point of the selected rectangle
   * @param p2 second point of the selected rectangle
   */
  private void updateSelection(Mode mode, SVGPoint p1, SVGPoint p2) {
    DBIDSelection selContext = context.getSelection();
    // Note: we rely on SET semantics below!
    final HashSetModifiableDBIDs selection;
    if(selContext == null || mode == Mode.REPLACE) {
      selection = DBIDUtil.newHashSet();
    }
    else {
      selection = DBIDUtil.newHashSet(selContext.getSelectedIds());
    }
    int[] axisrange = getAxisRange(Math.min(p1.getX(), p2.getX()), Math.max(p1.getX(), p2.getX()));
    for(DBID objId : relation.iterDBIDs()) {
      double[] yPos = proj.fastProjectDataToRenderSpace(relation.get(objId));
      if(checkSelected(axisrange, yPos, Math.max(p1.getX(), p2.getX()), Math.min(p1.getX(), p2.getX()), Math.max(p1.getY(), p2.getY()), Math.min(p1.getY(), p2.getY()))) {
        if(mode == Mode.INVERT) {
          if(!selection.contains(objId)) {
            selection.add(objId);
          }
          else {
            selection.remove(objId);
          }
        }
        else {
          // In REPLACE and ADD, add objects.
          // The difference was done before by not re-using the selection.
          // Since we are using a set, we can just add in any case.
          selection.add(objId);
        }
      }
    }
    context.setSelection(new DBIDSelection(selection));
  }
View Full Code Here

   * Add marker for the selected IDs to mtag
   */
  public void addMarker() {
    List<ClusterOrderEntry<D>> order = getClusterOrder();
    // TODO: replace mtag!
    DBIDSelection selContext = context.getSelection();
    if(selContext != null) {
      DBIDs selection = DBIDUtil.ensureSet(selContext.getSelectedIds());

      final double width = plotwidth / order.size();
      int begin = -1;
      for(int j = 0; j < order.size(); j++) {
        DBID id = order.get(j).getID();
View Full Code Here

    if(begin < 0 || begin > end || end >= order.size()) {
      logger.warning("Invalid range in updateSelection: " + begin + " .. " + end);
      return;
    }

    DBIDSelection selContext = context.getSelection();
    HashSetModifiableDBIDs selection;
    if(selContext == null || mode == Mode.REPLACE) {
      selection = DBIDUtil.newHashSet();
    }
    else {
      selection = DBIDUtil.newHashSet(selContext.getSelectedIds());
    }

    for(int i = begin; i <= end; i++) {
      DBID id = order.get(i).getID();
      if(mode == Mode.INVERT) {
        if(!selection.contains(id)) {
          selection.add(id);
        }
        else {
          selection.remove(id);
        }
      }
      else {
        // In REPLACE and ADD, add objects.
        // The difference was done before by not re-using the selection.
        // Since we are using a set, we can just add in any case.
        selection.add(id);
      }
    }
    context.setSelection(new DBIDSelection(selection));
  }
View Full Code Here

  }

  @Override
  protected void redraw() {
    addCSSClasses(svgp);
    DBIDSelection selContext = context.getSelection();
    if(selContext != null) {
      DBIDs selection = selContext.getSelectedIds();
      ConvexHull2D hull = new ConvexHull2D();
      for(DBID i : selection) {
        try {
          hull.add(new Vector(proj.fastProjectDataToRenderSpace(rel.get(i))));
        }
View Full Code Here

  /**
   * Update our selection
   */
  protected void updateFromSelection() {
    DBIDSelection sel = context.getSelection();
    if(sel != null) {
      this.dbids = DBIDUtil.newArray(sel.getSelectedIds());
      this.dbids.sort();
    }
    else {
      this.dbids = DBIDUtil.newArray();
    }
View Full Code Here

      final DBID id = dbids.get(row);
      todel.add(id);
      remain.remove(id);
    }
    // Unselect first ...
    context.setSelection(new DBIDSelection(remain));
    // Now delete them.
    for(DBID id : todel) {
      upd.delete(id);
    }
  }
View Full Code Here

   * @param proj The projection
   * @param p1 First Point of the selected rectangle
   * @param p2 Second Point of the selected rectangle
   */
  private void updateSelection(Projection proj, SVGPoint p1, SVGPoint p2) {
    DBIDSelection selContext = context.getSelection();
    ModifiableDBIDs selection;
    if(selContext != null) {
      selection = DBIDUtil.newHashSet(selContext.getSelectedIds());
    }
    else {
      selection = DBIDUtil.newHashSet();
    }
    DoubleDoublePair[] ranges;
View Full Code Here

TOP

Related Classes of de.lmu.ifi.dbs.elki.result.DBIDSelection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.