MeshLib C++ Docs
Loading...
Searching...
No Matches
MRObjectMeshHolder.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRPch/MRBindingMacros.h"
4#include "MRVisualObject.h"
5#include "MRXfBasedCache.h"
6#include "MRMeshPart.h"
7#include "MRObjectMeshData.h"
8#include "MRHeapBytes.h"
9#include "MRMeshTexture.h"
10
11namespace MR
12{
15
16
17enum class MRMESH_CLASS MeshVisualizePropertyType
18{
30 _count [[maybe_unused]],
31};
32template <> struct IsVisualizeMaskEnum<MeshVisualizePropertyType> : std::true_type {};
33
37{
38public:
40
41 ObjectMeshHolder( ObjectMeshHolder&& ) noexcept = default;
42 ObjectMeshHolder& operator = ( ObjectMeshHolder&& ) noexcept = default;
43
44 constexpr static const char* StaticTypeName() noexcept { return "MeshHolder"; }
45 virtual const char* typeName() const override { return StaticTypeName(); }
46
47 MRMESH_API virtual void applyScale( float scaleFactor ) override;
48
50 MRMESH_API virtual bool hasVisualRepresentation() const override;
51
52 [[nodiscard]] virtual bool hasModel() const override { return bool( data_.mesh ); }
53
55 [[nodiscard]] Mesh* varMeshPtr() { return data_.mesh.get(); }
56
58 [[nodiscard]] const Mesh* meshPtr() const { return data_.mesh.get(); }
59
60 #ifdef __GNUC__
61 #pragma GCC diagnostic push
62 #pragma GCC diagnostic ignored "-Wstrict-aliasing"
63 #endif
65 [[deprecated( "use meshPtr() instead" )]]
66 const std::shared_ptr< const Mesh >& mesh() const
67 { return reinterpret_cast< const std::shared_ptr<const Mesh>& >( data_.mesh ); }
68 #ifdef __GNUC__
69 #pragma GCC diagnostic pop
70 #endif
71
73 MeshPart meshPart() const { return data_.selectedFaces.any() ? MeshPart{ *data_.mesh, &data_.selectedFaces } : *data_.mesh; }
74
75 MRMESH_API virtual std::shared_ptr<Object> clone() const override;
76 MRMESH_API virtual std::shared_ptr<Object> shallowClone() const override;
77
78 MRMESH_API virtual void setDirtyFlags( uint32_t mask, bool invalidateCaches = true ) override;
79
83 MRMESH_API virtual void setDirtyFlagsFast( uint32_t mask );
84
86 MRMESH_API virtual void invalidateMetricsCache( uint32_t mask );
87
88 const FaceBitSet& getSelectedFaces() const { return data_.selectedFaces; }
89 MRMESH_API virtual void selectFaces( FaceBitSet newSelection );
93 MRMESH_API virtual void setSelectedFacesColor( const Color& color, ViewportId id = {} );
94
95 const UndirectedEdgeBitSet& getSelectedEdges() const { return data_.selectedEdges; }
96 MRMESH_API virtual void selectEdges( UndirectedEdgeBitSet newSelection );
100 MRMESH_API virtual void setSelectedEdgesColor( const Color& color, ViewportId id = {} );
101
104
107
110
113
116
119
121 const UndirectedEdgeBitSet& creases() const { return data_.creases; }
122 MRMESH_API virtual void setCreases( UndirectedEdgeBitSet creases );
123
125 void setFlatShading( bool on )
126 { return setVisualizeProperty( on, MeshVisualizePropertyType::FlatShading, ViewportMask::all() ); }
127 bool flatShading() const
128 { return getVisualizeProperty( MeshVisualizePropertyType::FlatShading, ViewportMask::any() ); }
129
130 [[nodiscard]] MRMESH_API bool supportsVisualizeProperty( AnyVisualizeMaskEnum type ) const override;
131
136
138 const ObjectMeshData& data() const { return data_; }
139
141 virtual void setData( ObjectMeshData && data ) { data_ = std::move( data ); setDirtyFlags( DIRTY_ALL ); }
142
144 virtual void updateData( ObjectMeshData& data ) { std::swap( data_, data ); setDirtyFlags( DIRTY_ALL ); }
145
147 const VertColors& getVertsColorMap() const { return data_.vertColors; }
148
150 virtual void setVertsColorMap( VertColors vertsColorMap ) { data_.vertColors = std::move( vertsColorMap ); setDirtyFlags( DIRTY_VERTS_COLORMAP ); }
151
153 virtual void updateVertsColorMap( VertColors& vertsColorMap ) { std::swap( data_.vertColors, vertsColorMap ); setDirtyFlags( DIRTY_VERTS_COLORMAP ); }
154
155 const FaceColors& getFacesColorMap() const { return data_.faceColors; }
156 virtual void setFacesColorMap( FaceColors facesColorMap ) { data_.faceColors = std::move( facesColorMap ); setDirtyFlags( DIRTY_PRIMITIVE_COLORMAP ); }
157 virtual void updateFacesColorMap( FaceColors& updated ) { std::swap( data_.faceColors, updated ); setDirtyFlags( DIRTY_PRIMITIVE_COLORMAP ); }
158
159 MRMESH_API virtual void setEdgeWidth( float edgeWidth );
160 float getEdgeWidth() const { return edgeWidth_; }
161 MRMESH_API virtual void setPointSize( float size );
162 virtual float getPointSize() const { return pointSize_; }
163
164 const Color& getEdgesColor( ViewportId id = {} ) const { return edgesColor_.get(id); }
165 virtual void setEdgesColor( const Color& color, ViewportId id = {} )
166 { edgesColor_.set( color, id ); needRedraw_ = true; }
167
168 const Color& getPointsColor( ViewportId id = {} ) const { return pointsColor_.get(id); }
169 virtual void setPointsColor( const Color& color, ViewportId id = {} )
170 { pointsColor_.set( color, id ); needRedraw_ = true; }
171
172 const Color& getBordersColor( ViewportId id = {} ) const { return bordersColor_.get( id ); }
173 virtual void setBordersColor( const Color& color, ViewportId id = {} )
174 { bordersColor_.set( color, id ); needRedraw_ = true; }
175
179
183 [[deprecated]] MRMESH_API MR_BIND_IGNORE virtual void setTexture( MeshTexture texture );
184 [[deprecated]] MRMESH_API MR_BIND_IGNORE virtual void updateTexture( MeshTexture& updated );
186 virtual void setTextures( Vector<MeshTexture, TextureId> texture ) { textures_ = std::move( texture ); setDirtyFlags( DIRTY_TEXTURE ); }
187 virtual void updateTextures( Vector<MeshTexture, TextureId>& updated ) { std::swap( textures_, updated ); setDirtyFlags( DIRTY_TEXTURE ); }
188
191 virtual void setTexturePerFace( Vector<TextureId, FaceId> texturePerFace ) { data_.texturePerFace = std::move( texturePerFace ); setDirtyFlags( DIRTY_TEXTURE_PER_FACE ); }
192 virtual void updateTexturePerFace( Vector<TextureId, FaceId>& texturePerFace ) { std::swap( data_.texturePerFace, texturePerFace ); setDirtyFlags( DIRTY_TEXTURE_PER_FACE ); }
193 virtual void addTexture( MeshTexture texture ) { textures_.emplace_back( std::move( texture ) ); setDirtyFlags( DIRTY_TEXTURE_PER_FACE ); }
194 const TexturePerFace& getTexturePerFace() const { return data_.texturePerFace; }
195
196 const VertUVCoords& getUVCoords() const { return data_.uvCoordinates; }
197 virtual void setUVCoords( VertUVCoords uvCoordinates ) { data_.uvCoordinates = std::move( uvCoordinates ); setDirtyFlags( DIRTY_UV ); }
198 virtual void updateUVCoords( VertUVCoords& updated ) { std::swap( data_.uvCoordinates, updated ); setDirtyFlags( DIRTY_UV ); }
199
201 MRMESH_API virtual void copyTextureAndColors( const ObjectMeshHolder& src, const VertMap& thisToSrc, const FaceMap& thisToSrcFaces = {} );
202
204 MRMESH_API virtual void copyColors( const ObjectMeshHolder& src, const VertMap& thisToSrc, const FaceMap& thisToSrcFaces = {} );
205
208 virtual void setAncillaryTexture( MeshTexture texture ) { ancillaryTexture_ = std::move( texture ); setDirtyFlags( DIRTY_TEXTURE ); }
209
210 const VertUVCoords& getAncillaryUVCoords() const { return ancillaryUVCoordinates_; }
211 virtual void setAncillaryUVCoords( VertUVCoords uvCoordinates ) { ancillaryUVCoordinates_ = std::move( uvCoordinates ); setDirtyFlags( DIRTY_UV ); }
212 void updateAncillaryUVCoords( VertUVCoords& updated ) { std::swap( ancillaryUVCoordinates_, updated ); setDirtyFlags( DIRTY_UV ); }
213
214 bool hasAncillaryTexture() const { return !ancillaryUVCoordinates_.empty() && !ancillaryTexture_.pixels.empty(); }
216
217 MRMESH_API virtual bool getRedrawFlag( ViewportMask viewportMask ) const override;
218
220 [[nodiscard]] MRMESH_API bool isMeshClosed() const;
221
224 [[nodiscard]] MRMESH_API virtual Box3f getWorldBox( ViewportId = {} ) const override;
225
227 [[nodiscard]] MRMESH_API size_t numSelectedFaces() const;
228
230 [[nodiscard]] MRMESH_API size_t numSelectedEdges() const;
231
233 [[nodiscard]] MRMESH_API size_t numCreaseEdges() const;
234
236 [[nodiscard]] MRMESH_API double totalArea() const;
237
239 [[nodiscard]] MRMESH_API double selectedArea() const;
240
242 [[nodiscard]] MRMESH_API double volume() const;
243
245 [[nodiscard]] MRMESH_API float avgEdgeLen() const;
246
248 [[nodiscard]] MRMESH_API size_t numUndirectedEdges() const;
249
251 [[nodiscard]] MRMESH_API size_t numHoles() const;
252
254 [[nodiscard]] MRMESH_API size_t numComponents() const;
255
257 [[nodiscard]] MRMESH_API size_t numHandles() const;
258
260 [[nodiscard]] MRMESH_API virtual size_t heapBytes() const override;
261
263 [[nodiscard]] const char * serializeFormat() const { return serializeFormat_; }
264
266 [[nodiscard]] MRMESH_API const char * actualSerializeFormat() const;
267
270 MRMESH_API void setSerializeFormat( const char * newFormat );
271
275 MRMESH_API void resetColors() override;
276
277 MRMESH_API virtual size_t getModelHash() const override;
278 MRMESH_API virtual bool sameModels( const Object& other ) const override;
279
285
287 using MeshChangedSignal = Signal<void( uint32_t mask )>;
289
290protected:
292
295
298
299 mutable std::optional<size_t> numHoles_;
300 mutable std::optional<size_t> numComponents_;
301 mutable std::optional<size_t> numUndirectedEdges_;
302 mutable std::optional<size_t> numHandles_;
303 mutable std::optional<bool> meshIsClosed_;
304 mutable std::optional<size_t> numSelectedFaces_, numSelectedEdges_, numCreaseEdges_;
305 mutable std::optional<double> totalArea_, selectedArea_;
306 mutable std::optional<double> volume_;
307 mutable std::optional<float> avgEdgeLen_;
309
311
313 MRMESH_API virtual void swapBase_( Object& other ) override;
316 MRMESH_API virtual void swapSignals_( Object& other ) override;
317
318 MRMESH_API virtual Expected<std::future<Expected<void>>> serializeModel_( const std::filesystem::path& path ) const override;
319
320 MRMESH_API virtual void serializeFields_( Json::Value& root ) const override;
321
322 MRMESH_API void deserializeFields_( const Json::Value& root ) override;
323
324 MRMESH_API Expected<void> deserializeModel_( const std::filesystem::path& path, ProgressCallback progressCb = {} ) override;
326
328 MRMESH_API void setAllVisualizeProperties_( const AllVisualizeProperties& properties, std::size_t& pos ) override;
329
330 MRMESH_API virtual Box3f computeBoundingBox_() const override;
331
332 MRMESH_API virtual void setupRenderObject_() const override;
333
343
347
349
355
356 float edgeWidth_{ 0.5f };
357 float pointSize_{ 5.f };
358
359private:
361 void setDefaultColors_();
362
364 void setDefaultSceneProperties_();
365
366 const char * serializeFormat_ = nullptr;
367};
368
371[[nodiscard]] MRMESH_API const std::string & defaultSerializeMeshFormat();
372
377MRMESH_API void setDefaultSerializeMeshFormat( std::string newFormat );
378
379}
#define MRMESH_API
Definition MRMeshFwd.h:85
#define MRMESH_CLASS
Definition MRMeshFwd.h:92
Definition MRVisualObject.h:54
named object in the data model
Definition MRObject.h:61
std::vector<T>-like container that requires specific indexing type,
Definition MRVector.h:23
Definition MRViewportId.h:16
stores mask of viewport unique identifiers
Definition MRViewportId.h:42
static ViewportMask any()
Definition MRViewportId.h:50
static ViewportMask all()
mask meaning all or any viewports
Definition MRViewportId.h:49
Definition MRViewportProperty.h:17
bool getVisualizeProperty(AnyVisualizeMaskEnum type, ViewportMask viewportMask) const
returns true if the property is set at least in one viewport specified by the mask
void setVisualizeProperty(bool value, AnyVisualizeMaskEnum type, ViewportMask viewportMask)
set visual property in all viewports specified by the mask
std::function< bool(float)> ProgressCallback
Definition MRMeshFwd.h:759
Vector< MeshTexture, TextureId > textures_
Texture options.
Definition MRObjectMeshHolder.h:294
virtual void updateTexturePerFace(Vector< TextureId, FaceId > &texturePerFace)
Definition MRObjectMeshHolder.h:192
size_t numUndirectedEdges() const
returns cached information about the number of undirected edges in the mesh
virtual MR_BIND_IGNORE void setTexture(MeshTexture texture)
for backward compatibility
ViewportProperty< Color > faceSelectionColor_
Definition MRObjectMeshHolder.h:354
OnlyOddFragments
Definition MRObjectMeshHolder.h:27
virtual void setSelectedFacesColor(const Color &color, ViewportId id={})
sets colors of selected triangles
void setSerializeFormat(const char *newFormat)
virtual void updateTextures(Vector< MeshTexture, TextureId > &updated)
Definition MRObjectMeshHolder.h:187
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
const Mesh * meshPtr() const
returns the mesh of this object, or nullptr if it is not set
Definition MRObjectMeshHolder.h:58
const Color & getEdgesColor(ViewportId id={}) const
Definition MRObjectMeshHolder.h:164
const FaceColors & getFacesColorMap() const
Definition MRObjectMeshHolder.h:155
virtual bool hasModel() const override
Definition MRObjectMeshHolder.h:52
std::optional< size_t > numSelectedFaces_
Definition MRObjectMeshHolder.h:304
virtual void setPointSize(float size)
SelectionChangedSignal edgeSelectionChangedSignal
Definition MRObjectMeshHolder.h:283
virtual bool getRedrawFlag(ViewportMask viewportMask) const override
returns true if the object must be redrawn (due to dirty flags) in one of specified viewports
MeshChangedSignal meshChangedSignal
Definition MRObjectMeshHolder.h:288
const VertUVCoords & getUVCoords() const
Definition MRObjectMeshHolder.h:196
virtual void setTexturePerFace(Vector< TextureId, FaceId > texturePerFace)
Definition MRObjectMeshHolder.h:191
Faces
Definition MRObjectMeshHolder.h:19
bool supportsVisualizeProperty(AnyVisualizeMaskEnum type) const override
Returns true if this class supports the property type. Otherwise passing it to the functions below is...
Expected< void > deserializeModel_(const std::filesystem::path &path, ProgressCallback progressCb={}) override
Reads model from file.
std::optional< size_t > numHoles_
Definition MRObjectMeshHolder.h:299
static constexpr const char * StaticTypeName() noexcept
Definition MRObjectMeshHolder.h:44
ViewportProperty< Color > edgeSelectionColor_
Definition MRObjectMeshHolder.h:353
virtual void swapSignals_(Object &other) override
virtual void addTexture(MeshTexture texture)
Definition MRObjectMeshHolder.h:193
ViewportMask flatShading_
toggle per-face or per-vertex properties
Definition MRObjectMeshHolder.h:342
SelectedFaces
Definition MRObjectMeshHolder.h:23
virtual std::shared_ptr< Object > clone() const override
Edges
Definition MRObjectMeshHolder.h:21
void resetColors() override
reset all object colors to their default values from the current theme
const Vector< MeshTexture, TextureId > & getTextures() const
Definition MRObjectMeshHolder.h:185
ViewportMask showEdges_
Definition MRObjectMeshHolder.h:336
EnableShading
Definition MRObjectMeshHolder.h:25
ObjectMeshHolder(ProtectedStruct, const ObjectMeshHolder &obj)
Definition MRObjectMeshHolder.h:177
const Color & getBordersColor(ViewportId id={}) const
Definition MRObjectMeshHolder.h:172
ImVec2 size(const ViewportRectangle &rect)
Definition MRViewport.h:32
ViewportProperty< XfBasedCache< Box3f > > worldBox_
Definition MRObjectMeshHolder.h:308
void setDefaultSerializeMeshFormat(std::string newFormat)
virtual void setEdgesColor(const Color &color, ViewportId id={})
Definition MRObjectMeshHolder.h:165
virtual void setVertsColorMap(VertColors vertsColorMap)
sets per-vertex colors of the object
Definition MRObjectMeshHolder.h:150
ViewportMask onlyOddFragments_
Definition MRObjectMeshHolder.h:348
virtual void updateVertsColorMap(VertColors &vertsColorMap)
swaps per-vertex colors of the object with given argument
Definition MRObjectMeshHolder.h:153
virtual void invalidateMetricsCache(uint32_t mask)
invalidates same caches with mesh metrics (area, volume, ...) as by setDirtyFlags( mask )
VertUVCoords ancillaryUVCoordinates_
vertices coordinates in ancillary texture
Definition MRObjectMeshHolder.h:297
const Color & getSelectedEdgesColor(ViewportId id={}) const
returns colors of selected edges
virtual void updateUVCoords(VertUVCoords &updated)
Definition MRObjectMeshHolder.h:198
virtual Expected< std::future< Expected< void > > > serializeModel_(const std::filesystem::path &path) const override
SelectionChangedSignal faceSelectionChangedSignal
Definition MRObjectMeshHolder.h:282
virtual Box3f getWorldBox(ViewportId={}) const override
ObjectMeshHolder(ObjectMeshHolder &&) noexcept=default
virtual bool sameModels(const Object &other) const override
return true if model of current object equals to model (the same) of other
void resetFrontColor() override
reset basic object colors to their default values from the current theme
ObjectMeshData data_
Definition MRObjectMeshHolder.h:291
virtual void setupRenderObject_() const override
ViewportMask showPoints_
Definition MRObjectMeshHolder.h:337
virtual size_t getModelHash() const override
return hash of model (or hash object pointer if object has no model)
Points
Definition MRObjectLinesHolder.h:15
void deserializeFields_(const Json::Value &root) override
std::optional< size_t > numSelectedEdges_
Definition MRObjectMeshHolder.h:304
virtual void setDirtyFlags(uint32_t mask, bool invalidateCaches=true) override
const MeshTexture & getTexture() const
returns first texture in the vector. If there is no textures, returns empty texture
std::optional< double > volume_
Definition MRObjectMeshHolder.h:306
double selectedArea() const
returns cached area of selected triangles
const ViewportProperty< Color > & getSelectedEdgesColorsForAllViewports() const
virtual void selectEdges(UndirectedEdgeBitSet newSelection)
virtual Box3f computeBoundingBox_() const override
const TexturePerFace & getTexturePerFace() const
Definition MRObjectMeshHolder.h:194
MeshPart meshPart() const
reinterpret_cast to avoid making a copy of shared_ptr
Definition MRObjectMeshHolder.h:73
const MeshTexture & getAncillaryTexture() const
ancillary texture can be used to have custom features visualization without affecting real one
Definition MRObjectMeshHolder.h:207
size_t numSelectedFaces() const
returns cached information about the number of selected faces in the mesh
size_t numHoles() const
returns cached information about the number of holes in the mesh
std::optional< size_t > numHandles_
Definition MRObjectMeshHolder.h:302
void updateAncillaryUVCoords(VertUVCoords &updated)
Definition MRObjectMeshHolder.h:212
float avgEdgeLen() const
returns cached average edge length
const FaceBitSet & getSelectedFaces() const
Definition MRObjectMeshHolder.h:88
_count
If true, show additional details on the name tag, such as point coordinates. Not all features use thi...
Definition MRFeatureObject.h:90
bool hasAncillaryTexture() const
Definition MRObjectMeshHolder.h:214
std::optional< size_t > numUndirectedEdges_
Definition MRObjectMeshHolder.h:301
ViewportProperty< Color > pointsColor_
Definition MRObjectMeshHolder.h:351
tl::expected< T, E > Expected
Definition MRExpected.h:31
const ViewportProperty< Color > & getPointsColorsForAllViewports() const
void setFlatShading(bool on)
sets flat (true) or smooth (false) shading
Definition MRObjectMeshHolder.h:125
virtual void setEdgeWidth(float edgeWidth)
size_t numCreaseEdges() const
returns cached information about the number of crease undirected edges in the mesh
const UndirectedEdgeBitSet & getSelectedEdges() const
Definition MRObjectMeshHolder.h:95
virtual void setCreases(UndirectedEdgeBitSet creases)
std::optional< float > avgEdgeLen_
Definition MRObjectMeshHolder.h:307
const ViewportProperty< Color > & getEdgesColorsForAllViewports() const
virtual void setPointsColor(const Color &color, ViewportId id={})
Definition MRObjectMeshHolder.h:169
virtual Expected< void > setSharedModel_(const Object &other) override
shares model from other object
virtual void serializeFields_(Json::Value &root) const override
ViewportMask showBordersHighlight_
Definition MRObjectMeshHolder.h:340
Signal< void()> SelectionChangedSignal
signal about face selection changing, triggered in selectFaces
Definition MRObjectMeshHolder.h:281
const ViewportProperty< Color > & getBordersColorsForAllViewports() const
virtual const char * typeName() const override
Definition MRObjectMeshHolder.h:45
ObjectMeshHolder(const ObjectMeshHolder &other)=default
const ViewportProperty< Color > & getSelectedFacesColorsForAllViewports() const
virtual void setSelectedEdgesColorsForAllViewports(ViewportProperty< Color > val)
PolygonOffsetFromCamera
Definition MRObjectMeshHolder.h:29
virtual std::shared_ptr< Object > shallowClone() const override
const ViewportMask & getVisualizePropertyMask(AnyVisualizeMaskEnum type) const override
returns mask of viewports where given property is set
virtual void swapBase_(Object &other) override
swaps this object with other
std::optional< size_t > numComponents_
Definition MRObjectMeshHolder.h:300
size_t numComponents() const
returns cached information about the number of components in the mesh
virtual void copyColors(const ObjectMeshHolder &src, const VertMap &thisToSrc, const FaceMap &thisToSrcFaces={})
copies vertex colors from given source object
virtual void setEdgesColorsForAllViewports(ViewportProperty< Color > val)
virtual void setTextures(Vector< MeshTexture, TextureId > texture)
Definition MRObjectMeshHolder.h:186
void copyAllSolidColors(const ObjectMeshHolder &other)
set all object solid colors (front/back/etc.) from other object for all viewports
void setAllVisualizeProperties_(const AllVisualizeProperties &properties, std::size_t &pos) override
set all visualize properties masks
float edgeWidth_
Definition MRObjectMeshHolder.h:356
bool isMeshClosed() const
returns cached information whether the mesh is closed
const std::string & defaultSerializeMeshFormat()
const VertUVCoords & getAncillaryUVCoords() const
Definition MRObjectMeshHolder.h:210
virtual void setAncillaryUVCoords(VertUVCoords uvCoordinates)
Definition MRObjectMeshHolder.h:211
const char * actualSerializeFormat() const
returns overriden file extension used to serialize mesh inside this object if set,...
FlatShading
Definition MRObjectMeshHolder.h:26
SelectedEdges
Definition MRObjectMeshHolder.h:24
MeshTexture ancillaryTexture_
Definition MRObjectMeshHolder.h:296
bool flatShading() const
Definition MRObjectMeshHolder.h:127
ViewportMask showSelectedFaces_
Definition MRObjectMeshHolder.h:339
float pointSize_
Definition MRObjectMeshHolder.h:357
virtual void setSelectedFacesColorsForAllViewports(ViewportProperty< Color > val)
size_t numSelectedEdges() const
returns cached information about the number of selected undirected edges in the mesh
virtual float getPointSize() const
Definition MRObjectMeshHolder.h:162
const char * serializeFormat() const
returns overriden file extension used to serialize mesh inside this object, nullptr means defaultSeri...
Definition MRObjectMeshHolder.h:263
const UndirectedEdgeBitSet & creases() const
Edges on mesh, that will have sharp visualization even with smooth shading.
Definition MRObjectMeshHolder.h:121
virtual void setUVCoords(VertUVCoords uvCoordinates)
Definition MRObjectMeshHolder.h:197
Texture
Definition MRObjectMeshHolder.h:20
virtual void setBordersColor(const Color &color, ViewportId id={})
Definition MRObjectMeshHolder.h:173
virtual void updateData(ObjectMeshData &data)
swaps whole ObjectMeshData with given argument
Definition MRObjectMeshHolder.h:144
ViewportProperty< Color > bordersColor_
Definition MRObjectMeshHolder.h:352
virtual void applyScale(float scaleFactor) override
scale object size (all point positions)
Mesh * varMeshPtr()
returns the mesh of this object for modification, or nullptr if it is not set
Definition MRObjectMeshHolder.h:55
size_t numHandles() const
returns cached information about the number of handles in the mesh
std::optional< double > totalArea_
Definition MRObjectMeshHolder.h:305
ViewportMask polygonOffset_
Definition MRObjectMeshHolder.h:341
AllVisualizeProperties getAllVisualizeProperties() const override
get all visualize properties masks
const Color & getSelectedFacesColor(ViewportId id={}) const
returns colors of selected triangles
virtual void setPointsColorsForAllViewports(ViewportProperty< Color > val)
Signal< void(uint32_t mask)> MeshChangedSignal
signal about mesh changing, triggered in setDirtyFlag
Definition MRObjectMeshHolder.h:287
virtual void selectFaces(FaceBitSet newSelection)
std::array< Vector3f, 3 > MR_BIND_IGNORE
Definition MRMeshBuilderTypes.h:13
const Color & getPointsColor(ViewportId id={}) const
Definition MRObjectMeshHolder.h:168
std::optional< double > selectedArea_
Definition MRObjectMeshHolder.h:305
const VertColors & getVertsColorMap() const
returns per-vertex colors of the object
Definition MRObjectMeshHolder.h:147
virtual void setDirtyFlagsFast(uint32_t mask)
virtual void setFacesColorMap(FaceColors facesColorMap)
Definition MRObjectMeshHolder.h:156
virtual void setData(ObjectMeshData &&data)
sets whole new ObjectMeshData
Definition MRObjectMeshHolder.h:141
virtual void copyTextureAndColors(const ObjectMeshHolder &src, const VertMap &thisToSrc, const FaceMap &thisToSrcFaces={})
copies texture, UV-coordinates and vertex colors from given source object
float getEdgeWidth() const
Definition MRObjectMeshHolder.h:160
ViewportMask showFaces_
Definition MRObjectMeshHolder.h:335
virtual MR_BIND_IGNORE void updateTexture(MeshTexture &updated)
ViewportMask showSelectedEdges_
Definition MRObjectMeshHolder.h:338
std::optional< bool > meshIsClosed_
Definition MRObjectMeshHolder.h:303
const ObjectMeshData & data() const
provides read-only access to whole ObjectMeshData
Definition MRObjectMeshHolder.h:138
double totalArea() const
returns cached summed area of mesh triangles
virtual void setBordersColorsForAllViewports(ViewportProperty< Color > val)
double volume() const
returns cached volume of space surrounded by the mesh, which is valid only if mesh is closed
ViewportMask shadingEnabled_
Definition MRObjectMeshHolder.h:346
virtual void setSelectedEdgesColor(const Color &color, ViewportId id={})
sets colors of selected edges
BordersHighlight
Definition MRObjectMeshHolder.h:28
std::optional< size_t > numCreaseEdges_
Definition MRObjectMeshHolder.h:304
const std::shared_ptr< const Mesh > & mesh() const
Definition MRObjectMeshHolder.h:66
ViewportMask showTexture_
Definition MRObjectMeshHolder.h:334
SelectionChangedSignal creasesChangedSignal
Definition MRObjectMeshHolder.h:284
virtual void setAncillaryTexture(MeshTexture texture)
Definition MRObjectMeshHolder.h:208
virtual void updateFacesColorMap(FaceColors &updated)
Definition MRObjectMeshHolder.h:157
virtual bool hasVisualRepresentation() const override
mesh object can be seen if the mesh has at least one edge
ViewportProperty< Color > edgesColor_
Definition MRObjectMeshHolder.h:350
@ other
Angle, normally float. Measure in radians.
Definition MRFeatureObject.h:27
std::vector< ViewportMask > AllVisualizeProperties
Definition MRVisualObject.h:72
@ DIRTY_PRIMITIVE_COLORMAP
Definition MRVisualObject.h:87
@ DIRTY_TEXTURE
Definition MRVisualObject.h:83
@ DIRTY_TEXTURE_PER_FACE
Definition MRVisualObject.h:89
@ DIRTY_VERTS_COLORMAP
Definition MRVisualObject.h:86
@ DIRTY_ALL
Definition MRVisualObject.h:94
@ DIRTY_UV
Definition MRVisualObject.h:78
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MRColor.h:12
Definition MRVisualObject.h:32
Definition MRMeshTexture.h:13
Definition MRMesh.h:24
mesh and its per-element attributes for ObjectMeshHolder
Definition MRObjectMeshData.h:17
Definition MRObject.h:289
Definition MRSignal.h:28