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 );
100 MRVIEWER_API
bool onMouseDown_(
MouseButton button,
int modifiers )
override;
102 MRVIEWER_API
bool onMouseUp_(
MouseButton button,
int modifiers )
override;
104 MRVIEWER_API
bool onMouseMove_(
int mouse_x,
int mouse_y )
override;
106 MRVIEWER_API
void postDraw_()
override;
108 void reallocData_(
size_t size );
111 void initConnections_();
112 void resetConnections_();
114 void changeSurface_();
115 void updateUVmap_(
bool set );
116 void updateRegion_(
const Vector2f& mousePos );
119 void laplacianPickVert_(
const PointOnFace& pick );
120 void laplacianMoveVert_(
const Vector2f& mousePos );
122 void updateVizualizeSelection_(
const ObjAndPick& objAndPick );
124 void updateRegionUVs_(
const VertBitSet& region );
125 void updateValueChanges_(
const VertBitSet& region );
126 void updateValueChangesPointToPoint_(
const VertBitSet& region );
127 void updateValueChangesPointToPlane_(
const VertBitSet& region );
128 void updateValueChangesExactDistance_(
const VertBitSet& region );
129 void createLastStableObjMesh_();
130 void removeLastStableObjMesh_();
134 void compressChangePointsAction_();
136 void updateDistancesAndRegion_(
const Mesh& mesh,
const PointOnFace& pOnFace, VertScalars& distances, VertBitSet& region );
140 std::shared_ptr<ObjectMesh> obj_;
141 VertBitSet unchangeableVerts_;
142 float minRadius_ = 1.f;
144 VertBitSet singleEditingRegion_;
145 VertBitSet visualizationRegion_;
146 VertBitSet generalEditingRegion_;
147 VertScalars pointsShift_;
148 VertScalars editingDistanceMap_;
149 VertScalars visualizationDistanceMap_;
150 VertBitSet changedRegion_;
151 VertScalars valueChanges_;
152 VertScalars lastStableValueChanges_;
153 std::shared_ptr<Mesh> originalMesh_;
154 VertBitSet unknownSign_;
155 std::shared_ptr<ObjectMesh> lastStableObjMesh_;
156 bool firstInit_ =
true;
157 bool badRegion_ =
false;
159 bool mousePressed_ =
false;
161 std::chrono::time_point<std::chrono::high_resolution_clock> timePoint_;
162 boost::signals2::scoped_connection meshChangedConnection_;
163 bool ownMeshChangedSignal_ =
false;
165 bool connectionsInitialized_ =
false;
169 Vector3f touchVertIniPos_;
170 Vector2i storedDown_;
171 std::unique_ptr<Laplacian> laplacian_;
174 class SmartChangeMeshPointsAction;
175 std::shared_ptr<SmartChangeMeshPointsAction> historyAction_;
178 bool appendHistoryAction_ =
false;
180 std::shared_ptr<Palette> palette_;
181 bool enableDeviationTexture_ =
false;
182 DeviationCalculationMethod deviationCalculationMethod_ = DeviationCalculationMethod::ExactDistance;
183 bool sameValidVerticesAsInOriginMesh_ =
true;
186 bool ignoreOcclusion_ =
false;
187 bool editOnlyCodirectedSurface_ =
true;
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:18
std::pair< std::shared_ptr< MR::VisualObject >, MR::PointOnObject > ObjAndPick
Definition MRViewerFwd.h:73
@ 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 MRMesh/MRMesh.h:22
Definition MRViewerEventsListener.h:29
a point located on some mesh's face
Definition MRMesh/MRPointOnFace.h:11