|
|
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » geom package?
geom package? [message #9706] |
Fri, 25 May 2007 22:45 |
gertwin
Messages: 25 Registered: May 2007 Location: Netherlands
|
Promising Member |
|
|
Hello,
I'am new to U++, and i like it very much.
I want make a 2D gis data viewer.
I have classes which holds the geometry (something like oracle SDO GEOMETRY) and a R-Tree for spatial selection/queries.
The question is what is good starting point implementing the on screen (and printer) render classes.
I think i could do it myself, translating geometry world coordinates to screen coordinates, implementing zoom etc. and only using the U++ Draw class.
Or can i use the geom package?
I searched but there is no documentation or examples describing the geom package.
Gertwin
|
|
|
|
|
|
|
Re: geom package? [message #9739 is a reply to message #9737] |
Mon, 28 May 2007 23:29 |
rylek
Messages: 79 Registered: November 2005
|
Member |
|
|
Hello Gertwin!
Sorry for the missing documentation. In fact I started to write the Geom-related packages first as a supplement to Mirek's basics in Core (which in fact comprise little more than a 2D floating-point vector and rectangle) for use in my own applications. Over the time, some of the concepts turn out to be more viable and reusable, some do not.
For practical reasons it would be very hard for us to make a clean cut between "nice" and "dirty" stuff; at the time being it might be cleanest if I agreed with Mirek on making a new set of packages which would contain only the 'clean' stuff, whereas the 'dirty' stuff would be moved into a kind of TGeom and perhaps in time removed from the uppsrc tree altogether.
The trouble is that Mirek almost never uses floating point geometry; he simply doesn't often write the kind of software needing this and I'm not sure how eager he would be to assist in filtering the portions of the above packages for 'common use' when he almost seems to take pride in avoiding them.
To make the long story short: take the geometry-related packages with a grain of salt. As you've already noticed, so far there's no documentation to them; I can gradually start creating small example programs demonstrating various aspects of these modules but it's going to take time.
The individual modules have the following purposes:
Geom - various 2D and 3D analytic geometry calculations, linear equation set solver, Delaunay triangulator, generic polygon rasterizer
Geom/Coords - utilities for geographic coordinate transform calculations; several coordinate systems have already been implemented, unfortunately (for evident reasons) mostly systems used in the middle Europe.
Geom/Draw - linear & bilinear image warping (imgtran), floating-point based drawing tools (plotter), generic patterned line drawing (pathDraw)
Geom/Ctrl - Ctrl-related stuff, most important is PlotterCtrl which is a zoomable view to a physical floating-point-based world
The most important classes to start with (for the purposes you mentioned):
1) Plotter - a Draw combined with a transform matrix (2x3), clipping regions and some other info. Used to transform between logical and device coordinate space and to draw stuff based on logical floating-point coordinates.
2) PathTool, AreaTool, MarkTool, TextTool - tools for drawing lines, areas, markers and text based on logical floating-point coordinates (use a Plotter to transform the logical coordinates into device coordinate space).
3) PlotterCtrl - basically a zoomable view into a floating-point image, map or chart. At the very least, you just override the Plot method (a Plotter-based floating-point equivalent of Ctrl::Paint), set up the logical extent (SetExtent) and you're all set. You can also set the direction of positive X- and Y- axis, set up fixed or free aspect ratio (free aspect ratio is used for views with heterogeneous X- and Y- coordinates).
4) PlotterDragDrop - by deriving from this class you can define various drag & drop modes for the PlotterCtrl view. The Geom/Ctrl package implements three standard drag & drop modes - the zoom in mode, zoom out mode and pan mode. In a similar way, you can implement arbitrary additional editation, selection or drawing modes.
Regards
Tomas
[Updated on: Mon, 28 May 2007 23:31] Report message to a moderator
|
|
|
|
|
|
Re: geom package? [message #9868 is a reply to message #9857] |
Tue, 05 June 2007 09:20 |
pap2k
Messages: 8 Registered: June 2007
|
Promising Member |
|
|
I'm using recent svn checkout (revision 60) under winXp on msvc 2005 express.
I've derived my class MyPlot from PlotterCtrl, where i implement Plot().
But running MyPlot i never pass in MyPlot::Plot, but i pass in virtual PlotterCtrl::Plot;
In the constructor of MyPlot i'm initializing using
FrameLayout(Rect(0, 0, 700, 700));
Do you think that MyPlot::Plot need to be spell using this form :
ImageDraw& im = BeginBufferPaint();
Plot( Plotter(
im,
polygonVectBox,
Rect(0, 0, 500, 500)));
EndBufferPaint();
|
|
|
Re: geom package? [message #9883 is a reply to message #9868] |
Wed, 06 June 2007 12:41 |
gertwin
Messages: 25 Registered: May 2007 Location: Netherlands
|
Promising Member |
|
|
pap2k wrote on Tue, 05 June 2007 09:20 | I'm using recent svn checkout (revision 60) under winXp on msvc 2005 express.
|
I tried revision 60 from svn but it won't compile on linux.
Looks like not many people are using the geom package on linux.
pap2k wrote on Tue, 05 June 2007 09:20 | I've derived my class MyPlot from PlotterCtrl, where i implement Plot().
But running MyPlot i never pass in MyPlot::Plot, but i pass in virtual PlotterCtrl::Plot;
In the constructor of MyPlot i'm initializing using
FrameLayout(Rect(0, 0, 700, 700));
Do you think that MyPlot::Plot need to be spell using this form :
ImageDraw& im = BeginBufferPaint();
Plot( Plotter(
im,
polygonVectBox,
Rect(0, 0, 500, 500)));
EndBufferPaint();
|
I think you didn't make your Plot member virtual.
Maybe i try it on windows and see if i get it to work.
Gertwin
|
|
|
|
Re: geom package? [message #9902 is a reply to message #9900] |
Fri, 08 June 2007 00:28 |
gertwin
Messages: 25 Registered: May 2007 Location: Netherlands
|
Promising Member |
|
|
pap2k wrote on Thu, 07 June 2007 11:33 | It work now on windows !
In a first time i'm using a splitter and "it fall in work) !
After i undertand that i've to use :
Add(plot);
to init my instance of MyPlot. That was my mistake.
I'm a upp newbie ...
What's wrong on linux ?
I'm also interested by a working version on linux!
(i've got compiling pb on mingw too).
|
I'm also a upp newbie, i hope there are more experienced geom package users on this forum to help us a little.
g++ reports many problems of this from:
decl:
void Rescale(RasterEncoder& tgt, Size tsz, Raster& src, const Rect& src_rc);
call:
Rescale(ImageWriter(put->block, org.TopLeft()), org.Size(), ImageBufferRaster(block.block), RUNIT);
g++ complains:
no matching function for call to 'Rescale(Upp::ImageWriter, Upp::Size_<int>, Upp::ImageBufferRaster, const Upp::Rect&)
I don't know if the references are ment to be output parameters, guess not because the var is contructed in the call so maybe the decl must use const parameters.
Does the microsoft compiler generates warnings compiling this kind of code?
So i changed it, this wil compile:
ImageWriter iw(put->block, org.TopLeft());
ImageBufferRaster ibr(block.block);
Rescale(iw, org.Size(), ibr, RUNIT);
I went through the geom package solving all this kind of problems.
My first goal is make it compilable, not worrieing about functionality.
The only problem i have now is a linking problem, after that i can start using the geom package.
Problem is that i created my own copy of the geom package wich i changed, i don't want to do that after each release.
Maybe i can provide a patchfile for the geom maintainer.
Gertwin
|
|
|
|
Goto Forum:
Current Time: Fri Nov 01 01:37:32 CET 2024
Total time taken to generate the page: 0.02816 seconds
|
|
|