コード例 #1
0
ファイル: ObjVectList.cs プロジェクト: tatsumiking/GitBackup
 public void RemoveVect(ObjVect ObjVect)
 {
     m_lstObjVect.Remove(ObjVect);
 }
コード例 #2
0
        private ObjVect cnvRejionVect(byte[] byteData, int sp, int ep)
        {
            ObjVect  objVect;
            int      pp, p0, p1, p2, p3, p4;;
            ClsAtrXY atrxy0;
            ClsAtrXY atrxy1;
            ClsAtrXY atrxy2;
            ClsAtrXY atrxy3;
            ClsAtrXY atrxy4;
            ObjFigu  objFigu;

            if (sp == ep)
            {
                return(null);
            }
            if (sp + 1 == ep)
            {
                return(null);
            }
            for (pp = sp; pp <= ep; pp++)
            {
                atrxy0 = AtrDXYGet(byteData, pp);
            }
            objVect = new ObjVect();
            for (pp = sp; pp <= ep;)
            {
                p0     = getLegalPoint(pp - 1, sp, ep);
                p1     = getLegalPoint(pp, sp, ep);
                p2     = getLegalPoint(pp + 1, sp, ep);
                p3     = getLegalPoint(pp + 2, sp, ep);
                p4     = getLegalPoint(pp + 3, sp, ep);
                atrxy0 = AtrDXYGet(byteData, p0);
                atrxy1 = AtrDXYGet(byteData, p1);
                atrxy2 = AtrDXYGet(byteData, p2);
                atrxy3 = AtrDXYGet(byteData, p3);
                atrxy4 = AtrDXYGet(byteData, p4);
                if (checkBeze(atrxy1.atr, atrxy2.atr, atrxy3.atr) == true)
                {
                    objFigu = cnvBezeToFigu(atrxy1, atrxy2, atrxy3, atrxy4);
                    objVect.m_lstObjFigu.Add(objFigu);
                    pp = pp + 3;
                }
                else if (checkArc(atrxy1.atr, atrxy2.atr, atrxy3.atr) == true)
                {
                    objFigu = cnvArcToFigu(atrxy1, atrxy2, atrxy3);
                    objVect.m_lstObjFigu.Add(objFigu);
                    pp = pp + 2;
                }
                else if (checkArc(atrxy1.atr) == true)
                {
                    objFigu = cnvLineToFigu(atrxy1, atrxy2);
                    objVect.m_lstObjFigu.Add(objFigu);
                    pp = pp + 1;
                    //objFigu = cnvCruveToFigu(atrxy0, atrxy1, atrxy2, atrxy3);
                    //objVect.m_lstObjFigu.Add(objFigu);
                    //pp = pp + 1;
                }
                else
                {
                    objFigu = cnvLineToFigu(atrxy1, atrxy2);
                    objVect.m_lstObjFigu.Add(objFigu);
                    pp = pp + 1;
                }
            }
            return(objVect);
        }
コード例 #3
0
ファイル: ObjVectList.cs プロジェクト: tatsumiking/GitBackup
 public void AddVect(ObjVect ObjVect)
 {
     m_lstObjVect.Add(ObjVect);
 }
コード例 #4
0
ファイル: LibWinFont.cs プロジェクト: tatsumiking/GitBackup
        public ObjVectList ConvMojiToVectList(string str, string sFontName)
        {
            string              sTTFontName;
            double              dFontSize;
            ObjVectList         objVectList;
            ObjVect             objVect;
            ObjFigu             objFigu;
            ClsFontPathGeometry clsFGP;
            PathGeometry        pg;
            int               psmax, psidx;
            PathSegment       ps;
            int               pfmax, pfidx;
            PathFigure        pf;
            BezierSegment     bz;
            PolyBezierSegment pbz;
            LineSegment       ln;
            PolyLineSegment   pln;
            int               ptmax, ptidx;
            string            stype;
            double            x1, y1;

            dFontSize   = 1024;
            sTTFontName = GetTTFontName(sFontName);
            clsFGP      = m_libCmn.GetFontPathGeometry(str, dFontSize, sFontName);
            pfmax       = clsFGP.pg.Figures.Count;
            objVectList = new ObjVectList();
            for (pfidx = 0; pfidx < pfmax; pfidx++)
            {
                objVect = new ObjVect();
                pf      = clsFGP.pg.Figures[pfidx];
                x1      = pf.StartPoint.X;
                y1      = pf.StartPoint.Y + clsFGP.dMoveY;
                psmax   = pf.Segments.Count;
                for (psidx = 0; psidx < psmax; psidx++)
                {
                    ps    = pf.Segments[psidx];
                    stype = ps.GetType().Name;
                    if (stype.Equals("PolyBezierSegment"))
                    {
                        pbz   = (PolyBezierSegment)ps;
                        ptmax = pbz.Points.Count;
                        for (ptidx = 0; ptidx < ptmax; ptidx = ptidx + 3)
                        {
                            objFigu      = new ObjFigu();
                            objFigu.x1   = x1;
                            objFigu.y1   = y1;
                            objFigu.x2   = pbz.Points[ptidx].X;
                            objFigu.y2   = pbz.Points[ptidx].Y + clsFGP.dMoveY;
                            objFigu.x3   = pbz.Points[ptidx + 1].X;
                            objFigu.y3   = pbz.Points[ptidx + 1].Y + clsFGP.dMoveY;
                            objFigu.x4   = pbz.Points[ptidx + 2].X;
                            objFigu.y4   = pbz.Points[ptidx + 2].Y + clsFGP.dMoveY;
                            objFigu.kind = Constants.BEZEKIND;
                            objVect.m_lstObjFigu.Add(objFigu);
                            x1 = objFigu.x4;
                            y1 = objFigu.y4;
                        }
                    }
                    else if (stype.Equals("PolyLineSegment"))
                    {
                        pln   = (PolyLineSegment)ps;
                        ptmax = pln.Points.Count;
                        for (ptidx = 0; ptidx < ptmax; ptidx++)
                        {
                            objFigu      = new ObjFigu();
                            objFigu.x1   = x1;
                            objFigu.y1   = y1;
                            objFigu.x4   = pln.Points[ptidx].X;
                            objFigu.y4   = pln.Points[ptidx].Y + clsFGP.dMoveY;
                            objFigu.kind = Constants.LINEKIND;
                            objVect.m_lstObjFigu.Add(objFigu);
                            x1 = objFigu.x4;
                            y1 = objFigu.y4;
                        }
                    }
                    else if (stype.Equals("BezierSegment"))
                    {
                        objFigu      = new ObjFigu();
                        bz           = (BezierSegment)ps;
                        objFigu.x1   = x1;
                        objFigu.y1   = y1;
                        objFigu.x2   = bz.Point1.X;
                        objFigu.y2   = bz.Point1.Y + clsFGP.dMoveY;
                        objFigu.x3   = bz.Point2.X;
                        objFigu.y3   = bz.Point2.Y + clsFGP.dMoveY;
                        objFigu.x4   = bz.Point3.X;
                        objFigu.y4   = bz.Point3.Y + clsFGP.dMoveY;
                        objFigu.kind = Constants.BEZEKIND;
                        objVect.m_lstObjFigu.Add(objFigu);
                        x1 = objFigu.x4;
                        y1 = objFigu.y4;
                    }
                    else if (stype.Equals("LineSegment"))
                    {
                        objFigu      = new ObjFigu();
                        ln           = (LineSegment)ps;
                        objFigu.x1   = x1;
                        objFigu.y1   = y1;
                        objFigu.x4   = ln.Point.X;
                        objFigu.y4   = ln.Point.Y + clsFGP.dMoveY;
                        objFigu.kind = Constants.LINEKIND;
                        objVect.m_lstObjFigu.Add(objFigu);
                        x1 = objFigu.x4;
                        y1 = objFigu.y4;
                    }
                }
                objVectList.AddVect(objVect);
            }
            return(objVectList);
        }