Exemple #1
0
        private void PlaceElement(ITypeProvider provider, double x, double y)
        {
            BaseElementViewModel viewModel = BaseElementViewModel.GetViewModel(provider.ElementType, this);

            viewModel.Left = x - _trackerCenterX;
            viewModel.Top  = y - _trackerCenterY;
            BaseElements.Add(viewModel);
            AddUndoAction(new GenericAddedAction <BaseElementViewModel>(this, viewModel));
        }
Exemple #2
0
 /// <summary>
 /// Add tracker, selection and drawing connection view models
 /// </summary>
 private void AddDefaultElements()
 {
     Tracker   = new TrackerViewModel(this);
     Selection = new SelectionViewModel(this);
     _drawingConnectionViewModel = new DrawingConnectionViewModel(this);
     BaseElements.Add(Tracker);
     BaseElements.Add(Selection);
     BaseElements.Add(_drawingConnectionViewModel);
 }
Exemple #3
0
        public static async Task <OperationResult <IEnumerable <Element> > > GetBaseElements()
        {
            BaseElements intermediateResult = null;

            try
            {
                var url = Constants.ApiUrl + "/api/Elements/base";
                intermediateResult = await HttpClient.GetWithRetries <BaseElements>(url, 5);
            }
            catch
            {
                return(OperationResult <IEnumerable <Element> > .Failure());
            }

            var elements = intermediateResult.elements.Select(r =>
                                                              new Element(new Guid(r.id), r.imageName, r.name, r.score, r.description));

            return(OperationResult <IEnumerable <Element> > .Success(elements));
        }
Exemple #4
0
 public TwoHolesMeasurementMethod()
 {
     BaseElements.Add(new Hole());
     BaseElements.Add(new Hole());
 }
 public OneHoleMeasurementMethod()
 {
     BaseElements.Add(new Hole());
 }
Exemple #6
0
 public void DeleteItem(BaseElementViewModel item)
 {
     BaseElements.Remove(item);
     AddUndoAction(new GenericDeletedAction <BaseElementViewModel>(this, item));
 }
 public SurfacePerpendicularityMeasurementMethod()
 {
     BaseElements.Add(new Surface());
     BaseElements.Add(new Surface());
 }
Exemple #8
0
 public SurfaceParalellismMeasurementMethod()
 {
     BaseElements.Add(new Surface());
     BaseElements.Add(new Surface());
 }