21 public MultiListener<MouseDownListener, MouseMoveListener, MouseUpListener,
64 MRVIEWER_API
void init(
const std::shared_ptr<ObjectMesh>& objectMesh );
131 MRVIEWER_API
virtual bool checkModifiers_(
int modifiers )
const {
return modifiers == 0; }
170 void updateDistancesAndRegion_(
const Mesh& mesh,
const std::vector<MeshTriPoint>& start, VertScalars& distances, VertBitSet& region,
const VertBitSet* untouchable );
174 std::shared_ptr<ObjectMesh>
obj_;
Class to hold one dimension texture with value to UV mapping.
Definition MRPalette.h:30
bool editOnlyCodirectedSurface_
Definition MRSurfaceManipulationWidget.h:232
Vector2i storedDown_
initial position of fixed vertex
Definition MRSurfaceManipulationWidget.h:203
DeviationCalculationMethod
Method for calculating mesh changes.
Definition MRSurfaceManipulationWidget.h:40
bool enableDeviationTexture_
Definition MRSurfaceManipulationWidget.h:226
bool appendHistoryAction_
true if historyAction_ is prepared but not yet appended to HistoryStore, which is done on first mouse...
Definition MRSurfaceManipulationWidget.h:223
WorkMode workMode
Definition MRSurfaceManipulationWidget.h:50
MouseButton
Definition MRMouse.h:13
Settings settings_
Definition MRSurfaceManipulationWidget.h:172
void enableDeviationVisualization(bool enable)
enable visualization of mesh deviations
bool connectionsInitialized_
Definition MRSurfaceManipulationWidget.h:198
void setEditOnlyCodirectedSurface(bool edit)
restricts editable area to vertices whose normals look into the same half-space as normal under curso...
Definition MRSurfaceManipulationWidget.h:111
boost::signals2::scoped_connection meshChangedConnection_
Definition MRSurfaceManipulationWidget.h:195
void createLastStableObjMesh_()
void laplacianMoveVert_(const Vector2f &mousePos)
VertBitSet singleEditingRegion_
current (under the cursor) region of tool application
Definition MRSurfaceManipulationWidget.h:179
bool mousePressed_
in selected region less than 3 points
Definition MRSurfaceManipulationWidget.h:193
EdgeWeights edgeWeights
edge weights for Laplacian and Patch
Definition MRSurfaceManipulationWidget.h:56
float relaxForce
speed of relaxing, typical values (0 - 0.5]
Definition MRSurfaceManipulationWidget.h:52
ImVec2 size(const ViewportRectangle &rect)
Definition MRViewport.h:32
bool sameOriginalMeshTopology_
Definition MRSurfaceManipulationWidget.h:228
void initLaplacian_(RememberShape rs)
Laplacian.
VertScalars pointsShift_
Definition MRSurfaceManipulationWidget.h:182
std::shared_ptr< Palette > palette_
Definition MRSurfaceManipulationWidget.h:225
float radius
radius of editing region
Definition MRSurfaceManipulationWidget.h:51
void setIgnoreOcclusion(bool ignore)
allow the user to edit parts of object that are hidden in the current view by other objects
Definition MRSurfaceManipulationWidget.h:107
float minRadius_
Definition MRSurfaceManipulationWidget.h:176
bool subdivideGrooves
if true in Add/Remove modes, changed parts of mesh will be subdivided on mouse up
Definition MRSurfaceManipulationWidget.h:59
virtual ~SurfaceManipulationWidget()
VertId touchVertId_
Laplacian.
Definition MRSurfaceManipulationWidget.h:201
void invalidateMetricsCache_()
void init(const std::shared_ptr< ObjectMesh > &objectMesh)
initialize widget according ObjectMesh
VertScalars valueChanges_
Definition MRSurfaceManipulationWidget.h:185
std::unique_ptr< Laplacian > laplacian_
Definition MRSurfaceManipulationWidget.h:204
VertScalars lastStableValueChanges_
Definition MRSurfaceManipulationWidget.h:186
VertBitSet pickedVerts_
these are all vertices, which will are attracted to be under mouse considering material width since l...
Definition MRSurfaceManipulationWidget.h:207
void updateRegionUVs_(const VertBitSet ®ion)
bool mimicPatch
Definition MRSurfaceManipulationWidget.h:60
DeviationCalculationMethod deviationCalculationMethod_
Definition MRSurfaceManipulationWidget.h:227
void setDeviationCalculationMethod(DeviationCalculationMethod method)
set method for calculating mesh changes
VertBitSet visualizationRegion_
vertices of triangles partially or fully highlighted with red
Definition MRSurfaceManipulationWidget.h:180
bool onMouseUp_(MouseButton button, int modifiers) override
stop modifying mesh surface, generate history action
EdgeWeights
determines the weight of each edge in applications like Laplacian
Definition MREnums.h:44
const Settings & getSettings()
get widget settings
Definition MRSurfaceManipulationWidget.h:77
void updateUVs()
update texture uv coords used for colorize surface (use after change ranges in palette)
void reset()
reset widget state
bool onMouseDown_(MouseButton button, int modifiers) override
start modifying mesh surface
void reallocData_(size_t size)
void updateTexture()
update texture used for colorize surface (use after change colorMap in palette)
DeviationCalculationMethod deviationCalculationMethod() const
get method for calculating mesh changes
Definition MRSurfaceManipulationWidget.h:98
bool firstInit_
Definition MRSurfaceManipulationWidget.h:190
std::shared_ptr< ObjectMesh > obj_
Definition MRSurfaceManipulationWidget.h:174
bool laplacianBasedAddRemove
if true in Add/Remove modes, the modification will be done using Laplacian solver,...
Definition MRSurfaceManipulationWidget.h:58
void removeLastStableObjMesh_()
std::shared_ptr< VersatileChangeMeshPointsAction > historyAction_
Definition MRSurfaceManipulationWidget.h:220
bool ignoreOcclusion_
allow the user to edit parts of object that are hidden in the current view by other objects
Definition MRSurfaceManipulationWidget.h:231
void updateValueChanges_(const VertBitSet ®ion)
float getMinRadius()
minimum radius of editing area.
Definition MRSurfaceManipulationWidget.h:80
Vector3f touchVertIniPos_
we fix this vertex in Laplacian and move it manually
Definition MRSurfaceManipulationWidget.h:202
void subdivideAfterAddRemove_()
std::vector< MeshTriPoint > pointsUnderMouse_
mesh points under mouse in the current frame (could be many in case of fast mouse movement)
Definition MRSurfaceManipulationWidget.h:178
bool sameOriginalMeshTopology() const
returns true if the current object's mesh has the same topology as original input mesh (and vertices ...
Definition MRSurfaceManipulationWidget.h:101
VertBitSet unchangeableVerts_
Definition MRSurfaceManipulationWidget.h:175
std::shared_ptr< ObjectMesh > lastStableObjMesh_
Definition MRSurfaceManipulationWidget.h:189
void updateValueChangesExactDistance_(const VertBitSet ®ion)
RememberShape
Definition MREnums.h:56
VertexMass vmass
vertex weights for Laplacian and Patch
Definition MRSurfaceManipulationWidget.h:57
WorkMode
widget work modes
Definition MRSurfaceManipulationWidget.h:30
float editForce
material thickness added or removed to the surface
Definition MRSurfaceManipulationWidget.h:53
bool badRegion_
need to save settings in re-initial
Definition MRSurfaceManipulationWidget.h:191
float relaxForceAfterEdit
force of relaxing modified area after editing (add / remove) is complete. [0 - 0.5],...
Definition MRSurfaceManipulationWidget.h:55
bool ownMeshChangedSignal_
Definition MRSurfaceManipulationWidget.h:196
void updateRegion_(const Vector2f &mousePos)
void setFixedRegion(const FaceBitSet ®ion)
Vector3f target
Definition MRSurfaceManipulationWidget.h:211
Palette & palette()
get palette used for visualization point shifts
Definition MRSurfaceManipulationWidget.h:83
std::shared_ptr< Mesh > originalMesh_
original input mesh
Definition MRSurfaceManipulationWidget.h:187
VertBitSet unknownSign_
cached data to avoid reallocating memory
Definition MRSurfaceManipulationWidget.h:188
float sharpness
effect of force on points far from center editing area. [0 - 100]
Definition MRSurfaceManipulationWidget.h:54
virtual void appendMeshDataChangeHistory_(ObjectMeshData &&newMeshData, const FaceBitSet &newFaces)
VertBitSet generalEditingRegion_
united region of tool application since the last mouse down
Definition MRSurfaceManipulationWidget.h:181
SurfaceManipulationWidget()
void compressChangePointsAction_()
bool isEditOnlyCodirectedSurface() const
get state of an editable region restriction
Definition MRSurfaceManipulationWidget.h:114
void laplacianPickVert_(const PointOnFace &pick)
for singleEditingRegion_
void updateValueChangesPointToPoint_(const VertBitSet ®ion)
VertexMass
determines the weight or mass of each vertex in applications like Laplacian
Definition MREnums.h:34
void updateDistancesAndRegion_(const Mesh &mesh, const std::vector< MeshTriPoint > &start, VertScalars &distances, VertBitSet ®ion, const VertBitSet *untouchable)
void updateUVmap_(bool set, bool wholeMesh=false)
void postDraw_() override
need to visualize bad region (draw grey circle)
VertScalars editingDistanceMap_
Definition MRSurfaceManipulationWidget.h:183
bool ignoreOcclusion() const
Definition MRSurfaceManipulationWidget.h:108
void setSettings(const Settings &settings)
set widget settings (mesh change settings)
VertScalars visualizationDistanceMap_
Definition MRSurfaceManipulationWidget.h:184
bool onMouseMove_(int mouse_x, int mouse_y) override
update
Vector2f getMinMax()
get min / max point shifts for (useful for setup palette)
float minMouseDistSq
attraction point
Definition MRSurfaceManipulationWidget.h:212
void updateValueChangesPointToPlane_(const VertBitSet ®ion)
phmap::flat_hash_map< K, V, Hash, Eq > HashMap
Definition MRMeshFwd.h:610
virtual bool checkModifiers_(int modifiers) const
Definition MRSurfaceManipulationWidget.h:131
Vector2f mousePos_
mouse position of last updateRegion_
Definition MRSurfaceManipulationWidget.h:177
HashMap< VertId, PickedVertData > pickedVertsToData_
same vertices as in pickedVerts_ mapped to PickedVertData
Definition MRSurfaceManipulationWidget.h:216
void updateVizualizeSelection_()
@ PointToPlane
distance between the initial plane (starting point and normal to it) and the end point
Definition MRSurfaceManipulationWidget.h:42
@ ExactDistance
distance between the start and end meshes
Definition MRSurfaceManipulationWidget.h:43
@ PointToPoint
distance between the start and end points
Definition MRSurfaceManipulationWidget.h:41
@ Cotan
edge weight depends on local geometry and uses cotangent values
Definition MREnums.h:49
@ Remove
Definition MRSurfaceManipulationWidget.h:32
@ Patch
Definition MRSurfaceManipulationWidget.h:35
@ Laplacian
Definition MRSurfaceManipulationWidget.h:34
@ Add
Definition MRSurfaceManipulationWidget.h:31
@ Relax
Definition MRSurfaceManipulationWidget.h:33
@ NeiArea
vertex mass depends on local geometry and proportional to the area of first-ring triangles
Definition MREnums.h:39
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MRViewerEventsListener.h:32
mesh and its per-element attributes for ObjectMeshHolder
Definition MRObjectMeshData.h:17
a point located on some mesh's face
Definition MRPointOnFace.h:16