#warning "!!! THIS IS WHERE THE SNAPPER IS BEING DRAWN... !!!"
drawSnapper();
- if (RS_DIALOGFACTORY != NULL)
+ if (RS_DIALOGFACTORY)
RS_DIALOGFACTORY->updateCoordinateWidget(snapCoord, snapCoord - graphicView->getRelativeZero());
RS_DEBUG->print("RS_Snapper::snapPoint: OK");
int idx = -1;
- if (entity != NULL && entity->getParent() != NULL)
+ if (entity && entity->getParent())
idx = entity->getParent()->findEntity(entity);
- if (entity != NULL && dist <= graphicView->toGraphDX(snapRange))
+ if (entity && dist <= graphicView->toGraphDX(snapRange))
{
// highlight:
RS_DEBUG->print("RS_Snapper::catchEntity: found: %d", idx);
}
RS_DEBUG->print("RS_Snapper::catchEntity: OK");
- }
+}
/**
* Catches an entity which is close to the mouse cursor.
*/
void RS_Snapper::hideOptions()
{
- if (snapMode == RS2::SnapDist)
- if (RS_DIALOGFACTORY != NULL)
- RS_DIALOGFACTORY->requestSnapDistOptions(distance, false);
+ if (snapMode == RS2::SnapDist && RS_DIALOGFACTORY)
+ RS_DIALOGFACTORY->requestSnapDistOptions(distance, false);
}
/**
*/
void RS_Snapper::showOptions()
{
- if (snapMode == RS2::SnapDist)
- if (RS_DIALOGFACTORY != NULL)
- RS_DIALOGFACTORY->requestSnapDistOptions(distance, true);
+ if (snapMode == RS2::SnapDist && RS_DIALOGFACTORY)
+ RS_DIALOGFACTORY->requestSnapDistOptions(distance, true);
}
/**
*/
void RS_Snapper::drawSnapper()
{
+printf("RS_Snapper::drawSnapper(): Using DEPRECATED function!!!\n");
if (!visible)
xorSnapper();
}
*/
void RS_Snapper::deleteSnapper()
{
+printf("RS_Snapper::deleteSnapper(): Using DEPRECATED function!!!\n");
if (visible)
{
xorSnapper();
visible = !visible;
#endif
}
+
+void RS_Snapper::SetSnapperVisible(bool visibility/*= true*/)
+{
+ graphicView->SetSnapperDraw(visibility);
+}
+
+//Hmm, not sure this is necessary...
+#warning "!!! Not sure this is necessary... !!!"
+void RS_Snapper::SetSnapperCoords(Vector snapCoord, Vector snapSpot)
+{
+ graphicView->SetSnapperVars(snapSpot, snapCoord, showCrosshairs);
+}