3#include "MRPch/MRBindingMacros.h"
28 constexpr static const
char* TypeName() noexcept {
return "PointsHolder"; }
29 virtual const char*
typeName()
const override {
return TypeName(); }
35 [[nodiscard]]
virtual bool hasModel()
const override {
return bool( points_ ); }
37 const std::shared_ptr<const PointCloud>&
pointCloud()
const
38 {
return reinterpret_cast< const std::shared_ptr<const PointCloud>&
>( points_ ); }
52 void selectPoints( VertBitSet newSelection ) { updateSelectedPoints( newSelection ); }
63 return selectedVerticesColor_.get(
id );
122 static constexpr int MaxRenderingPointsDefault = 1'000'000;
124 static constexpr int MaxRenderingPointsUnlimited = std::numeric_limits<int>::max();
171 float pointSize_{ 5.0f };
193 int maxRenderingPoints_ = MaxRenderingPointsDefault;
198 void setDefaultColors_();
201 void setDefaultSceneProperties_();
204 void updateRenderDiscretization_();
206 int renderDiscretization_ = 1;
208 const char * serializeFormat_ =
nullptr;
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:80
#define MRMESH_CLASS
Definition MRMesh/MRMeshFwd.h:84
SelectedVertices
Definition MRObjectPointsHolder.h:13
Definition MRVisualObject.h:57
Definition MRObjectPointsHolder.h:21
ViewportProperty< Color > selectedVerticesColor_
Definition MRObjectPointsHolder.h:159
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...
MR_BIND_IGNORE const char * savePointsFormat() const
Definition MRObjectPointsHolder.h:136
MRMESH_API const ViewportProperty< Color > & getSelectedVerticesColorsForAllViewports() const
MRMESH_API int getMaxRenderingPoints() const
Definition MRObjectPointsHolder.h:128
MRMESH_API ObjectPointsHolder()
ObjectPointsHolder(ProtectedStruct, const ObjectPointsHolder &obj)
Definition MRObjectPointsHolder.h:96
const std::shared_ptr< const PointCloud > & pointCloud() const
Definition MRObjectPointsHolder.h:37
std::optional< size_t > numValidPoints_
Definition MRObjectPointsHolder.h:157
virtual MRMESH_API void swapSignals_(Object &other) override
MRMESH_API size_t numRenderingValidPoints() const
returns count of valid points that will be rendered
virtual MRMESH_API void copyColors(const ObjectPointsHolder &src, const VertMap &thisToSrc, const FaceMap &thisToSrcFaces={})
copies point colors from given source object
virtual MRMESH_API size_t heapBytes() const override
returns the amount of memory this object occupies on heap
virtual MRMESH_API void setDirtyFlags(uint32_t mask, bool invalidateCaches=true) override
virtual void updateVertsColorMap(VertColors &vertsColorMap)
swaps per-point colors of the object with given argument
Definition MRObjectPointsHolder.h:80
virtual MRMESH_API void setupRenderObject_() const override
ObjectPointsHolder(ObjectPointsHolder &&) noexcept=default
MR_BIND_IGNORE void setSavePointsFormat(const char *newFormat)
Definition MRObjectPointsHolder.h:141
VertColors vertsColorMap_
Definition MRObjectPointsHolder.h:161
virtual bool hasModel() const override
Definition MRObjectPointsHolder.h:35
const Color & getSelectedVerticesColor(ViewportId id={}) const
returns colors of selected vertices
Definition MRObjectPointsHolder.h:61
MRMESH_API size_t numSelectedPoints() const
returns cached information about the number of selected points
virtual const char * typeName() const override
Definition MRObjectPointsHolder.h:29
MRMESH_API void setAllVisualizeProperties_(const AllVisualizeProperties &properties, std::size_t &pos) override
set all visualize properties masks
MRMESH_API const VertBitSet & getSelectedPointsOrAll() const
returns selected points if any, otherwise returns all valid points
SelectionChangedSignal pointsSelectionChangedSignal
Definition MRObjectPointsHolder.h:150
virtual MRMESH_API void deserializeFields_(const Json::Value &root) override
VertBitSet selectedPoints_
Definition MRObjectPointsHolder.h:156
int getRenderDiscretization() const
Definition MRObjectPointsHolder.h:116
virtual MRMESH_API Expected< std::future< Expected< void > > > serializeModel_(const std::filesystem::path &path) const override
MRMESH_API void setMaxRenderingPoints(int val)
virtual MRMESH_API Box3f computeBoundingBox_() const override
Signal< void()> renderDiscretizationChangedSignal
signal about render discretization changing, triggered in setRenderDiscretization
Definition MRObjectPointsHolder.h:153
MRMESH_API const ViewportMask & getVisualizePropertyMask(AnyVisualizeMaskEnum type) const override
returns mask of viewports where given property is set
MRMESH_API void setSerializeFormat(const char *newFormat)
virtual MRMESH_API std::shared_ptr< Object > clone() const override
ObjectPointsHolder(const ObjectPointsHolder &other)=default
virtual MRMESH_API void updateSelectedPoints(VertBitSet &selection)
swaps current selected points with the argument
ViewportProperty< XfBasedCache< Box3f > > worldBox_
Definition MRObjectPointsHolder.h:168
MRMESH_API AllVisualizeProperties getAllVisualizeProperties() const override
get all visualize properties masks
PointCloudPart pointCloudPart() const
Definition MRObjectPointsHolder.h:41
virtual MRMESH_API void setSelectedVerticesColor(const Color &color, ViewportId id={})
sets colors of selected vertices
const char * serializeFormat() const
returns overriden file extension used to serialize point cloud inside this object,...
Definition MRObjectPointsHolder.h:135
virtual float getPointSize() const
returns size of points on screen in pixels
Definition MRObjectPointsHolder.h:93
virtual MRMESH_API Expected< void > deserializeModel_(const std::filesystem::path &path, ProgressCallback progressCb={}) override
Reads model from file.
virtual MRMESH_API void setPointSize(float size)
sets size of points on screen in pixels
virtual MRMESH_API bool hasVisualRepresentation() const override
does the object have any visual representation (visible points, triangles, edges, etc....
virtual MRMESH_API std::shared_ptr< Object > shallowClone() const override
void selectPoints(VertBitSet newSelection)
sets current selected points
Definition MRObjectPointsHolder.h:52
MRMESH_API size_t numValidPoints() const
returns cached information about the number of valid points
virtual MRMESH_API void applyScale(float scaleFactor) override
scale object size (all point positions)
std::shared_ptr< PointCloud > points_
Definition MRObjectPointsHolder.h:167
virtual MRMESH_API Box3f getWorldBox(ViewportId={}) const override
virtual void setVertsColorMap(VertColors vertsColorMap)
sets per-point colors of the object
Definition MRObjectPointsHolder.h:77
const VertBitSet & getSelectedPoints() const
gets current selected points
Definition MRObjectPointsHolder.h:49
MRMESH_API void resetFrontColor() override
reset basic object colors to their default values from the current theme
virtual MRMESH_API void serializeFields_(Json::Value &root) const override
const VertColors & getVertsColorMap() const
returns per-point colors of the object
Definition MRObjectPointsHolder.h:74
virtual MRMESH_API void swapBase_(Object &other) override
swaps this object with other
virtual MRMESH_API void setSelectedVerticesColorsForAllViewports(ViewportProperty< Color > val)
std::optional< size_t > numSelectedPoints_
Definition MRObjectPointsHolder.h:158
MRMESH_API void resetColors() override
reset all object colors to their default values from the current theme
named object in the data model
Definition MRObject.h:62
Definition MRViewportId.h:16
stores mask of viewport unique identifiers
Definition MRViewportId.h:42
Definition MRViewportProperty.h:17
Visual Object.
Definition MRVisualObject.h:122
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:728
std::vector< ViewportMask > AllVisualizeProperties
Definition MRVisualObject.h:75
@ DIRTY_VERTS_COLORMAP
Definition MRVisualObject.h:90
Definition MRCameraOrientationPlugin.h:8
tl::expected< T, E > Expected
Definition MRExpected.h:25
MRMESH_API void setDefaultSerializePointsFormat(std::string newFormat)
std::array< Vector3f, 3 > MR_BIND_IGNORE
Definition MRMeshBuilderTypes.h:10
MRMESH_API const std::string & defaultSerializePointsFormat()
Definition MRMesh/MRColor.h:9
Definition MRVisualObject.h:35
Definition MRObject.h:274
represents full point cloud (if region is nullptr) or some portion of point cloud (if region pointer ...
Definition MRPointCloudPart.h:10