public SoilProperties() { //Init to conservative starting values _soilShrinkability = Shrinkage.Medium; _granular = false; _targetStepSize = 0.3f; _groundBearingPressure = 50d; }
protected Circle DrawRing(double depth, Shrinkage shrinkage, Point3d location) { var radius = GetRingRadius(depth, shrinkage); if (radius <= 0) { return(null); } return(new Circle { Center = new Point3d(location.X, location.Y, 0), Radius = radius }); }
public DBObjectCollection DrawRings(Shrinkage shrinkage, float StartDepth, float Step) { DBObjectCollection collection = new DBObjectCollection(); // Get the current document and database Document acDoc = Application.DocumentManager.MdiActiveDocument; Database acCurDb = acDoc.Database; Transaction acTrans = acCurDb.TransactionManager.TopTransaction; // Open the Block table for read BlockTable acBlkTbl; acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId, OpenMode.ForRead) as BlockTable; // Open the Block table record Model space for write BlockTableRecord acBlkTblRec; acBlkTblRec = acTrans.GetObject(acBlkTbl[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord; bool next = true; float currentDepth = StartDepth; Shrinkage = shrinkage; while (next) { float radius = GetRingRadius(currentDepth); if (radius > 0) { Circle acCirc = new Circle(); acCirc.Center = new Point3d(Location.X, Location.Y, 0); acCirc.Radius = radius; collection.Add(acCirc); } else { next = false; } currentDepth = currentDepth + Step; } return(collection); }
protected double GetRingRadius(double foundationDepth, Shrinkage shrinkage) { double dh = M(shrinkage) * foundationDepth + C(shrinkage); double actualRadius = dh * Height; double roundedRadius = Math.Ceiling(actualRadius * 100) / 100; //Check for "sapling" to avoid excessive rings if (ToBeRemoved && ActualHeight < MaxSpeciesHeight / 2) { if (actualRadius < 2) { return(-1); } } return(roundedRadius); }
public override DBObjectCollection DrawRings(Shrinkage shrinkage, double startDepth, double step) { var collection = new DBObjectCollection(); var currentDepth = startDepth; while (true) { var shape = DrawShape(currentDepth, shrinkage); if (shape == null) { return(collection); } collection.Add(shape); currentDepth += step; } }
public virtual DBObjectCollection DrawRings(Shrinkage shrinkage, double StartDepth, double Step) { DBObjectCollection collection = new DBObjectCollection(); bool next = true; double currentDepth = StartDepth; while (next) { Circle acCirc = DrawShape(currentDepth, shrinkage) as Circle; if (acCirc != null) { collection.Add(acCirc); } else { next = false; } currentDepth = currentDepth + Step; } return(collection); }
private void AdjustTabStripDisplayForScreenSize() { if (!_viewInitialized) { return; } if (_originalToolStripPanelWidth == 0) { SaveOriginalWidthValues(); SaveOriginalButtonTexts(); } switch (_currentShrinkage) { default: // Shrinkage.FullSize if (Width < STAGE_1) { // shrink to stage 1 _currentShrinkage = Shrinkage.Stage1; ShrinkToStage1(); // It is possible that we are jumping from FullScreen to a 'remembered' // smaller screen size, so test for all of them! if (Width < STAGE_2) { _currentShrinkage = Shrinkage.Stage2; ShrinkToStage2(); if (Width < STAGE_3) { _currentShrinkage = Shrinkage.Stage3; ShrinkToStage3(); } } } break; case Shrinkage.Stage1: if (Width >= STAGE_1) { // grow back to unshrunk _currentShrinkage = Shrinkage.FullSize; GrowToFullSize(); break; } if (Width < STAGE_2) { // shrink to stage 2 _currentShrinkage = Shrinkage.Stage2; ShrinkToStage2(); } break; case Shrinkage.Stage2: if (Width >= STAGE_2) { // grow back to stage 1 _currentShrinkage = Shrinkage.Stage1; GrowToStage1(); break; } if (Width < STAGE_3) { // shrink to stage 3 _currentShrinkage = Shrinkage.Stage3; ShrinkToStage3(); } break; case Shrinkage.Stage3: if (Width >= STAGE_3) { // grow back to stage 2 _currentShrinkage = Shrinkage.Stage2; GrowToStage2(); } break; } }
protected double C(Shrinkage shrinkage) { switch (TreeType) { case TreeType.Coniferous: switch (shrinkage) { case Shrinkage.High: switch (WaterDemand) { case WaterDemand.High: return(0.85); case WaterDemand.Medium: return(0.6); case WaterDemand.Low: throw new NotImplementedException(); } break; case Shrinkage.Medium: switch (WaterDemand) { case WaterDemand.High: return(0.8586); case WaterDemand.Medium: return(0.6401); case WaterDemand.Low: throw new NotImplementedException(); } break; case Shrinkage.Low: switch (WaterDemand) { case WaterDemand.High: return(0.8601); case WaterDemand.Medium: return(0.6608); case WaterDemand.Low: throw new NotImplementedException(); } break; } break; case TreeType.Deciduous: switch (shrinkage) { case Shrinkage.High: switch (WaterDemand) { case WaterDemand.High: return(1.75); case WaterDemand.Medium: return(1.29); case WaterDemand.Low: return(1.125); } break; case Shrinkage.Medium: switch (WaterDemand) { case WaterDemand.High: return(1.7783); case WaterDemand.Medium: return(1.3643); case WaterDemand.Low: return(1.25); } break; case Shrinkage.Low: switch (WaterDemand) { case WaterDemand.High: return(1.7912); case WaterDemand.Medium: return(1.4109); case WaterDemand.Low: return(1.3333); } break; } break; } return(0); }
protected double M(Shrinkage shrinkage) { switch (TreeType) { case TreeType.Coniferous: switch (shrinkage) { case Shrinkage.High: switch (WaterDemand) { case WaterDemand.High: return(-0.25); case WaterDemand.Medium: return(-0.25); case WaterDemand.Low: throw new NotImplementedException(); } break; case Shrinkage.Medium: switch (WaterDemand) { case WaterDemand.High: return(-0.2869); case WaterDemand.Medium: return(-0.3107); case WaterDemand.Low: throw new NotImplementedException(); } break; case Shrinkage.Low: switch (WaterDemand) { case WaterDemand.High: return(-0.3432); case WaterDemand.Medium: return(-0.4127); case WaterDemand.Low: throw new NotImplementedException(); } break; } break; case TreeType.Deciduous: switch (shrinkage) { case Shrinkage.High: switch (WaterDemand) { case WaterDemand.High: return(-0.5); case WaterDemand.Medium: return(-0.542); case WaterDemand.Low: return(-0.625); } break; case Shrinkage.Medium: switch (WaterDemand) { case WaterDemand.High: return(-0.5907); case WaterDemand.Medium: return(-0.6837); case WaterDemand.Low: return(-0.8333); } break; case Shrinkage.Low: switch (WaterDemand) { case WaterDemand.High: return(-0.7204); case WaterDemand.Medium: return(-0.8625); case WaterDemand.Low: return(-1.1111); } break; } break; } return(0); }
public virtual Curve DrawShape(double depth, Shrinkage shrinkage) { return(DrawRing(depth, shrinkage, Location)); }
//TODO: Need to review drawing of initial offset... public override Curve DrawShape(double depth, Shrinkage shrinkage) { var radius = GetRingRadius(depth, shrinkage); if (radius <= 0) { return(null); } var pLine = PolylineFromBase(); if (pLine == null) { return(null); } //TODO: Review this offset section as believe its a large maxinitialoffset result that is causing errors var initOffset = MaxInitialOffset(pLine); var initOffPlus = TryOffsetCurve(pLine, initOffset); var initOffMinus = TryOffsetCurve(pLine, -initOffset); var plusVert = new List <int>(); var minusVert = new List <int>(); for (var i = 1; i < pLine.NumberOfVertices; i++) { var circle = new Circle { Center = pLine.GetPoint3dAt(i), Radius = initOffset }; if (DoesIntersect(initOffPlus, circle)) { plusVert.Add(i); } if (DoesIntersect(initOffMinus, circle)) { minusVert.Add(i); } } var plusVertOrdered = plusVert.OrderByDescending(val => val).ToList(); var minusVertOrdered = minusVert.OrderByDescending(val => val).ToList(); plusVertOrdered.ForEach(i => initOffPlus.FilletAt(i, initOffset)); minusVertOrdered.ForEach(i => initOffMinus.FilletAt(i, initOffset)); //Now we've built the base create the real thing.... var adjust = radius - initOffset; var realOffPlus = TryOffsetCurve(initOffPlus, adjust); var realOffMinus = TryOffsetCurve(initOffMinus, -adjust); if (!pLine.Closed) { var start = StartArc(pLine, realOffPlus, realOffMinus, radius); var end = EndArc(pLine, realOffPlus, realOffMinus, radius); realOffPlus.JoinEntities(new Entity[] { start, end, realOffMinus }); realOffPlus.Closed = true; } else { realOffPlus.Closed = true; realOffMinus.Closed = true; if (realOffMinus.Length > realOffPlus.Length) { realOffPlus = realOffMinus; } } return(realOffPlus); }
private void AdjustTabStripDisplayForScreenSize() { if (!_viewInitialized) { return; } if (_originalToolStripPanelWidth == 0) { SaveOriginalWidthValues(); SaveOriginalButtonTexts(); } // First, set the width of _panelHoldingToolstrip, the control holding the language menu, help menu, // and possibly zoom control. It must be wide enough to display its content. In stages Full and 1, // it is also not less than original width. int desiredToolStripPanelWidth = Math.Max(_toolStrip.Width + MinToolStripMargin, _currentShrinkage <= Shrinkage.Stage1 ? _originalToolStripPanelWidth : 0); if (desiredToolStripPanelWidth != _panelHoldingToolStrip.Width) { _panelHoldingToolStrip.Width = desiredToolStripPanelWidth; AlignTopRightPanels(); } switch (_currentShrinkage) { default: // Shrinkage.FullSize if (Width < STAGE_1) { // shrink to stage 1 _currentShrinkage = Shrinkage.Stage1; ShrinkToStage1(); // It is possible that we are jumping from FullScreen to a 'remembered' // smaller screen size, so test for all of them! if (Width < STAGE_2) { _currentShrinkage = Shrinkage.Stage2; ShrinkToStage2(); if (Width < STAGE_3) { _currentShrinkage = Shrinkage.Stage3; ShrinkToStage3(); } } } break; case Shrinkage.Stage1: if (Width >= STAGE_1) { // grow back to unshrunk _currentShrinkage = Shrinkage.FullSize; GrowToFullSize(); break; } if (Width < STAGE_2) { // shrink to stage 2 _currentShrinkage = Shrinkage.Stage2; ShrinkToStage2(); } break; case Shrinkage.Stage2: if (Width >= STAGE_2) { // grow back to stage 1 _currentShrinkage = Shrinkage.Stage1; GrowToStage1(); break; } if (Width < STAGE_3) { // shrink to stage 3 _currentShrinkage = Shrinkage.Stage3; ShrinkToStage3(); } break; case Shrinkage.Stage3: if (Width >= STAGE_3) { // grow back to stage 2 _currentShrinkage = Shrinkage.Stage2; GrowToStage2(); } break; } }
private void AdjustTabStripDisplayForScreenSize() { if (!_viewInitialized) return; if (_originalToolStripPanelWidth == 0) { SaveOriginalWidthValues(); SaveOriginalButtonTexts(); } switch (_currentShrinkage) { default: // Shrinkage.FullSize if (Width < STAGE_1) { // shrink to stage 1 _currentShrinkage = Shrinkage.Stage1; ShrinkToStage1(); // It is possible that we are jumping from FullScreen to a 'remembered' // smaller screen size, so test for all of them! if (Width < STAGE_2) { _currentShrinkage = Shrinkage.Stage2; ShrinkToStage2(); if (Width < STAGE_3) { _currentShrinkage = Shrinkage.Stage3; ShrinkToStage3(); } } } break; case Shrinkage.Stage1: if (Width >= STAGE_1) { // grow back to unshrunk _currentShrinkage = Shrinkage.FullSize; GrowToFullSize(); break; } if (Width < STAGE_2) { // shrink to stage 2 _currentShrinkage = Shrinkage.Stage2; ShrinkToStage2(); } break; case Shrinkage.Stage2: if (Width >= STAGE_2) { // grow back to stage 1 _currentShrinkage = Shrinkage.Stage1; GrowToStage1(); break; } if (Width < STAGE_3) { // shrink to stage 3 _currentShrinkage = Shrinkage.Stage3; ShrinkToStage3(); } break; case Shrinkage.Stage3: if (Width >= STAGE_3) { // grow back to stage 2 _currentShrinkage = Shrinkage.Stage2; GrowToStage2(); } break; } }