comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Clipping IDLgrPolyLine objects?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Clipping IDLgrPolyLine objects? [message #13844] Thu, 17 December 1998 00:00 Go to next message
dEdmundson is currently offline  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 Go to previous message
Struan Gray is currently offline  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
Re: Clipping IDLgrPolyLine objects? [message #13975 is a reply to message #13844] Fri, 18 December 1998 00:00 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
dEdmundson@Bigfoot.com wrote in message <75agu3$74b$1@nnrp1.dejanews.com>...
> ...Is there
> a simple method of clipping polylines?

Draw something in front of it!

I have found the simplest way of controlling clipping/overlap in Object
Graphics is to use vertical separation. The smallest vertical separation
recognised by IDL for this purpose is equal to the distance between the
view's front and rear clipping planes divided by 2^16.

Eg see the Mask method in

http://katipo.niwa.cri.nz/~hadfield/gust/software/idl/mghgrg raph__define.pro

--
Mark Hadfield, m.hadfield@niwa.cri.nz http://www.niwa.cri.nz/~hadfield/
National Institute for Water and Atmospheric Research
PO Box 14-901, Wellington, New Zealand
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Double Slider
Next Topic: Re: Keeping rotated plots the same size

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:12:53 PDT 2025

Total time taken to generate the page: 0.00568 seconds