MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenColorIO / removeDisplayView

Method removeDisplayView

src/OpenColorIO/Config.cpp:3752–3805  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3750}
3751
3752void Config::removeDisplayView(const char * display, const char * view)
3753{
3754 if (!display || !*display)
3755 {
3756 throw Exception("Can't remove a view from a display with an empty display name.");
3757 }
3758 if (!view || !*view)
3759 {
3760 throw Exception("Can't remove a view from a display with an empty view name.");
3761 }
3762
3763 const std::string displayNameRef(display);
3764
3765 // Check if the display exists.
3766
3767 DisplayMap::iterator iter = FindDisplay(getImpl()->m_displays, display);
3768 if (iter==getImpl()->m_displays.end())
3769 {
3770 std::ostringstream os;
3771 os << "Could not find a display named '" << display << "' to be removed from config.";
3772 throw Exception(os.str().c_str());
3773 }
3774
3775 ViewVec & views = iter->second.m_views;
3776 StringUtils::StringVec & sharedViews = iter->second.m_sharedViews;
3777
3778 const std::string viewNameRef(view);
3779 if (!StringUtils::Remove(sharedViews, view))
3780 {
3781 // view is not a shared view.
3782 // Is it a view?
3783 auto viewIt = FindView(views, view);
3784 if (viewIt == views.end())
3785 {
3786 std::ostringstream os;
3787 os << "Could not find a view named '" << view;
3788 os << " to be removed from the display named '" << display << "'.";
3789 throw Exception(os.str().c_str());
3790 }
3791
3792 views.erase(viewIt);
3793 }
3794
3795 // Check if the display needs to be removed also.
3796 if (views.empty() && sharedViews.empty())
3797 {
3798 getImpl()->m_displays.erase(iter);
3799 }
3800
3801 getImpl()->m_displayCache.clear();
3802
3803 AutoMutex lock(getImpl()->m_cacheidMutex);
3804 getImpl()->resetCacheIDs();
3805}
3806
3807void Config::clearDisplays()
3808{

Callers 10

_clear_itemsMethod · 0.80
_add_itemMethod · 0.80
_remove_itemMethod · 0.80
_remove_itemMethod · 0.80
_remove_itemMethod · 0.80
RemoveDisplayViewFunction · 0.80
test_ruled_viewsMethod · 0.80
test_virtual_displayMethod · 0.80
OCIO_ADD_TESTFunction · 0.80
OCIO_ADD_TESTFunction · 0.80

Calls 9

FindDisplayFunction · 0.85
RemoveFunction · 0.85
FindViewFunction · 0.85
eraseMethod · 0.80
resetCacheIDsMethod · 0.80
getImplFunction · 0.50
endMethod · 0.45
emptyMethod · 0.45
clearMethod · 0.45

Tested by 4

test_ruled_viewsMethod · 0.64
test_virtual_displayMethod · 0.64
OCIO_ADD_TESTFunction · 0.64
OCIO_ADD_TESTFunction · 0.64