Beispiel #1
0
        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);
                graphics.BackgroundColor  = Color.Transparent;
                graphics.CameraPosition   = vCamera;
                graphics.Target           = vTarget;
                graphics.MarginPercentage = 0.0;
                graphics.ShowDimensions   = false;
                using (ViewerSolution viewer = new ViewerSolution(_analysis.Solution))
                { viewer.Draw(graphics, RelativeTransf); }
                graphics.Flush();

                // save bitmap
                _bitmap  = graphics.Bitmap;
                _vCamera = vCamera;
                _vTarget = vTarget;
                _offset  = graphics.Offset;
            }
            offset = _offset;
            return(_bitmap);
        }
Beispiel #2
0
 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);
     }
     else if (null != BagProperties)
     {
         BoxRounded bag = new BoxRounded(0, BagProperties, new BoxPosition(Vector3D.Zero).Transform(transf));
         graphics.AddBox(bag);
     }
 }
Beispiel #3
0
        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(Graphics3DControl ctrl, Graphics3D graphics)
 {
     bool showDimensions = true;
     ViewerSolution sv = new ViewerSolution( Solution);
     sv.Draw(graphics, showDimensions);
 }