private void handleInputPointSet(QDInputPointSet pointSet) { QDShapeFitting fitter = new QDShapeFitting(); bool shapeFitted = fitter.analyse(pointSet); //pointSet = scaleToAbs(pointSet); if (shapeFitted) { List <QDShape> modifiedShapes = constraints.analyse(pointSet); shapeDB.addInputPointSet(pointSet); foreach (QDShape shape in modifiedShapes) { paintSurface.Children.Remove(shape.path); } foreach (QDShape shape in modifiedShapes) { paintSurface.Children.Add(shape.getPath()); } paintSurface.Children.Add(pointSet.fittedShape.getPath()); // SERIOUS HACKERY //paintSurface.Children.Clear(); //foreach (QDInputPointSet ptSet in shapeDB.getPtSets()) //{ // ptSet.fittedShape.path = new System.Windows.Shapes.Path(); // this wipes the old one in case we changed it in constraints // paintSurface.Children.Add(ptSet.fittedShape.getPath()); //} } }
public void addInputPointSet(QDInputPointSet set) { int objectID = ptSets.Count; ptSets.Add(set); List <QDShapeDBPoint> intermediatePts = set.fittedShape.getIntermediatePoints(PT_SPACING); foreach (QDShapeDBPoint pt in intermediatePts) { pt.shape = set.fittedShape; quadTree.addPoint(pt); } }
public void setPtSetById(QDInputPointSet ptSet, int ID) { ptSets[ID] = ptSet; }