private void DrawDeep(DeepMode mode, int spx, int spy) { try { using (var deepModel = new TreeChartModel()) { deepModel.Assign(fModel); deepModel.SetRenderer(fRenderer); deepModel.DepthLimitAncestors = 2; deepModel.DepthLimitDescendants = 2; deepModel.GenChart(fSelected.Rec, TreeChartKind.ckBoth, true); deepModel.RecalcChart(true); var pers = deepModel.FindPersonByRec(fSelected.Rec); if (pers == null) { Logger.WriteError("TreeChartBox.DrawDeep(): unexpected failure"); return; } 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(BSDColors.Black), 2.0f); IColor bColor = ChartRenderer.GetColor(BSDColors.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); } }
public void SetRenderer(ChartRenderer renderer) { fRenderer = renderer; fModel.SetRenderer(renderer); }
public override void SetRenderer(ChartRenderer renderer) { base.SetRenderer(renderer); fModel.SetRenderer(renderer); }