19 public MultiListener<MouseDownListener, MouseMoveListener, MouseUpListener,
50 float relaxForce = 0.2f;
51 float editForce = 1.f;
52 float sharpness = 50.f;
53 float relaxForceAfterEdit = 0.25f;
58 MRVIEWER_API
void init(
const std::shared_ptr<ObjectMesh>& objectMesh );
95 MRVIEWER_API
bool onMouseDown_(
MouseButton button,
int modifiers )
override;
97 MRVIEWER_API
bool onMouseUp_(
MouseButton button,
int modifiers )
override;
99 MRVIEWER_API
bool onMouseMove_(
int mouse_x,
int mouse_y )
override;
101 MRVIEWER_API
void postDraw_()
override;
103 void reallocData_(
size_t size );
106 void initConnections_();
107 void resetConnections_();
109 void changeSurface_();
110 void updateUVmap_(
bool set );
111 void updateRegion_(
const Vector2f& mousePos );
114 void laplacianPickVert_(
const PointOnFace& pick );
115 void laplacianMoveVert_(
const Vector2f& mousePos );
117 void updateVizualizeSelection_(
const ObjAndPick& objAndPick );
119 void updateRegionUVs_(
const VertBitSet& region );
120 void updateValueChanges_(
const VertBitSet& region );
121 void updateValueChangesPointToPoint_(
const VertBitSet& region );
122 void updateValueChangesPointToPlane_(
const VertBitSet& region );
123 void updateValueChangesExactDistance_(
const VertBitSet& region );
124 void createLastStableObjMesh_();
125 void removeLastStableObjMesh_();
129 void compressChangePointsAction_();
133 std::shared_ptr<ObjectMesh> obj_;
134 VertBitSet unchangeableVerts_;
135 float minRadius_ = 1.f;
137 VertBitSet singleEditingRegion_;
138 VertBitSet visualizationRegion_;
139 VertBitSet generalEditingRegion_;
140 VertScalars pointsShift_;
141 VertScalars editingDistanceMap_;
142 VertScalars visualizationDistanceMap_;
143 VertBitSet changedRegion_;
144 VertScalars valueChanges_;
145 VertScalars lastStableValueChanges_;
146 std::shared_ptr<Mesh> originalMesh_;
147 VertBitSet unknownSign_;
148 std::shared_ptr<ObjectMesh> lastStableObjMesh_;
149 bool firstInit_ =
true;
150 bool badRegion_ =
false;
152 bool mousePressed_ =
false;
154 std::chrono::time_point<std::chrono::high_resolution_clock> timePoint_;
155 boost::signals2::scoped_connection meshChangedConnection_;
156 bool ownMeshChangedSignal_ =
false;
158 bool connectionsInitialized_ =
false;
162 Vector3f touchVertIniPos_;
163 Vector2i storedDown_;
164 std::unique_ptr<Laplacian> laplacian_;
167 class SmartChangeMeshPointsAction;
168 std::shared_ptr<SmartChangeMeshPointsAction> historyAction_;
171 bool appendHistoryAction_ =
false;
173 std::shared_ptr<Palette> palette_;
174 bool enableDeviationTexture_ =
false;
175 DeviationCalculationMethod deviationCalculationMethod_ = DeviationCalculationMethod::ExactDistance;
176 bool sameValidVerticesAsInOriginMesh_ =
true;
179 bool ignoreOcclusion_ =
false;
Definition MRMesh/MRLaplacian.h:32
Class to hold one dimension texture with value to UV mapping.
Definition MRPalette.h:25
MouseButton
Definition MRMouse.h:9
EdgeWeights
determines the weight of each edge in applications like Laplacian
Definition MREnums.h:8
std::pair< std::shared_ptr< MR::VisualObject >, MR::PointOnObject > ObjAndPick
Definition MRViewerFwd.h:69
@ PointToPlane
converge much faster than PointToPoint in case of many good (with not all points/normals in one plane...
@ PointToPoint
it is the safest approach but can converge slowly
Definition MRViewerEventsListener.h:29
Definition MRMesh/MRPointOnFace.h:11