Skip to content

Commit

Permalink
nikon plugin fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
diemmarkus committed Nov 9, 2017
1 parent cc3b39a commit c11cfa6
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"AuthorName" : "Tim Jerman",
"Company" : "",
"DateCreated" : "2014-06-01",
"DateModified" : "2017-04-21",
"DateModified" : "2017-11-06",
"Description" : "Apply affine transformations to the selected image. The available transformations are: scale, rotation (with automatic skewness detection), and shear.",
"Tagline" : "Transform and rotate images",
"PluginId" : "7a4a50a45ddb408ba46a16a40e6518fd",
Expand Down
2 changes: 1 addition & 1 deletion FakeMiniaturesPlugin/src/DkFakeMiniaturesPlugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"AuthorName" : "Tim Jerman",
"Company" : "",
"DateCreated" : "2014-06-01",
"DateModified" : "2017-04-21",
"DateModified" : "2017-11-06",
"Description" : "On the preview image select (by mouse click move and release) the region without blurring. A blur is applyied depending on the distance from this region. The amount of blur and saturation can be changed with the sliders on the right of the dialog.",
"Tagline" : "Apply a fake miniature filter (tilt shift effect) to the image.",
"PluginId" : "a2ac7b68866b4ab29fb1df3e170b8f0d",
Expand Down
37 changes: 24 additions & 13 deletions NikonPlugin/src/DkNikonPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ DkNikonPlugin::~DkNikonPlugin() {
}
}

void DkNikonPlugin::setVisible(bool visible) {

if (!viewport)
return;

viewport->setVisible(visible);
}

/**
* Returns descriptive image
**/
Expand Down Expand Up @@ -94,32 +102,26 @@ QSharedPointer<nmc::DkImageContainer> DkNikonPlugin::runPlugin(const QString &ru
return image;
};

/**
* returns paintViewPort
**/
nmc::DkPluginViewPort* DkNikonPlugin::getViewPort() {
bool DkNikonPlugin::createViewPort(QWidget * parent) {

if (!viewport) {
// >DIR: dummy viewport [4.7.2014 markus]
viewport = new DkNikonViewPort();
}
viewport = new DkNikonViewPort(parent);

if (!maidFacade) {
QMainWindow* mainWindow = getMainWindow();

maidFacade = new MaidFacade(mainWindow);

if (maidFacade->init()) {


if (!camControls) {

// get last location
QSettings settings;
int dockLocation = settings.value("camControlsLocation", Qt::RightDockWidgetArea).toInt();

camControls = new DkCamControls(maidFacade, tr("Camera Controls"));

if (mainWindow)
mainWindow->addDockWidget((Qt::DockWidgetArea)dockLocation, camControls);

Expand All @@ -128,9 +130,10 @@ nmc::DkPluginViewPort* DkNikonPlugin::getViewPort() {
connect(camControls, SIGNAL(closeSignal()), getViewPort(), SIGNAL(closePlugin()));
}

camControls->setVisible(true);
camControls->setVisible(true);

} else {
}
else {
QMessageBox warningDialog(mainWindow);
warningDialog.setWindowTitle(tr("MAID Library could not be opened"));
warningDialog.setText(tr("The MAID library could not be opened. Camera controls will be disabled."));
Expand All @@ -144,6 +147,14 @@ nmc::DkPluginViewPort* DkNikonPlugin::getViewPort() {
}
}

return true;
}

/**
* returns paintViewPort
**/
nmc::DkPluginViewPort* DkNikonPlugin::getViewPort() {

return viewport;
}

Expand Down
6 changes: 5 additions & 1 deletion NikonPlugin/src/DkNikonPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,14 @@ class DkNikonPlugin : public QObject, nmc::DkViewPortInterface {
QImage image() const override;

QSharedPointer<nmc::DkImageContainer> runPlugin(const QString &runID = QString(), QSharedPointer<nmc::DkImageContainer> image = QSharedPointer<nmc::DkImageContainer>()) const override;
nmc::DkPluginViewPort* getViewPort();
nmc::DkPluginViewPort* getViewPort() override;
void deleteViewPort();
virtual bool closesOnImageChange() {return false;};

void setVisible(bool visible) override;

bool createViewPort(QWidget* parent) override;

protected:
nmc::DkPluginViewPort* viewport;
DkCamControls* camControls;
Expand Down
2 changes: 1 addition & 1 deletion NikonPlugin/src/DkNikonPlugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"AuthorName" : "Thomas Lang",
"Company" : "",
"DateCreated" : "2014-06-01",
"DateModified" : "2017-03-23",
"DateModified" : "2017-11-06",
"Description" : "Control Nikon D4 using nomacs.",
"Tagline" : "Live preview and controls for Nikon D4.",
"PluginId" : "87c51045b38744caa9f389e000d64f3f",
Expand Down
2 changes: 1 addition & 1 deletion PageExtractionPlugin/src/DkPageExtractionPlugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"AuthorName" : "Markus Diem, Thomas Lang",
"Company" : "Computer Vision Lab",
"DateCreated" : "2015-08-27",
"DateModified" : "2017-04-21",
"DateModified" : "2017-11-06",
"Description" : "This plugin detects document pages and either crops the image accordingly or annotates the region.",
"Tagline" : "Detect document pages in images",
"PluginId" : "4acb88c461024cb080ae5cd15d0ef0ec",
Expand Down
2 changes: 1 addition & 1 deletion PaintPlugin/src/DkPaintPlugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"AuthorName" : "Tim Jerman",
"Company" : "",
"DateCreated" : "2014-05-01",
"DateModified" : "2017-04-21",
"DateModified" : "2017-11-06",
"Description" : "Paint on an image. The color, size and opacity of the brush can be changed.",
"Tagline" : "Draw with adjustable brushes to an image.",
"PluginId" : "ad970ef36cc24737afd2b53ad015ff0d",
Expand Down

0 comments on commit c11cfa6

Please sign in to comment.