widget for surface modifying @detail available 3 modes: add (move surface region in direction of normal) remove (move surface region in opposite direction to normal) relax (relax surface region)
More...
#include <MRSurfaceManipulationWidget.h>
|
MRVIEWER_API bool | onMouseDown_ (MouseButton button, int modifiers) override |
| start modifying mesh surface
|
|
MRVIEWER_API bool | onMouseUp_ (MouseButton button, int modifiers) override |
| stop modifying mesh surface, generate history action
|
|
MRVIEWER_API bool | onMouseMove_ (int mouse_x, int mouse_y) override |
| update
|
|
MRVIEWER_API void | postDraw_ () override |
| need to visualize bad region (draw grey circle)
|
|
virtual MRVIEWER_API void | appendMeshChangeHistory_ (std::shared_ptr< Mesh > newMesh, const FaceBitSet &newFaces) |
|
void | reallocData_ (size_t size) |
|
void | clearData_ () |
|
void | initConnections_ () |
|
void | resetConnections_ () |
|
void | changeSurface_ () |
|
void | updateUVmap_ (bool set, bool wholeMesh=false) |
|
void | updateRegion_ (const Vector2f &mousePos) |
|
void | abortEdit_ () |
|
void | laplacianPickVert_ (const PointOnFace &pick) |
| Laplacian.
|
|
void | laplacianMoveVert_ (const Vector2f &mousePos) |
|
void | updateVizualizeSelection_ () |
|
void | updateRegionUVs_ (const VertBitSet ®ion) |
|
void | updateValueChanges_ (const VertBitSet ®ion) |
|
void | updateValueChangesPointToPoint_ (const VertBitSet ®ion) |
|
void | updateValueChangesPointToPlane_ (const VertBitSet ®ion) |
|
void | updateValueChangesExactDistance_ (const VertBitSet ®ion) |
|
void | createLastStableObjMesh_ () |
|
void | removeLastStableObjMesh_ () |
|
void | compressChangePointsAction_ () |
|
void | updateDistancesAndRegion_ (const Mesh &mesh, const VertBitSet &start, VertScalars &distances, VertBitSet ®ion, const VertBitSet *untouchable) |
|
widget for surface modifying @detail available 3 modes: add (move surface region in direction of normal) remove (move surface region in opposite direction to normal) relax (relax surface region)
◆ DeviationCalculationMethod
Method for calculating mesh changes.
Enumerator |
---|
PointToPoint | distance between the start and end points
|
PointToPlane | distance between the initial plane (starting point and normal to it) and the end point
|
ExactDistance | distance between the start and end meshes
|
◆ WorkMode
widget work modes
Enumerator |
---|
Add | |
Remove | |
Relax | |
Laplacian | |
Patch | |
◆ SurfaceManipulationWidget()
MRVIEWER_API MR::SurfaceManipulationWidget::SurfaceManipulationWidget |
( |
| ) |
|
◆ ~SurfaceManipulationWidget()
virtual MRVIEWER_API MR::SurfaceManipulationWidget::~SurfaceManipulationWidget |
( |
| ) |
|
|
virtual |
◆ abortEdit_()
void MR::SurfaceManipulationWidget::abortEdit_ |
( |
| ) |
|
|
protected |
◆ appendMeshChangeHistory_()
virtual MRVIEWER_API void MR::SurfaceManipulationWidget::appendMeshChangeHistory_ |
( |
std::shared_ptr< Mesh > | newMesh, |
|
|
const FaceBitSet & | newFaces ) |
|
protectedvirtual |
called to change mesh with history record newFaces seems to be useful
◆ changeSurface_()
void MR::SurfaceManipulationWidget::changeSurface_ |
( |
| ) |
|
|
protected |
◆ clearData_()
void MR::SurfaceManipulationWidget::clearData_ |
( |
| ) |
|
|
protected |
◆ compressChangePointsAction_()
void MR::SurfaceManipulationWidget::compressChangePointsAction_ |
( |
| ) |
|
|
protected |
this function is called after all modifications are finished; if we previously appended SmartChangeMeshPointsAction, then switch it from uncompressed to compressed format to occupy less amount of memory
◆ createLastStableObjMesh_()
void MR::SurfaceManipulationWidget::createLastStableObjMesh_ |
( |
| ) |
|
|
protected |
◆ deviationCalculationMethod()
get method for calculating mesh changes
◆ enableDeviationVisualization()
MRVIEWER_API void MR::SurfaceManipulationWidget::enableDeviationVisualization |
( |
bool | enable | ) |
|
enable visualization of mesh deviations
◆ getMinMax()
MRVIEWER_API Vector2f MR::SurfaceManipulationWidget::getMinMax |
( |
| ) |
|
get min / max point shifts for (usefull for setup palette)
◆ getMinRadius()
MRVIEWER_API float MR::SurfaceManipulationWidget::getMinRadius |
( |
| ) |
|
|
inline |
mimum radius of editing area.
◆ getSettings()
MRVIEWER_API const Settings & MR::SurfaceManipulationWidget::getSettings |
( |
| ) |
|
|
inline |
◆ ignoreOcclusion()
MRVIEWER_API bool MR::SurfaceManipulationWidget::ignoreOcclusion |
( |
| ) |
const |
|
inline |
◆ init()
MRVIEWER_API void MR::SurfaceManipulationWidget::init |
( |
const std::shared_ptr< ObjectMesh > & | objectMesh | ) |
|
◆ initConnections_()
void MR::SurfaceManipulationWidget::initConnections_ |
( |
| ) |
|
|
protected |
◆ isEditOnlyCodirectedSurface()
bool MR::SurfaceManipulationWidget::isEditOnlyCodirectedSurface |
( |
| ) |
const |
|
inline |
get state of an editable region restriction
◆ laplacianMoveVert_()
void MR::SurfaceManipulationWidget::laplacianMoveVert_ |
( |
const Vector2f & | mousePos | ) |
|
|
protected |
◆ laplacianPickVert_()
void MR::SurfaceManipulationWidget::laplacianPickVert_ |
( |
const PointOnFace & | pick | ) |
|
|
protected |
◆ onMouseDown_()
MRVIEWER_API bool MR::SurfaceManipulationWidget::onMouseDown_ |
( |
MouseButton | button, |
|
|
int | modifiers ) |
|
overrideprotected |
start modifying mesh surface
◆ onMouseMove_()
MRVIEWER_API bool MR::SurfaceManipulationWidget::onMouseMove_ |
( |
int | mouse_x, |
|
|
int | mouse_y ) |
|
overrideprotected |
◆ onMouseUp_()
MRVIEWER_API bool MR::SurfaceManipulationWidget::onMouseUp_ |
( |
MouseButton | button, |
|
|
int | modifiers ) |
|
overrideprotected |
stop modifying mesh surface, generate history action
◆ palette()
Palette & MR::SurfaceManipulationWidget::palette |
( |
| ) |
|
|
inline |
get palette used for visualization point shifts
◆ postDraw_()
MRVIEWER_API void MR::SurfaceManipulationWidget::postDraw_ |
( |
| ) |
|
|
overrideprotected |
need to visualize bad region (draw grey circle)
◆ reallocData_()
void MR::SurfaceManipulationWidget::reallocData_ |
( |
size_t | size | ) |
|
|
protected |
◆ removeLastStableObjMesh_()
void MR::SurfaceManipulationWidget::removeLastStableObjMesh_ |
( |
| ) |
|
|
protected |
◆ reset()
MRVIEWER_API void MR::SurfaceManipulationWidget::reset |
( |
| ) |
|
◆ resetConnections_()
void MR::SurfaceManipulationWidget::resetConnections_ |
( |
| ) |
|
|
protected |
◆ sameValidVerticesAsInOriginMesh()
MRVIEWER_API bool MR::SurfaceManipulationWidget::sameValidVerticesAsInOriginMesh |
( |
| ) |
const |
|
inline |
checks for a one-to-one correspondence between the vertices of the original grid and the modified one
◆ setDeviationCalculationMethod()
set method for calculating mesh changes
◆ setEditOnlyCodirectedSurface()
void MR::SurfaceManipulationWidget::setEditOnlyCodirectedSurface |
( |
bool | edit | ) |
|
|
inline |
restricts editable area to vertices whose normals look into the same half-space as normal under cursor
◆ setFixedRegion()
MRVIEWER_API void MR::SurfaceManipulationWidget::setFixedRegion |
( |
const FaceBitSet & | region | ) |
|
lock the mesh region (vertices in this region cannot be moved, added or deleted)
- Note
- boundary edges can be splitted to improve quality of the patch
◆ setIgnoreOcclusion()
MRVIEWER_API void MR::SurfaceManipulationWidget::setIgnoreOcclusion |
( |
bool | ignore | ) |
|
|
inline |
allow the user to edit parts of object that are hidden in the current view by other objects
◆ setSettings()
MRVIEWER_API void MR::SurfaceManipulationWidget::setSettings |
( |
const Settings & | settings | ) |
|
set widget settings (mesh change settings)
◆ updateDistancesAndRegion_()
void MR::SurfaceManipulationWidget::updateDistancesAndRegion_ |
( |
const Mesh & | mesh, |
|
|
const VertBitSet & | start, |
|
|
VertScalars & | distances, |
|
|
VertBitSet & | region, |
|
|
const VertBitSet * | untouchable ) |
|
protected |
◆ updateRegion_()
void MR::SurfaceManipulationWidget::updateRegion_ |
( |
const Vector2f & | mousePos | ) |
|
|
protected |
◆ updateRegionUVs_()
void MR::SurfaceManipulationWidget::updateRegionUVs_ |
( |
const VertBitSet & | region | ) |
|
|
protected |
◆ updateTexture()
MRVIEWER_API void MR::SurfaceManipulationWidget::updateTexture |
( |
| ) |
|
update texture used for colorize surface (use after change colorMap in palette)
◆ updateUVmap_()
void MR::SurfaceManipulationWidget::updateUVmap_ |
( |
bool | set, |
|
|
bool | wholeMesh = false ) |
|
protected |
◆ updateUVs()
MRVIEWER_API void MR::SurfaceManipulationWidget::updateUVs |
( |
| ) |
|
update texture uv coords used for colorize surface (use after change ranges in palette)
◆ updateValueChanges_()
void MR::SurfaceManipulationWidget::updateValueChanges_ |
( |
const VertBitSet & | region | ) |
|
|
protected |
◆ updateValueChangesExactDistance_()
void MR::SurfaceManipulationWidget::updateValueChangesExactDistance_ |
( |
const VertBitSet & | region | ) |
|
|
protected |
◆ updateValueChangesPointToPlane_()
void MR::SurfaceManipulationWidget::updateValueChangesPointToPlane_ |
( |
const VertBitSet & | region | ) |
|
|
protected |
◆ updateValueChangesPointToPoint_()
void MR::SurfaceManipulationWidget::updateValueChangesPointToPoint_ |
( |
const VertBitSet & | region | ) |
|
|
protected |
◆ updateVizualizeSelection_()
void MR::SurfaceManipulationWidget::updateVizualizeSelection_ |
( |
| ) |
|
|
protected |
◆ activePickedVertices_
VertBitSet MR::SurfaceManipulationWidget::activePickedVertices_ |
|
protected |
vertices that are considered under mouse in curernt frame (could be many in case of fast mouse mouvement)
◆ appendHistoryAction_
bool MR::SurfaceManipulationWidget::appendHistoryAction_ = false |
|
protected |
true if historyAction_ is prepared but not yet appended to HistoryStore, which is done on first mouse move
◆ badRegion_
bool MR::SurfaceManipulationWidget::badRegion_ = false |
|
protected |
need to save settings in re-initial
◆ changedRegion_
VertBitSet MR::SurfaceManipulationWidget::changedRegion_ |
|
protected |
◆ connectionsInitialized_
bool MR::SurfaceManipulationWidget::connectionsInitialized_ = false |
|
protected |
◆ deviationCalculationMethod_
◆ editingDistanceMap_
VertScalars MR::SurfaceManipulationWidget::editingDistanceMap_ |
|
protected |
◆ editOnlyCodirectedSurface_
bool MR::SurfaceManipulationWidget::editOnlyCodirectedSurface_ = true |
|
protected |
◆ enableDeviationTexture_
bool MR::SurfaceManipulationWidget::enableDeviationTexture_ = false |
|
protected |
◆ firstInit_
bool MR::SurfaceManipulationWidget::firstInit_ = true |
|
protected |
◆ generalEditingRegion_
VertBitSet MR::SurfaceManipulationWidget::generalEditingRegion_ |
|
protected |
united region of tool application since the last mouse down
◆ historyAction_
std::shared_ptr<SmartChangeMeshPointsAction> MR::SurfaceManipulationWidget::historyAction_ |
|
protected |
◆ ignoreOcclusion_
bool MR::SurfaceManipulationWidget::ignoreOcclusion_ = false |
|
protected |
allow the user to edit parts of object that are hidden in the current view by other objects
◆ laplacian_
std::unique_ptr<Laplacian> MR::SurfaceManipulationWidget::laplacian_ |
|
protected |
◆ lastStableObjMesh_
std::shared_ptr<ObjectMesh> MR::SurfaceManipulationWidget::lastStableObjMesh_ |
|
protected |
◆ lastStableValueChanges_
VertScalars MR::SurfaceManipulationWidget::lastStableValueChanges_ |
|
protected |
◆ meshChangedConnection_
boost::signals2::scoped_connection MR::SurfaceManipulationWidget::meshChangedConnection_ |
|
protected |
◆ minRadius_
float MR::SurfaceManipulationWidget::minRadius_ = 1.f |
|
protected |
◆ mousePos_
Vector2f MR::SurfaceManipulationWidget::mousePos_ |
|
protected |
mouse position of last updateRegion_
◆ mousePressed_
bool MR::SurfaceManipulationWidget::mousePressed_ = false |
|
protected |
in selected region less than 3 points
◆ obj_
std::shared_ptr<ObjectMesh> MR::SurfaceManipulationWidget::obj_ |
|
protected |
◆ originalMesh_
std::shared_ptr<Mesh> MR::SurfaceManipulationWidget::originalMesh_ |
|
protected |
◆ ownMeshChangedSignal_
bool MR::SurfaceManipulationWidget::ownMeshChangedSignal_ = false |
|
protected |
◆ palette_
std::shared_ptr<Palette> MR::SurfaceManipulationWidget::palette_ |
|
protected |
◆ pointsShift_
VertScalars MR::SurfaceManipulationWidget::pointsShift_ |
|
protected |
◆ sameValidVerticesAsInOriginMesh_
bool MR::SurfaceManipulationWidget::sameValidVerticesAsInOriginMesh_ = true |
|
protected |
◆ settings_
Settings MR::SurfaceManipulationWidget::settings_ |
|
protected |
◆ singleEditingRegion_
VertBitSet MR::SurfaceManipulationWidget::singleEditingRegion_ |
|
protected |
current (under the cursor) region of tool application
◆ storedDown_
Vector2i MR::SurfaceManipulationWidget::storedDown_ |
|
protected |
initial position of fixed vertex
◆ timePoint_
std::chrono::time_point<std::chrono::high_resolution_clock> MR::SurfaceManipulationWidget::timePoint_ |
|
protected |
◆ touchVertId_
VertId MR::SurfaceManipulationWidget::touchVertId_ |
|
protected |
◆ touchVertIniPos_
Vector3f MR::SurfaceManipulationWidget::touchVertIniPos_ |
|
protected |
we fix this vertex in Laplacian and move it manually
◆ unchangeableVerts_
VertBitSet MR::SurfaceManipulationWidget::unchangeableVerts_ |
|
protected |
◆ unknownSign_
VertBitSet MR::SurfaceManipulationWidget::unknownSign_ |
|
protected |
cached data to avoid reallocating memory
◆ valueChanges_
VertScalars MR::SurfaceManipulationWidget::valueChanges_ |
|
protected |
◆ visualizationDistanceMap_
VertScalars MR::SurfaceManipulationWidget::visualizationDistanceMap_ |
|
protected |
◆ visualizationRegion_
VertBitSet MR::SurfaceManipulationWidget::visualizationRegion_ |
|
protected |
vertices of triangles partially or fully highlighted with red
The documentation for this class was generated from the following file: