Add interactive bind to cycle backface culling modes#3126
Conversation
mwestphal
left a comment
There was a problem hiding this comment.
looks good, please add tests and doc :)
| std::string CachePath; | ||
|
|
||
| std::optional<std::string> BackfaceType; | ||
| std::map<vtkProperty*, bool> OriginalBackfaceCulling; |
There was a problem hiding this comment.
why do you need a bool on top of the property ?
There was a problem hiding this comment.
Because the vtkProperty acts as a key for each material. We need the bool as a backup so when we cycle back to default, we can fully recover the original state for each part of the object.
There was a problem hiding this comment.
Im really confused. the original vtkProperty should contain all the info you need, should it not ?
|
|
||
| vtkProperty* prop = coloring.Actor->GetProperty(); | ||
| vtkProperty* origProp = coloring.OriginalActor->GetProperty(); | ||
| if (this->OriginalBackfaceCulling.count(prop) == 0) |
There was a problem hiding this comment.
find should be enough, no need to use count
|
Need any help moving forward @isaccunha ? :) |
|
I just pushed some changes, do you think it is ready and I can move on to testing and docs? |
Ill take a look :) |
| this->addBinding({mod_t::NONE, "P"}, "cycle_blending", "Scene", docBlend, f3d::interactor::BindingType::CYCLIC); | ||
| this->addBinding({mod_t::NONE, "Q"}, "toggle render.effect.ambient_occlusion","Scene", std::bind(docTgl, "Ambient occlusion", std::cref(opts.render.effect.ambient_occlusion)), f3d::interactor::BindingType::TOGGLE); | ||
| this->addBinding({mod_t::NONE, "A"}, "cycle_anti_aliasing","Scene", docAA, f3d::interactor::BindingType::CYCLIC); | ||
| this->addBinding({mod_t::CTRL, "B"},"cycle_backface_type","Scene",docBackface,f3d::interactor::BindingType::CYCLIC); |
There was a problem hiding this comment.
| this->addBinding({mod_t::CTRL, "B"},"cycle_backface_type","Scene",docBackface,f3d::interactor::BindingType::CYCLIC); | |
| this->addBinding({mod_t::CTRL, "B"},"cycle_backface_type", "Scene",docBackface,f3d::interactor::BindingType::CYCLIC); |
mwestphal
left a comment
There was a problem hiding this comment.
Still unclear in regards to the vtkProperty thing.
Lets discuss on discord if you can :)
Describe your changes
This PR adds a command and a bind to control backface culling.
Issue ticket number and link if any
#2697
Checklist for finalizing the PR
.github/workflows/versions.json, I have updateddocker_timestampAI Disclosure
Continuous integration
Please write a comment to run CI, eg:
\ci fast.See here for more info.