-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ issue #2525: Line color of shapes are always black
- Loading branch information
Showing
1 changed file
with
3 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7e01d01
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LineColorArray is used to color individual edges. It was added for the temporary highlithing of edges for PartDesign features like fillet, to show the user which edges are selected. This functionality does not need any persistence, it is only shown temporary, hence a Property is IMHO the wrong way to achieve this. I think life becomes easier if we remove this property and implement the highlithing with some kind of temporary mode in the object with normal member variable as storage.
7e01d01
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the same temporary highlighting is needed for faces and Points, same issue as described for lines hold for those Properties too.
7e01d01
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be easily done by declaring the property as "Transient". This attribute causes the property container (and sub-classes) to ignore the property when saving a document. On load time nothing happens because the LineColorArray won't be triggered.
Might be correct for points but it's definitely wrong for faces. There we already have the possibility to set individual colors for faces using the DiffuseColor property. For faces there is no second color property used for highlighting so that I guess DiffuseColor is used for this, too.
My actual goal is to reduce the (historically grown) different color properties. For a standard view provider we at the moment have: ShapeColor, ShapeMaterial and DiffuseColor to set color(s) on faces. For edges we have LineColor, LineMaterial and LineColorArray and for points we have PointColor, PointMaterial and PointColorArray.
At least the pairs (ShapeColor and ShapeMaterial), (LineColor and LineMaterial) and (PointColor and PointMaterial) can be replaced by one property for each. I therefore suggest the new property PropertyMaterialList because this gives us the full flexibility of the SoMaterial node.
We can still keep DiffuseColors, LineColorArray and PointColorArray but should rename them to FaceHightlight, LineHighlight and PointHighlight to make clear their purposes.
7e01d01
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a look at the code now to see how LineColorArray is used at the moment. It's always done like this:
OK, there is indeed no reason to have this implemented with properties. To highlight any sub-elements I would add a method e.g. hightlightFaces() which gets a list of colors or materials and a method unhighlightFaces() which internally triggers the property to restore the old colors.
So, this also means for faces, line and point we can have only one property for each.