// Who When What
// --- ---------- -----------------------------------------------------------
// JLH 05/22/2010 Added this text. :-)
+// JLH 09/17/2010 Fixed preview/snapper rendering somewhat. Some bugs remain.
//
#include "actionmodifytrim.h"
* @param both Trim both entities.
*/
ActionModifyTrim::ActionModifyTrim(EntityContainer & container,
- GraphicView & graphicView, bool both): ActionInterface("Trim Entity",
- container, graphicView)
+ GraphicView & graphicView, bool b):
+ ActionInterface("Trim Entity", container, graphicView),
+ limitEntity(NULL), limitCoord(false), trimEntity(NULL), trimCoord(false),
+ both(b)
{
- trimEntity = NULL;
- trimCoord = Vector(false);
- limitEntity = NULL;
- limitCoord = Vector(false);
- this->both = both;
+// trimEntity = NULL;
+// trimCoord = Vector(false);
+// limitEntity = NULL;
+// limitCoord = Vector(false);
+// this->both = both;
}
ActionModifyTrim::~ActionModifyTrim()
if (trimEntity && trimEntity->isAtomic() && limitEntity)
{
Modification m(*container, graphicView);
- m.trim(trimCoord, (AtomicEntity *)trimEntity,
- limitCoord, limitEntity, both);
+ m.trim(trimCoord, (AtomicEntity *)trimEntity, limitCoord, limitEntity,
+ both);
trimEntity = NULL;
if (both)
{
limitEntity->setHighlighted(false);
- graphicView->drawEntity(limitEntity);
+// graphicView->drawEntity(limitEntity);
setStatus(ChooseLimitEntity);
+ graphicView->redraw(); //hm.
}
else
setStatus(ChooseTrimEntity);
if (limitEntity)
{
limitEntity->setHighlighted(true);
- graphicView->drawEntity(limitEntity);
+// graphicView->drawEntity(limitEntity);
setStatus(ChooseTrimEntity);
+ graphicView->redraw(); //hm.
}
break;
trimCoord = mouse;
trimEntity = se;
- if (trimEntity != NULL && trimEntity->isAtomic())
+ if (trimEntity && trimEntity->isAtomic())
trigger();
break;
}
else if (e->button() == Qt::RightButton)
{
- deletePreview();
- deleteSnapper();
+// deletePreview();
+// deleteSnapper();
- if (limitEntity != NULL)
+ if (limitEntity)
{
limitEntity->setHighlighted(false);
- graphicView->drawEntity(limitEntity);
+// graphicView->drawEntity(limitEntity);
}
+
init(getStatus() - 1);
+ graphicView->redraw(); //hm.
}
}
{
DIALOGFACTORY->requestToolBar(RS2::ToolBarModify);
}
-