Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » geom package?
geom package? [message #9706] Fri, 25 May 2007 22:45 Go to next message
gertwin is currently offline  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 #9708 is a reply to message #9706] Sat, 26 May 2007 07:53 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14105
Registered: November 2005
Ultimate Member
Most likely yes, Geom was added because of GIS Smile
Re: geom package? [message #9710 is a reply to message #9708] Sat, 26 May 2007 14:35 Go to previous messageGo to next message
gertwin is currently offline  gertwin
Messages: 25
Registered: May 2007
Location: Netherlands
Promising Member
That is nice.

Is there a example or documentation about the geom package?
Or a description in a few lines what the meaning of the main classes are to get started.

Thanks,

Gertwin
Re: geom package? [message #9726 is a reply to message #9710] Mon, 28 May 2007 14:43 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14105
Registered: November 2005
Ultimate Member
Unfortunately, ATM, none I am aware off.

Re: geom package? [message #9737 is a reply to message #9726] Mon, 28 May 2007 22:15 Go to previous messageGo to next message
gertwin is currently offline  gertwin
Messages: 25
Registered: May 2007
Location: Netherlands
Promising Member
Ok, i will try without documentation.

I will make some small projects to learn the package.
Maybe it is usefull to post them as examples?

But first i have to build the package but it seems something is missing or this is work in progress?

First i made for myself a list of dependencies (notation with '->') inside the geom package (only packages inside geom are shown):
* Geom
* Geom\Coords -> Geom
* Geom\Coords\Ctrl -> Geom\Coords -> Geom
* Geom\Draw -> Geom\Coords -> Geom
* Geom\Ctrl -> Geom\Draw -> Geom\Coords -> Geom

When i build the packages this is the result:
* Geom package: build OK
* Geom\Coords package: build FAILED, class RefBase is undefined, package TCore does not exits.
* Geom\Coords\Ctrl: build FAILED because Geom\Coords, this is a empty package.
* Geom\Draw: build FAILED because of Geom\Coords, package TDraw does not exits.
* Geom/Ctrl package: build FAILED because of Geom\Coords, package TCtrlLib does not exits.

I am using the 2007.1 release on linux.
What do you think should i take the Geom package from svn or didn't i get the whole release and do i need to install somthing additional?

Greetings,
Gertwin




Re: geom package? [message #9739 is a reply to message #9737] Mon, 28 May 2007 23:29 Go to previous messageGo to next message
rylek is currently offline  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 #9765 is a reply to message #9739] Tue, 29 May 2007 22:56 Go to previous messageGo to next message
gertwin is currently offline  gertwin
Messages: 25
Registered: May 2007
Location: Netherlands
Promising Member
Thanks Tomas,

Your brief description will do, i look into the code and learn what the functionality of each class is.

My only problem at this moment is that not all the components of the geom package will build (on linux), i did a standaard install of version 2007.1.

Do you know where i can find the missing files?
Or do i need to set extra dependencies, i found out that the missing class RefBase is in utils.h in the web package.

Greetings,
Gertwin



Re: geom package? [message #9839 is a reply to message #9765] Fri, 01 June 2007 16:19 Go to previous messageGo to next message
pap2k is currently offline  pap2k
Messages: 8
Registered: June 2007
Promising Member
Is PlotterDragDrop supposed to be usable in svn repository ?
I do not understand how to use it ?
I've allways a problem with the constructor who need an Upp::PlotterCtrl who is abstract class ...

afaik, it was the excat widget i need !
Re: geom package? [message #9857 is a reply to message #9839] Mon, 04 June 2007 08:34 Go to previous messageGo to next message
gertwin is currently offline  gertwin
Messages: 25
Registered: May 2007
Location: Netherlands
Promising Member
You cannot instantiate a abstract class directly.
To use PlotterCtrl you have to derive a class from it and override the abstract member(s).

In PlotterCtrl you have to provide an implementation for "void Plot(Plotter& plotter)" wich i think paints the picture.

How did you manage to build the geom package, do you use a recent svn checkout?
I use the 2007.1 release on linux, but this is missing dependencies to build the geom package.

Gertwin
Re: geom package? [message #9868 is a reply to message #9857] Tue, 05 June 2007 09:20 Go to previous messageGo to next message
pap2k is currently offline  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 Go to previous messageGo to next message
gertwin is currently offline  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. Sad

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 #9900 is a reply to message #9883] Thu, 07 June 2007 11:33 Go to previous messageGo to next message
pap2k is currently offline  pap2k
Messages: 8
Registered: June 2007
Promising Member
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).
Re: geom package? [message #9902 is a reply to message #9900] Fri, 08 June 2007 00:28 Go to previous messageGo to next message
gertwin is currently offline  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. Razz

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


icon5.gif  Re: geom package? [message #11041 is a reply to message #9706] Thu, 16 August 2007 09:45 Go to previous message
tlukanov is currently offline  tlukanov
Messages: 4
Registered: May 2007
Location: Bulgaria
Junior Member
Hello,

I am new to U++ too.

I want to make a 2D gis editor.
At this moment I'm using Upp 2007.1 with MinGW on Windows 2000.
Where I can find Geom package (with Geom/Ctrl etc.), that compiles successfully ?

Todor
Previous Topic: SMTP non english error messages
Next Topic: bug? : operator "!" for "bool"
Goto Forum:
  


Current Time: Fri Nov 01 01:37:32 CET 2024

Total time taken to generate the page: 0.02816 seconds