Exemple #1
0
        private void DrawDeep(DeepMode mode, int spx, int spy)
        {
            try {
                using (var deepModel = new TreeChartModel()) {
                    deepModel.Assign(fModel);
                    deepModel.SetRenderer(fRenderer);
                    deepModel.DepthLimit = 2;
                    deepModel.GenChart(fSelected.Rec, TreeChartKind.ckBoth, true);
                    deepModel.RecalcChart(true);

                    var pers = deepModel.FindPersonByRec(fSelected.Rec);
                    int dmX  = (spx + (fSelected.PtX - pers.PtX));
                    int dmY  = (spy + (fSelected.PtY - pers.PtY));
                    deepModel.SetOffsets(dmX, dmY);
                    deepModel.VisibleArea = ExtRect.CreateBounds(0, 0, deepModel.ImageWidth, deepModel.ImageHeight);

                    switch (mode)
                    {
                    case DeepMode.Background:
                        fRenderer.SetTranslucent(0.75f);
                        break;

                    case DeepMode.Foreground:
                        fRenderer.SetTranslucent(0.25f);
                        IPen   xpen   = fRenderer.CreatePen(ChartRenderer.GetColor(BSDConsts.Colors.Black), 2.0f);
                        IColor bColor = ChartRenderer.GetColor(BSDConsts.Colors.White);
                        fRenderer.DrawRoundedRectangle(xpen, bColor, dmX, dmY, deepModel.ImageWidth, deepModel.ImageHeight, 6);
                        fRenderer.SetTranslucent(0.00f);
                        break;
                    }

                    deepModel.Draw(ChartDrawMode.dmStatic);
                }
            } catch (Exception ex) {
                Logger.WriteError("TreeChartBox.DrawDeep()", ex);
            }
        }