Beispiel #1
0
        public void Update([NotNull] ChangeAlongCurves newState)
        {
            _curveUsability = newState._curveUsability;

            _reshapeSubcurves.Clear();
            _reshapeSubcurves.AddRange(newState.ReshapeCutSubcurves);

            TargetFeatures = newState.TargetFeatures;
        }
Beispiel #2
0
        public static List <ResultFeature> ApplyCutCurves(
            [NotNull] ChangeAlongGrpc.ChangeAlongGrpcClient rpcClient,
            [NotNull] IList <Feature> sourceFeatures,
            [NotNull] IList <Feature> targetFeatures,
            [NotNull] IList <CutSubcurve> selectedSubcurves,
            CancellationToken cancellationToken,
            out ChangeAlongCurves newChangeAlongCurves)
        {
            Dictionary <GdbObjectReference, Feature> featuresByObjRef =
                CreateFeatureDictionary(sourceFeatures, targetFeatures);

            ApplyCutLinesRequest request =
                CreateApplyCutCurvesRequest(sourceFeatures, targetFeatures, selectedSubcurves);

            ApplyCutLinesResponse response =
                rpcClient.ApplyCutLines(request, null, null, cancellationToken);

            List <ResultObjectMsg> responseResultFeatures = response.ResultFeatures.ToList();

            var resultFeatures = new List <ResultFeature>();

            foreach (ResultObjectMsg resultObjectMsg in responseResultFeatures)
            {
                GdbObjectReference originalFeatureRef =
                    GetOriginalGdbObjectReference(resultObjectMsg);

                Feature originalFeature = featuresByObjRef[originalFeatureRef];

                ResultFeature resultFeature = new ResultFeature(
                    originalFeature, resultObjectMsg);

                resultFeatures.Add(resultFeature);
            }

            newChangeAlongCurves = PopulateReshapeAlongCurves(
                sourceFeatures, targetFeatures, response.NewCutLines,
                (ReshapeAlongCurveUsability)response.CutLinesUsability);

            return(resultFeatures);
        }