45 template <
typename T,
typename C,
typename SetterFunc>
56 return std::invoke( m_getter,
dynamic_cast< const C*
>( objectToInvoke ),
id );
59 if constexpr ( ( std::is_same_v<SetterFunc, void ( C::* )( const T&,
ViewportId )> )
60 || ( std::is_same_v<SetterFunc, void ( C::* )( T,
ViewportId )> ) )
64 assert( std::holds_alternative<T>( v ) );
65 if ( std::holds_alternative<T>( v ) )
67 std::invoke( m_setter,
dynamic_cast< C*
> ( objectToInvoke ), std::get<T>( v ),
id );
173 float pointSize_ = 10;
174 float lineWidth_ = 2;
177 float subPointSize_ = 6;
178 float subLineWidth_ = 1;
181 float mainFeatureAlpha_ = 1;
182 float subAlphaPoints_ = 1;
183 float subAlphaLines_ = 1;
184 float subAlphaMesh_ = 0.5f;
DetailsOnNameTag
Definition MRFeatureObject.h:86
Subfeatures
Definition MRFeatureObject.h:85
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
#define MRMESH_CLASS
Definition MRMesh/MRMeshFwd.h:50
Definition MRVisualObject.h:67
An interface class which allows feature objects to share setters and getters on their main properties...
Definition MRFeatureObject.h:93
MRMESH_API AllVisualizeProperties getAllVisualizeProperties() const override
get all visualize properties masks
virtual MRMESH_API float getMainFeatureAlpha() const
MRMESH_API const ViewportMask & getVisualizePropertyMask(AnyVisualizeMaskEnum type) const override
returns mask of viewports where given property is set
virtual MRMESH_API float getPointSize() const
std::array< ViewportProperty< Color >, 2 > decorationsColor_
Definition MRFeatureObject.h:168
virtual MRMESH_API void setLineWidth(float lineWidth)
MRMESH_API void setXf(const AffineXf3f &xf, ViewportId id={}) override
virtual MRMESH_API void setSubfeatureAlphaLines(float alpha)
virtual MRMESH_API float getSubfeatureAlphaMesh() const
virtual MRMESH_API float getSubfeaturePointSize() const
virtual MRMESH_API const ViewportProperty< Color > & getDecorationsColorForAllViewports(bool selected) const
virtual MRMESH_API void setDecorationsColor(const Color &color, bool selected, ViewportId viewportId={})
virtual MRMESH_API float getLineWidth() const
Matrix3f getScaleShearMatrix(ViewportId id={}, bool *isDef=nullptr) const
Definition MRFeatureObject.h:122
MRMESH_API FeatureObject(int numDimensions)
virtual const std::vector< FeatureObjectSharedProperty > & getAllSharedProperties() const =0
Create and generate list of bounded getters and setters for the main properties of feature object,...
virtual MRMESH_API void setPointSize(float pointSize)
virtual MRMESH_API Vector3f getBasePoint(ViewportId id={}) const
Matrix3f getRotationMatrix(ViewportId id={}, bool *isDef=nullptr) const
Definition MRFeatureObject.h:119
virtual MRMESH_API void setSubfeatureAlphaPoints(float alpha)
MRMESH_API bool supportsVisualizeProperty(AnyVisualizeMaskEnum type) const override
Returns true if this class supports the property type. Otherwise passing it to the functions below is...
ViewportProperty< Matrix3f > s_
Definition MRFeatureObject.h:165
MRMESH_API void resetXf(ViewportId id={}) override
forgets specific transform in given viewport (or forgets all specific transforms for {}...
virtual MRMESH_API float getSubfeatureLineWidth() const
virtual MRMESH_API void setDecorationsColorForAllViewports(ViewportProperty< Color > val, bool selected)
virtual MRMESH_API float getSubfeatureAlphaLines() const
MRMESH_API void serializeFields_(Json::Value &root) const override
ViewportProperty< Matrix3f > r_
Definition MRFeatureObject.h:164
virtual MRMESH_API void setSubfeaturePointSize(float pointSize)
virtual FeatureObjectProjectPointResult projectPoint(const Vector3f &point, ViewportId id={}) const =0
virtual MRMESH_API void setSubfeatureAlphaMesh(float alpha)
MRMESH_API std::optional< Vector3f > getNormal(const Vector3f &point) const
virtual MRMESH_API void setMainFeatureAlpha(float alpha)
MRMESH_API void deserializeFields_(const Json::Value &root) override
MRMESH_API void setAllVisualizeProperties_(const AllVisualizeProperties &properties, std::size_t &pos) override
virtual MRMESH_API void setSubfeatureLineWidth(float lineWidth)
MRMESH_API const Color & getDecorationsColor(bool selected, ViewportId viewportId={}, bool *isDef=nullptr) const
virtual MRMESH_API float getSubfeatureAlphaPoints() const
Definition MRViewportId.h:16
stores mask of viewport unique identifiers
Definition MRViewportId.h:38
Definition MRViewportProperty.h:17
Visual Object.
Definition MRVisualObject.h:131
represents a 3-dimentional float-typed vector
Definition MRDotNet/MRVector3.h:8
std::vector< ViewportMask > AllVisualizeProperties
Definition MRVisualObject.h:85
Definition MRCameraOrientationPlugin.h:7
FeaturePropertyKind
Definition MRFeatureObject.h:19
std::variant< float, Vector3f > FeaturesPropertyTypesVariant
Definition MRFeatureObject.h:13
constexpr bool dependent_false
Definition MRMesh/MRMeshFwd.h:619
Definition MRFeatureObject.h:78
std::optional< Vector3f > normal
Definition MRFeatureObject.h:80
Vector3f point
Definition MRFeatureObject.h:79
Definition MRFeatureObject.h:36
std::function< FeaturesPropertyTypesVariant(const FeatureObject *objectToInvoke, ViewportId id)> getter
Definition MRFeatureObject.h:40
std::function< void(const FeaturesPropertyTypesVariant &, FeatureObject *objectToInvoke, ViewportId id)> setter
Definition MRFeatureObject.h:43
std::string propertyName
Definition MRFeatureObject.h:37
FeatureObjectSharedProperty(std::string name, FeaturePropertyKind kind, T(C::*m_getter)(ViewportId) const, SetterFunc m_setter)
Definition MRFeatureObject.h:46
FeaturePropertyKind kind
Definition MRFeatureObject.h:38
Definition MRVisualObject.h:45