[Qgis-developer] Re: composer redesign branch

Martin Dobias wonder.sk at gmail.com
Mon Mar 3 20:06:49 EST 2008


On Mon, Mar 3, 2008 at 5:45 PM, Marco Hugentobler
<marco.hugentobler at karto.baug.ethz.ch> wrote:
>  So my suggestion is to have the rendering context somehow like this:
>
>  class QgsMapRenderContext
>  {
>         QgsMapToPixel mMapToPixel;
>         QgsCoordinateTransform mCoordTransform;
>         QgsRect mExtent;
>         bool drawEditingInformation;
>         bool mRenderingStopped;
>         double mResolutionRatio;
>  };

Yes, something like that should do it...
We should also include a member like "force vector output" which will
tell to renderer whether it can use just a rendered pixmap of a symbol
or whether it should render the symbol directly - this is where map
composer is failing.

>  The resolution ratio is usually 1, except when drawing to a different paint
>  device (like QPrinter). I hope it will allow to consider for different line
>  width / symbol sizes on these output devices.

When looking at QgsVectorLayer::draw(), there's symbolScale and
widthScale... are both of them covered by mResolutionRatio?

>  Maybe QgsComposerView (derived from QGraphicsView) could go to gui and the
>  composer items to core? Then client applications (or some interface component
>  in core) could arrange the items and call QGraphicsScene::render.

I haven't got so far with the planning... I was more thinking of
making the composer items independent of any GUI parts, also the
graphics view related parts and wanted to create their counterparts in
GUI library for graphics view. I haven't realized that we could use
just graphics scene and graphics items in core library and having the
graphics view in gui library. Your idea sounds better.

Bye
Martin


More information about the Qgis-developer mailing list