Hi Vijay,
You're welcome and I hope ATF proves useful to you.
One first-party client who created a heavily customized version of CircuitEditor did derive from D2dCircuitRenderer and overrode these methods:
- public override void Draw(CircuitElement inElement, DiagramDrawingStyle inStyle, D2dGraphics inG)
- protected override D2dBrush GetPen(Pin pin)
- public override void Draw(Wire inWire, DiagramDrawingStyle inStyle, D2dGraphics inG)
- public override void Draw(CircuitElement inOutputElement, Pin inOutputPin, CircuitElement inInputElement, Pin inInputPin, string inLabel, Point inEndPoint, D2dGraphics inG)
- public override void OnGraphObjectChanged(object sender, ItemChangedEventArgs<object> e)
- public override RectangleF GetBounds(CircuitElement inElement, D2dGraphics inG)
- public override int GetPinOffset(ICircuitElement inElement, int inPinIndex, bool inInputSide)
- protected override bool Pick(CircuitElement inElement, D2dGraphics inG, PointF inP)
- protected override bool PickEdge(Wire inWire, PointF inPoint, D2dGraphics inG, float xOffset = 0, float yOffset = 0)
- protected override ElementSizeInfo GetElementSizeInfo(ICircuitElementType inType, D2dGraphics inG, string title = null)
(These methods were from a version of ATF from about a year ago, plus they had a forked version of ATF, so I can't promise that these methods are exactly the same in the current version.)
This did generate a lot of duplicate code. There's no easy alternative at the moment. For example, we don't have anything like a scene graph or container system where you could insert custom parts for each circuit element.
Can you give us some examples of the kinds of extra state that you wish to render? For example, do you envision each circuit element as a little property editor, with property editing controls (check boxes, text editors, sliders, etc.)?
--Ron