Clipping IDLgrPolyLine objects? [message #13844] |
Thu, 17 December 1998 00:00  |
dEdmundson
Messages: 23 Registered: February 1998
|
Junior Member |
|
|
I've created my own Plot2D object that contains axes and
any number of line plots. The user sets the axes range
via a keyword parameter. Plots are then added via an
object method, e.g.
p = Obj_New('Plot2D', xrange=[0.0,50.0], yrange=[-0.5,0.5])
x=findgen(100)
p->addplot,x,sin(x)
The problem is that the polyline object is not clipped to
the box defined by the Plot2D range. If x spans a larger
range (as it does above), the line crosses the boundary.
While I can deal with clipping at the x endpoints easily
enough, I can't think of a simple way to clip pieces of
the polyline that go over the top or bottom. Is there
a simple method of clipping polylines?
Cheers,
Darran.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
|
|
|
Re: Clipping IDLgrPolyLine objects? [message #13972 is a reply to message #13844] |
Fri, 18 December 1998 00:00  |
Struan Gray
Messages: 178 Registered: December 1995
|
Senior Member |
|
|
dEdmundson@Bigfoot.com wrote in message
> ...Is there a simple method of clipping polylines?
Put them in their own IDLgrView object, and set that view's
location, dimension and viewplane rectangle properties so that it
matches the plotting area in both device and real-world coordinates.
Then put the axes, annotations, etc in a second, larger view object
which encloses and overlays the first. Put both views into an
IDLgrScene in the order given above so that annotations overlay the
plot and not vice versa, and set the second view to be transparent so
that it doesn't erase the first.
Struan
|
|
|
|