MeshLib C++ Docs
Loading...
Searching...
No Matches

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 <MRViewer/MRSurfaceManipulationWidget.h>

Inheritance diagram for MR::SurfaceManipulationWidget:

Classes

struct  PickedVertData
struct  Settings
 Mesh change settings. More...

Public Types

enum class  WorkMode {
  WorkMode::Add , WorkMode::Remove , WorkMode::Relax , WorkMode::Laplacian ,
  WorkMode::Patch
}
 widget work modes More...
enum class  DeviationCalculationMethod { DeviationCalculationMethod::PointToPoint , DeviationCalculationMethod::PointToPlane , DeviationCalculationMethod::ExactDistance }
 Method for calculating mesh changes. More...

Public Member Functions

 SurfaceManipulationWidget ()
virtual ~SurfaceManipulationWidget ()
void init (const std::shared_ptr< ObjectMesh > &objectMesh)
 initialize widget according ObjectMesh
void reset ()
 reset widget state
void setFixedRegion (const FaceBitSet &region)
void setSettings (const Settings &settings)
 set widget settings (mesh change settings)
const SettingsgetSettings ()
 get widget settings
float getMinRadius ()
 minimum radius of editing area.
Palettepalette ()
 get palette used for visualization point shifts
void updateTexture ()
 update texture used for colorize surface (use after change colorMap in palette)
void updateUVs ()
 update texture uv coords used for colorize surface (use after change ranges in palette)
void enableDeviationVisualization (bool enable)
 enable visualization of mesh deviations
void setDeviationCalculationMethod (DeviationCalculationMethod method)
 set method for calculating mesh changes
DeviationCalculationMethod deviationCalculationMethod () const
 get method for calculating mesh changes
bool sameOriginalMeshTopology () const
 returns true if the current object's mesh has the same topology as original input mesh (and vertices with same IDs can be compared)
Vector2f getMinMax ()
 get min / max point shifts for (useful for setup palette)
void setIgnoreOcclusion (bool ignore)
 allow the user to edit parts of object that are hidden in the current view by other objects
bool ignoreOcclusion () const
void setEditOnlyCodirectedSurface (bool edit)
 restricts editable area to vertices whose normals look into the same half-space as normal under cursor
bool isEditOnlyCodirectedSurface () const
 get state of an editable region restriction
Public Member Functions inherited from MR::MultiListener< MouseDownListener, MouseMoveListener, MouseUpListener, PostDrawListener >
virtual ~MultiListener ()=default
virtual void connect (Viewer *viewer, int group=0, boost::signals2::connect_position pos=boost::signals2::connect_position::at_back)
virtual void disconnect ()

Protected Member Functions

bool onMouseDown_ (MouseButton button, int modifiers) override
 start modifying mesh surface
bool onMouseUp_ (MouseButton button, int modifiers) override
 stop modifying mesh surface, generate history action
bool onMouseMove_ (int mouse_x, int mouse_y) override
 update
void postDraw_ () override
 need to visualize bad region (draw grey circle)
virtual bool checkModifiers_ (int modifiers) const
virtual void appendMeshDataChangeHistory_ (ObjectMeshData &&newMeshData, 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 invalidateMetricsCache_ ()
void abortEdit_ ()
void initLaplacian_ (RememberShape rs)
 Laplacian.
void laplacianPickVert_ (const PointOnFace &pick)
 for singleEditingRegion_
void laplacianMoveVert_ (const Vector2f &mousePos)
void updateVizualizeSelection_ ()
void updateRegionUVs_ (const VertBitSet &region)
void updateValueChanges_ (const VertBitSet &region)
void updateValueChangesPointToPoint_ (const VertBitSet &region)
void updateValueChangesPointToPlane_ (const VertBitSet &region)
void updateValueChangesExactDistance_ (const VertBitSet &region)
void createLastStableObjMesh_ ()
void removeLastStableObjMesh_ ()
void compressChangePointsAction_ ()
void subdivideAfterAddRemove_ ()
void updateDistancesAndRegion_ (const Mesh &mesh, const std::vector< MeshTriPoint > &start, VertScalars &distances, VertBitSet &region, const VertBitSet *untouchable)

Protected Attributes

Settings settings_
std::shared_ptr< ObjectMeshobj_
VertBitSet unchangeableVerts_
float minRadius_ = 1.f
Vector2f mousePos_
 mouse position of last updateRegion_
std::vector< MeshTriPointpointsUnderMouse_
 mesh points under mouse in the current frame (could be many in case of fast mouse movement)
VertBitSet singleEditingRegion_
 current (under the cursor) region of tool application
VertBitSet visualizationRegion_
 vertices of triangles partially or fully highlighted with red
VertBitSet generalEditingRegion_
 united region of tool application since the last mouse down
VertScalars pointsShift_
VertScalars editingDistanceMap_
VertScalars visualizationDistanceMap_
VertScalars valueChanges_
VertScalars lastStableValueChanges_
std::shared_ptr< MeshoriginalMesh_
 original input mesh
VertBitSet unknownSign_
 cached data to avoid reallocating memory
std::shared_ptr< ObjectMeshlastStableObjMesh_
bool firstInit_ = true
bool badRegion_ = false
 need to save settings in re-initial
bool mousePressed_ = false
 in selected region less than 3 points
boost::signals2::scoped_connection meshChangedConnection_
bool ownMeshChangedSignal_ = false
bool connectionsInitialized_ = false
VertId touchVertId_
 Laplacian.
Vector3f touchVertIniPos_
 we fix this vertex in Laplacian and move it manually
Vector2i storedDown_
 initial position of fixed vertex
std::unique_ptr< Laplacianlaplacian_
VertBitSet pickedVerts_
 these are all vertices, which will are attracted to be under mouse considering material width since last mouse down
HashMap< VertId, PickedVertDatapickedVertsToData_
 same vertices as in pickedVerts_ mapped to PickedVertData
std::shared_ptr< VersatileChangeMeshPointsActionhistoryAction_
bool appendHistoryAction_ = false
 true if historyAction_ is prepared but not yet appended to HistoryStore, which is done on first mouse move
std::shared_ptr< Palettepalette_
bool enableDeviationTexture_ = false
DeviationCalculationMethod deviationCalculationMethod_ = DeviationCalculationMethod::ExactDistance
bool sameOriginalMeshTopology_ = true
bool ignoreOcclusion_ = false
 allow the user to edit parts of object that are hidden in the current view by other objects
bool editOnlyCodirectedSurface_ = true

Detailed Description

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)


The documentation for this class was generated from the following file: