Esempio n. 1
0
        private ObjFigu cnvCruveToFigu(ClsAtrXY atrxy0, ClsAtrXY atrxy1, ClsAtrXY atrxy2, ClsAtrXY atrxy3)
        {
            ObjFigu    objFigu;
            int        atr0, atr1, atr2;
            double     x0, y0, x1, y1, x2, y2, x3, y3;
            ClsBeze    bz;
            ClsPairRag pr;
            ClsPoint   pt;

            objFigu      = new ObjFigu();
            objFigu.kind = Constants.BEZEKIND;
            objFigu.x1   = atrxy1.x; objFigu.y1 = atrxy1.y;
            objFigu.x4   = atrxy2.x; objFigu.y4 = atrxy2.y;
            atr0         = atrxy0.atr;
            atr1         = atrxy1.atr;
            atr2         = atrxy2.atr;
            x0           = atrxy0.x; y0 = atrxy0.y;
            x1           = atrxy1.x; y1 = atrxy1.y;
            x2           = atrxy2.x; y2 = atrxy2.y;
            x3           = atrxy3.x; y3 = atrxy3.y;
            pr           = new ClsPairRag();
            pr.srag      = m_libCurve.getCurveStartRag(atr0, atr1, x0, y0, x1, y1, x2, y2);
            pr.erag      = m_libCurve.getCurveEndRag(atr1, atr2, x1, y1, x2, y2, x3, y3);
            pr           = m_libCurve.legalCurveRag(pr);
            pt           = m_libCurve.getBezeControlPoint(x1, y1, x2, y2, pr.srag);
            objFigu.x2   = pt.x; objFigu.y2 = pt.y;
            pt           = m_libCurve.getBezeControlPoint(x2, y2, x1, y1, pr.erag);
            objFigu.x3   = pt.x; objFigu.y3 = pt.y;
            return(objFigu);
        }
Esempio n. 2
0
 public ClsPairRag legalCurveRag(ClsPairRag pr)
 {
     if (checkEqual(pr.srag, Constants.NORAG))
     {
         pr.srag = -(pr.erag);
     }
     if (checkEqual(pr.erag, Constants.NORAG))
     {
         pr.erag = -(pr.srag);
     }
     return(pr);
 }