void ModelPlotter::mousePressed(int xPos, int yPos, int button) { if(_recordMode) { if(!isClickWithinModel(xPos, yPos)) { if (_selectedModel == DISABLED) { App * app = App::getInstance(); Page * model = new Page(); model->addDefaultPoints(xPos, yPos); model->id = _idCounter; app->addPageModel(model); _idCounter++; } else { _selectedModel = DISABLED; } } } }