* connected to this view is a graphic and valid.
* NULL otherwise.
*/
-Drawing * GraphicView::getGraphic()
+Drawing * GraphicView::GetDrawing()
{
- if (container && container->rtti() == RS2::EntityGraphic)
+ if (container && container->rtti() == RS2::EntityDrawing)
return (Drawing *)container;
return NULL;
{
if (container)
{
- Drawing * d = container->getGraphic();
+ Drawing * d = container->GetDrawing();
if (d)
return d->isGridOn();
* Called by the actual GUI class which implements the GraphicView
* interface to notify qcadlib about mouse events.
*/
-void GraphicView::mousePressEvent(QMouseEvent * e)
+void GraphicView::_mousePressEvent(QMouseEvent * e)
{
if (eventHandler)
eventHandler->MousePressEvent(e);
* Called by the actual GUI class which implements the GraphicView
* interface to notify qcadlib about mouse events.
*/
-void GraphicView::mouseReleaseEvent(QMouseEvent * e)
+void GraphicView::_mouseReleaseEvent(QMouseEvent * e)
{
DEBUG->print("GraphicView::mouseReleaseEvent");
* Called by the actual GUI class which implements the GraphicView
* interface to notify qcadlib about mouse events.
*/
-void GraphicView::mouseMoveEvent(QMouseEvent * e)
+void GraphicView::_mouseMoveEvent(QMouseEvent * e)
{
DEBUG->print("GraphicView::mouseMoveEvent begin");
Drawing * drawing = NULL;
- if (container->rtti() == RS2::EntityGraphic)
+ if (container->rtti() == RS2::EntityDrawing)
drawing = (Drawing *)container;
DEBUG->print("GraphicView::mouseMoveEvent 001");
* Called by the actual GUI class which implements the GraphicView
* interface to notify qcadlib about mouse events.
*/
-void GraphicView::mouseLeaveEvent()
+void GraphicView::_mouseLeaveEvent()
{
if (eventHandler)
eventHandler->MouseLeaveEvent();
* Called by the actual GUI class which implements the GraphicView
* interface to notify qcadlib about mouse events.
*/
-void GraphicView::mouseEnterEvent()
+void GraphicView::_mouseEnterEvent()
{
if (eventHandler)
eventHandler->MouseEnterEvent();
* Called by the actual GUI class which implements the GraphicView
* interface to notify qcadlib about key events.
*/
-void GraphicView::keyPressEvent(QKeyEvent * e)
+void GraphicView::_keyPressEvent(QKeyEvent * e)
{
if (eventHandler)
eventHandler->KeyPressEvent(e);
* Called by the actual GUI class which implements the GraphicView
* interface to notify qcadlib about key events.
*/
-void GraphicView::keyReleaseEvent(QKeyEvent * e)
+void GraphicView::_keyReleaseEvent(QKeyEvent * e)
{
if (eventHandler)
eventHandler->KeyReleaseEvent(e);
if (simulationRunning)
return;
- Drawing * graphic = container->getGraphic();
+ Drawing * drawing = container->GetDrawing();
- if (graphic == NULL)
+ if (drawing == NULL)
return;
- Vector s = graphic->getPaperSize();
- Vector pinsbase = graphic->getPaperInsertionBase();
+ Vector s = drawing->getPaperSize();
+ Vector pinsbase = drawing->getPaperInsertionBase();
double fx, fy;
{
double uf = 1.0; // unit factor
double wf = 1.0; // width factor
- Drawing * graphic = container->getGraphic();
+ Drawing * drawing = container->GetDrawing();
- if (graphic)
+ if (drawing)
{
- uf = Units::convert(1.0, RS2::Millimeter, graphic->getUnit());
+ uf = Units::convert(1.0, RS2::Millimeter, drawing->getUnit());
- if ((isPrinting() || isPrintPreview()) && graphic->getPaperScale() > 1.0e-6)
- wf = 1.0 / graphic->getPaperScale();
+ if ((isPrinting() || isPrintPreview()) && drawing->getPaperScale() > 1.0e-6)
+ wf = 1.0 / drawing->getPaperScale();
}
pen.setScreenWidth(toGuiDX(w / 100.0 * uf * wf));
if (!container)
return;
- Drawing * graphic = container->getGraphic();
+ Drawing * drawing = container->GetDrawing();
- if (!graphic)
+ if (!drawing)
return;
- if (graphic->getPaperScale() < 1.0e-6)
+ if (drawing->getPaperScale() < 1.0e-6)
return;
if (!painter)
// draw paper:
painter->setPen(Pen(Qt::gray));
- Vector pinsbase = graphic->getPaperInsertionBase();
- Vector size = graphic->getPaperSize();
- double scale = graphic->getPaperScale();
+ Vector pinsbase = drawing->getPaperInsertionBase();
+ Vector size = drawing->getPaperSize();
+ double scale = drawing->getPaperScale();
Vector v1 = toGui((Vector(0, 0) - pinsbase) / scale);
Vector v2 = toGui((size - pinsbase) / scale);