MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / WrappedModelSubobject

Class WrappedModelSubobject

source/MRViewer/MRRenderFeatureObjects.h:97–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95// The base template handles `IsPrimary == true`. We have a specialization below for `false`.
96template <bool IsPrimary, typename BaseObjectType>
97class WrappedModelSubobject : public detail::WrappedModelSubobjectBase<IsPrimary, BaseObjectType>
98{
99public:
100 using detail::WrappedModelSubobjectBase<IsPrimary, BaseObjectType>::target_;
101
102 const ViewportProperty<Color>& getFrontColorsForAllViewports( bool selected = true ) const override
103 {
104 return target_->getFrontColorsForAllViewports( selected );
105 }
106
107 const ViewportProperty<Color>& getBackColorsForAllViewports() const override
108 {
109 return target_->getBackColorsForAllViewports();
110 }
111
112 const ViewportProperty<uint8_t>& getGlobalAlphaForAllViewports() const override
113 {
114 if ( IsPrimary )
115 const_cast<WrappedModelSubobject &>( *this ).setGlobalAlpha( (std::uint8_t)std::clamp( int( target_->getGlobalAlpha() * target_->getMainFeatureAlpha() ), 0, 255 ) );
116 return detail::WrappedModelSubobjectPart<IsPrimary, BaseObjectType>::getGlobalAlphaForAllViewports();
117 }
118};
119
120template <typename BaseObjectType>
121class WrappedModelSubobject<false, BaseObjectType> : public detail::WrappedModelSubobjectBase<false, BaseObjectType>

Callers

nothing calls this directly

Calls 3

clampFunction · 0.85
setGlobalAlphaMethod · 0.80
getMainFeatureAlphaMethod · 0.80

Tested by

no test coverage detected