public Bitmap Image(Size s, Vector3D vCamera, Vector3D vTarget, ref Point offset) { if ( ( null == _bitmap || ((_vCamera - vCamera).GetLengthSquared() > 1.0E-06 && (_vTarget - vTarget).GetLengthSquared() > 1.0E-06) ) && null != Analysis) { // generate bitmap Graphics3DImage graphics = new Graphics3DImage(s) { BackgroundColor = Color.Transparent, CameraPosition = vCamera, Target = vTarget, MarginPercentage = 0.0, ShowDimensions = false }; if (Analysis is AnalysisLayered analysisLay) { using (var viewer = new ViewerSolution(analysisLay.SolutionLay)) { viewer.Draw(graphics, RelativeTransf); } } else if (Analysis is AnalysisHCyl analysisHCyl) { using (var viewer = new ViewerSolutionHCyl(analysisHCyl.Solution as SolutionHCyl)) { viewer.Draw(graphics, RelativeTransf); } } graphics.Flush(); // save bitmap _bitmap = graphics.Bitmap; _vCamera = vCamera; _vTarget = vTarget; Offset = graphics.Offset; } offset = Offset; return(_bitmap); }
public void Draw(Graphics3D graphics, Transform3D transf) { if (Analysis is AnalysisLayered analysisLay) { using (var viewer = new ViewerSolution(analysisLay.SolutionLay)) { viewer.Draw(graphics, transf); } } else if (Analysis is AnalysisHCyl analysisHCyl) { using (var viewer = new ViewerSolutionHCyl(analysisHCyl.Solution as SolutionHCyl)) { viewer.Draw(graphics, transf); } } else if (null != PackProperties) { Pack pack = new Pack(0, PackProperties, new BoxPosition(Vector3D.Zero).Transform(transf)); graphics.AddBox(pack); } else if (null != InterlayerProperties) { Box box = new Box(0, InterlayerProperties, new BoxPosition(Vector3D.Zero).Transform(transf)); graphics.AddBox(box); } }
public void Draw(Graphics3DControl ctrl, Graphics3D graphics) { bool showDimensions = true; ViewerSolution sv = new ViewerSolution( Solution); sv.Draw(graphics, showDimensions); }