Is it possible to create custom drawing procedure for my object?

*To*: mathgroup at smc.vnet.net*Subject*: [mg113533] Is it possible to create custom drawing procedure for my object?*From*: Dims <dims12 at hotmail.com>*Date*: Mon, 1 Nov 2010 05:02:04 -0500 (EST)

Is it possible to define a custom draw procedure for some custom object? For example, I have some figure, which is defined by two points FigureOfMyOwn[{x1,y1},{x2,y2}] How to do so that this figure will draw like normal Line or Circle objects? Graphics[FigureOfMyOwn[{0,0},{2,2}]] I don't want to define FigureOfMyOwn as a function, which converts to construction of Lines and Circles, I want it behaves like Circle, i.e. remain unchanged if used in formulas. Only drawing procedure should be redefined. I.e. is it possible to do something correct like this: Unprotect[Graphics] Graphics[x_FigureOfMyOwn] := Graphics[Circle[x[[1]], Norm[x[[2]] - x[[1]]]]] Protect[Graphics] ? The approach above doesn't work correctly since it draws Graphics[FigureOfMyOwn[{0, 0}, {1, 1}]] but not draws Graphics[{Line[{{0, 0}, {1, 1}}], FigureOfMyOwn[{0, 0}, {1, 1}]}] while draws Graphics[{Line[{{0, 0}, {1, 1}}], Circle[{0, 0}, Sqrt[2]]}] Thanks.