public override BaseFootprintAlgorithm Unwrap() { return(new Bevel( IValueGeneratorContainer.FromObject(Angle), IValueGeneratorContainer.FromObject(Distance) )); }
public override BaseLotConstraint Unwrap() { return(new RequireAreaSpec( IValueGeneratorContainer.FromObject(Min ?? 0), IValueGeneratorContainer.FromObject(Max ?? float.PositiveInfinity) )); }
public override BaseSubdividerRule Unwrap() { return(new AccessRuleSpec( IValueGeneratorContainer.FromObject(TerminationChance ?? 0), Type )); }
public override BaseSpaceSpec Unwrap() { return(new RepeatSpec( Id, IValueGeneratorContainer.FromObject(Count), Space.Unwrap() )); }
public BaseFloorSelector Unwrap() { return(new RepeatSpec( Items.Select(a => a.Unwrap()).ToArray(), IValueGeneratorContainer.FromObject(Count), Vary )); }
public override BaseSubdividerRule Unwrap() { return(new AreaRuleSpec( IValueGeneratorContainer.FromObject(Min ?? 0), IValueGeneratorContainer.FromObject(Max ?? float.PositiveInfinity), IValueGeneratorContainer.FromObject(TerminationChance ?? 0) )); }
public override BaseSubdivideSpec Unwrap() { return(new ObbParcellerSpec( NonOptimalChance == null ? null : IValueGeneratorContainer.FromObject(NonOptimalChance), MaxNonOptimalRatio == null ? null : IValueGeneratorContainer.FromObject(MaxNonOptimalRatio), SplitRatio == null ? null : IValueGeneratorContainer.FromObject(SplitRatio), (Rules ?? new BaseSubdividerRule.BaseContainer[0]).Select(a => a.Unwrap()).ToArray() )); }
public Vector2 Unwrap(Func <double> random, INamedDataCollection metadata) { Contract.Requires(random != null); Contract.Requires(metadata != null); return(new Vector2( IValueGeneratorContainer.FromObject(X).SelectFloatValue(random, metadata), IValueGeneratorContainer.FromObject(Y).SelectFloatValue(random, metadata) )); }
public override BaseFootprintAlgorithm Unwrap() { return(new InvertCorner( IValueGeneratorContainer.FromObject(Angle), IValueGeneratorContainer.FromObject(Distance), IValueGeneratorContainer.FromObject(MinDistance ?? 0), InvertInner, InvertOuter )); }
public ITensorField Unwrap(Func <double> random, INamedDataCollection metadata) { Contract.Assume(Tensors != null); Contract.Assume(Center != null); return(new PointDistanceDecayField( Tensors.Unwrap(random, metadata), Center.Unwrap(random, metadata), IValueGeneratorContainer.FromObject(Decay).SelectFloatValue(random, metadata) )); }
public MergingParameters Unwrap() { var defaultAngular = new MergeParamPair(0.4f, 0.5f); var angular = AngularDeviation == null ? defaultAngular : new MergeParamPair(AngularDeviation.Value.Weight ?? defaultAngular.Weight, AngularDeviation.Value.Threshold ?? defaultAngular.Threshold); var defaultConvex = new MergeParamPair(0.3f, 0.9f); var convex = Convexity == null ? defaultConvex : new MergeParamPair(Convexity.Value.Weight ?? defaultConvex.Weight, Convexity.Value.Threshold ?? defaultConvex.Threshold); var defaultArea = new MergeParamPairWithCutoff(0.3f, 100, 4); var area = Area == null ? defaultArea : new MergeParamPairWithCutoff(Area.Value.Weight ?? defaultArea.Weight, Area.Value.Threshold ?? defaultArea.Threshold, Area.Value.Cutoff ?? defaultArea.Cutoff); return(new MergingParameters( IValueGeneratorContainer.FromObject(angular.Weight), IValueGeneratorContainer.FromObject(angular.Threshold), IValueGeneratorContainer.FromObject(convex.Weight), IValueGeneratorContainer.FromObject(convex.Threshold), IValueGeneratorContainer.FromObject(area.Weight), IValueGeneratorContainer.FromObject(area.Threshold), IValueGeneratorContainer.FromObject(area.Cutoff) )); }
public TracingConfiguration Unwrap(Func <double> random, INamedDataCollection metadata) { Contract.Requires(random != null); Contract.Requires(metadata != null); Contract.Ensures(Contract.Result <TracingConfiguration>() != null); Contract.Assume(MergeSearchAngle != null); Contract.Assume(SegmentLength != null); Contract.Assume(RoadWidth != null); Contract.Assume(PriorityField != null); Contract.Assume(SeparationField != null); Contract.Assume(TensorField != null); return(new TracingConfiguration( PriorityField.Unwrap(), SeparationField.Unwrap(), TensorField.Unwrap(random, metadata), IValueGeneratorContainer.FromObject(RoadWidth), MathHelper.ToRadians(IValueGeneratorContainer.FromObject(MergeSearchAngle).SelectFloatValue(random, metadata)), IValueGeneratorContainer.FromObject(SegmentLength).SelectFloatValue(random, metadata), IValueGeneratorContainer.FromObject(MergeDistance).SelectFloatValue(random, metadata))); }
public WallGrowthParameters Unwrap() { Contract.Assume(SeedSpacing != null); Contract.Assume(SeedChance != null); //Get parallel parameters (or use defaults) var defaultParallel = new ParallelCheckParameters { Length = 1.25f, Width = 1, Angle = 10 }; var parallelParams = ParallelCheck ?? defaultParallel; return(new WallGrowthParameters( IValueGeneratorContainer.FromObject(SeedSpacing, new NormallyDistributedValue(1.5f, 3, 4.5f, 0.5f)), IValueGeneratorContainer.FromObject(SeedChance, 0.5f), IValueGeneratorContainer.FromObject(parallelParams.Length, defaultParallel.Length), IValueGeneratorContainer.FromObject(parallelParams.Width, defaultParallel.Width), IValueGeneratorContainer.FromObject(parallelParams.Angle, defaultParallel.Angle).Transform(MathHelper.ToRadians), IValueGeneratorContainer.FromObject(IntersectionContinuationChance, 0.75f) )); }
public BaseFloorSelector Unwrap() { IValueGenerator defaultHeight = DefaultHeight == null ? new NormallyDistributedValue(2.5f, 3, 3.5f, 0.2f) : IValueGeneratorContainer.FromObject(DefaultHeight); return(new FloorRangeSpec(Includes.Select(a => a.Unwrap(defaultHeight)).ToArray())); }
public override BaseFootprintAlgorithm Unwrap() { return(new Twist( IValueGeneratorContainer.FromObject(Angle ?? 0) )); }
public BaseFloorSelector Unwrap() { IValueGenerator height = Height == null ? new NormallyDistributedValue(2.5f, 3f, 3.5f, 0.2f) : IValueGeneratorContainer.FromObject(Height); return(new FloorSpec(Id ?? Guid.NewGuid().ToString(), Tags.Unwrap().ToArray(), height)); }
internal FloorRangeIncludeSpec Unwrap(IValueGenerator defaultHeight) { var count = IValueGeneratorContainer.FromObject(Count); return(new FloorRangeIncludeSpec(Id ?? Guid.NewGuid().ToString(), count, Vary, Continuous, Tags.Unwrap().ToArray(), IValueGeneratorContainer.FromObject(Height, defaultHeight))); }
public CorridorParameters Unwrap() { return(new CorridorParameters( IValueGeneratorContainer.FromObject(Width ?? new NormallyDistributedValue(1, 1.5f, 2, 0.25f)) )); }
public ITensorField Unwrap(Func <double> random, INamedDataCollection metadata) { var angle = IValueGeneratorContainer.FromObject(Angle).SelectFloatValue(random, metadata); return(new Gridline(MathHelper.ToRadians(angle), Length ?? 1)); }
public override BaseFootprintAlgorithm Unwrap() { return(new Shrink( IValueGeneratorContainer.FromObject(Distance ?? 0) )); }
public override BaseFootprintAlgorithm Unwrap() { return(new MinArea(IValueGeneratorContainer.FromObject(Area), Action.Unwrap(), Fallback.UnwrapNullable())); }