Example #1
0
 public void CreateEntities(PicFactory factory)
 {
     ImpositionSolution solution = listBoxSolutions.SelectedItem as ImpositionSolution;
     if (null == solution) return;
     solution.CreateEntities(factory);
     factory.InsertCardboardFormat(solution.CardboardPosition, solution.CardboardDimensions);
 }
Example #2
0
        public void CreateEntities(PicFactory factory)
        {
            if (!(listBoxSolutions.SelectedItem is ImpositionSolution solution))
            {
                return;
            }
            solution.CreateEntities(factory);

            // insert dimensions
            short grp = 0;

            if (PicCotation.GetBBCotations(solution.Bbox, CotTypeBB, 0.1, out Vector2D pt0, out Vector2D pt1, out Vector2D pt2, out Vector2D pt3, out double delta0, out double delta1))
            {
                PicCotationDistance cotH = factory.AddCotation(PicCotation.CotType.COT_HORIZONTAL, grp, 0, pt0, pt1, delta0, "", 1) as PicCotationDistance;
                cotH.UseShortLines = true;
                cotH.Auto          = true;

                PicCotationDistance cotV = factory.AddCotation(PicCotation.CotType.COT_VERTICAL, grp, 0, pt2, pt3, delta1, "", 1) as PicCotationDistance;
                cotV.UseShortLines = true;
                cotV.Auto          = true;
            }


            if (null != Format && PicCotation.GetBBCotations(new Box2D(solution.CardboardPosition, solution.CardboardDimensions), CotTypeFormat, 0.1, out Vector2D ptf0, out Vector2D ptf1, out Vector2D ptf2, out Vector2D ptf3, out double deltaf0, out double deltaf1))
            {
                PicCotationDistance cotH = factory.AddCotation(PicCotation.CotType.COT_HORIZONTAL, grp, 0, ptf0, ptf1, deltaf0, "", 1) as PicCotationDistance;
                cotH.UseShortLines = true;
                cotH.Auto          = false;

                PicCotationDistance cotV = factory.AddCotation(PicCotation.CotType.COT_VERTICAL, grp, 0, ptf2, ptf3, deltaf1, "", 1) as PicCotationDistance;
                cotV.UseShortLines = true;
                cotV.Auto          = false;
            }
            factory.InsertCardboardFormat(solution.CardboardPosition, solution.CardboardDimensions);
        }
Example #3
0
 public void CreateEntities(PicFactory factory)
 {
     if (!(listBoxSolutions.SelectedItem is ImpositionSolution solution))
     {
         return;
     }
     solution.CreateEntities(factory);
     factory.InsertCardboardFormat(solution.CardboardPosition, solution.CardboardDimensions);
 }
Example #4
0
 public void GenerateThumbnail()
 {
     using (PicFactory factory = new PicFactory())
     {
         CreateEntities(factory);
         // insert format
         factory.InsertCardboardFormat(CardboardPosition, CardboardDimensions);
         // draw thumbnail
         PicGraphicsImage picImage = new PicGraphicsImage(new Size(ThumbnailWidth, ThumbnailWidth), Tools.BoundingBox(factory, PicFilter.FilterNone, 0.01));
         factory.Draw(picImage);
         // save thumbnail
         Thumbnail = picImage.Bitmap;
     }
 }
 public void GenerateThumbnail()
 {
     using (PicFactory factory = new PicFactory())
     {
         CreateEntities(factory);
         // compute bounding box without format
         PicVisitorBoundingBox visitor0 = new PicVisitorBoundingBox();
         factory.ProcessVisitor(visitor0);
         _box = visitor0.Box;
         // insert format
         factory.InsertCardboardFormat(CardboardPosition, CardboardDimensions);
         // compute bounding box with format
         PicVisitorBoundingBox visitor1 = new PicVisitorBoundingBox();
         factory.ProcessVisitor(visitor1);
         // draw thumbnail
         PicGraphicsImage picImage = new PicGraphicsImage(new System.Drawing.Size(50, 50), visitor1.Box);
         factory.Draw(picImage);
         // save thumbnail
         _thumbnail = picImage.Bitmap;
     }
 }