Home » Eclipse Projects » GEF » clipping on region
clipping on region [message #154392] |
Mon, 18 October 2004 08:31 |
Eclipse User |
|
|
|
Originally posted by: primat.anyware-tech.com
Currently it not possible to set a clipping on region for the Graphics
object like in SWT.GC, will it be available soon?
thx
|
|
|
Re: clipping on region [message #154437 is a reply to message #154392] |
Mon, 18 October 2004 17:08 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
We cannot scale a Region, so there are no plans to support regions.
What are you trying to do? We could probably support regions as long as
they are not zoomed, but it would require warnings or exceptions when
clients try to use regions together with zoom. Also, the implementations of
push and popState on Graphics may be performance impacted by cloning
regions. This would require some special treatment.
"primat" <primat@anyware-tech.com> wrote in message
news:ckvurs$ugh$1@eclipse.org...
> Currently it not possible to set a clipping on region for the Graphics
> object like in SWT.GC, will it be available soon?
> thx
|
|
| |
Re: clipping on region [message #154470 is a reply to message #154454] |
Mon, 18 October 2004 19:32 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
> I am working with "primat" on GEF. We want to use regions to hatch a
> figure (ex : a polygon) :
> - draw an hatched rectangle
What does hatched mean? Diagonal lines?
> - get the region for the polygon
What polygon?
> - use this region to clip the hatched rectangle
I don't know of any easy ways to convert a polygon to an SWT region. Do
you? The workarounds I know of are about as slow as painting the hatching
yourself without using region clipping.
> Could you use a other method ?
I'm not sure what you mean by hatching, but there are lot's of ways to
highlight things visually, such as outlining with XOR or DASHED lines.
>
> David
>
> Randy Hudson wrote:
> > We cannot scale a Region, so there are no plans to support regions.
> > What are you trying to do? We could probably support regions as long as
> > they are not zoomed, but it would require warnings or exceptions when
> > clients try to use regions together with zoom. Also, the
implementations of
> > push and popState on Graphics may be performance impacted by cloning
> > regions. This would require some special treatment.
> >
> > "primat" <primat@anyware-tech.com> wrote in message
> > news:ckvurs$ugh$1@eclipse.org...
> >
> >>Currently it not possible to set a clipping on region for the Graphics
> >>object like in SWT.GC, will it be available soon?
> >>thx
> >
> >
> >
|
|
| |
Re: clipping on region [message #154495 is a reply to message #154478] |
Mon, 18 October 2004 20:35 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
> I'm sorry, I doesn't find an other word for "hatching" :) so you could
> see the attached image.
> Here is the result we want to reach. How can we do this ?
The question here is should we add Region support to Graphics. I had
thought that Region only supported Rectangular add/subtract, but it looks
like it supports polygons too.
But, you could solve for the scanlines for a polygon yourself using some
easy-to-find algorithms.
It sounds like regions would be a convenient addition. Please open a
bugzilla. Also, contributions are welcome.
For zooming of regions, it would make more sense to add new clip methods
which took Rectangles and PointList instead of Region. That way, the
geometry can be scaled properly, then applied to a Region behind the scenes
(SWTGraphics) at 1-to-1 ratio.
> Thanks
> David
>
> Randy Hudson wrote:
> >>I am working with "primat" on GEF. We want to use regions to hatch a
> >>figure (ex : a polygon) :
> >>- draw an hatched rectangle
> >
> > What does hatched mean? Diagonal lines?
> >
> >>- get the region for the polygon
> >
> > What polygon?
> >
> >>- use this region to clip the hatched rectangle
> >
> >
> > I don't know of any easy ways to convert a polygon to an SWT region. Do
> > you? The workarounds I know of are about as slow as painting the
hatching
> > yourself without using region clipping.
> >
> >
> >>Could you use a other method ?
> >
> >
> > I'm not sure what you mean by hatching, but there are lot's of ways to
> > highlight things visually, such as outlining with XOR or DASHED lines.
> >
> >
> >>David
> >>
> >>Randy Hudson wrote:
> >>
> >>>We cannot scale a Region, so there are no plans to support regions.
> >>>What are you trying to do? We could probably support regions as long
as
> >>>they are not zoomed, but it would require warnings or exceptions when
> >>>clients try to use regions together with zoom. Also, the
> >
> > implementations of
> >
> >>>push and popState on Graphics may be performance impacted by cloning
> >>>regions. This would require some special treatment.
> >>>
> >>>"primat" <primat@anyware-tech.com> wrote in message
> >>>news:ckvurs$ugh$1@eclipse.org...
> >>>
> >>>
> >>>>Currently it not possible to set a clipping on region for the Graphics
> >>>>object like in SWT.GC, will it be available soon?
> >>>>thx
> >>>
> >>>
> >>>
> >
> >
>
>
------------------------------------------------------------ ----------------
----
|
|
|
Re: clipping on region [message #154510 is a reply to message #154495] |
Mon, 18 October 2004 20:46 |
David Sciamma Messages: 78 Registered: July 2009 |
Member |
|
|
I have downloaded the GEF sources and I will try to add a new method for
polygon clipping. If the result works I'll submit changes for a
contribution.
Thanks for your advices
David
Randy Hudson wrote:
>>I'm sorry, I doesn't find an other word for "hatching" :) so you could
>>see the attached image.
>>Here is the result we want to reach. How can we do this ?
>
>
> The question here is should we add Region support to Graphics. I had
> thought that Region only supported Rectangular add/subtract, but it looks
> like it supports polygons too.
>
> But, you could solve for the scanlines for a polygon yourself using some
> easy-to-find algorithms.
>
> It sounds like regions would be a convenient addition. Please open a
> bugzilla. Also, contributions are welcome.
>
> For zooming of regions, it would make more sense to add new clip methods
> which took Rectangles and PointList instead of Region. That way, the
> geometry can be scaled properly, then applied to a Region behind the scenes
> (SWTGraphics) at 1-to-1 ratio.
>
>
>>Thanks
>>David
>>
>>Randy Hudson wrote:
>>
>>>>I am working with "primat" on GEF. We want to use regions to hatch a
>>>>figure (ex : a polygon) :
>>>>- draw an hatched rectangle
>>>
>>>What does hatched mean? Diagonal lines?
>>>
>>>
>>>>- get the region for the polygon
>>>
>>>What polygon?
>>>
>>>
>>>>- use this region to clip the hatched rectangle
>>>
>>>
>>>I don't know of any easy ways to convert a polygon to an SWT region. Do
>>>you? The workarounds I know of are about as slow as painting the
>
> hatching
>
>>>yourself without using region clipping.
>>>
>>>
>>>
>>>>Could you use a other method ?
>>>
>>>
>>>I'm not sure what you mean by hatching, but there are lot's of ways to
>>>highlight things visually, such as outlining with XOR or DASHED lines.
>>>
>>>
>>>
>>>>David
>>>>
>>>>Randy Hudson wrote:
>>>>
>>>>
>>>>>We cannot scale a Region, so there are no plans to support regions.
>>>>>What are you trying to do? We could probably support regions as long
>
> as
>
>>>>>they are not zoomed, but it would require warnings or exceptions when
>>>>>clients try to use regions together with zoom. Also, the
>>>
>>>implementations of
>>>
>>>
>>>>>push and popState on Graphics may be performance impacted by cloning
>>>>>regions. This would require some special treatment.
>>>>>
>>>>>"primat" <primat@anyware-tech.com> wrote in message
>>>>>news:ckvurs$ugh$1@eclipse.org...
>>>>>
>>>>>
>>>>>
>>>>>>Currently it not possible to set a clipping on region for the Graphics
>>>>>>object like in SWT.GC, will it be available soon?
>>>>>>thx
>>>>>
>>>>>
>>>>>
>>>
>>
>
>
> ------------------------------------------------------------ ----------------
> ----
>
>
>
>
>
|
|
|
Re: clipping on region [message #154518 is a reply to message #154510] |
Mon, 18 October 2004 21:56 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
The obvious part is add new method(s) to Graphics, SWTGraphics, and
ScaledGraphics.
The hard part is going to be implement pushState(), restoreState(), and
optimizing so that once the state has been restored back to just a
rectangular area, that the region is thrown away and no longer used. So
you'd go from using:
GC.setClip(int, int, int, int)
to
GC.setClip(Region)
Then back to the first once the state has been popped off.
FYI, push and pop get called a lot.
"David Sciamma" <david.sciamma@anyware-tech.com> wrote in message
news:cl19q7$r1o$1@eclipse.org...
> I have downloaded the GEF sources and I will try to add a new method for
> polygon clipping. If the result works I'll submit changes for a
> contribution.
>
> Thanks for your advices
> David
>
> Randy Hudson wrote:
> >>I'm sorry, I doesn't find an other word for "hatching" :) so you could
> >>see the attached image.
> >>Here is the result we want to reach. How can we do this ?
> >
> >
> > The question here is should we add Region support to Graphics. I had
> > thought that Region only supported Rectangular add/subtract, but it
looks
> > like it supports polygons too.
> >
> > But, you could solve for the scanlines for a polygon yourself using some
> > easy-to-find algorithms.
> >
> > It sounds like regions would be a convenient addition. Please open a
> > bugzilla. Also, contributions are welcome.
> >
> > For zooming of regions, it would make more sense to add new clip methods
> > which took Rectangles and PointList instead of Region. That way, the
> > geometry can be scaled properly, then applied to a Region behind the
scenes
> > (SWTGraphics) at 1-to-1 ratio.
> >
> >
> >>Thanks
> >>David
> >>
> >>Randy Hudson wrote:
> >>
> >>>>I am working with "primat" on GEF. We want to use regions to hatch a
> >>>>figure (ex : a polygon) :
> >>>>- draw an hatched rectangle
> >>>
> >>>What does hatched mean? Diagonal lines?
> >>>
> >>>
> >>>>- get the region for the polygon
> >>>
> >>>What polygon?
> >>>
> >>>
> >>>>- use this region to clip the hatched rectangle
> >>>
> >>>
> >>>I don't know of any easy ways to convert a polygon to an SWT region.
Do
> >>>you? The workarounds I know of are about as slow as painting the
> >
> > hatching
> >
> >>>yourself without using region clipping.
> >>>
> >>>
> >>>
> >>>>Could you use a other method ?
> >>>
> >>>
> >>>I'm not sure what you mean by hatching, but there are lot's of ways to
> >>>highlight things visually, such as outlining with XOR or DASHED lines.
> >>>
> >>>
> >>>
> >>>>David
> >>>>
> >>>>Randy Hudson wrote:
> >>>>
> >>>>
> >>>>>We cannot scale a Region, so there are no plans to support regions.
> >>>>>What are you trying to do? We could probably support regions as long
> >
> > as
> >
> >>>>>they are not zoomed, but it would require warnings or exceptions when
> >>>>>clients try to use regions together with zoom. Also, the
> >>>
> >>>implementations of
> >>>
> >>>
> >>>>>push and popState on Graphics may be performance impacted by cloning
> >>>>>regions. This would require some special treatment.
> >>>>>
> >>>>>"primat" <primat@anyware-tech.com> wrote in message
> >>>>>news:ckvurs$ugh$1@eclipse.org...
> >>>>>
> >>>>>
> >>>>>
> >>>>>>Currently it not possible to set a clipping on region for the
Graphics
> >>>>>>object like in SWT.GC, will it be available soon?
> >>>>>>thx
> >>>>>
> >>>>>
> >>>>>
> >>>
> >>
> >
> >
>
> ------------------------------------------------------------ --------------
--
> > ----
> >
> >
> >
> >
> >
|
|
|
Re: clipping on region [message #154585 is a reply to message #154518] |
Tue, 19 October 2004 12:48 |
David Sciamma Messages: 78 Registered: July 2009 |
Member |
|
|
I have changed the 3 Graphics classes : Graphics, SWTGraphics and ScaledGraphics.
I added 2 new methods :
public PointList getClip(PointList points);
public void setClip(PointList p);
Everything works fine and now we can clip the Graphic Context on a polygon region.
I would like to submit my changes for a contribution. How can I do that ?
I have some other interesting classes for a contribution :
- Bezier Curve
- Multi-points creation tool, command and request
David
Randy Hudson wrote:
> The obvious part is add new method(s) to Graphics, SWTGraphics, and
> ScaledGraphics.
> The hard part is going to be implement pushState(), restoreState(), and
> optimizing so that once the state has been restored back to just a
> rectangular area, that the region is thrown away and no longer used. So
> you'd go from using:
> GC.setClip(int, int, int, int)
> to
> GC.setClip(Region)
> Then back to the first once the state has been popped off.
>
> FYI, push and pop get called a lot.
>
> "David Sciamma" <david.sciamma@anyware-tech.com> wrote in message
> news:cl19q7$r1o$1@eclipse.org...
>
>>I have downloaded the GEF sources and I will try to add a new method for
>>polygon clipping. If the result works I'll submit changes for a
>>contribution.
>>
>>Thanks for your advices
>>David
>>
>>Randy Hudson wrote:
>>
>>>>I'm sorry, I doesn't find an other word for "hatching" :) so you could
>>>>see the attached image.
>>>>Here is the result we want to reach. How can we do this ?
>>>
>>>
>>>The question here is should we add Region support to Graphics. I had
>>>thought that Region only supported Rectangular add/subtract, but it
>
> looks
>
>>>like it supports polygons too.
>>>
>>>But, you could solve for the scanlines for a polygon yourself using some
>>>easy-to-find algorithms.
>>>
>>>It sounds like regions would be a convenient addition. Please open a
>>>bugzilla. Also, contributions are welcome.
>>>
>>>For zooming of regions, it would make more sense to add new clip methods
>>>which took Rectangles and PointList instead of Region. That way, the
>>>geometry can be scaled properly, then applied to a Region behind the
>
> scenes
>
>>>(SWTGraphics) at 1-to-1 ratio.
>>>
>>>
>>>
>>>>Thanks
>>>>David
>>>>
>>>>Randy Hudson wrote:
>>>>
>>>>
>>>>>>I am working with "primat" on GEF. We want to use regions to hatch a
>>>>>>figure (ex : a polygon) :
>>>>>>- draw an hatched rectangle
>>>>>
>>>>>What does hatched mean? Diagonal lines?
>>>>>
>>>>>
>>>>>
>>>>>>- get the region for the polygon
>>>>>
>>>>>What polygon?
>>>>>
>>>>>
>>>>>
>>>>>>- use this region to clip the hatched rectangle
>>>>>
>>>>>
>>>>>I don't know of any easy ways to convert a polygon to an SWT region.
>
> Do
>
>>>>>you? The workarounds I know of are about as slow as painting the
>>>
>>>hatching
>>>
>>>
>>>>>yourself without using region clipping.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>Could you use a other method ?
>>>>>
>>>>>
>>>>>I'm not sure what you mean by hatching, but there are lot's of ways to
>>>>>highlight things visually, such as outlining with XOR or DASHED lines.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>David
>>>>>>
>>>>>>Randy Hudson wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>>We cannot scale a Region, so there are no plans to support regions.
>>>>>>>What are you trying to do? We could probably support regions as long
>>>
>>>as
>>>
>>>
>>>>>>>they are not zoomed, but it would require warnings or exceptions when
>>>>>>>clients try to use regions together with zoom. Also, the
>>>>>
>>>>>implementations of
>>>>>
>>>>>
>>>>>
>>>>>>>push and popState on Graphics may be performance impacted by cloning
>>>>>>>regions. This would require some special treatment.
>>>>>>>
>>>>>>>"primat" <primat@anyware-tech.com> wrote in message
>>>>>>>news:ckvurs$ugh$1@eclipse.org...
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>Currently it not possible to set a clipping on region for the
>
> Graphics
>
>>>>>>>>object like in SWT.GC, will it be available soon?
>>>>>>>>thx
>>>>>>>
>>>>>>>
>>>>>>>
>>>
>> ------------------------------------------------------------ --------------
>
> --
>
>>>----
>>>
>>>
>>>
>>>
>>>
>
>
>
--
David Sciamma
Addr : Prologue 2, Rue Ampere
Addr : BP 87216, 31672 LABEGE Cedex
Tel : + 33 (0)5.61.00.73.45 / +33 (0)6.27.39.43.29
Fax : + 33 (0)5.61.00.51.46
Anyware Technologies - http://www.anyware-tech.com
|
|
|
Re: clipping on region [message #154601 is a reply to message #154585] |
Tue, 19 October 2004 14:53 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
Open a bugzilla, and attach the code or generate a CVS patch file if you are
connected to our CVS repository. Do each feature separately please in case
there is any feedback or changes recommended.
"David Sciamma" <david.sciamma@anyware-tech.com> wrote in message
news:cl324h$qkf$1@eclipse.org...
> I have changed the 3 Graphics classes : Graphics, SWTGraphics and
ScaledGraphics.
> I added 2 new methods :
> public PointList getClip(PointList points);
> public void setClip(PointList p);
>
> Everything works fine and now we can clip the Graphic Context on a polygon
region.
>
> I would like to submit my changes for a contribution. How can I do that ?
> I have some other interesting classes for a contribution :
> - Bezier Curve
> - Multi-points creation tool, command and request
>
> David
>
>
> Randy Hudson wrote:
> > The obvious part is add new method(s) to Graphics, SWTGraphics, and
> > ScaledGraphics.
> > The hard part is going to be implement pushState(), restoreState(), and
> > optimizing so that once the state has been restored back to just a
> > rectangular area, that the region is thrown away and no longer used. So
> > you'd go from using:
> > GC.setClip(int, int, int, int)
> > to
> > GC.setClip(Region)
> > Then back to the first once the state has been popped off.
> >
> > FYI, push and pop get called a lot.
> >
> > "David Sciamma" <david.sciamma@anyware-tech.com> wrote in message
> > news:cl19q7$r1o$1@eclipse.org...
> >
> >>I have downloaded the GEF sources and I will try to add a new method for
> >>polygon clipping. If the result works I'll submit changes for a
> >>contribution.
> >>
> >>Thanks for your advices
> >>David
> >>
> >>Randy Hudson wrote:
> >>
> >>>>I'm sorry, I doesn't find an other word for "hatching" :) so you could
> >>>>see the attached image.
> >>>>Here is the result we want to reach. How can we do this ?
> >>>
> >>>
> >>>The question here is should we add Region support to Graphics. I had
> >>>thought that Region only supported Rectangular add/subtract, but it
> >
> > looks
> >
> >>>like it supports polygons too.
> >>>
> >>>But, you could solve for the scanlines for a polygon yourself using
some
> >>>easy-to-find algorithms.
> >>>
> >>>It sounds like regions would be a convenient addition. Please open a
> >>>bugzilla. Also, contributions are welcome.
> >>>
> >>>For zooming of regions, it would make more sense to add new clip
methods
> >>>which took Rectangles and PointList instead of Region. That way, the
> >>>geometry can be scaled properly, then applied to a Region behind the
> >
> > scenes
> >
> >>>(SWTGraphics) at 1-to-1 ratio.
> >>>
> >>>
> >>>
> >>>>Thanks
> >>>>David
> >>>>
> >>>>Randy Hudson wrote:
> >>>>
> >>>>
> >>>>>>I am working with "primat" on GEF. We want to use regions to hatch a
> >>>>>>figure (ex : a polygon) :
> >>>>>>- draw an hatched rectangle
> >>>>>
> >>>>>What does hatched mean? Diagonal lines?
> >>>>>
> >>>>>
> >>>>>
> >>>>>>- get the region for the polygon
> >>>>>
> >>>>>What polygon?
> >>>>>
> >>>>>
> >>>>>
> >>>>>>- use this region to clip the hatched rectangle
> >>>>>
> >>>>>
> >>>>>I don't know of any easy ways to convert a polygon to an SWT region.
> >
> > Do
> >
> >>>>>you? The workarounds I know of are about as slow as painting the
> >>>
> >>>hatching
> >>>
> >>>
> >>>>>yourself without using region clipping.
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>>Could you use a other method ?
> >>>>>
> >>>>>
> >>>>>I'm not sure what you mean by hatching, but there are lot's of ways
to
> >>>>>highlight things visually, such as outlining with XOR or DASHED
lines.
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>>David
> >>>>>>
> >>>>>>Randy Hudson wrote:
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>>We cannot scale a Region, so there are no plans to support regions.
> >>>>>>>What are you trying to do? We could probably support regions as
long
> >>>
> >>>as
> >>>
> >>>
> >>>>>>>they are not zoomed, but it would require warnings or exceptions
when
> >>>>>>>clients try to use regions together with zoom. Also, the
> >>>>>
> >>>>>implementations of
> >>>>>
> >>>>>
> >>>>>
> >>>>>>>push and popState on Graphics may be performance impacted by
cloning
> >>>>>>>regions. This would require some special treatment.
> >>>>>>>
> >>>>>>>"primat" <primat@anyware-tech.com> wrote in message
> >>>>>>>news:ckvurs$ugh$1@eclipse.org...
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>>Currently it not possible to set a clipping on region for the
> >
> > Graphics
> >
> >>>>>>>>object like in SWT.GC, will it be available soon?
> >>>>>>>>thx
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>
>
>> ------------------------------------------------------------ --------------
> >
> > --
> >
> >>>----
> >>>
> >>>
> >>>
> >>>
> >>>
> >
> >
> >
>
> --
> David Sciamma
>
> Addr : Prologue 2, Rue Ampere
> Addr : BP 87216, 31672 LABEGE Cedex
> Tel : + 33 (0)5.61.00.73.45 / +33 (0)6.27.39.43.29
> Fax : + 33 (0)5.61.00.51.46
> Anyware Technologies - http://www.anyware-tech.com
|
|
|
Goto Forum:
Current Time: Tue Jan 21 19:45:50 GMT 2025
Powered by FUDForum. Page generated in 0.04892 seconds
|