Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added VisAttr ref extension compact construction #851

Merged
merged 3 commits into from Jul 27, 2021

Conversation

whit2333
Copy link

Closes #841

BEGINRELEASENOTES

  • Using ref="OtherVisName" attribute with the vis tag, the visualization attribute is an extension of
    "OtherVisName" which is used to initialize the new vis attribute.
  • The new VisAttr inherits all the properties of the ref and additional arguments override these values.

Example where the only difference is the alpha value.

  <vis name="SiVertexBarrelModuleVis"
       alpha="1.0" r="1.0" g="0.75" b="0.76"
       drawingStyle="wireframe"
       showDaughters="false"
       visible="true"/>

  <vis name="SiVertexEndcapModuleVis"
       ref="SiVertexBarrelModuleVis"
       alpha="0.5"/>

ENDRELEASENOTES

 - Using `ref="OtherVisName"` attribute, the visualization attribute is an extension of
the `"OtherVisName"` which is used to initialize the new vis attribute.
 - The new VisAttr inherits all the properties  of the ref and additional arguments override these values.

Example where the only difference is the `alpha` value.

```
  <vis name="SiVertexBarrelModuleVis"
       alpha="1.0" r="1.0" g="0.75" b="0.76"
       drawingStyle="wireframe"
       showDaughters="false"
       visible="true"/>

  <vis name="SiVertexEndcapModuleVis"
       ref="SiVertexBarrelModuleVis"
       alpha="0.5"/>
```

	modified:   src/plugins/Compact2Objects.cpp
@whit2333
Copy link
Author

@MarkusFrankATcernch, can you have a look at this PR? I'm not sure if the checks fail because of something here.

- Lets see if the checks pass...
@MarkusFrankATcernch
Copy link
Contributor

@whit2333
This implementation will not work as expected.
It will apply defaults for all properties, which are not part of the XML definition.
I have implemented the stuff already some time ago, but did not push.
If you agree I commit my version and close this PR.
Otherwise you have to NOT apply all defaults if the "ref" property is present. Then I discard my changes.

@whit2333
Copy link
Author

@MarkusFrankATcernch , You are right. I did push changes.

@whit2333
Copy link
Author

@MarkusFrankATcernch, I have no problem if you prefer your implementation which does the same thing. The sooner it can be merged into the better!

@MarkusFrankATcernch
Copy link
Contributor

@andresailer Please merge this PR. Thanks!

@andresailer andresailer merged commit f2da87b into AIDASoft:master Jul 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature: Extend/inherit visualization attributes.
3 participants