]> gerrit.simantics Code Review - simantics/district.git/commit
First prototype of HSV color space based dynamic DN element coloring 42/2342/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Sat, 20 Oct 2018 22:59:48 +0000 (01:59 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Sat, 20 Oct 2018 23:01:49 +0000 (23:01 +0000)
commit00803fe68b14b5dce310a5a88b9c2a55bd1c85e6
treef5abcc96ffccfadb841744a00383923431136d49
parentb654d9f368d601565303bcf646fc4fbdfbc37090
First prototype of HSV color space based dynamic DN element coloring

Both VertexNode and EdgeNode support a new property 'dynamicColor' that
can be set to either a Color or null.

DN.Diagram has three new properties:
* Element Color Hue
* Element Color Saturation
* Element Color Brightness Function

where the first two are constants and the last one is a (Resource ->
<ReadGraph> Double) function that is expected to return a value in [0,1]
which is then used to get the final element color from the HSV gradient.
The Resource argument is the DN diagram element.

The function allows users to define any complex functions in SCLMain to
perform the evaluation for the DN element.

gitlab #2

Change-Id: Ia8dbe0df9400242670949da91e373d68cf7ff758
(cherry picked from commit 2cf7ae447c79df6240b67fd3ca4f0338bdae8c00)
15 files changed:
org.simantics.district.network.ontology/graph/DistrictNetwork.pgraph
org.simantics.district.network.ontology/graph/DistrictNetworkDiagramSettings.pgraph
org.simantics.district.network.ontology/graph/DistrictNetworkProfiles.pgraph
org.simantics.district.network.ontology/scl/Simantics/District/SCLMain.scl
org.simantics.district.network.ontology/src/org/simantics/district/network/ontology/DistrictNetworkResource.java
org.simantics.district.network.ui/src/org/simantics/district/network/ui/function/Functions.java
org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/DistrictNetworkEdgeNode.java
org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/DistrictNetworkVertexNode.java
org.simantics.district.network/adapters.xml
org.simantics.district.network/scl/Simantics/District.scl
org.simantics.district.network/src/org/simantics/district/network/profile/ColorGradient.java [new file with mode: 0644]
org.simantics.district.network/src/org/simantics/district/network/profile/Colors.java [new file with mode: 0644]
org.simantics.district.network/src/org/simantics/district/network/profile/DNElementColorStyle.java [new file with mode: 0644]
org.simantics.district.network/src/org/simantics/district/network/profile/DiagramSettings.java
org.simantics.district.network/src/org/simantics/district/network/profile/DiagramSettingsRequest.java