Feature request #3430

fill pattern missing for point markers in new symbology engine

Added by Mathieu Pellerin - nIRV almost 14 years ago. Updated over 8 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Symbology
Pull Request or Patch supplied:No Resolution:fixed/implemented
Easy fix?:No Copied to github as #:13490

Description

It's not possible with the new symbology engine to set the fill pattern (i.e. vertical line, horizontal line, etc.) of a point marker.

The feature is available in the old symbology engine and can be quite useful at times (for e.g. to create a circle surrounding a marker with a specific radius length using map unit).

Will it be reimplemented?

Cheers

qgis-point-symbols.jpg - (arrow points at lost features) (125 KB) Mathieu Pellerin - nIRV, 2011-03-04 12:05 AM

qgis-point-new_symbols.jpg (39.6 KB) Mathieu Pellerin - nIRV, 2011-03-04 12:06 AM

patch_for_bug__3430.diff Magnifier (11.6 KB) sunilkcube -, 2011-04-01 04:22 AM

new_patch_for_bug__3430.diff Magnifier - New patch (11.4 KB) sunilkcube -, 2011-05-02 11:01 PM

fills.PNG (11.2 KB) Alister Hood, 2011-05-03 02:27 AM

patch_for_bug__3430_alister.diff Magnifier (13.8 KB) Alister Hood, 2011-05-05 03:43 AM

patch_for_bug__3430_alister_25-5-11.diff Magnifier (15.1 KB) Alister Hood, 2011-05-24 11:13 PM

patch_for_bug__3430_alister_21-8-12.diff Magnifier (17.8 KB) Alister Hood, 2012-08-21 12:58 AM

History

#1 Updated by Mathieu Pellerin - nIRV almost 14 years ago

Since the new symbology engine will be the default in 1.7, I think devs should look at this lost of feature from old to new symbology. I've attached screenshots (old engine, new engine, and one map example) in case my description above was unclear.

#2 Updated by sunilkcube - over 13 years ago

  • Status changed from Open to In Progress

#3 Updated by sunilkcube - over 13 years ago

The patch has been added above. Can anyone please kindly review the patch and if you have any comments let me know , I will soon work on your comments and try to resolve that ?. Thanks .

#4 Updated by Alister Hood over 13 years ago

Thanks Sunil; I'm not someone who can review the patch, but it seems to work well :)

#5 Updated by Alister Hood over 13 years ago

I find that I can switch a layer from old symbology to new symbology successfully, but not back again. The patch could be improved slightly by allowing it to switch back, but I think this is a very minor issue (probably not worth the effort to fix) if old symbology is to be removed from QGIS soon.

e.g.

- select the first point symbol (circle) in old symbology, set the fill options to "None", Apply

- switch to new symbology and Apply - the markers should stay the same (apart from outline width, which is #3458)

- switch to old symbology - the markers will now have a solid fill

#6 Updated by Alister Hood over 13 years ago

Also, I'm pretty sure this part of your patch breaks the dialogue somewhat:

-  connect( spinAngle, SIGNAL( valueChanged( double ) ), this, SLOT( setAngle() ) );

#7 Updated by Alister Hood over 13 years ago

I'm guessing you actually meant to delete the line above that, as it is the same as the line the patch adds below, so the same line will appear twice if the patch is used.

#8 Updated by sunilkcube - over 13 years ago

Replying to [comment:9 Alister]:

I'm guessing you actually meant to delete the line above that, as it is the same as the line the patch adds below, so the same line will appear twice if the patch is used.

Thanks for reviewing the patch. Yes you are right I have done mistake while patching. I have attached a new patch can you please kindly review this one also ?

#9 Updated by Alister Hood over 13 years ago

Hmmm. I didn't realise transparency wasn't working. I'm guessing uncommenting this in the new patch was supposed to fix it:

// selColor.setAlphaF( context.alpha() );

But transparency for the symbol fill still doesn't work for me... unless QGIS hasn't rebuilt properly.

#10 Updated by Alister Hood over 13 years ago

Like I say, I can't "review" the patch as I have almost no knowledge of C++, QT or the internals of QGIS.

I've noticed another thing that could be improved though: when you select a feature, the fill style is not applied to it.

#11 Updated by Alister Hood over 13 years ago

see attached screenshot:

- fill style is not applied to selected features (actually, it looks like selected points are rendered by simply filling each symbol layer with yellow, so if transparency is applied the yellow is darker where two symbol layers overlap). I don't think this is a significant problem.

- transparency is only applied to borders, not fills.

#12 Updated by Alister Hood over 13 years ago

- transparency is only applied to borders, not fills.

But it is applied to the yellow fill for selected features, as you can see :)

#13 Updated by Alister Hood over 13 years ago

.

#14 Updated by Alister Hood over 13 years ago

.

#15 Updated by Alister Hood over 13 years ago

Ah - there's a preview button! I should use it ;)
-----------

- fill style is not applied to selected features (actually, it looks like selected points are rendered by simply filling each symbol layer with yellow, so if transparency is applied the yellow is darker where two symbol layers overlap). I don't think this is a significant problem.

- transparency is only applied to borders, not fills.

OK, that was easier than I expected. I've had a look at it, and fixed those things, and also what I'm pretty sure was a pre-existing mistake in this line:

QColor selPenColor = selBrushColor == mColor ? selBrushColor : mBorderColor;

I had to tidy/rearrange that section of code so I could understand it :)

I added a number of comments, mostly about inconsistencies compared with how QGIS renders polygon layers. Can someone else look at these and tell me what they think?

There is one reasonably annoying bug:

//"no fill" doesn't work if brushColor = penColor 
// e.g. if the symbol is a circle, the whole bounding box (is that what  it's called?)
// of the circle is filled.

I'm guessing to fix this an if statement is required something like the one I commented out because that method didn't work. But I don't know what to put in it!

#16 Updated by Alister Hood over 13 years ago

Oh, yeah - I noticed another problem.

In the symbol layers box with these patches it only shows the fill, whereas it used to show a preview of the symbol layer.

#17 Updated by Alister Hood over 13 years ago

//"no fill" doesn't work if brushColor = penColor

// e.g. if the symbol is a circle, the whole bounding box (is that what it's called?)

// of the circle is filled.

Actually, this isn't quite right. It definitely happens sometimes with no fill, but I can't figure out exactly when... it looks like it is something to do with the order in which I change the settings or something odd like that.

#18 Updated by Alister Hood over 13 years ago

Oh, of course.

We shouldn't apply the fill style to selected features unless either we have a special pen colour for selected features (personally I think this would be nice), or we check to make sure the fill style isn't "no fill".

If the fill style is "no fill" and we apply it to selected features, then they look the same as unselected features :)

#19 Updated by Alister Hood over 13 years ago

Oh, and I think I was wrong about this:

// Alister - I don't understand the reasoning for the following line
//  QColor selPenColor = selBrushColor == mColor ? selBrushColor : mBorderColor;
// I think it is a mistake and is meant to be this
  QColor selPenColor = mBorderColor == mColor ? selBrushColor : mBorderColor ;

This wouldn't have been a mistake - it is trying to make the selection look different if the symbol fill is the same colour as the selection fill. But there are still things that could be improved here: it won't achieve anything if the symbol fill and the symbol outline are both the same colour as the selection fill. Also, polygon layers aren't dealt with in the same way, and they probably should be.

#20 Updated by Alister Hood over 13 years ago

Oh, yeah - I noticed another problem.

In the symbol layers box with these patches it only shows the fill, whereas it used to show a preview of the symbol layer.

Sorry, my mistake again - the preview works fine. I must have been testing with symbols larger than the space that the preview fits in.

#21 Updated by Alister Hood over 13 years ago

Please disregard my patch for now. After looking at it again I came to understand how some things were intended to work.

I have made some changes to make the display of selected features in point symbology more consistent with polygon and polyline features, but I'll check them in the next day or so before posting a new patch.

#22 Updated by Alister Hood over 13 years ago

Ah, sorry. That's a long couple of days :(

Please see the new patch. I was hoping to do more to improve the consistency between points, polylines and polygons, but I won't have a chance to do any more for a while.

#23 Updated by Giovanni Manghi about 13 years ago

  • Target version changed from Version 1.7.0 to Version 1.7.4

#24 Updated by Giovanni Manghi over 12 years ago

  • Target version changed from Version 1.7.4 to Version 2.0.0

#25 Updated by Jürgen Fischer over 12 years ago

  • Assignee deleted (sunilkcube -)
  • Pull Request or Patch supplied set to No

#26 Updated by Alister Hood over 12 years ago

Here's an updated patch against current master.

If SLD supports marker symbol fill styles then the SLD import/export will need more work. At the moment it should just apply the default fill style (solid fill).

------
I guess this ticket should not be "low" priority. If this functionality is needed for QGIS 2.0 then maybe tickets like this should be "blockers"!

#27 Updated by Giovanni Manghi over 12 years ago

Hi Alister

Alister Hood wrote:

Here's an updated patch against current master.

it would be better to submit the patch as pull request on github, the are more chances to have it reviewed and committed.

------
I guess this ticket should not be "low" priority. If this functionality is needed for QGIS 2.0 then maybe tickets like this should be "blockers"!

"Blockers" are regressions, so I guess that this could fit. Anyway the list of missing features in new symbology (available in the old one) is quite long, so instead we have wiki page

https://issues.qgis.org/projects/quantum-gis/wiki/Switching_from_Old_to_New_Symbology_and_Labeling/

#28 Updated by Giuseppe Sucameli over 12 years ago

  • Operating System deleted (All)
  • Status changed from In Progress to Open

I've merged a part of the pull request 210 by Alister H., the one about selection color.
The other one (fill pattern in point markers), was not merged since Qt brush styles aren't suitable for printouts because they can't be scaled.

Marco H. wrote:

I think it (Qt brush styles) should not be advertised and maybe even removed from the simple fill symbol renderer / widget. It is much better to use line pattern fill / point pattern fill symbol layer instead.
A cool possibility would be to embed a polygon symbol into the simple marker symbollayer and use that to draw the point fill (just like e.g. the point fill symbollayer embeds a point symbol). Like this, the user could choose any polygon fill for the point symbol.

See https://github.com/qgis/Quantum-GIS/pull/210 for the complete discussion.

#29 Updated by Pirmin Kalberer about 12 years ago

  • Target version changed from Version 2.0.0 to Future Release - Nice to have

#30 Updated by Alister Hood about 12 years ago

Has it been decided to retain the old symbology (or just not to implement all the missing features in new symbology) for 2.0.0?
Or has this been shifted to 2.1.0 because it is marked as a feature, but it should be marked as a bug?

#31 Updated by Paolo Cavallini about 12 years ago

  • Target version changed from Future Release - Nice to have to Version 2.0.0

#32 Updated by Giovanni Manghi about 12 years ago

  • Pull Request or Patch supplied changed from No to Yes

#33 Updated by Marco Hugentobler about 12 years ago

  • Status changed from Open to Closed
  • Pull Request or Patch supplied changed from Yes to No

Changing to patch supplied -> no, since the accepted parts of the patches have been applied.

#34 Updated by Marco Hugentobler about 12 years ago

  • Status changed from Closed to Open

Ooops, status should not be closed

#35 Updated by Mathieu Pellerin - nIRV over 11 years ago

Since old symbology was removed, I'm wondering whether this issue will be fixed prior to 2.0 release.

#36 Updated by Giovanni Manghi over 11 years ago

nirvn - wrote:

Since old symbology was removed, I'm wondering whether this issue will be fixed prior to 2.0 release.

missing features in new symbology available in old should be tagged as blockers. The issue is already on the "todo" list

https://issues.qgis.org/wiki/17/Switching_from_Old_to_New_Symbology_and_Labeling

#37 Updated by Paolo Cavallini almost 11 years ago

  • Target version changed from Version 2.0.0 to Future Release - High Priority

#38 Updated by Mathieu Pellerin - nIRV over 10 years ago

  • Status changed from Open to Closed
  • Resolution set to fixed/implemented

It's done, wouhou.

#39 Updated by Alister Hood over 10 years ago

Ummm. Why do you think this is fixed?
As far as I can tell we still have the same situation with fill styles (which Marco says are not actually suitable) available for polygons but not point symbols.
Or did you close it because you really just wanted the ability to have no fill, and you can do this by specifying 0 for the alpha channel?

#40 Updated by Mathieu Pellerin - nIRV over 10 years ago

Oups, Alister's right, this isn't fix; I got confused with the outline style vs fill style.

Could someone re-open this issue? It's a pretty important one.

#41 Updated by Giovanni Manghi over 10 years ago

  • Status changed from Closed to Open
  • Resolution deleted (fixed/implemented)

#42 Updated by Mathieu Pellerin - nIRV over 8 years ago

  • Status changed from Open to Closed
  • Resolution set to fixed/implemented

Nyall's filled marker does exactly that, and then some :) closing, feature implemented.

Also available in: Atom PDF