Commit e0ff7d78 authored by Karsten Rink's avatar Karsten Rink

added licensing information to gui

parent d763c5c8
......@@ -13,6 +13,7 @@ set( SOURCES
GeoTreeModel.cpp
GeoTreeView.cpp
GMSHPrefsDialog.cpp
LicenseDialog.cpp
LinearEditDialog.cpp
LineEditDialog.cpp
ListPropertiesDialog.cpp
......@@ -49,6 +50,7 @@ set( MOC_HEADERS
GeoTreeModel.h
GeoTreeView.h
GMSHPrefsDialog.h
LicenseDialog.h
LinearEditDialog.h
LineEditDialog.h
ListPropertiesDialog.h
......@@ -91,6 +93,7 @@ set( UIS
FEMConditionSetup.ui
GeoTabWidgetBase.ui
GMSHPrefs.ui
License.ui
LinearEdit.ui
LineEdit.ui
ModellingTabWidgetBase.ui
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>License</class>
<widget class="QDialog" name="License">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>610</width>
<height>421</height>
</rect>
</property>
<property name="windowTitle">
<string>OpenGeoSys Software License</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTextBrowser" name="licenseTextBrowser"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="okPushButton">
<property name="text">
<string>OK</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
/**
* Copyright (c) 2012, OpenGeoSys Community (http://www.opengeosys.net)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/LICENSE.txt
*
* \file LicenseDialog.cpp
*
* Created on 2012-11-30 by Karsten Rink
*/
#include "LicenseDialog.h"
#include <QTextStream>
LicenseDialog::LicenseDialog(QDialog* parent) : QDialog(parent)
{
setupUi(this);
this->licenseTextBrowser->setOpenExternalLinks(true);
this->setText();
}
void LicenseDialog::setText()
{
QString text;
QTextStream stream(&text);
stream << "<p>Copyright (c) 2012, OpenGeoSys Community "
<< "(<a href='http://www.opengeosys.org'>http://www.opengeosys.org</a>)<br />"
<< "All rights reserved.</p>"
<< "<p>Redistribution and use in source and binary forms, with or without"
<< "modification, are permitted provided that the following conditions are met:"
<< "<ol>"
<< "<li>Redistributions of source code must retain the above copyright"
<< "notice, this list of conditions and the following disclaimer.</li>"
<< "<li>Redistributions in binary form must reproduce the above copyright"
<< "notice, this list of conditions and the following disclaimer in the"
<< "documentation and/or other materials provided with the distribution.</li>"
<< "<li>All advertising materials mentioning features or use of this software"
<< "must display the following acknowledgement:" << "<br />"
<< "'This product includes software developed by the OpenGeoSys Community.'</li>"
<< "<li>Neither the name of the OpenGeoSys Community nor the"
<< "names of its contributors may be used to endorse or promote products"
<< "derived from this software without specific prior written permission.</li>"
<< "<li>Attribute the OpenGeoSys Community, preferably citing an appropriate"
<< "paper listed on the OpenGeoSys Community homepage:"
<< "<a href='http://www.opengeosys.org/papers'>http://www.opengeosys.org/papers</a></li>"
<< "</ol></p>"
<< "<p>THIS SOFTWARE IS PROVIDED BY THE OpenGeoSys Community ''AS IS'' AND ANY"
<< "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED"
<< "WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE"
<< "DISCLAIMED. IN NO EVENT SHALL THE OpenGeoSys Community BE LIABLE FOR ANY"
<< "DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"
<< "(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;"
<< "LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND"
<< "ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT"
<< "(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS"
<< "SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>";
this->licenseTextBrowser->setHtml(*(stream.string()));
}
void LicenseDialog::on_okPushButton_pressed()
{
this->done(QDialog::Accepted);
}
/**
* Copyright (c) 2012, OpenGeoSys Community (http://www.opengeosys.net)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/LICENSE.txt
*
* \file LicenseDialog.h
*
* Created on 2012-11-30 by Karsten Rink
*/
#ifndef LICENSEDIALOG_H
#define LICENSEDIALOG_H
#include "ui_License.h"
#include <QDialog>
/**
* \brief A dialog window displaying the OGS license information
*/
class LicenseDialog : public QDialog, private Ui_License
{
Q_OBJECT
public:
LicenseDialog(QDialog* parent = 0);
~LicenseDialog() {};
private:
void setText();
private slots:
void on_okPushButton_pressed();
};
#endif //LICENSEDIALOG_H
......@@ -15,6 +15,7 @@
#include <vtkActor.h>
#include <vtkAlgorithmOutput.h>
#include <vtkCamera.h>
#include <vtkCellData.h>
#include <vtkCellPicker.h>
#include <vtkDataSetMapper.h>
#include <vtkExtractSelection.h>
......@@ -181,7 +182,27 @@ void VtkCustomInteractorStyle::OnLeftButtonDown()
VtkMeshSource* source = dynamic_cast<VtkMeshSource*>(data_set);
if (source)
emit elementPicked(source->GetMesh(), picker->GetCellId());
/* test for picking on selection filters
else
{
vtkAlgorithm* data_set = picker->GetActor()->GetMapper()->GetInputConnection(0,0)->GetProducer()
->GetInputConnection(0,0)->GetProducer()
->GetInputConnection(0,0)->GetProducer()
->GetInputConnection(0,0)->GetProducer()
->GetInputConnection(0,0)->GetProducer()
->GetInputConnection(0,0)->GetProducer();
VtkMeshSource* source = dynamic_cast<VtkMeshSource*>(data_set);
if (source)
{
vtkUnstructuredGridAlgorithm* data_set = vtkUnstructuredGridAlgorithm::SafeDownCast(picker->GetActor()->GetMapper()->GetInputConnection(0,0)->GetProducer());
vtkUnstructuredGrid* grid = vtkUnstructuredGrid::SafeDownCast(data_set->GetOutputDataObject(0));
vtkDataArray* scalar_array = grid->GetCellData()->GetArray("vtkIdFilter_Ids");
double test = scalar_array->GetTuple1(picker->GetCellId());
emit elementPicked(source->GetMesh(), test);
}
}
*/
selectedMapper->SetInputConnection(selected->GetProducerPort());
this->Interactor->GetRenderWindow()->GetRenderers()->GetFirstRenderer()->
......
......@@ -39,14 +39,16 @@ void VtkCompositeSelectionFilter::init()
selFilter->SetInputConnection(_inputAlgorithm->GetOutputPort());
selFilter->SetSelectionArray(_selection, thresholdLower, thresholdUpper);
selFilter->Update();
/*
vtkIdFilter* idFilter = vtkIdFilter::New();
idFilter->SetInputConnection(selFilter->GetOutputPort());
idFilter->SetPointIds(0);
idFilter->SetCellIds(1);
*/
idFilter->PointIdsOn();
idFilter->CellIdsOn();
idFilter->FieldDataOn();
idFilter->Update();
vtkThreshold* threshold = vtkThreshold::New();
threshold->SetInputConnection(selFilter->GetOutputPort());
threshold->SetInputConnection(idFilter->GetOutputPort());
threshold->SetInputArrayToProcess(0,0,0,vtkDataObject::FIELD_ASSOCIATION_CELLS, filter_name);
threshold->SetSelectedComponent(0);
threshold->ThresholdBetween(thresholdLower, thresholdUpper);
......
......@@ -29,6 +29,7 @@
#include "FEMConditionSetupDialog.h"
//TODO6 #include "OGSFileConverter.h"
#include "GMSHPrefsDialog.h"
#include "LicenseDialog.h"
#include "LineEditDialog.h"
#include "ListPropertiesDialog.h"
#include "MshQualitySelectionDialog.h"
......@@ -697,6 +698,12 @@ void MainWindow::writeSettings()
settings.setValue("windowState", saveState());
}
void MainWindow::showLicense()
{
LicenseDialog dlg;
dlg.exec();
}
void MainWindow::about()
{
QString ogsVersion = QString(OGS_VERSION_AND_PERSONS);
......@@ -716,7 +723,7 @@ void MainWindow::about()
about.append(QString("Git branch: %1\n").arg(gitBranch.mid(2)));
#endif // GIT_BRANCH_INFO
#endif // OGS_BUILD_INFO
QMessageBox::about(this, "About OpenGeoSys-5", about);
QMessageBox::about(this, "About OpenGeoSys 6", about);
}
QMenu* MainWindow::createImportFilesMenu()
......
......@@ -86,6 +86,7 @@ protected slots:
/// Calls the diagram prefs dialog from the station list (i.e. for a specific station).
void showDiagramPrefsDialog(QModelIndex &index);
//TODO6 void showFileConverterDialog();
void showLicense();
void showLineEditDialog(const std::string &geoName);
void showGMSHPrefsDialog();
void showMshQualitySelectionDialog(VtkMeshSource* mshSource);
......
......@@ -133,6 +133,7 @@
<property name="title">
<string>Help</string>
</property>
<addaction name="actionLicense"/>
<addaction name="actionAbout"/>
</widget>
<addaction name="menu_File"/>
......@@ -400,6 +401,11 @@
<string>File Converter...</string>
</property>
</action>
<action name="actionLicense">
<property name="text">
<string>License</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
......@@ -586,6 +592,22 @@
</hint>
</hints>
</connection>
<connection>
<sender>actionLicense</sender>
<signal>triggered()</signal>
<receiver>MainWindowClass</receiver>
<slot>showLicense()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>400</x>
<y>372</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>open()</slot>
......@@ -597,5 +619,6 @@
<slot>FEMTestStart()</slot>
<slot>showDiagramPrefsDialog()</slot>
<slot>about()</slot>
<slot>showLicense()</slot>
</slots>
</ui>
Copyright (c) 2012, OpenGeoSys Community (http://www.opengeosys.com)
Copyright (c) 2012, OpenGeoSys Community (http://www.opengeosys.org)
All rights reserved.
Redistribution and use in source and binary forms, with or without
......@@ -16,7 +16,7 @@ modification, are permitted provided that the following conditions are met:
derived from this software without specific prior written permission.
5. Attribute the OpenGeoSys Community, preferably citing an appropriate
paper listed on the OpenGeoSys Community homepage:
http://www.opengeosys.com/papers
http://www.opengeosys.org/papers
THIS SOFTWARE IS PROVIDED BY THE OpenGeoSys Community ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
......
quickcheck @ 8822bc07
Subproject commit ffe048be480061f3472d8e7fdb79b54c4b073cce
Subproject commit 8822bc07dc9557797f5ee9920b64fc34793feb01
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment